diff --git a/frontend/src/components/SelectInstances.vue b/frontend/src/components/SelectInstances.vue index 4cab80a1..a0d122e5 100644 --- a/frontend/src/components/SelectInstances.vue +++ b/frontend/src/components/SelectInstances.vue @@ -115,8 +115,8 @@ const submit = async () => { }; onMounted(async () => { - await initInstancesData(); open.value = true; + await initInstancesData(); }); const handleQueryInstance = throttle(async () => { diff --git a/frontend/src/config/const.ts b/frontend/src/config/const.ts index 8adee720..0e608ad8 100644 --- a/frontend/src/config/const.ts +++ b/frontend/src/config/const.ts @@ -1 +1,3 @@ export const GLOBAL_INSTANCE_NAME = "__MCSM_GLOBAL_INSTANCE__"; + +export const GLOBAL_INSTANCE_UUID = "global0001"; diff --git a/frontend/src/hooks/useFileManager.ts b/frontend/src/hooks/useFileManager.ts index 6e4def39..640cafee 100644 --- a/frontend/src/hooks/useFileManager.ts +++ b/frontend/src/hooks/useFileManager.ts @@ -342,6 +342,7 @@ export const useFileManager = (instanceId?: string, daemonId?: string) => { await uploadFile({ data: uploadFormData, + timeout: Number.MAX_VALUE, url: `${parseForwardAddress(uploadCfg.value.addr, "http")}/upload/${ uploadCfg.value.password }`, diff --git a/frontend/src/services/apis/fileManager.ts b/frontend/src/services/apis/fileManager.ts index 87e6de02..62fb7751 100644 --- a/frontend/src/services/apis/fileManager.ts +++ b/frontend/src/services/apis/fileManager.ts @@ -167,10 +167,8 @@ export const uploadAddress = useDefineApi< export const uploadFile = useDefineApi< { data: FormData; - url: string; - onUploadProgress: Function; }, - {} + any >({ method: "POST", headers: { "Content-Type": "multipart/form-data" } diff --git a/frontend/src/services/apis/instance.ts b/frontend/src/services/apis/instance.ts index 317d13f7..5a6d85ad 100644 --- a/frontend/src/services/apis/instance.ts +++ b/frontend/src/services/apis/instance.ts @@ -191,10 +191,8 @@ export const uploadInstanceFile = useDefineApi< code: string; }; data: FormData; - url: string; - onUploadProgress: Function; }, - {} + any >({ method: "POST", headers: { "Content-Type": "multipart/form-data" } diff --git a/frontend/src/services/apis/layout.ts b/frontend/src/services/apis/layout.ts index 849a1b72..1a289e9f 100644 --- a/frontend/src/services/apis/layout.ts +++ b/frontend/src/services/apis/layout.ts @@ -22,3 +22,14 @@ export const resetLayoutConfig = useDefineApi({ url: "/api/overview/layout", method: "DELETE" }); + +export const uploadFile = useDefineApi< + { + data: FormData; + }, + string +>({ + method: "POST", + headers: { "Content-Type": "multipart/form-data" }, + url: "/api/overview/upload_assets" +}); diff --git a/frontend/src/widgets/UserInstanceList.vue b/frontend/src/widgets/UserInstanceList.vue index af1933c9..24647ca5 100644 --- a/frontend/src/widgets/UserInstanceList.vue +++ b/frontend/src/widgets/UserInstanceList.vue @@ -4,7 +4,7 @@ import { onMounted } from "vue"; import type { LayoutCard } from "@/types"; import { userInfoApi } from "@/services/apis/index"; import { useRouter } from "vue-router"; -import { INSTANCE_STATUS } from "@/types/const"; +import { INSTANCE_STATUS, INSTANCE_STATUS_CODE } from "@/types/const"; defineProps<{ card: LayoutCard; @@ -89,7 +89,7 @@ onMounted(() => { >