feat: replace native confirm with custom modal to fix auto-close issue

This commit is contained in:
infosave2007
2026-01-23 19:08:41 +03:00
parent 6303abd181
commit c9fecb45da
3 changed files with 77 additions and 3 deletions
+1 -1
View File
@@ -99,7 +99,7 @@
<i class="fas fa-eye mr-1"></i>{{ t('servers.view') }}
</a>
<form method="POST" action="/servers/{{ server.id }}/delete" class="inline" id="delete-form-{{ server.id }}">
<button type="button" class="text-red-600 hover:text-red-900" onclick="event.stopPropagation(); if(confirm('{{ t('message.confirm') }} Delete server {{ server.name }}?')) { document.getElementById('delete-form-{{ server.id }}').submit(); }">
<button type="button" class="text-red-600 hover:text-red-900" onclick="(async()=>{ event.stopPropagation(); if(await showConfirmModal('Удалить сервер {{ server.name }}?', 'Удаление сервера')) { document.getElementById('delete-form-{{ server.id }}').submit(); } })()">
<i class="fas fa-trash mr-1"></i>{{ t('servers.delete') }}
</button>
</form>
+2 -2
View File
@@ -455,8 +455,8 @@ document.addEventListener('DOMContentLoaded', function() {
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
const confirmResult = confirm('Удалить протокол и всех его клиентов?');
if (!confirmResult) return;
const confirmed = await showConfirmModal('Удалить протокол и всех его клиентов?', 'Удаление протокола');
if (!confirmed) return;
const slug = btn.getAttribute('data-slug');
const m = document.getElementById('uninstallSpMsg');
m.textContent = '';