- features/tasks/: tasks-manager.js (the /tasks page controller) + tasks.css. - shared/task/: the 6 cross-cutting task-kernel files (event-bus, commands, actions, router, global-functions, manager) + task-refresh-coordinator.js — used by tasks AND apps/app-detail/backup, so they go to shared/, not a feature. task-parameter-preserve.js stays at js/ (shared root). - Updated all path strings: system-loader.js task-system + apps-manager components, apps-manager loadTaskSystem(), index.html (refresh-coordinator + tasks.css). Globals (taskEventBus/tasksManager/TaskManager/...) unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
29 lines
1.4 KiB
JavaScript
Executable File
29 lines
1.4 KiB
JavaScript
Executable File
/**
|
|
* Global Functions for Individual Task Actions
|
|
* Extends the tasks manager with global action functions for individual tasks
|
|
*/
|
|
|
|
// Task global functions initialization is now handled by SystemLoader
|
|
// Global task functions will be set up centrally when TasksManager is available
|
|
|
|
function setupTaskGlobalFunctions() {
|
|
if (window.TasksManager || window.tasksManager) {
|
|
// Use whichever instance is available
|
|
const tasksManager = window.tasksManager || window.TasksManager;
|
|
|
|
// Add modular action functions to global scope
|
|
window.installApp = (appName, config = '') => tasksManager.router.routeAction('install', { appName, config });
|
|
window.uninstallApp = (appName) => tasksManager.router.routeAction('uninstall', { appName });
|
|
window.restartApp = (appName) => tasksManager.router.routeAction('restart', { appName });
|
|
window.startApp = (appName) => tasksManager.router.routeAction('start', { appName });
|
|
window.stopApp = (appName) => tasksManager.router.routeAction('stop', { appName });
|
|
window.backupApp = (appName) => tasksManager.router.routeAction('backup', { appName });
|
|
window.updateConfig = (appName) => tasksManager.router.routeAction('update_config', { appName });
|
|
window.systemUpdate = () => tasksManager.router.routeAction('system_update');
|
|
|
|
//console.log('✅ Task action functions registered globally');
|
|
} else {
|
|
console.warn('⚠️ TasksManager not found, action functions not registered');
|
|
}
|
|
}
|