From ca8790bbec2f9d9335c1b41c4babea2bbe9496bb Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 17 Dec 2023 17:53:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E8=84=9A=E6=9C=AC=E8=A1=8C=E6=95=B0=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/system.ts | 16 ++++++++++++---- src/locales/en-US.json | 2 +- src/locales/zh-CN.json | 2 +- src/pages/crontab/detail.tsx | 5 ++--- src/pages/crontab/index.less | 3 ++- src/pages/log/index.tsx | 3 +-- src/pages/setting/dependence.tsx | 2 +- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/back/services/system.ts b/back/services/system.ts index 4dc2c8a9..ba48ae3a 100644 --- a/back/services/system.ts +++ b/back/services/system.ts @@ -183,13 +183,21 @@ export default class SystemService { ...oDoc, info: { ...oDoc.info, ...info }, }); - let targetDomain = 'dl-cdn.alpinelinux.org'; + let defaultDomain = 'https://dl-cdn.alpinelinux.org'; + let targetDomain = 'https://dl-cdn.alpinelinux.org'; + if (oDoc.info?.linuxMirror) { + defaultDomain = oDoc.info.linuxMirror; + } if (info.linuxMirror) { targetDomain = info.linuxMirror; } - const command = `sed -i 's/${ - oDoc.info?.linuxMirror || 'dl-cdn.alpinelinux.org' - }/${targetDomain}/g' /etc/apk/repositories && apk update -f`; + const command = `sed -i 's/${defaultDomain.replace( + /\//g, + '\\/', + )}/${targetDomain.replace( + /\//g, + '\\/', + )}/g' /etc/apk/repositories && apk update -f`; this.scheduleService.runTask( command, diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 36df48e8..9bc2f504 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -475,5 +475,5 @@ "代理地址, 支持HTTP(S)/SOCK5": "Proxy Address, supports HTTP(S)/SOCK5", "NPM 镜像源": "NPM Mirror Source", "PyPI 镜像源": "PyPI Mirror Source", - "alpine linux 镜像源, 例如 mirrors.aliyun.com": "Alpine Linux Mirror Source, e.g. mirrors.aliyun.com" + "alpine linux 镜像源, 例如 https://mirrors.aliyun.com": "Alpine Linux Mirror Source, e.g. https://mirrors.aliyun.com" } diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index ae7d76fb..1d3ef7a5 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -475,5 +475,5 @@ "代理地址, 支持HTTP(S)/SOCK5": "代理地址, 支持HTTP(S)/SOCK5", "NPM 镜像源": "NPM 镜像源", "PyPI 镜像源": "PyPI 镜像源", - "alpine linux 镜像源, 例如 mirrors.aliyun.com": "alpine linux 镜像源, 例如 mirrors.aliyun.com" + "alpine linux 镜像源, 例如 https://mirrors.aliyun.com": "alpine linux 镜像源, 例如 https://mirrors.aliyun.com" } diff --git a/src/pages/crontab/detail.tsx b/src/pages/crontab/detail.tsx index 1f1b7f87..e5bb0866 100644 --- a/src/pages/crontab/detail.tsx +++ b/src/pages/crontab/detail.tsx @@ -107,10 +107,9 @@ const CronDetailModal = ({ value={value} options={{ fontSize: 12, + minimap: { enabled: false }, lineNumbersMinChars: 3, - fontFamily: 'Source Code Pro', glyphMargin: false, - wordWrap: 'on', }} onMount={(editor, monaco) => { editorRef.current = editor; @@ -364,7 +363,7 @@ const CronDetailModal = ({
{currentCron.name} diff --git a/src/pages/crontab/index.less b/src/pages/crontab/index.less index 1529cd93..8c9d7d58 100644 --- a/src/pages/crontab/index.less +++ b/src/pages/crontab/index.less @@ -23,6 +23,7 @@ padding: 12px; max-height: calc(80vh - 57px); max-height: calc(80vh - var(--vh-offset, 57px)); + word-wrap: unset; } .ant-card-body { @@ -197,4 +198,4 @@ body[data-mode='desktop'] { .cron.pinned-cron > td { background: #f2f2f2; -} \ No newline at end of file +} diff --git a/src/pages/log/index.tsx b/src/pages/log/index.tsx index 8b376550..a9e7dd3e 100644 --- a/src/pages/log/index.tsx +++ b/src/pages/log/index.tsx @@ -266,11 +266,10 @@ const Log = () => { options={{ readOnly: true, fontSize: 12, + minimap: { enabled: false }, lineNumbersMinChars: 3, - fontFamily: 'Source Code Pro', folding: false, glyphMargin: false, - wordWrap: 'on', }} /> diff --git a/src/pages/setting/dependence.tsx b/src/pages/setting/dependence.tsx index ef93c0b1..f7342ff1 100644 --- a/src/pages/setting/dependence.tsx +++ b/src/pages/setting/dependence.tsx @@ -185,7 +185,7 @@ const Dependence = () => { {