mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui-default: init
将ui-default合并至主存储库便于维护
This commit is contained in:
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;
|
||||
Reference in new issue
Block a user