core&ui: goodbye, minio (#417)

This commit is contained in:
undefined authored and GitHub committed 2022-08-23 00:40:21 +08:00
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;