mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-27 20:49:03 +08:00
fix: 解决清空文件后保存失败的问题 (#3965)
This commit is contained in:
parent
3bd6f46fe2
commit
58f58f0fac
@ -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 {
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user