From aadf5dcebc0e4adce609ff3a72231dccc89aafcb Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Fri, 5 Jun 2026 17:58:16 +0200 Subject: [PATCH] Added action & spin to dhcp and dns reload in index --- frontend/js/index.js | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/frontend/js/index.js b/frontend/js/index.js index 16c3a74..2e01732 100644 --- a/frontend/js/index.js +++ b/frontend/js/index.js @@ -460,28 +460,24 @@ const actionHandlers = { openBackupModal, // managed by boostrap closeBackupModal, // managed by boostrap // Reload DNS - reloadDns: async () => { - try { - const result = await serviceReloadDNS(); - const msg = (typeof result === 'object' && result?.message) - ? result.message - : 'DNS reload successfully'; - showToast(msg, true); - } catch (err) { - showToast(err?.message || "Error reloading DNS", false); - } + reloadDns: async (e, el) => { + await handleReload( + el, + serviceReloadDNS, + "DNS reload successfully", + "Error reloading DNS", + "Reloading DNS..." + ); }, // Reload DHCP - reloadDhcp: async () => { - try { - const result = await serviceReloadDHCP(); - const msg = (typeof result === 'object' && result?.message) - ? result.message - : 'DHCP reload successfully'; - showToast(msg, true); - } catch (err) { - showToast(err?.message || "Error reloading DHCP", false); - } + reloadDhcp: async (e, el) => { + await handleReload( + el, + serviceReloadDHCP, + "DHCP reload successfully", + "Error reloading DHCP", + "Reloading DHCP..." + ); }, // Check API status apiCheck: async () => { -- 2.47.3