Skip to content

Commit 6ade786

Browse files
elibosleyclaude
andcommitted
feat(task-tray): show target name in background-task progress headings
Generic progress headings ("Updating the container", "Install Plugin") don't say what is being acted on, which is ambiguous when several operations run at once. The target is already in scope at each call site, so fold it into the title that openDocker/openPlugin render: - docker update: "Update container: <name>" - docker update all: "Updating all Containers (N)" - plugin install: "Install Plugin: <plugin>" (Apps, Tailscale) - language install: "Install Language: <pack>" Names that aren't charset-constrained (plugin/language files) are reduced to a sanitized basename slug before display, since the swal heading is rendered with html:true. Container names rely on Docker's naming charset; counts are numeric. Stays out of HeadInlineJS so it does not conflict with the backend task-queue work in #2665. OS-460 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent cc6a800 commit 6ade786

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

emhttp/plugins/dynamix.docker.manager/javascript/docker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function updateContainer(container) {
107107
swal({
108108
title:_('Are you sure?'),text:_('Update container')+': '+container, type:'warning',html:true,showCancelButton:true,closeOnConfirm:false,confirmButtonText:_('Yes, update it!'),cancelButtonText:_('Cancel')
109109
},function(){
110-
openDocker('update_container '+encodeURIComponent(container),_('Updating the container'),'','loadlist');
110+
openDocker('update_container '+encodeURIComponent(container),_('Update container')+': '+container,'','loadlist');
111111
});
112112
}
113113
function rmContainer(container, image, id) {
@@ -182,7 +182,7 @@ function updateAll() {
182182
$('input[type=button]').prop('disabled',true);
183183
var ct = [];
184184
for (var i=0,d; d=docker[i]; i++) if (d.update==1) ct.push(encodeURIComponent(d.name));
185-
openDocker('update_container '+ct.join('*'),_('Updating all Containers'),'','loadlist');
185+
openDocker('update_container '+ct.join('*'),_('Updating all Containers')+' ('+ct.length+')','','loadlist');
186186
}
187187
function rebuildAll() {
188188
$('input[type=button]').prop('disabled',true);

emhttp/plugins/dynamix/Apps.page

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ Code="e942"
1616
?>
1717
<script>
1818
function installPlugin(file) {
19-
openPlugin("plugin install "+file,"_(Install Plugin)_","","refresh");
19+
// show which plugin in the progress heading; sanitize to a safe display slug
20+
// (the heading is rendered as HTML), derived from the .plg basename
21+
var name = (file.split('/').pop()||'').replace(/\.[a-z0-9]+$/i,'').replace(/[^\w.\- ]+/g,' ').trim();
22+
openPlugin("plugin install "+file,"_(Install Plugin)_"+(name?': '+name:''),"","refresh");
2023
}
2124
</script>
2225

emhttp/plugins/dynamix/Language.page

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ function getZIPfile(event,form) {
7575
}
7676
function installXML(name) {
7777
var file = name.trim();
78-
if (file) openPlugin('language install '+file, "_(Install Language)_");
78+
// show which language pack in the progress heading; sanitize to a safe display
79+
// slug (the heading is rendered as HTML), derived from the file basename
80+
var disp = (file.split('/').pop()||'').replace(/\.[a-z0-9]+$/i,'').replace(/[^\w.\- ]+/g,' ').trim();
81+
if (file) openPlugin('language install '+file, "_(Install Language)_"+(disp?': '+disp:''));
7982
}
8083
$(function() {
8184
$('input.view').switchButton({labels_placement:'left', off_label:"_(User)_", on_label:"_(Developer)_"});

emhttp/plugins/dynamix/Tailscale.page

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ Title="Tailscale"
1616
?>
1717
<script>
1818
function installPlugin(file) {
19-
openPlugin("plugin install "+file,"_(Install Plugin)_","","refresh");
19+
// show which plugin in the progress heading; sanitize to a safe display slug
20+
// (the heading is rendered as HTML), derived from the .plg basename
21+
var name = (file.split('/').pop()||'').replace(/\.[a-z0-9]+$/i,'').replace(/[^\w.\- ]+/g,' ').trim();
22+
openPlugin("plugin install "+file,"_(Install Plugin)_"+(name?': '+name:''),"","refresh");
2023
}
2124
</script>
2225

0 commit comments

Comments
 (0)