ui: add confirm to domain_delete

This commit is contained in:
undefined committed 2025-09-04 20:53:02 +08:00
1 parent dd6f5bbbea
commit dceaccb4d1
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();
});
});
});