mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: fix config editor file.path
This commit is contained in:
2 files changed
+3
-9
No files matched your search
@@ -148,7 +148,7 @@ export default function ConfigEditor({
|
||||
// FIXME: Otherwise first form change will be ignored
|
||||
React.useEffect(() => {
|
||||
setTimeout(() => {
|
||||
updateFromMonaco(`${stringConfig}\n\ndummy: 1`);
|
||||
updateFromMonaco(stringConfig === '{}' ? 'dummy: 1' : `${stringConfig}\n\ndummy: 1`);
|
||||
setTimeout(() => {
|
||||
setStringConfig(stringConfig);
|
||||
setValue(yaml.load(stringConfig));
|
||||
|
||||
@@ -73,7 +73,7 @@ const FileSetting = Schema.intersect([
|
||||
}).i18n({ en: 'File Storage Setting', zh: '文件存储设置' }),
|
||||
Schema.union([
|
||||
Schema.object({
|
||||
type: Schema.const('file').required(),
|
||||
type: Schema.const('file'),
|
||||
path: Schema.string().default(defaultPath).i18n({ en: 'Storage path', zh: '存储路径' }),
|
||||
secret: Schema.string().default(nanoid()).i18n({ en: 'Download file sign secret', zh: '下载文件签名密钥' }),
|
||||
}),
|
||||
@@ -87,13 +87,7 @@ const FileSetting = Schema.intersect([
|
||||
pathStyle: Schema.boolean().default(true),
|
||||
}),
|
||||
] as const),
|
||||
] as const).default({
|
||||
type: 'file',
|
||||
path: defaultPath,
|
||||
endPointForUser: '/fs/',
|
||||
endPointForJudge: '/fs/',
|
||||
secret: nanoid(),
|
||||
});
|
||||
] as const);
|
||||
|
||||
export const Config = FileSetting;
|
||||
|
||||
|
||||
Reference in new issue
Block a user