diff --git a/back/api/script.ts b/back/api/script.ts index 7ec05651..58a40a53 100644 --- a/back/api/script.ts +++ b/back/api/script.ts @@ -265,9 +265,11 @@ export default (app: Router) => { let { filename, path, pid } = req.body; const { name, ext } = parse(filename); const filePath = join(config.scriptPath, path, `${name}.swap${ext}`); + const logPath = join(config.logPath, path, `${name}.swap`); const scriptService = Container.get(ScriptService); const result = await scriptService.stopScript(filePath, pid); + emptyDir(logPath); res.send(result); } catch (e) { return next(e); diff --git a/back/services/script.ts b/back/services/script.ts index a7aa1e07..95681549 100644 --- a/back/services/script.ts +++ b/back/services/script.ts @@ -53,10 +53,9 @@ export default class ScriptService { } public async stopScript(filePath: string, pid: number) { - let str = ''; if (!pid) { const relativePath = path.relative(config.scriptPath, filePath); - pid = await getPid(`${TASK_COMMAND} -l ${relativePath} now`); + pid = await getPid(`${TASK_COMMAND} -l ${relativePath} now`) as number; } try { await killTask(pid); diff --git a/src/layouts/index.less b/src/layouts/index.less index 3bb6050b..8569d568 100644 --- a/src/layouts/index.less +++ b/src/layouts/index.less @@ -195,7 +195,7 @@ body { } .ant-tooltip { - max-width: 250px !important; + max-width: 300px !important; } } diff --git a/src/pages/crontab/modal.tsx b/src/pages/crontab/modal.tsx index 2dbbc254..dfba1484 100644 --- a/src/pages/crontab/modal.tsx +++ b/src/pages/crontab/modal.tsx @@ -83,7 +83,7 @@ const CronModal = ({ > { diff --git a/src/pages/dependence/modal.tsx b/src/pages/dependence/modal.tsx index cab283bc..d32a64ad 100644 --- a/src/pages/dependence/modal.tsx +++ b/src/pages/dependence/modal.tsx @@ -130,7 +130,7 @@ const DependenceModal = ({ > diff --git a/src/pages/env/index.tsx b/src/pages/env/index.tsx index 65d148bc..f9010650 100644 --- a/src/pages/env/index.tsx +++ b/src/pages/env/index.tsx @@ -91,7 +91,11 @@ const Env = () => { render: (text: string, record: any) => { return (
- +
{text}
diff --git a/src/pages/env/modal.tsx b/src/pages/env/modal.tsx index 0a051b0e..d7645e2f 100644 --- a/src/pages/env/modal.tsx +++ b/src/pages/env/modal.tsx @@ -1,4 +1,4 @@ -import intl from 'react-intl-universal' +import intl from 'react-intl-universal'; import React, { useEffect, useState } from 'react'; import { Modal, message, Input, Form, Radio } from 'antd'; import { request } from '@/utils/http'; @@ -44,7 +44,9 @@ const EnvModal = ({ ); if (code === 200) { - message.success(env ? intl.get('更新变量成功') : intl.get('创建变量成功')); + message.success( + env ? intl.get('更新变量成功') : intl.get('创建变量成功'), + ); handleCancel(data); } setLoading(false); @@ -82,7 +84,11 @@ const EnvModal = ({ name="name" label={intl.get('名称')} rules={[ - { required: true, message: intl.get('请输入环境变量名称'), whitespace: true }, + { + required: true, + message: intl.get('请输入环境变量名称'), + whitespace: true, + }, { pattern: /^[a-zA-Z_][0-9a-zA-Z_]*$/, message: intl.get('只能输入字母数字下划线,且不能以数字开头'), @@ -108,12 +114,15 @@ const EnvModal = ({ name="value" label={intl.get('值')} rules={[ - { required: true, message: intl.get('请输入环境变量值'), whitespace: true }, + { + required: true, + message: intl.get('请输入环境变量值'), + whitespace: true, + }, ]} > diff --git a/src/pages/initialization/index.tsx b/src/pages/initialization/index.tsx index 6952b5d8..61cc90d2 100644 --- a/src/pages/initialization/index.tsx +++ b/src/pages/initialization/index.tsx @@ -185,7 +185,7 @@ const Initialization = () => { style={{ maxWidth: 400 }} > diff --git a/src/pages/setting/notification.tsx b/src/pages/setting/notification.tsx index a679b84b..af781729 100644 --- a/src/pages/setting/notification.tsx +++ b/src/pages/setting/notification.tsx @@ -88,7 +88,7 @@ const NotificationSetting = ({ data }: any) => { ) : ( )} diff --git a/src/pages/subscription/modal.tsx b/src/pages/subscription/modal.tsx index bac0cf9c..adeb47bd 100644 --- a/src/pages/subscription/modal.tsx +++ b/src/pages/subscription/modal.tsx @@ -326,8 +326,7 @@ const SubscriptionModal = ({ ]} > @@ -486,7 +485,7 @@ const SubscriptionModal = ({