var VPshortcut = (function () {
    let vp_template = `
    <div class="card mb-3">
        <div class="card-body">
            <div class="row g-3">
                <div v-for="shortcut in shortcuts" class="col-4">
                    <div class="feature-card mx-auto text-center">
                        <a :href="shortcut.url">
                            <div class="card mx-auto bg-gray"><img :src="shortcut.icon" :alt="'Icon '+shortcut.name"></div>
                            <p class="mb-0">{{shortcut.name}}</p>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    `
    return {
        template: vp_template,
        data() {
            return {
                shortcuts: [],
            }
        },
        mounted() {
            this.loadShortcut();
        },
        methods: {
            loadShortcut() {
                axios({
                    method: 'GET',
                    url: this.$store.state.config.base_url + '/shortcut',
                }).then((response) => {
                    if (!isObject(response.data)) return setTimeout(() => this.loadShortcut(), 5000);
                    this.shortcuts = response.data.shorcuts;
                }, (error) => { });
            },
        }
    }
})();