From 2d33f500892f523f55d4a7fbd89ff522c48230bd Mon Sep 17 00:00:00 2001
From: Mint Cider <170254502+MintCider@users.noreply.github.com>
Date: Fri, 21 Jun 2024 20:11:08 +0800
Subject: [PATCH] =?UTF-8?q?feat=20(JS):=20=E9=87=8D=E7=BD=AE/=E9=87=8D?=
=?UTF-8?q?=E8=BD=BD=E9=85=8D=E7=BD=AE=E5=90=8E=EF=BC=8C=E6=B8=85=E9=99=A4?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9=E5=92=8C=E9=85=8D=E7=BD=AE?=
=?UTF-8?q?=E9=94=99=E8=AF=AF=E5=8F=98=E9=87=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/mod/PageJs.vue | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/components/mod/PageJs.vue b/src/components/mod/PageJs.vue
index 8d86b59e..1a26fc61 100644
--- a/src/components/mod/PageJs.vue
+++ b/src/components/mod/PageJs.vue
@@ -306,8 +306,8 @@
{{(c as unknown as JsPluginConfigItem).key}}
{{ (c as unknown as JsPluginConfigItem).description }}
-
-
+
+
格式错误!
@@ -331,8 +331,8 @@
{{(c as unknown as JsPluginConfigItem).key}}
{{ (c as unknown as JsPluginConfigItem).description }}
-
-
+
+
格式错误!
@@ -449,30 +449,30 @@ const doJsConfigChanged = () => {
}
let jsConfigFormatErrKeys: Ref = ref([]);
-const doTaskCronFormatCheck = (key: string, expr: string) => {
+const doTaskCronFormatCheck = (pluginName: string, key: string, expr: string) => {
try {
cronParseExpression(expr);
- let index = jsConfigFormatErrKeys.value.indexOf(key);
+ let index = jsConfigFormatErrKeys.value.indexOf(pluginName + '/' + key);
if (index !== -1) {
jsConfigFormatErrKeys.value.splice(index, 1);
}
jsConfigEdited.value = true;
} catch (_err) {
- jsConfigFormatErrKeys.value.push(key);
+ jsConfigFormatErrKeys.value.push(pluginName + '/' + key);
jsConfigEdited.value = true;
}
};
-const doTaskDailyFormatCheck = (key: string, expr: string) => {
+const doTaskDailyFormatCheck = (pluginName: string, key: string, expr: string) => {
const pattern = /^([0-1]?[0-9]|2[0-3]):([0-5][0-9])$/;
if (pattern.test(expr)) {
- let index = jsConfigFormatErrKeys.value.indexOf(key);
+ let index = jsConfigFormatErrKeys.value.indexOf(pluginName + '/' + key);
if (index !== -1) {
jsConfigFormatErrKeys.value.splice(index, 1);
}
jsConfigEdited.value = true;
} else {
- jsConfigFormatErrKeys.value.push(key);
+ jsConfigFormatErrKeys.value.push(pluginName + '/' + key);
jsConfigEdited.value = true;
}
};
@@ -513,6 +513,8 @@ const doResetJsConfig = (plginName: string, key: string) => {
})
setTimeout(() => {
refreshConfig()
+ jsConfigEdited.value = false
+ jsConfigFormatErrKeys.value = []
}, 1000);
})
}