ui-default: init

将ui-default合并至主存储库便于维护
This commit is contained in:
undefined committed 2021-04-03 01:44:22 +08:00
1 parent 6317c9057f
commit 5faa54c7ca
564 files changed
+23083 -14

No files matched your search

@@ -0,0 +1,32 @@
import { NamedPage } from 'vj/misc/Page';
import Notification from 'vj/components/notification';
import { ActionDialog } from 'vj/components/dialog';
import request from 'vj/utils/request';
const page = new NamedPage('manage_script', () => {
const runScriptDialog = new ActionDialog({
$body: $('.dialog__body--run-script > div'),
});
runScriptDialog.clear = function () {
this.$dom.find('[name="args"]').val('');
return this;
};
window.runScript = async function (id) {
const action = await runScriptDialog.clear().open();
if (action !== 'ok') return;
const args = runScriptDialog.$dom.find('[name="args"]').val();
try {
const res = await request.post('', {
args,
id,
});
window.location.href = res.url;
} catch (error) {
Notification.error(error.message);
}
};
});
export default page;