mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: goodbye, minio (#417)
This commit is contained in:
1 parent
7abc0a7d1b
commit
e06c86e9dd
34 files changed
+410
-322
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import yaml from 'js-yaml';
|
||||
import Schema from 'schemastery';
|
||||
import Notification from 'vj/components/notification';
|
||||
import { NamedPage } from 'vj/misc/Page';
|
||||
import request from 'vj/utils/request';
|
||||
|
||||
const page = new NamedPage('manage_config', async () => {
|
||||
const schema = new Schema(UiContext.schema);
|
||||
setInterval(() => {
|
||||
try {
|
||||
const v = yaml.load($('#config').val().toString());
|
||||
schema(v);
|
||||
$('#info').text('');
|
||||
} catch (e) {
|
||||
console.debug(e);
|
||||
$('#info').text(e.message);
|
||||
}
|
||||
}, 1000);
|
||||
$('#submit').on('click', () => {
|
||||
const value = $('#config').val();
|
||||
request.post('', { value }).then(() => {
|
||||
Notification.success('保存成功');
|
||||
}).catch((e) => {
|
||||
Notification.error('保存失败:', e.message);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
export default page;
|
||||
Reference in new issue
Block a user