From 6199a2238efcc2449c79aa228e40cb75c59cf663 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期二, 24 十月 2023 19:16:24 +0800
Subject: [PATCH] 集群退出添加密码
---
src/pages/ai/FileUpload/uploader.vue | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/pages/ai/FileUpload/uploader.vue b/src/pages/ai/FileUpload/uploader.vue
index 14735e4..69705de 100644
--- a/src/pages/ai/FileUpload/uploader.vue
+++ b/src/pages/ai/FileUpload/uploader.vue
@@ -41,6 +41,9 @@
return {}
}
},
+ sourceType: {
+ type: Number,
+ },
options: {
type: Object,
default() {
@@ -83,6 +86,16 @@
}
},
filesAdded(files, fileList) {
+ if (this.sourceType == 3 && files[0]) {
+ if (
+ !files[0].name.endsWith(".tar") ||
+ !files[0].name.endsWith(".gz") ||
+ !files[0].name.endsWith(".tar.gz")
+ ) {
+ this.shouldStop = true
+ return
+ }
+ }
this.$emit(kebabCase(FILES_ADDED_EVENT), files, fileList)
if (files.ignored || fileList.ignored) {
// is ignored, filter it
@@ -94,6 +107,16 @@
this.fileList = this.uploader.fileList
},
filesSubmitted(files, fileList) {
+ if (this.sourceType == 3&& files[0]) {
+ if (
+ !files[0].name.endsWith(".tar") ||
+ !files[0].name.endsWith(".gz") ||
+ !files[0].name.endsWith(".tar.gz")
+ ) {
+ this.shouldStop = true
+ return
+ }
+ }
this.files = this.uploader.files
this.fileList = this.uploader.fileList
if (this.autoStart) {
@@ -101,7 +124,6 @@
}
},
allEvent(...args) {
- console.log(args)
const name = args[0]
const EVENTSMAP = {
[FILE_ADDED_EVENT]: true,
@@ -123,7 +145,6 @@
}
},
created() {
- // console.log('uploader attrs',this.attrs);
// this.bindUploader();
this.options.initialPaused = !this.autoStart
const uploader = new Uploader(this.options)
--
Gitblit v1.8.0