From c77e302874666d4d2e838b87ca8737a4461b0610 Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Mon, 26 Jul 2021 00:56:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=B9=E6=A1=86=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/crontab/logModal.tsx | 59 ++++++++++++++-------------------- src/pages/diff/index.tsx | 3 +- src/pages/log/index.tsx | 4 ++- src/pages/script/index.tsx | 3 +- 4 files changed, 31 insertions(+), 38 deletions(-) diff --git a/src/pages/crontab/logModal.tsx b/src/pages/crontab/logModal.tsx index cc67d2e5..dcbbd964 100644 --- a/src/pages/crontab/logModal.tsx +++ b/src/pages/crontab/logModal.tsx @@ -6,7 +6,6 @@ import { Loading3QuartersOutlined, CheckCircleOutlined, } from '@ant-design/icons'; -import Editor from "@monaco-editor/react"; enum CrontabStatus { 'running', @@ -92,50 +91,40 @@ const CronLogModal = ({ setIsPhone(document.body.clientWidth < 768); }, []); - useEffect(()=>{ - const media = window.matchMedia('(prefers-color-scheme: dark)'); - const storageTheme = localStorage.getItem('qinglong_dark_theme'); - const isDark = (media.matches && storageTheme !== 'light') || storageTheme === 'dark'; - setTheme(isDark?'vs-dark':'vs'); - media.addEventListener('change',(e)=>{ - if(storageTheme === 'auto' || !storageTheme){ - if(e.matches){ - setTheme('vs-dark') - }else{ - setTheme('vs'); - } - } - }) - },[]) - return ( cancel()} onCancel={() => cancel()} > {!loading && value && ( - +
+          {value}
+        
)}
); diff --git a/src/pages/diff/index.tsx b/src/pages/diff/index.tsx index db774adf..e2f11d8b 100644 --- a/src/pages/diff/index.tsx +++ b/src/pages/diff/index.tsx @@ -91,7 +91,8 @@ const Crontab = () => { lineNumbersMinChars: 3, folding: false, glyphMargin: false, - renderSideBySide: width==='100%' + renderSideBySide: width==='100%', + wordWrap: 'on' }} theme={theme} /> diff --git a/src/pages/log/index.tsx b/src/pages/log/index.tsx index 133beb9e..f2a1cea0 100644 --- a/src/pages/log/index.tsx +++ b/src/pages/log/index.tsx @@ -196,8 +196,10 @@ const Log = () => { fontSize: 12, minimap: {enabled: width==='100%'}, lineNumbersMinChars: 3, + fontFamily: 'Source Code Pro', folding: false, - glyphMargin: false + glyphMargin: false, + wordWrap: 'on' }} onChange={(val, ev) => {setValue(val as string)}} /> diff --git a/src/pages/script/index.tsx b/src/pages/script/index.tsx index 6e2d6872..0f908359 100644 --- a/src/pages/script/index.tsx +++ b/src/pages/script/index.tsx @@ -172,7 +172,8 @@ const Script = () => { minimap: {enabled: width==='100%'}, lineNumbersMinChars: 3, folding: false, - glyphMargin: false + glyphMargin: false, + wordWrap: 'on' }} onChange={(val) => {setValue(val as string)}} />