mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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
|
// FIXME: Otherwise first form change will be ignored
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
updateFromMonaco(`${stringConfig}\n\ndummy: 1`);
|
updateFromMonaco(stringConfig === '{}' ? 'dummy: 1' : `${stringConfig}\n\ndummy: 1`);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setStringConfig(stringConfig);
|
setStringConfig(stringConfig);
|
||||||
setValue(yaml.load(stringConfig));
|
setValue(yaml.load(stringConfig));
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ const FileSetting = Schema.intersect([
|
|||||||
}).i18n({ en: 'File Storage Setting', zh: '文件存储设置' }),
|
}).i18n({ en: 'File Storage Setting', zh: '文件存储设置' }),
|
||||||
Schema.union([
|
Schema.union([
|
||||||
Schema.object({
|
Schema.object({
|
||||||
type: Schema.const('file').required(),
|
type: Schema.const('file'),
|
||||||
path: Schema.string().default(defaultPath).i18n({ en: 'Storage path', zh: '存储路径' }),
|
path: Schema.string().default(defaultPath).i18n({ en: 'Storage path', zh: '存储路径' }),
|
||||||
secret: Schema.string().default(nanoid()).i18n({ en: 'Download file sign secret', 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),
|
pathStyle: Schema.boolean().default(true),
|
||||||
}),
|
}),
|
||||||
] as const),
|
] as const),
|
||||||
] as const).default({
|
] as const);
|
||||||
type: 'file',
|
|
||||||
path: defaultPath,
|
|
||||||
endPointForUser: '/fs/',
|
|
||||||
endPointForJudge: '/fs/',
|
|
||||||
secret: nanoid(),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const Config = FileSetting;
|
export const Config = FileSetting;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user