Compare commits
No commits in common. "ce7b7040841f514b06c4011d20f8748ae07ce70d" and "cd6f1354ca2da144837a989e052983da5a7ff93b" have entirely different histories.
ce7b704084
...
cd6f1354ca
@ -2219,36 +2219,7 @@ class TasksManager {
|
|||||||
const escHtml = (s) => String(s == null ? '' : s)
|
const escHtml = (s) => String(s == null ? '' : s)
|
||||||
.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
||||||
|
|
||||||
// Build a friendly title + app icon so the modal reads "Install Ipinfo"
|
const taskLabel = (task && (task.command || task.id)) || 'Unknown task';
|
||||||
// with the app's logo, not the raw "libreportal app install ipinfo"
|
|
||||||
// command. Mirrors the completion-notification flow above so the
|
|
||||||
// visual identity of a task is consistent across surfaces.
|
|
||||||
const appName = (task && task.app) || null;
|
|
||||||
const action = (task && task.type) || '';
|
|
||||||
const isSystemTask = action.startsWith('setup-') || appName === 'system';
|
|
||||||
let actionTitle = this.formatActionTitle(action);
|
|
||||||
// Tool tasks: prefer the tool's curated label.
|
|
||||||
const toolCmdMatch = (task && task.command || '').match(/libreportal app tool (\S+) (\S+)/);
|
|
||||||
if (toolCmdMatch) {
|
|
||||||
const toolId = toolCmdMatch[2];
|
|
||||||
let toolLabel = null;
|
|
||||||
const cat = window.toolsCatalog;
|
|
||||||
if (cat && cat.apps && cat.apps[toolCmdMatch[1]] && Array.isArray(cat.apps[toolCmdMatch[1]].tools)) {
|
|
||||||
const t = cat.apps[toolCmdMatch[1]].tools.find(x => x.id === toolId);
|
|
||||||
if (t && t.label) toolLabel = t.label;
|
|
||||||
}
|
|
||||||
if (!toolLabel) toolLabel = toolId.split(/[_-]/).map(w => w ? w.charAt(0).toUpperCase() + w.slice(1) : '').join(' ');
|
|
||||||
actionTitle = toolLabel;
|
|
||||||
}
|
|
||||||
const displayName = isSystemTask
|
|
||||||
? ''
|
|
||||||
: ((appName && window.getAppDisplayName) ? window.getAppDisplayName(appName) : (appName || ''));
|
|
||||||
const taskLabel = displayName
|
|
||||||
? `${actionTitle} ${displayName}`
|
|
||||||
: (actionTitle || (task && task.id) || 'Unknown task');
|
|
||||||
const taskIcon = isSystemTask
|
|
||||||
? '/icons/libreportal.svg'
|
|
||||||
: (appName ? `/icons/apps/${encodeURIComponent(appName)}.svg` : null);
|
|
||||||
const taskStatus = (task && task.status) || 'unknown';
|
const taskStatus = (task && task.status) || 'unknown';
|
||||||
|
|
||||||
const warningTitle = isActive ? 'Active task' : 'This cannot be undone';
|
const warningTitle = isActive ? 'Active task' : 'This cannot be undone';
|
||||||
@ -2286,8 +2257,6 @@ class TasksManager {
|
|||||||
window.openEoModal({
|
window.openEoModal({
|
||||||
id: 'delete-task-modal',
|
id: 'delete-task-modal',
|
||||||
size: 'sm',
|
size: 'sm',
|
||||||
icon: taskIcon || undefined,
|
|
||||||
iconAlt: displayName || 'Task',
|
|
||||||
eyebrow: 'Delete Task',
|
eyebrow: 'Delete Task',
|
||||||
title: taskLabel,
|
title: taskLabel,
|
||||||
desc: 'Confirm to delete this task.',
|
desc: 'Confirm to delete this task.',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user