mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-14 01:34:47 +08:00
style: 路由增加可更新提醒
This commit is contained in:
parent
f6feac6106
commit
8e00830d7a
1
frontend/components.d.ts
vendored
1
frontend/components.d.ts
vendored
@ -20,6 +20,7 @@ declare module 'vue' {
|
|||||||
ElAlert: typeof import('element-plus/es')['ElAlert']
|
ElAlert: typeof import('element-plus/es')['ElAlert']
|
||||||
ElAside: typeof import('element-plus/es')['ElAside']
|
ElAside: typeof import('element-plus/es')['ElAside']
|
||||||
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
||||||
|
ElBadge: typeof import('element-plus/es')['ElBadge']
|
||||||
ElButton: typeof import('element-plus/es')['ElButton']
|
ElButton: typeof import('element-plus/es')['ElButton']
|
||||||
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
||||||
ElCard: typeof import('element-plus/es')['ElCard']
|
ElCard: typeof import('element-plus/es')['ElCard']
|
||||||
|
@ -68,7 +68,7 @@ export namespace App {
|
|||||||
export interface AppInstallSearch extends ReqPage {
|
export interface AppInstallSearch extends ReqPage {
|
||||||
name?: string;
|
name?: string;
|
||||||
tags?: string[];
|
tags?: string[];
|
||||||
updated?: boolean;
|
update?: boolean;
|
||||||
unused?: boolean;
|
unused?: boolean;
|
||||||
}
|
}
|
||||||
export interface ChangePort {
|
export interface ChangePort {
|
||||||
|
@ -7,7 +7,11 @@
|
|||||||
v-for="(button, index) in buttonArray"
|
v-for="(button, index) in buttonArray"
|
||||||
size="large"
|
size="large"
|
||||||
:key="index"
|
:key="index"
|
||||||
></el-radio-button>
|
>
|
||||||
|
<el-badge :value="button.count" class="item" v-if="button.count > 0">
|
||||||
|
<span>{{ button.label }}</span>
|
||||||
|
</el-badge>
|
||||||
|
</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
@ -22,6 +26,7 @@ const props = defineProps({
|
|||||||
buttons: {
|
buttons: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
|
count: Number,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<RouterButton :buttons="buttons" />
|
<div v-if="showButton">
|
||||||
|
<RouterButton :buttons="buttons" />
|
||||||
|
</div>
|
||||||
<LayoutContent>
|
<LayoutContent>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</LayoutContent>
|
</LayoutContent>
|
||||||
@ -11,6 +13,9 @@
|
|||||||
import LayoutContent from '@/layout/layout-content.vue';
|
import LayoutContent from '@/layout/layout-content.vue';
|
||||||
import RouterButton from '@/components/router-button/index.vue';
|
import RouterButton from '@/components/router-button/index.vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
import { SearchAppInstalled } from '@/api/modules/app';
|
||||||
|
let showButton = ref(false);
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
label: i18n.global.t('app.all'),
|
label: i18n.global.t('app.all'),
|
||||||
@ -23,6 +28,13 @@ const buttons = [
|
|||||||
{
|
{
|
||||||
label: i18n.global.t('app.canUpdate'),
|
label: i18n.global.t('app.canUpdate'),
|
||||||
path: '/apps/update',
|
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>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user