升级对话框显示服务器版本

This commit is contained in:
miao 2023-02-14 09:45:09 +08:00
parent 8b6949f087
commit febcf00d94
1 changed files with 290 additions and 278 deletions

View File

@ -92,7 +92,9 @@
<q-separator /> <q-separator />
<q-card-actions align="right"> <q-card-actions>
<q-item-section>V: {{ server_version }}</q-item-section>
<q-space />
<q-btn <q-btn
:loading="loading" :loading="loading"
flat flat
@ -144,6 +146,7 @@ export default defineComponent({
let select_options = [$t.t("software"), $t.t("rootfs")]; let select_options = [$t.t("software"), $t.t("rootfs")];
let upgrade_type = ref($t.t("software")); let upgrade_type = ref($t.t("software"));
const server_version = ref("unknow");
return { return {
show_dialog, show_dialog,
@ -155,6 +158,7 @@ export default defineComponent({
file_count, file_count,
upgrade_type, upgrade_type,
select_options, select_options,
server_version,
generatorFileUploadHeaders(files: File[]) { generatorFileUploadHeaders(files: File[]) {
if (files.length > 0) { if (files.length > 0) {
return [ return [
@ -189,6 +193,14 @@ export default defineComponent({
url.searchParams.set("type", HttpProtocol.UploadTypeSoftware); url.searchParams.set("type", HttpProtocol.UploadTypeSoftware);
upload_url_software.value = url.toString(); upload_url_software.value = url.toString();
try {
client?.getBuildInfo()?.then((build_info) => {
if (build_info) {
server_version.value = build_info.version;
}
});
// console.log(build_info);
} catch {}
} }
}, },
resetData() { resetData() {