<template>
    <div v-if="authUser.data.attributes.is_admin">
        <div class="card block">
            <h2>Raspberry Links</h2>
            <ul class="mt-2">
                <li><a v-for="(link, index) in links" :href="link.link" :key="index" target="_blank" class="block text-lg">{{ link.name }}</a></li>
            </ul>
        </div>
    </div>
</template>

<script>
import {mapGetters} from 'vuex'

export default {
    name: 'AutomaticLinksHome',
    data: function () {
        return {
            links: [
                { name: 'Gitea', link: 'https://git.rodev.fr/'},
                { name: 'Home Assistant', link: 'http://192.168.1.27:8123/lovelace/default_view'},
                { name: 'Météo', link: 'http://192.168.1.32/meteo/meteo'},
                { name: 'MotionEye', link: 'http://192.168.1.32:8765'},
                { name: 'TT-RSS', link: 'https://tt-rss.bricooli.fr'},
                { name: 'Datus', link: 'https://192.168.1.24:5001'},
                { name: 'Pi-Hole', link: 'http://192.168.1.27:8089/admin/index.php'},
                { name: 'RaspAp', link: 'http://192.168.1.32/raspap'},
                { name: 'Kodi', link: 'http://192.168.1.19:8080/'},
                { name: 'RaspiWork Adminer', link: 'http://192.168.1.27:9080/'},
                { name: 'RaspiWeb Adminer', link: 'http://192.168.1.32/adminer.php'},
                { name: 'RaspiGate Adminer', link: 'http://192.168.1.29/adminer.php'},
            ],
        }
    },
    computed: {
        ...mapGetters({
            authUser: 'authUser',
        })
    },
}
</script>
