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

This commit is contained in:
miao 2023-02-16 11:10:49 +08:00
parent 1bfb5af0a5
commit 27f914c995
3 changed files with 16 additions and 5 deletions

View File

@ -117,7 +117,7 @@ export default defineComponent({
console.log(e); console.log(e);
} }
EventBus.getInstance().on(EventNamesDefine.CheckDebug2, () => { EventBus.getInstance().on(EventNamesDefine.CheckDebug, () => {
const to_normal_url = () => { const to_normal_url = () => {
const p1 = window.location.href.indexOf("?debug"); const p1 = window.location.href.indexOf("?debug");
const p2 = window.location.href.indexOf("#"); const p2 = window.location.href.indexOf("#");

View File

@ -1090,6 +1090,7 @@ export default defineComponent({
}); });
loading.value = false; loading.value = false;
uploading.value = false; uploading.value = false;
uploader.value.reset()
}, 500); }, 500);
}, },
copyFile(file: FileEntity) { copyFile(file: FileEntity) {

View File

@ -91,7 +91,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
@ -143,7 +145,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,
loading, loading,
@ -154,19 +156,27 @@ export default defineComponent({
file_count, file_count,
upgrade_type, upgrade_type,
select_options, select_options,
server_version,
loga(a: any) { loga(a: any) {
console.log(a); console.log(a);
}, },
showDialog() { showDialog() {
show_dialog.value = true; show_dialog.value = true;
let url = GlobalData.getInstance().createCurrentRequestUrl(); let url = GlobalData.getInstance().createCurrentRequestUrl();
if (url) { if (url) {
url.pathname = "/upload_soft_file"; url.pathname = "/upload_soft_file";
upload_url_software.value = url.toString(); upload_url_software.value = url.toString();
url.pathname = "/upload_root_fs_file"; url.pathname = "/upload_root_fs_file";
upload_url_rootfs.value = url.toString(); upload_url_rootfs.value = url.toString();
} }
try {
let client = GlobalData.getInstance().getCurrentClient();
client?.getBuildInfo()?.then((build_info) => {
if (build_info) {
server_version.value = build_info.version;
}
});
} catch (error) {}
}, },
resetData() { resetData() {
loading.value = false; loading.value = false;