mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: add confirm to domain_delete
This commit is contained in:
3 files changed
+18
-1
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { confirm } from 'vj/components/dialog';
|
||||
import { NamedPage } from 'vj/misc/Page';
|
||||
import { i18n } from 'vj/utils';
|
||||
|
||||
export default new NamedPage('domain_dashboard', () => {
|
||||
let confirmed = false;
|
||||
$(document).on('submit', '#delete-domain-form', (ev) => {
|
||||
if (confirmed) return;
|
||||
ev.preventDefault();
|
||||
confirm(i18n('Confirm deleting this domain? This action cannot be undone.')).then((yes) => {
|
||||
if (!yes) return;
|
||||
confirmed = true;
|
||||
$(ev.currentTarget).submit();
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user