Skip to content

Commit 5450901

Browse files
author
FolderView Plus Test
committed
Gate docker member force update behind advanced mode
1 parent 72398df commit 5450901

9 files changed

Lines changed: 45 additions & 9 deletions

archive/folderview.plus-2026.04.05.10.txz.sha256

Lines changed: 0 additions & 1 deletion
This file was deleted.

archive/folderview.plus-2026.04.05.11.txz.sha256

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9c47a8df4f9e1743913298ca94bf59e5ad71527ebed9d40c0ce3278de14ab9ae folderview.plus-2026.04.08.03.txz
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
df1cc422665f47114c49dfc6852a68373c641aae6ebaee61a9970e894c4e33fa folderview.plus-2026.04.08.04.txz

folderview.plus.plg

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@
66
<!ENTITY launch "Settings/FolderViewPlus">
77
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
88
<!ENTITY pluginURL "https://raw.githubusercontent.com/&github;/dev/folderview.plus.plg">
9-
<!ENTITY version "2026.04.08.02">
10-
<!ENTITY md5 "c4b6b577c7e5cbd144bfe2c0167e57ea">
9+
<!ENTITY version "2026.04.08.04">
10+
<!ENTITY md5 "1d68089a0df39087855f68ddae636b28">
1111
]>
1212

1313
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" icon="folder-icon.png" support="https://forums.unraid.net/topic/197631-plugin-folderview-plus/" min="7.0.0">
1414
<CHANGES>
1515

16+
###2026.04.08.04
17+
- Fix: Docker runtime rows, folder state, and container interactions.
18+
19+
20+
###2026.04.08.03
21+
- Fix: Docker folder member rows now hide `force update` unless Docker advanced view is enabled, while still preserving `apply update` for containers that actually have an update ready.
22+
23+
1624
###2026.04.08.02
1725
- Fix: Docker runtime rows, folder state, and container interactions.
1826
- Fix: Server endpoints, runtime payloads, and persistence or validation paths.

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/docker.runtime.preview-actions.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@
139139
}
140140
};
141141

142+
const isDockerAdvancedModeEnabled = () => {
143+
try {
144+
return typeof jq?.cookie === 'function' && jq.cookie('docker_listview_mode') == 'advanced';
145+
} catch (_error) {
146+
return false;
147+
}
148+
};
149+
142150
const escapeInlineJsSingleQuotedValue = (value) => String(value ?? '')
143151
.replace(/\\/g, '\\\\')
144152
.replace(/'/g, "\\'");
@@ -155,7 +163,10 @@
155163
if (entry?.update === true) {
156164
return `<span class="orange-text folder-update-text" style="white-space:nowrap;"><i class="fa fa-flash fa-fw"></i>${escapeHtml(i18nLabel('update-ready', 'update-ready'))}</span><br><a class="exec" onclick="hideAllTips(); updateContainer('${safeContainerName}');"><span style="white-space:nowrap;"><i class="fa fa-cloud-download fa-fw"></i>${escapeHtml(i18nLabel('apply-update', 'apply-update'))}</span></a>`;
157165
}
158-
return `<span class="green-text folder-update-text"><i class="fa fa-check fa-fw"></i>${escapeHtml(i18nLabel('up-to-date', 'up-to-date'))}</span><br><a class="exec" onclick="hideAllTips(); updateContainer('${safeContainerName}');"><span style="white-space:nowrap;"><i class="fa fa-cloud-download fa-fw"></i>${escapeHtml(i18nLabel('force-update', 'force-update'))}</span></a>`;
166+
const forceUpdateHtml = isDockerAdvancedModeEnabled()
167+
? `<br><a class="exec" onclick="hideAllTips(); updateContainer('${safeContainerName}');"><span style="white-space:nowrap;"><i class="fa fa-cloud-download fa-fw"></i>${escapeHtml(i18nLabel('force-update', 'force-update'))}</span></a>`
168+
: '';
169+
return `<span class="green-text folder-update-text"><i class="fa fa-check fa-fw"></i>${escapeHtml(i18nLabel('up-to-date', 'up-to-date'))}</span>${forceUpdateHtml}`;
159170
};
160171

161172
const getDockerPreviewStatusMeta = (entry = {}) => {

tests/docker-update-status-regression.test.mjs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,16 @@ test('docker runtime builds member row update markup from per-container runtime
7575
const previewActionsApi = dockerPreviewActionsModule.createApi({
7676
window: {},
7777
$: Object.assign(() => ({}), {
78-
i18n: (key) => key
78+
i18n: (key) => key,
79+
cookie: () => ''
80+
}),
81+
escapeHtml: (value) => String(value ?? '')
82+
});
83+
const previewActionsAdvancedApi = dockerPreviewActionsModule.createApi({
84+
window: {},
85+
$: Object.assign(() => ({}), {
86+
i18n: (key) => key,
87+
cookie: () => 'advanced'
7988
}),
8089
escapeHtml: (value) => String(value ?? '')
8190
});
@@ -105,14 +114,21 @@ test('docker runtime builds member row update markup from per-container runtime
105114
manager: 'dockerman',
106115
update: true
107116
});
117+
const advancedUpToDateHtml = previewActionsAdvancedApi.buildDockerMemberUpdateColumnHtml({
118+
name: 'app-two',
119+
manager: 'dockerman',
120+
update: false
121+
});
108122

109123
assert.match(updateReadyHtml, /update-ready/);
110124
assert.match(updateReadyHtml, /apply-update/);
111125
assert.match(updateReadyHtml, /updateContainer\('app-one'\)/);
112126
assert.doesNotMatch(updateReadyHtml, /force-update/);
113127
assert.match(upToDateHtml, /up-to-date/);
114-
assert.match(upToDateHtml, /force-update/);
115-
assert.match(upToDateHtml, /updateContainer\('app-two'\)/);
128+
assert.doesNotMatch(upToDateHtml, /force-update/);
129+
assert.doesNotMatch(upToDateHtml, /updateContainer\('app-two'\)/);
130+
assert.match(advancedUpToDateHtml, /force-update/);
131+
assert.match(advancedUpToDateHtml, /updateContainer\('app-two'\)/);
116132
assert.doesNotMatch(upToDateHtml, /apply-update/);
117133
assert.match(composeHtml, /compose/);
118134
assert.doesNotMatch(composeHtml, /updateContainer\(/);
@@ -139,7 +155,8 @@ test('docker runtime sync rewrites both hidden and expanded member rows', () =>
139155
assert.match(dockerPreviewActionsModule.createApi({
140156
window: {},
141157
$: Object.assign(() => ({}), {
142-
i18n: (key) => key
158+
i18n: (key) => key,
159+
cookie: () => 'advanced'
143160
}),
144161
escapeHtml: (value) => String(value ?? '')
145162
}).buildDockerMemberUpdateColumnHtml({ name: 'demo', manager: 'dockerman', update: false }), /force-update/);

0 commit comments

Comments
 (0)