diff --git a/controllers/dashboard.js b/controllers/dashboard.js index a9d243f..57bb18d 100644 --- a/controllers/dashboard.js +++ b/controllers/dashboard.js @@ -257,6 +257,15 @@ export const Card = (req, res) => { containerId.inspect().then(data => { let state = data.State.Status; + + let state_indicator = 'green'; + if (state == 'exited') { + state = 'stopped'; + state_indicator = 'red'; + } else if (state == 'paused') { + state_indicator = 'orange'; + } + let wrapped = name; let disable = ""; let chartName = name.replace(/-/g, ''); @@ -269,13 +278,7 @@ export const Card = (req, res) => { // if ( external_port == undefined ) { external_port = 0; } // if ( internal_port == undefined ) { internal_port = 0; } - let state_indicator = 'green'; - if (state == 'exited') { - state = 'stopped'; - state_indicator = 'red'; - } else if (state == 'paused') { - state_indicator = 'orange'; - } + let trigger = 'data-hx-trigger="load, every 2s"'; if (state != 'running') { trigger = 'data-hx-trigger="load"'; } @@ -301,7 +304,7 @@ export const Card = (req, res) => { newCard = newCard.replace(/AppName/g, name); newCard = newCard.replace(/AppShortName/g, wrapped); newCard = newCard.replace(/AppIcon/g, service); - newCard = newCard.replace(/AppState/g, data.State.Status); + newCard = newCard.replace(/AppState/g, state); newCard = newCard.replace(/AppImage/g, data.Config.Image.split('/')); newCard = newCard.replace(/StateColor/g, state_indicator); newCard = newCard.replace(/ChartName/g, chartName); diff --git a/views/account.html b/views/account.html index e66a9e3..cb0f6a5 100644 --- a/views/account.html +++ b/views/account.html @@ -21,7 +21,7 @@
- <%- include('navbar.html') %> + <%- include('/partials/navbar.html') %>
diff --git a/views/apps.html b/views/apps.html index 7870b22..01dcc24 100644 --- a/views/apps.html +++ b/views/apps.html @@ -22,7 +22,7 @@
- <%- include('navbar.html') %> + <%- include('partials/navbar.html') %>
@@ -107,7 +107,7 @@
- <%- include('footer.html') %> + <%- include('partials/footer.html') %>
diff --git a/views/dashboard.html b/views/dashboard.html index 3744008..58dad6b 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -24,7 +24,7 @@
- <%- include('navbar.html') %> + <%- include('partials/navbar.html') %>
@@ -142,13 +142,13 @@
-
+
-
+
@@ -197,7 +197,7 @@
- <%- include('footer.html') %> + <%- include('partials/footer.html') %>
diff --git a/views/images.html b/views/images.html index 4e386fe..649e522 100644 --- a/views/images.html +++ b/views/images.html @@ -20,7 +20,7 @@
- <%- include('navbar.html') %> + <%- include('partials/navbar.html') %>
@@ -72,7 +72,7 @@
- <%- include('footer.html') %> + <%- include('partials/footer.html') %> diff --git a/views/networks.html b/views/networks.html index 09a9aae..d85b56e 100644 --- a/views/networks.html +++ b/views/networks.html @@ -20,7 +20,7 @@
- <%- include('navbar.html') %> + <%- include('partials/navbar.html') %>
@@ -87,7 +87,7 @@
- <%- include('footer.html') %> + <%- include('partials/footer.html') %> diff --git a/views/footer.html b/views/partials/footer.html similarity index 100% rename from views/footer.html rename to views/partials/footer.html diff --git a/views/navbar.html b/views/partials/navbar.html similarity index 100% rename from views/navbar.html rename to views/partials/navbar.html diff --git a/views/sidebar.html b/views/partials/sidebar.html similarity index 100% rename from views/sidebar.html rename to views/partials/sidebar.html diff --git a/views/portal.html b/views/portal.html index 473851f..22363e8 100644 --- a/views/portal.html +++ b/views/portal.html @@ -21,7 +21,7 @@
- <%- include('navbar.html') %> + <%- include('partials/navbar.html') %>
@@ -131,7 +131,7 @@
- <%- include('footer.html') %> + <%- include('partials/footer.html') %>
diff --git a/views/settings.html b/views/settings.html index bc64b60..a8a0acf 100644 --- a/views/settings.html +++ b/views/settings.html @@ -21,7 +21,7 @@
- <%- include('navbar.html') %> + <%- include('partials/navbar.html') %>