Skip to content

Commit 91e4b48

Browse files
fix: keep stopped folder status visible when stopped badge is disabled
1 parent 95da60f commit 91e4b48

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

  • src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/docker.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,13 @@ const createFolder = (folder, id, positionInMainOrder, liveOrderArray, container
10261026
$(`tr.folder-id-${id} > td.updatecolumn`).next().attr('colspan', 6).end().remove();
10271027
}
10281028

1029-
if ((folderIsRunning && !showRunningBadge) || (!folderIsRunning && !showStoppedBadge)) {
1030-
$(`tr.folder-id-${id} i#load-folder-${id}, tr.folder-id-${id} span.folder-state`).hide();
1029+
if (folderIsRunning && !showRunningBadge) {
1030+
$(`tr.folder-id-${id} i#load-folder-${id}`).hide();
1031+
}
1032+
if (!folderIsRunning && !showStoppedBadge) {
1033+
const total = Object.entries(folder.containers).length;
1034+
$(`tr.folder-id-${id} i#load-folder-${id}`).hide();
1035+
$(`tr.folder-id-${id} span.folder-state`).text(`${started}/${total} ${$.i18n('started')}`);
10311036
}
10321037

10331038
if (!managerTypes.has('dockerman')) {

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/vm.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,13 @@ const createFolder = (folder, id, position, order, vmInfo, foldersDone) => {
360360
const showRunningBadge = badgePrefs.running !== false;
361361
const showStoppedBadge = badgePrefs.stopped === true;
362362
const folderIsRunning = started > 0;
363-
if ((folderIsRunning && !showRunningBadge) || (!folderIsRunning && !showStoppedBadge)) {
364-
$(`tr.folder-id-${id} i#load-folder-${id}, tr.folder-id-${id} span.folder-state`).hide();
363+
if (folderIsRunning && !showRunningBadge) {
364+
$(`tr.folder-id-${id} i#load-folder-${id}`).hide();
365+
}
366+
if (!folderIsRunning && !showStoppedBadge) {
367+
const total = Object.entries(folder.containers).length;
368+
$(`tr.folder-id-${id} i#load-folder-${id}`).hide();
369+
$(`tr.folder-id-${id} span.folder-state`).text(`${started}/${total} ${$.i18n('started')}`);
365370
}
366371

367372

0 commit comments

Comments
 (0)