feat: show version info in SettingsDrawer
This commit is contained in:
@@ -1,13 +1,23 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NDivider, NDrawer, NDrawerContent, NFlex, NFormItem, NInputNumber } from 'naive-ui';
|
import { NDivider, NDrawer, NDrawerContent, NFlex, NFormItem, NInputNumber, NText } from 'naive-ui';
|
||||||
import ThemeSwitch from './theme-switch.vue';
|
import ThemeSwitch from './theme-switch.vue';
|
||||||
import { useLayoutStore } from '@/stores/layout';
|
import { useLayoutStore } from '@/stores/layout';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
import axios from 'axios';
|
||||||
|
import type { VersionInfo } from '@/apis/domains/version-info';
|
||||||
|
|
||||||
const show = defineModel<boolean>('show');
|
const show = defineModel<boolean>('show');
|
||||||
|
|
||||||
const layoutStore = useLayoutStore();
|
const layoutStore = useLayoutStore();
|
||||||
const { stationLayoutGridCols } = storeToRefs(layoutStore);
|
const { stationLayoutGridCols } = storeToRefs(layoutStore);
|
||||||
|
|
||||||
|
const versionInfo = ref<VersionInfo>({ version: '', buildTime: '' });
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
const { data } = await axios.get<VersionInfo>(`/manifest.json?t=${Date.now()}`);
|
||||||
|
versionInfo.value = data;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -23,6 +33,11 @@ const { stationLayoutGridCols } = storeToRefs(layoutStore);
|
|||||||
<NInputNumber v-model:value="stationLayoutGridCols" :min="1" :max="10" />
|
<NInputNumber v-model:value="stationLayoutGridCols" :min="1" :max="10" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
</NFlex>
|
</NFlex>
|
||||||
|
<template #footer>
|
||||||
|
<NFlex vertical justify="flex-end" align="center" style="width: 100%; font-size: 12px; gap: 4px">
|
||||||
|
<NText :depth="3">平台版本: {{ versionInfo.version }} ({{ versionInfo.buildTime }})</NText>
|
||||||
|
</NFlex>
|
||||||
|
</template>
|
||||||
</NDrawerContent>
|
</NDrawerContent>
|
||||||
</NDrawer>
|
</NDrawer>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user