make defult about page tab 'overview' if invalid

This commit is contained in:
Norm 2022-09-03 17:39:55 -04:00
parent 29e3d8175f
commit 74ee7c84d6
Signed by untrusted user: norm
GPG key ID: 7123E30E441E80DE

View file

@ -95,22 +95,6 @@ import number from '@/filters/number';
import { i18n } from '@/i18n';
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(() => [{
key: 'overview',
title: i18n.ts.overview,
@ -128,6 +112,22 @@ const headerTabs = $computed(() => [{
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(() => ({
title: i18n.ts.instanceInfo,
icon: 'fas fa-info-circle',