Merge claude/2
This commit is contained in:
commit
ce7b704084
@ -2219,7 +2219,36 @@ 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, '>');
|
||||||
|
|
||||||
const taskLabel = (task && (task.command || task.id)) || 'Unknown task';
|
// Build a friendly title + app icon so the modal reads "Install Ipinfo"
|
||||||
|
// 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';
|
||||||
@ -2257,6 +2286,8 @@ 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