fix(config): 添加系统信息

Signed-off-by: BTMuli <BT-Muli@outlook.com>
This commit is contained in:
BTMuli
2023-04-05 00:22:41 +08:00
parent 2bb5659674
commit 0acdc6d5f1

View File

@@ -39,6 +39,24 @@
<v-list-item-subtitle>{{ achievementsStore.last_version }}</v-list-item-subtitle>
</template>
</v-list-item>
<v-list-subheader inset class="config-header">系统信息</v-list-subheader>
<v-divider inset class="border-opacity-75" />
<v-list-item title="系统平台">
<template v-slot:prepend>
<v-icon>mdi-desktop-classic</v-icon>
</template>
<template v-slot:append>
<v-list-item-subtitle>{{ osPlatform }}</v-list-item-subtitle>
</template>
</v-list-item>
<v-list-item title="系统版本">
<template v-slot:prepend>
<v-icon>mdi-desktop-classic</v-icon>
</template>
<template v-slot:append>
<v-list-item-subtitle>{{ osVersion }}</v-list-item-subtitle>
</template>
</v-list-item>
<v-list-subheader inset class="config-header">设置</v-list-subheader>
<v-divider inset class="border-opacity-75" />
<v-list-item @click="openMergeData" prepend-icon="mdi-folder" title="打开用户数据目录" />
@@ -107,7 +125,7 @@ import { onMounted, ref } from "vue";
import TLoading from "../components/t-loading.vue";
import TConfirm from "../components/t-confirm.vue";
// tauri
import { dialog, fs, app } from "@tauri-apps/api";
import { dialog, fs, app, os } from "@tauri-apps/api";
// store
import useAppStore from "../store/modules/app";
import useHomeStore from "../store/modules/home";
@@ -126,6 +144,10 @@ const achievementsStore = useAchievementsStore();
const versionApp = ref("" as string);
const versionTauri = ref("" as string);
// About OS
const osPlatform = ref("" as string);
const osVersion = ref("" as string);
// loading
const loading = ref(true as boolean);
@@ -146,6 +168,8 @@ const confirmShow = ref(false as boolean);
onMounted(async () => {
versionApp.value = await app.getVersion();
versionTauri.value = await app.getTauriVersion();
osPlatform.value = `${await os.platform()}`;
osVersion.value = await os.version();
setTimeout(() => {
loading.value = false;
}, 1000);