From 58f58f0fac480a8f4e7b84a2b22ef878c3a988c5 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:36:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=B8=85=E7=A9=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8E=E4=BF=9D=E5=AD=98=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#3965)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/dto/request/file.go | 2 +- frontend/src/views/host/file-management/code-editor/index.vue | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/app/dto/request/file.go b/backend/app/dto/request/file.go index abda45b67..31a088be1 100644 --- a/backend/app/dto/request/file.go +++ b/backend/app/dto/request/file.go @@ -64,7 +64,7 @@ type FileDeCompress struct { type FileEdit struct { Path string `json:"path" validate:"required"` - Content string `json:"content" validate:"required"` + Content string `json:"content"` } type FileRename struct { diff --git a/frontend/src/views/host/file-management/code-editor/index.vue b/frontend/src/views/host/file-management/code-editor/index.vue index ee9a0c2c6..ac1e58bf0 100644 --- a/frontend/src/views/host/file-management/code-editor/index.vue +++ b/frontend/src/views/host/file-management/code-editor/index.vue @@ -197,7 +197,7 @@ const quickSave = () => { const saveContent = (closePage: boolean) => { loading.value = true; - SaveFileContent(form.value).finally(() => { + SaveFileContent(form.value).then(() => { loading.value = false; open.value = !closePage; MsgSuccess(i18n.global.t('commons.msg.updateSuccess')); @@ -212,8 +212,6 @@ const acceptParams = (props: EditProps) => { form.value.path = props.path; config.language = props.language; fileName.value = props.name; - // TODO Now,1panel only support liunux,so we can use LF. - // better,We should rely on the actual line feed character of the file returned from the background config.eol = monaco.editor.EndOfLineSequence.LF; open.value = true; };