diff --git a/back/services/script.ts b/back/services/script.ts index 3796213e..04fed94b 100644 --- a/back/services/script.ts +++ b/back/services/script.ts @@ -41,7 +41,7 @@ export default class ScriptService { const relativePath = path.relative(config.scriptPath, filePath); const command = `${TASK_COMMAND} ${relativePath} now`; const pid = await this.scheduleService.runTask( - command, + `real_time=true ${command}`, this.taskCallbacks(filePath), { command }, 'start', @@ -63,7 +63,10 @@ export default class ScriptService { } public async getFile(filePath: string, fileName: string) { - const _filePath = join(config.scriptPath, filePath, fileName); + let _filePath = join(config.scriptPath, filePath, fileName); + if (filePath.startsWith(config.dataPath)) { + _filePath = join(filePath, fileName); + } const content = await getFileContentByName(_filePath); return content; } diff --git a/sample/notify.js b/sample/notify.js index 86eb8fac..966673fa 100644 --- a/sample/notify.js +++ b/sample/notify.js @@ -808,12 +808,13 @@ function pushPlusNotify(text, desp) { function wePlusBotNotify(text, desp) { return new Promise((resolve) => { - const { WE_PLUS_BOT_TOKEN, WE_PLUS_BOT_RECEIVER, WE_PLUS_BOT_VERSION } = push_config; + const { WE_PLUS_BOT_TOKEN, WE_PLUS_BOT_RECEIVER, WE_PLUS_BOT_VERSION } = + push_config; if (WE_PLUS_BOT_TOKEN) { const template = 'txt'; - if(desp.length>800){ - desp = desp.replace(/[\n\r]/g, '
'); - template = 'html'; + if (desp.length > 800) { + desp = desp.replace(/[\n\r]/g, '
'); + template = 'html'; } const body = { token: `${WE_PLUS_BOT_TOKEN}`, @@ -834,19 +835,12 @@ function wePlusBotNotify(text, desp) { $.post(options, (err, resp, data) => { try { if (err) { - console.log( - `微加机器人 发送通知消息失败😞\n`, - err, - ); + console.log(`微加机器人发送通知消息失败😞\n`, err); } else { if (data.code === 200) { - console.log( - `微加机器人 发送通知消息完成🎉\n`, - ); + console.log(`微加机器人发送通知消息完成🎉\n`); } else { - console.log( - `微加机器人 发送通知消息异常 ${data.msg}\n`, - ); + console.log(`微加机器人发送通知消息异常 ${data.msg}\n`); } } } catch (e) { diff --git a/src/pages/crontab/detail.tsx b/src/pages/crontab/detail.tsx index a29d706a..3e25ee76 100644 --- a/src/pages/crontab/detail.tsx +++ b/src/pages/crontab/detail.tsx @@ -110,7 +110,7 @@ const CronDetailModal = ({ minimap: { enabled: false }, lineNumbersMinChars: 3, glyphMargin: false, - accessibilitySupport: 'off' + accessibilitySupport: 'off', }} onMount={(editor, monaco) => { editorRef.current = editor; @@ -162,8 +162,9 @@ const CronDetailModal = ({ setValue(data); } }); - } else if (result) { + } else { setValidTabs([validTabs[0]]); + setActiveTabKey('log'); } }; @@ -359,10 +360,15 @@ const CronDetailModal = ({ -
+
{currentCron.name} diff --git a/src/pages/crontab/index.less b/src/pages/crontab/index.less index 8c9d7d58..b0828f9a 100644 --- a/src/pages/crontab/index.less +++ b/src/pages/crontab/index.less @@ -81,6 +81,7 @@ display: flex; align-items: center; justify-content: space-between; + gap: 24px; .operations { display: flex; diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index e8f9f98d..4aa3ee02 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -75,18 +75,16 @@ const Crontab = () => { style={{ wordBreak: 'break-all', marginBottom: 0, - color: '#1890ff' + color: '#1890ff', + cursor: 'pointer' }} ellipsis={{ tooltip: text, rows: 2 }} + onClick={() => { + setDetailCron(record); + setIsDetailModalVisible(true); + }} > - { - setDetailCron(record); - setIsDetailModalVisible(true); - }} - > - {record.name || '-'} - + {record.name || '-'} ), sorter: {