diff --git a/back/api/config.ts b/back/api/config.ts index d2539113..e900ff75 100644 --- a/back/api/config.ts +++ b/back/api/config.ts @@ -30,8 +30,8 @@ export default (app: Router) => { let shareCodeFile = getLastModifyFilePath(config.shareCodeDir); content = getFileContentByName(shareCodeFile); break; - case 'diy': - content = getFileContentByName(config.diyFile); + case 'extra': + content = getFileContentByName(config.extraFile); break; default: break; diff --git a/back/config/index.ts b/back/config/index.ts index 1092c904..ca68177e 100644 --- a/back/config/index.ts +++ b/back/config/index.ts @@ -12,7 +12,7 @@ const crontabFile = path.join(rootPath, 'config/crontab.list'); const confBakDir = path.join(rootPath, 'config/bak/'); const authConfigFile = path.join(rootPath, 'config/auth.json'); const shareCodeDir = path.join(rootPath, 'log/export_sharecodes/'); -const diyFile = path.join(rootPath, 'config/diy.sh'); +const extraFile = path.join(rootPath, 'config/extra.sh'); const logPath = path.join(rootPath, 'log/'); const authError = '错误的用户名密码,请重试'; const loginFaild = '请先登录!'; @@ -38,7 +38,7 @@ export default { loginFaild, authError, logPath, - diyFile, + extraFile, shareCodeDir, authConfigFile, confBakDir, @@ -49,7 +49,7 @@ export default { fileMap: { 'config.sh': confFile, 'crontab.list': crontabFile, - 'diy.sh': diyFile, + 'extra.sh': extraFile, }, dbPath, cronDbFile, diff --git a/sample/config.sh.sample b/sample/config.sh.sample index a5feaf9a..9a7d0172 100644 --- a/sample/config.sh.sample +++ b/sample/config.sh.sample @@ -571,8 +571,8 @@ export JOY_RUN_HELP_MYSELF="" ################################## 是否添加DIY脚本(选填) ################################## ## 如果你自己会写shell脚本,并且希望在每次git_pull.sh这个脚本运行时,额外运行你的DIY脚本,请赋值为 "true" -## 同时,请务必将你的脚本命名为 diy.sh (只能叫这个文件名),放在 config 目录下 -## 仓库下已经上传diy.sh模板,如果你想使用;可以参考本仓库下 diy.sh 文件;地址:https://raw.githubusercontent.com/dockere/jd-base/master/sample/diy.sh +## 同时,请务必将你的脚本命名为 extra.sh (只能叫这个文件名),放在 config 目录下 +## 仓库下已经上传extra.sh模板,如果你想使用;可以参考本仓库下 extra.sh 文件;地址:https://raw.githubusercontent.com/dockere/jd-base/master/sample/diy.sh EnableExtraShell="" diff --git a/src/pages/diy/index.tsx b/src/pages/diy/index.tsx index cd223b90..a5d1ee0d 100644 --- a/src/pages/diy/index.tsx +++ b/src/pages/diy/index.tsx @@ -25,7 +25,7 @@ const Crontab = () => { const updateConfig = () => { request .post(`${config.apiPrefix}save`, { - data: { content: value, name: 'diy.sh' }, + data: { content: value, name: 'extra.sh' }, }) .then((data) => { notification.success({ @@ -50,7 +50,7 @@ const Crontab = () => { return ( 保存