mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 16:29:17 +08:00
fix: 解决清空文件后保存失败的问题 (#3965)
This commit is contained in:
parent
3bd6f46fe2
commit
58f58f0fac
@ -64,7 +64,7 @@ type FileDeCompress struct {
|
|||||||
|
|
||||||
type FileEdit struct {
|
type FileEdit struct {
|
||||||
Path string `json:"path" validate:"required"`
|
Path string `json:"path" validate:"required"`
|
||||||
Content string `json:"content" validate:"required"`
|
Content string `json:"content"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type FileRename struct {
|
type FileRename struct {
|
||||||
|
@ -197,7 +197,7 @@ const quickSave = () => {
|
|||||||
|
|
||||||
const saveContent = (closePage: boolean) => {
|
const saveContent = (closePage: boolean) => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
SaveFileContent(form.value).finally(() => {
|
SaveFileContent(form.value).then(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
open.value = !closePage;
|
open.value = !closePage;
|
||||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||||
@ -212,8 +212,6 @@ const acceptParams = (props: EditProps) => {
|
|||||||
form.value.path = props.path;
|
form.value.path = props.path;
|
||||||
config.language = props.language;
|
config.language = props.language;
|
||||||
fileName.value = props.name;
|
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;
|
config.eol = monaco.editor.EndOfLineSequence.LF;
|
||||||
open.value = true;
|
open.value = true;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user