<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: 'MotionEye', link: 'http://192.168.3.19:8765'},
                { name: 'TT-RSS', link: 'https://tt-rss.bricooli.fr'},
                { name: 'Datus', link: 'https://192.168.3.24:5001'},
                { name: 'Pi-Hole', link: 'http://192.168.3.19:8089/admin/index.php'},
                { name: 'Grafana', link: 'http://192.168.3.19:3000'},
                { name: 'Gladys', link: 'http://192.168.3.21/dashboard'},
                { name: 'Kodi', link: 'http://192.168.3.12:8080/'},
                { name: 'RaspiWork Adminer', link: 'http://192.168.3.19:9080/'},
                { name: 'RaspiGate Adminer', link: 'http://192.168.3.29/adminer.php'},
            ],
        }
    },
    computed: {
        ...mapGetters({
            authUser: 'authUser',
        })
    },
}
</script>
