diff --git a/web_interface/templates/v3/index.html b/web_interface/templates/v3/index.html index 6233c39c..9f5f3635 100644 --- a/web_interface/templates/v3/index.html +++ b/web_interface/templates/v3/index.html @@ -73,7 +73,7 @@ Start Display @@ -82,7 +82,7 @@ Stop Display @@ -91,7 +91,7 @@ Update Code @@ -101,7 +101,7 @@ hx-vals='{"action": "reboot_system"}' hx-confirm="Are you sure you want to reboot the system?" hx-swap="none" - hx-on:htmx:after-request="if (typeof showNotification !== 'undefined' && event.detail.xhr) { try { var d = JSON.parse(event.detail.xhr.responseText); showNotification(d.message || 'System rebooting...', d.status || 'info'); } catch(e) {} }" + hx-on:htmx:after-request="if (typeof showNotification !== 'undefined') { var m='System rebooting...',s='info'; try { var d=JSON.parse(event.detail.xhr.responseText); m=d.message||m; s=d.status||s; } catch(e) {} showNotification(m,s); }" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-yellow-600 hover:bg-yellow-700"> Reboot System diff --git a/web_interface/templates/v3/partials/overview.html b/web_interface/templates/v3/partials/overview.html index 4433c629..f9d509ea 100644 --- a/web_interface/templates/v3/partials/overview.html +++ b/web_interface/templates/v3/partials/overview.html @@ -151,7 +151,7 @@ Start Display @@ -160,7 +160,7 @@ Stop Display @@ -170,7 +170,7 @@ hx-vals='{"action": "git_pull"}' hx-confirm="This will stash any local changes and update the code. Continue?" hx-swap="none" - hx-on:htmx:after-request="if (typeof showNotification !== 'undefined' && event.detail.xhr) { try { var d = JSON.parse(event.detail.xhr.responseText); showNotification(d.message || 'Code update completed', d.status || 'info'); } catch(e) {} }" + hx-on:htmx:after-request="if (typeof showNotification !== 'undefined') { var m='Code update completed',s='info'; try { var d=JSON.parse(event.detail.xhr.responseText); m=d.message||m; s=d.status||s; } catch(e) {} showNotification(m,s); }" class="inline-flex items-center px-4 py-2 border border-gray-300 text-base font-semibold rounded-md text-gray-900 bg-white hover:bg-gray-50"> Update Code @@ -180,7 +180,7 @@ hx-vals='{"action": "reboot_system"}' hx-confirm="Are you sure you want to reboot the system?" hx-swap="none" - hx-on:htmx:after-request="if (typeof showNotification !== 'undefined' && event.detail.xhr) { try { var d = JSON.parse(event.detail.xhr.responseText); showNotification(d.message || 'System rebooting...', d.status || 'info'); } catch(e) {} }" + hx-on:htmx:after-request="if (typeof showNotification !== 'undefined') { var m='System rebooting...',s='info'; try { var d=JSON.parse(event.detail.xhr.responseText); m=d.message||m; s=d.status||s; } catch(e) {} showNotification(m,s); }" class="inline-flex items-center px-4 py-2 border border-transparent text-base font-semibold rounded-md text-white bg-yellow-600 hover:bg-yellow-700"> Reboot System @@ -190,7 +190,7 @@ hx-vals='{"action": "shutdown_system"}' hx-confirm="Are you sure you want to shut down the system? This will power off the Raspberry Pi." hx-swap="none" - hx-on:htmx:after-request="if (typeof showNotification !== 'undefined' && event.detail.xhr) { try { var d = JSON.parse(event.detail.xhr.responseText); showNotification(d.message || 'System shutting down...', d.status || 'info'); } catch(e) {} }" + hx-on:htmx:after-request="if (typeof showNotification !== 'undefined') { var m='System shutting down...',s='info'; try { var d=JSON.parse(event.detail.xhr.responseText); m=d.message||m; s=d.status||s; } catch(e) {} showNotification(m,s); }" class="inline-flex items-center px-4 py-2 border border-transparent text-base font-semibold rounded-md text-white bg-red-800 hover:bg-red-900"> Shutdown System @@ -199,7 +199,7 @@ Restart Display Service @@ -208,7 +208,7 @@ Restart Web Service