// Auto-extracted from tasks-manager.js (verbatim) — augments TasksManager.prototype. Loaded after the base. Object.assign(TasksManager.prototype, { // Confirmation modal for deleteTask. Uses the shared openEoModal so it // visually matches every other destructive confirmation on the app // (Uninstall, Apply Configuration, etc). Resolves true if the user // confirms Delete, false on Cancel / backdrop click / close. _showDeleteTaskModal(task, isActive) { return new Promise((resolve) => { const escHtml = (s) => String(s == null ? '' : s) .replace(/&/g, '&').replace(//g, '>'); // Friendly title + app icon — mirrors the completion-toast format so // the modal's identity matches every other surface. const { isSystemTask, actionTitle, displayName, icon: taskIcon } = this._taskNotificationDescriptor(task); // For the modal we omit the "LibrePortal" subject (the eyebrow already // says "Delete Task") and just lead with the action: "Update Config". const modalSubject = isSystemTask ? '' : displayName; const taskLabel = modalSubject ? `${actionTitle} ${modalSubject}` : (actionTitle || (task && task.id) || 'Unknown task'); const taskStatus = (task && task.status) || 'unknown'; const warningTitle = isActive ? 'Active task' : 'This cannot be undone'; const warningText = isActive ? 'This task is still running or queued. It will be cancelled first, then deleted.' : 'The task and its logs will be permanently removed.'; const bodyHtml = `
${escHtml(warningTitle)}
${escHtml(warningText)}
This cannot be undone
All selected tasks and their logs will be permanently removed.