forked from FoundKeyGang/FoundKey
make defult about page tab 'overview' if invalid
This commit is contained in:
parent
29e3d8175f
commit
74ee7c84d6
1 changed files with 16 additions and 16 deletions
|
@ -95,22 +95,6 @@ import number from '@/filters/number';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata';
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
|
||||||
initialTab?: string;
|
|
||||||
}>(), {
|
|
||||||
initialTab: 'overview',
|
|
||||||
});
|
|
||||||
|
|
||||||
let stats = $ref(null);
|
|
||||||
let tab = $ref(props.initialTab);
|
|
||||||
|
|
||||||
const initStats = () => os.api('stats', {
|
|
||||||
}).then((res) => {
|
|
||||||
stats = res;
|
|
||||||
});
|
|
||||||
|
|
||||||
const headerActions = $computed(() => []);
|
|
||||||
|
|
||||||
const headerTabs = $computed(() => [{
|
const headerTabs = $computed(() => [{
|
||||||
key: 'overview',
|
key: 'overview',
|
||||||
title: i18n.ts.overview,
|
title: i18n.ts.overview,
|
||||||
|
@ -128,6 +112,22 @@ const headerTabs = $computed(() => [{
|
||||||
icon: 'fas fa-chart-simple',
|
icon: 'fas fa-chart-simple',
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<{
|
||||||
|
initialTab?: string;
|
||||||
|
}>(), {
|
||||||
|
initialTab: 'overview',
|
||||||
|
});
|
||||||
|
|
||||||
|
let stats = $ref(null);
|
||||||
|
let tab = $ref(headerTabs.some(({ key }) => key === props.initialTab) ? props.initialTab : 'overview');
|
||||||
|
|
||||||
|
const initStats = () => os.api('stats', {
|
||||||
|
}).then((res) => {
|
||||||
|
stats = res;
|
||||||
|
});
|
||||||
|
|
||||||
|
const headerActions = $computed(() => []);
|
||||||
|
|
||||||
definePageMetadata(computed(() => ({
|
definePageMetadata(computed(() => ({
|
||||||
title: i18n.ts.instanceInfo,
|
title: i18n.ts.instanceInfo,
|
||||||
icon: 'fas fa-info-circle',
|
icon: 'fas fa-info-circle',
|
||||||
|
|
Loading…
Reference in a new issue