SyuanYu 1 éve
szülő
commit
d0e275e1e3

+ 5 - 3
frontend/src/components/NotificationsManager.vue

@@ -26,6 +26,8 @@ const currentNotificationColor = computed(() => {
 const firstNotification = mainStoreRef.readFirstNotification;
 
 async function hide() {
+  console.log('hide');
+  
   show.value = false;
   await new Promise<void>((resolve, reject) =>
     setTimeout(() => resolve(), 500)
@@ -55,9 +57,9 @@ watch(firstNotification, async (newNotification, oldNotification) => {
 });
 
 async function setNotification(notification: AppNotification | false) {
-  if (show.value) {
-    await hide();
-  }
+  // if (show.value) {
+  //   await hide();
+  // }
   if (notification) {
     currentNotification.value = notification;
     showProgress.value = notification.showProgress || false;

+ 20 - 41
frontend/src/views/main/Upload.vue

@@ -5,15 +5,14 @@ import { required } from "@/utils";
 import { useI18n } from "vue-i18n";
 import { wsUrl } from "@/env";
 import type { VideoCreate } from "@/interfaces";
-import router from "@/router";
-import Dialog from "@/components/Dialog.vue";
+// import Dialog from "@/components/Dialog.vue";
 
 // props
-let dialog = reactive({
-  msg: "影片處理需要約 5-10 分鐘,敬請耐心等候",
-  state: "info",
-  show: false,
-});
+// let dialog = reactive({
+//   msg: "影片處理需要約 5-10 分鐘,敬請耐心等候",
+//   state: "info",
+//   show: false,
+// });
 
 const { t } = useI18n();
 const mainStore = useMainStore();
@@ -167,19 +166,19 @@ const getImageUrl = (imgFolder: string, name: string) => {
     .href;
 };
 
-watch(dialog, (newVal, oldVal) => {
-  if (!newVal.show) {
-    setTimeout(() => {
-      router.push("/main/progress");
-    }, 1000);
-  }
-});
+// watch(dialog, (newVal, oldVal) => {
+//   if (!newVal.show) {
+//     setTimeout(() => {
+//       router.push("/main/progress");
+//     }, 1000);
+//   }
+// });
 
 async function Submit() {
   WS.send("subscribe");
-  setTimeout(() => {
-    dialog.show = true;
-  }, 2000);
+  // setTimeout(() => {
+  //   dialog.show = true;
+  // }, 2000);
   await (Form as any).value.validate();
   if (valid.value) {
     valid.value = false;
@@ -192,7 +191,7 @@ async function Submit() {
 
     await mainStore.uploadPlot(video_data, zipFiles.value[0]);
     valid.value = true;
-    // (Form as any).value.reset();
+    (Form as any).value.reset();
   }
 }
 </script>
@@ -312,7 +311,7 @@ async function Submit() {
       </v-card-text>
       <v-card-actions>
         <v-spacer></v-spacer>
-        <v-btn @click="Submit" :disabled="!valid">
+        <v-btn @click="Submit" :disabled="!valid" variant="outlined">
           {{ t("send") }}
         </v-btn>
       </v-card-actions>
@@ -378,28 +377,8 @@ async function Submit() {
       </v-card-text>
     </v-card>
 
-    <template>
+    <!-- <template>
       <div class="text-center">
-        <!-- <v-dialog v-model="dialog" width="auto">
-          <v-card>
-            <v-card-text>
-              <section class="d-flex flex-column align-center">
-                <v-icon
-                  style="font-size: 70px"
-                  icon="info"
-                  color="orange-darken-3"
-                />
-                <p class="mt-3">影片處理需要約 5-10 分鐘,敬請耐心等候</p>
-              </section>
-            </v-card-text>
-            <v-card-actions>
-              <v-btn color="primary" block @click="dialog = false">{{
-                t("close")
-              }}</v-btn>
-            </v-card-actions>
-          </v-card>
-        </v-dialog> -->
-
         <Dialog
           :msg="dialog.msg"
           :state="dialog.state"
@@ -407,7 +386,7 @@ async function Submit() {
           @close="dialog.show = false"
         ></Dialog>
       </div>
-    </template>
+    </template> -->
   </v-container>
 </template>