From d188139cdb0dd57c97699e0358e6b15116b4821d Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Sat, 3 Sep 2022 21:17:21 -0500 Subject: [PATCH] Fix app restart API; Add missing loading spinners and confirm dialogs on some pages --- .../mynode_apps/lndg/www/templates/lndg.html | 9 +++++++++ .../mynode_apps/wetty/www/templates/wetty.html | 9 +++++++++ .../var/www/mynode/static/js/manage_apps.js | 15 +++++++++++++++ .../var/www/mynode/templates/app/generic_app.html | 14 ++------------ 4 files changed, 35 insertions(+), 12 deletions(-) diff --git a/rootfs/standard/usr/share/mynode_apps/lndg/www/templates/lndg.html b/rootfs/standard/usr/share/mynode_apps/lndg/www/templates/lndg.html index d3100a80..72e4a6ac 100644 --- a/rootfs/standard/usr/share/mynode_apps/lndg/www/templates/lndg.html +++ b/rootfs/standard/usr/share/mynode_apps/lndg/www/templates/lndg.html @@ -42,5 +42,14 @@ + +
+ + + diff --git a/rootfs/standard/usr/share/mynode_apps/wetty/www/templates/wetty.html b/rootfs/standard/usr/share/mynode_apps/wetty/www/templates/wetty.html index d3100a80..72e4a6ac 100644 --- a/rootfs/standard/usr/share/mynode_apps/wetty/www/templates/wetty.html +++ b/rootfs/standard/usr/share/mynode_apps/wetty/www/templates/wetty.html @@ -42,5 +42,14 @@ + +
+ + + diff --git a/rootfs/standard/var/www/mynode/static/js/manage_apps.js b/rootfs/standard/var/www/mynode/static/js/manage_apps.js index a50573b9..2c5cfa88 100644 --- a/rootfs/standard/var/www/mynode/static/js/manage_apps.js +++ b/rootfs/standard/var/www/mynode/static/js/manage_apps.js @@ -13,6 +13,21 @@ function restart(name, short_name) { } } +function restart_app_via_api(name, short_name) { + if ( confirm("Are you sure you want to restart "+name+"?") ) { + $('#loading_spinner_message').html("Restarting..."); + $('#loading_spinner_overlay').fadeIn(); + $.get('/api/restart_app?app='+short_name) + .done(function( data ) { + if (data != "OK") { + alert("Error restarting app: "+data) + } + $('#loading_spinner_overlay').fadeOut(); + } + ); + } +} + // ========================================== // Manage app installations // ========================================== diff --git a/rootfs/standard/var/www/mynode/templates/app/generic_app.html b/rootfs/standard/var/www/mynode/templates/app/generic_app.html index 458a0d33..3d4c6285 100644 --- a/rootfs/standard/var/www/mynode/templates/app/generic_app.html +++ b/rootfs/standard/var/www/mynode/templates/app/generic_app.html @@ -31,18 +31,6 @@