1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-21 09:19:16 +08:00
2023-02-10 10:00:36 +08:00

41 lines
1.0 KiB
Vue

<template>
<div>
<div v-if="showButton">
<RouterButton :buttons="buttons" />
</div>
<LayoutContent>
<router-view></router-view>
</LayoutContent>
</div>
</template>
<script lang="ts" setup>
import LayoutContent from '@/layout/layout-content.vue';
import RouterButton from '@/components/router-button/index.vue';
import i18n from '@/lang';
import { onMounted, ref } from 'vue';
import { SearchAppInstalled } from '@/api/modules/app';
let showButton = ref(false);
const buttons = [
{
label: i18n.global.t('app.all'),
path: '/apps/all',
},
{
label: i18n.global.t('app.installed'),
path: '/apps/installed',
},
{
label: i18n.global.t('app.canUpdate'),
path: '/apps/update',
count: 0,
},
];
onMounted(() => {
SearchAppInstalled({ update: true, page: 1, pageSize: 100 }).then((res) => {
buttons[2].count = res.data.items.length;
showButton.value = true;
});
});
</script>