scheduler cleanup, high banner
frdel committed
Oct 15, 2025 at 09:22 UTC
80e8573acb156640d1831cf436e53a3b430833f2
2 files changed
+13
-25
docs/res/banner_high.png
Binary files /dev/null and b/docs/res/banner_high.png differ
webui/js/scheduler.js
+13
-25
@@ -4,7 +4,8 @@
4
*/
5
6
import { formatDateTime, getUserTimezone } from './time-utils.js';
7
-// switchFromContext is now in chats-store, accessed via globalThis
7
+import { store as chatsStore } from "/components/sidebar/chats/chats-store.js"
8
+import { store as notificationsStore } from "/components/notifications/notification-store.js"
9
10
// Ensure the showToast function is available
11
// if (typeof window.showToast !== 'function') {
@@ -60,26 +61,16 @@ import { formatDateTime, getUserTimezone } from './time-utils.js';
61
// Add this near the top of the scheduler.js file, outside of any function
62
const showToast = function(message, type = 'info') {
63
// Use new frontend notification system
63
- if (window.Alpine && window.Alpine.store && window.Alpine.store('notificationStore')) {
64
- const store = window.Alpine.store('notificationStore');
65
- switch (type.toLowerCase()) {
66
- case 'error':
67
- return store.frontendError(message, "Scheduler", 5);
68
- case 'success':
69
- return store.frontendInfo(message, "Scheduler", 3);
70
- case 'warning':
71
- return store.frontendWarning(message, "Scheduler", 4);
72
- case 'info':
73
- default:
74
- return store.frontendInfo(message, "Scheduler", 3);
75
- }
76
- } else {
77
- // Fallback to global toast function or console
78
- if (typeof window.toast === 'function') {
79
- window.toast(message, type);
80
- } else {
81
- console.log(`SCHEDULER ${type.toUpperCase()}: ${message}`);
82
- }
64
+ switch (type.toLowerCase()) {
65
+ case 'error':
66
+ return notificationsStore.frontendError(message, "Scheduler", 5);
67
+ case 'success':
68
+ return notificationsStore.frontendInfo(message, "Scheduler", 3);
69
+ case 'warning':
70
+ return notificationsStore.frontendWarning(message, "Scheduler", 4);
71
+ case 'info':
72
+ default:
73
+ return notificationsStore.frontendInfo(message, "Scheduler", 3);
74
}
75
};
76
@@ -973,10 +964,7 @@ const fullComponentImplementation = function() {
964
try {
965
966
// if we delete selected context, switch to another first
976
- const chatsStore = globalThis.Alpine?.store('chats');
977
- if (chatsStore && typeof chatsStore.switchFromContext === 'function') {
978
- await chatsStore.switchFromContext(taskId);
979
- }
967
+ await chatsStore.switchFromContext(taskId);
968
969
const response = await fetchApi('/scheduler_task_delete', {
970
method: 'POST',