Skip to content

Commit

Permalink
feat (JS - 定时任务): Change backend of Cron expr check
Browse files Browse the repository at this point in the history
  • Loading branch information
MintCider committed Jun 21, 2024
1 parent 423d997 commit 23fbd97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/mod/PageJs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ const doJsConfigChanged = () => {
}
let jsConfigFormatErrKeys: Ref<string[]> = ref([]);
const doTaskCronFormatCheck = (pluginName: string, key: string, expr: string) => {
try {
cronParseExpression(expr);
const doTaskCronFormatCheck = async (pluginName: string, key: string, expr: string) => {
try{
await store.checkCronExpr(expr);
let index = jsConfigFormatErrKeys.value.indexOf(pluginName + '/' + key);
if (index !== -1) {
jsConfigFormatErrKeys.value.splice(index, 1);
Expand Down
4 changes: 4 additions & 0 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ export const useStore = defineStore('main', {
return info as any
},

async checkCronExpr(expr: string) {
return await backend.get(urlPrefix + '/utils/check_cron_expr', {params: {expr: expr}}) as any
},

async addImConnection(form: addImConnectionForm ) {
const {
accountType,
Expand Down

0 comments on commit 23fbd97

Please sign in to comment.