@goodandready/dsh-cron 0.3.46 → 0.3.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.css +110 -4
- package/lib/client.js +73 -76
- package/package.json +1 -1
package/lib/client.css
CHANGED
|
@@ -28,10 +28,116 @@
|
|
|
28
28
|
display: none !important;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.dsh-cron-
|
|
32
|
-
.dsh-cron-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
.dsh-cron-nav-icon { display: inline-flex; align-items: center; justify-content: center; color: currentColor; flex-shrink: 0; }
|
|
32
|
+
.dsh-cron-nav-icon svg { width: 100%; height: 100%; display: block; }
|
|
33
|
+
|
|
34
|
+
/* In-session quick action bar & button (Issue #448, DSH style) */
|
|
35
|
+
.dsh-cron-session-add-btn {
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
gap: 5px;
|
|
39
|
+
height: 28px;
|
|
40
|
+
min-height: 28px;
|
|
41
|
+
padding: 0 8px;
|
|
42
|
+
border: 0;
|
|
43
|
+
border-radius: var(--dsw-radius-sm, 6px);
|
|
44
|
+
background: transparent;
|
|
45
|
+
color: var(--dsw-alias-label-tertiary, #999);
|
|
46
|
+
font-family: inherit;
|
|
47
|
+
font-size: 12px;
|
|
48
|
+
font-weight: 500;
|
|
49
|
+
line-height: 18px;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
user-select: none;
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
transition: background-color 0.15s ease, color 0.15s ease;
|
|
54
|
+
}
|
|
55
|
+
.dsh-cron-session-add-btn:hover {
|
|
56
|
+
background: var(--dsw-alias-fill-l2, color-mix(in srgb, var(--dsw-alias-label-primary, #fff) 10%, transparent));
|
|
57
|
+
color: var(--dsw-alias-label-primary, #fff);
|
|
58
|
+
}
|
|
59
|
+
.dsh-cron-session-add-btn:focus-visible {
|
|
60
|
+
background: var(--dsw-alias-fill-l2, color-mix(in srgb, var(--dsw-alias-label-primary, #fff) 10%, transparent));
|
|
61
|
+
color: var(--dsw-alias-label-primary, #fff);
|
|
62
|
+
outline: 2px solid var(--dsw-alias-focus-ring, #007acc);
|
|
63
|
+
outline-offset: 1px;
|
|
64
|
+
}
|
|
65
|
+
.dsh-cron-session-add-btn:active {
|
|
66
|
+
background: var(--dsw-alias-fill-l1, color-mix(in srgb, var(--dsw-alias-label-primary, #fff) 18%, transparent));
|
|
67
|
+
}
|
|
68
|
+
.dsh-cron-session-bar-icon {
|
|
69
|
+
display: inline-flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
width: 14px;
|
|
73
|
+
height: 14px;
|
|
74
|
+
flex-shrink: 0;
|
|
75
|
+
color: currentColor;
|
|
76
|
+
}
|
|
77
|
+
.dsh-cron-session-bar-icon svg {
|
|
78
|
+
width: 14px;
|
|
79
|
+
height: 14px;
|
|
80
|
+
display: block;
|
|
81
|
+
}
|
|
82
|
+
.dsh-cron-session-bar {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: 5px;
|
|
86
|
+
height: 28px;
|
|
87
|
+
min-height: 28px;
|
|
88
|
+
padding: 0 6px 0 8px;
|
|
89
|
+
border: 0;
|
|
90
|
+
border-radius: var(--dsw-radius-sm, 6px);
|
|
91
|
+
background: var(--dsw-alias-fill-l3, color-mix(in srgb, var(--dsw-alias-label-primary, #fff) 6%, transparent));
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
font-size: 12px;
|
|
94
|
+
line-height: 18px;
|
|
95
|
+
}
|
|
96
|
+
.dsh-cron-session-badge {
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
max-width: 130px;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
text-overflow: ellipsis;
|
|
102
|
+
white-space: nowrap;
|
|
103
|
+
border: 0;
|
|
104
|
+
background: transparent;
|
|
105
|
+
color: var(--dsw-alias-label-secondary, #ccc);
|
|
106
|
+
font-family: inherit;
|
|
107
|
+
font-size: 12px;
|
|
108
|
+
line-height: 18px;
|
|
109
|
+
padding: 2px 4px;
|
|
110
|
+
border-radius: var(--dsw-radius-xs, 4px);
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
transition: background-color 0.15s ease, color 0.15s ease;
|
|
113
|
+
}
|
|
114
|
+
.dsh-cron-session-badge:hover {
|
|
115
|
+
background: var(--dsw-alias-fill-l2, color-mix(in srgb, var(--dsw-alias-label-primary, #fff) 10%, transparent));
|
|
116
|
+
color: var(--dsw-alias-label-primary, #fff);
|
|
117
|
+
}
|
|
118
|
+
.dsh-cron-session-run-btn {
|
|
119
|
+
display: inline-flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: center;
|
|
122
|
+
height: 20px;
|
|
123
|
+
padding: 0 6px;
|
|
124
|
+
border: 0;
|
|
125
|
+
border-radius: var(--dsw-radius-xs, 4px);
|
|
126
|
+
background: var(--dsw-alias-fill-l2, color-mix(in srgb, var(--dsw-alias-label-primary, #fff) 10%, transparent));
|
|
127
|
+
color: var(--dsw-alias-label-secondary, #ccc);
|
|
128
|
+
font-family: inherit;
|
|
129
|
+
font-size: 11px;
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
transition: background-color 0.15s ease, color 0.15s ease;
|
|
132
|
+
}
|
|
133
|
+
.dsh-cron-session-run-btn:hover:not(:disabled) {
|
|
134
|
+
background: var(--dsw-alias-fill-l1, color-mix(in srgb, var(--dsw-alias-label-primary, #fff) 18%, transparent));
|
|
135
|
+
color: var(--dsw-alias-label-primary, #fff);
|
|
136
|
+
}
|
|
137
|
+
.dsh-cron-session-run-btn:disabled {
|
|
138
|
+
opacity: 0.5;
|
|
139
|
+
cursor: not-allowed;
|
|
140
|
+
}
|
|
35
141
|
|
|
36
142
|
.dsh-cron-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); overflow-y: auto; padding: 24px 48px 32px; z-index: 100; box-sizing: border-box; }
|
|
37
143
|
.dsh-cron-container { max-width: 960px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding: 8px 0 32px; box-sizing: border-box; }
|
package/lib/client.js
CHANGED
|
@@ -2,7 +2,10 @@ window.__ModuleLoader__.load({id: '@goodandready/dsh-cron',factory: (require) =>
|
|
|
2
2
|
var exports = module.exports
|
|
3
3
|
const React = window.React || require('react');
|
|
4
4
|
const _h = (...args) => (React && React.createElement ? React.createElement(...args) : null);
|
|
5
|
-
const ReactDOM = window.ReactDOM || require('react-dom/client');
|
|
5
|
+
const ReactDOM = window.ReactDOM || (function() {try { return require('react-dom/client'); } catch (_e) { void _e; }
|
|
6
|
+
try { return require('react-dom'); } catch (_e) { void _e; }
|
|
7
|
+
return null;
|
|
8
|
+
})();
|
|
6
9
|
const PLUGIN_ID = '@goodandready/dsh-cron';
|
|
7
10
|
const NS = 'dsh-cron';
|
|
8
11
|
const ROW_ID = 'dsh-cron';
|
|
@@ -278,9 +281,15 @@ function shouldDismissPanel(target) {if (target === null || target === undefined
|
|
|
278
281
|
if (typeof target.closest !== 'function') return false;
|
|
279
282
|
return target.closest(PANEL_OWNED_SELECTOR) === null;
|
|
280
283
|
}
|
|
284
|
+
function resolveSidebarAnchor() {if (typeof document === 'undefined') return null;
|
|
285
|
+
const marker = document.querySelector('[' + ENTRY_ATTR + ']');
|
|
286
|
+
if (!marker) return null;
|
|
287
|
+
return marker.closest('div[class*="panelEntry"]') || marker.closest('button') || marker.parentElement || marker;
|
|
288
|
+
}
|
|
281
289
|
function sidebarJobsSeatIsCurrent(state, entry) {
|
|
282
290
|
const root = state && state.root;
|
|
283
|
-
|
|
291
|
+
const anchor = (entry && typeof entry.closest === 'function') ? (entry.closest('div[class*="panelEntry"]') || entry.closest('button') || entry.parentElement || entry) : entry;
|
|
292
|
+
return root !== undefined && root.isConnected && anchor !== null && root.previousElementSibling === anchor;
|
|
284
293
|
}
|
|
285
294
|
function createToggle() {
|
|
286
295
|
let open = false;
|
|
@@ -1413,10 +1422,20 @@ preflightType: 'none',preflightTarget: '',priority: 5,concurrencyGroup: 'default
|
|
|
1413
1422
|
captureGitDiff: false,httpMethod: 'GET',httpUrl: '',httpHttpHeaders: '',httpBody: '',sshProfileId: '',sshTarget: '',sshKeyPath: '',dockerImage: '',nodePath: '',pythonPath: '',skillName: '',workflowName: '',});
|
|
1414
1423
|
setManualModalOpen(true);
|
|
1415
1424
|
};
|
|
1416
|
-
React.useEffect(() => {
|
|
1425
|
+
React.useEffect(() => {
|
|
1426
|
+
const checkPreset = () => {if (!pendingTaskPreset) return;
|
|
1417
1427
|
const p = pendingTaskPreset;
|
|
1418
1428
|
pendingTaskPreset = null;
|
|
1419
1429
|
openManualModal(p);
|
|
1430
|
+
};
|
|
1431
|
+
checkPreset();
|
|
1432
|
+
const onPreset = (ev) => {if (ev && ev.detail) openManualModal(ev.detail);
|
|
1433
|
+
else checkPreset();
|
|
1434
|
+
};
|
|
1435
|
+
if (typeof window !== 'undefined' && typeof window.addEventListener === 'function') {window.addEventListener('dsh-cron:preset', onPreset);
|
|
1436
|
+
return () => {try { window.removeEventListener('dsh-cron:preset', onPreset); } catch (_e) { void _e; }
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1420
1439
|
}, [tasks]);
|
|
1421
1440
|
const handleRetryDelivery = async (taskId, runId) => {setRetryingDeliveryId(runId);
|
|
1422
1441
|
try {
|
|
@@ -2472,38 +2491,9 @@ updateState.currentVersion && !updateState.error && !updateState.checking ? _h('
|
|
|
2472
2491
|
)
|
|
2473
2492
|
);
|
|
2474
2493
|
}
|
|
2475
|
-
function
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
}
|
|
2479
|
-
return undefined;
|
|
2480
|
-
}
|
|
2481
|
-
function createEntry(target, toggle, label) {
|
|
2482
|
-
const entry = target.cloneNode(true);
|
|
2483
|
-
entry.className = String(target.className) + ' dsh-cron-entry-clone';
|
|
2484
|
-
entry.setAttribute(ENTRY_ATTR, '');
|
|
2485
|
-
entry.setAttribute('data-dsh-plugin', 'dsh-cron');
|
|
2486
|
-
entry.setAttribute('data-dsh-part', 'sidebar-entry');
|
|
2487
|
-
entry.setAttribute('aria-label', label);
|
|
2488
|
-
entry.removeAttribute('id');
|
|
2489
|
-
entry.innerHTML = '';
|
|
2490
|
-
const icon = document.createElement('span');
|
|
2491
|
-
icon.className = 'dsh-cron-entry-icon';
|
|
2492
|
-
icon.innerHTML = ICON_TIMER;
|
|
2493
|
-
entry.appendChild(icon);
|
|
2494
|
-
const text = document.createElement('span');
|
|
2495
|
-
text.className = 'dsh-cron-entry-label';
|
|
2496
|
-
text.textContent = label;
|
|
2497
|
-
entry.appendChild(text);
|
|
2498
|
-
entry.addEventListener('click', (event) => {event.preventDefault();
|
|
2499
|
-
event.stopPropagation();
|
|
2500
|
-
toggle.toggle();
|
|
2501
|
-
});
|
|
2502
|
-
return entry;
|
|
2503
|
-
}
|
|
2504
|
-
const SIDEBAR_JOBS_KEY = 'dsh-cron-sidebar-open';
|
|
2505
|
-
const SIDEBAR_JOBS_MAX_ROWS = 5;
|
|
2506
|
-
function sessionIdOf(ctx, props) {try {if (props && props.session && props.session.id) return String(props.session.id);
|
|
2494
|
+
function sessionIdOf(ctx, props) {try {if (typeof props === 'string' && props) return props;
|
|
2495
|
+
if (props && typeof props.sessionId === 'string' && props.sessionId) return props.sessionId;
|
|
2496
|
+
if (props && props.session && props.session.id) return String(props.session.id);
|
|
2507
2497
|
if (props && props.session && props.session.sessionId) return String(props.session.sessionId);
|
|
2508
2498
|
if (props && props.input && props.input.sessionId) return String(props.input.sessionId);
|
|
2509
2499
|
if (ctx && ctx.scope && ctx.scope.session) return String(ctx.scope.session.id || ctx.scope.session.header?.id || '');
|
|
@@ -2551,6 +2541,9 @@ e.stopPropagation();
|
|
|
2551
2541
|
const sessionObj = props.session || (ctx && ctx.scope && ctx.scope.session);
|
|
2552
2542
|
const titleVal = (sessionObj && (sessionObj.title || sessionObj.name)) || '';
|
|
2553
2543
|
pendingTaskPreset = {title: titleVal ? titleVal + ' (Cron)' : '',targetSessionId: sessionId || '',type: 'llm',schedule: '0 9 * * 1-5',};
|
|
2544
|
+
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function') {try {window.dispatchEvent(new CustomEvent('dsh-cron:preset', { detail: pendingTaskPreset }));
|
|
2545
|
+
} catch (_e) { void _e; }
|
|
2546
|
+
}
|
|
2554
2547
|
toggle.set(true);
|
|
2555
2548
|
};
|
|
2556
2549
|
const handleQuickRun = async (e) => {e.preventDefault();
|
|
@@ -2581,6 +2574,8 @@ return _h('button', {type: 'button',className: 'dsh-cron-session-add-btn','data-
|
|
|
2581
2574
|
_h('span', {key: 'icon',className: 'dsh-cron-session-bar-icon',dangerouslySetInnerHTML: { __html: ICON_TIMER },}),_h('span', { key: 'label' }, T_KEY(barT, 'sessionBar.addRecurring'))
|
|
2582
2575
|
]);
|
|
2583
2576
|
}
|
|
2577
|
+
const SIDEBAR_JOBS_KEY = 'dsh-cron-sidebar-open';
|
|
2578
|
+
const SIDEBAR_JOBS_MAX_ROWS = 5;
|
|
2584
2579
|
function buildSidebarJobRow(state, task) {
|
|
2585
2580
|
const row = document.createElement('button');
|
|
2586
2581
|
row.type = 'button';
|
|
@@ -2648,7 +2643,7 @@ headEl.textContent = label;
|
|
|
2648
2643
|
headEl.addEventListener('click', (event) => {event.preventDefault();
|
|
2649
2644
|
event.stopPropagation();
|
|
2650
2645
|
state.open = !state.open;
|
|
2651
|
-
try { window.localStorage.setItem(SIDEBAR_JOBS_KEY, state.open ? '1' : '0'); } catch (err) {
|
|
2646
|
+
try { window.localStorage.setItem(SIDEBAR_JOBS_KEY, state.open ? '1' : '0'); } catch (err) { void err; }
|
|
2652
2647
|
applySidebarJobsOpen(state);
|
|
2653
2648
|
});
|
|
2654
2649
|
root.appendChild(headEl);
|
|
@@ -2661,7 +2656,7 @@ state.listEl = listEl;
|
|
|
2661
2656
|
return root;
|
|
2662
2657
|
}
|
|
2663
2658
|
function placeSidebarJobs(state, label) {
|
|
2664
|
-
const entry =
|
|
2659
|
+
const entry = resolveSidebarAnchor();
|
|
2665
2660
|
if (sidebarJobsSeatIsCurrent(state, entry)) return;
|
|
2666
2661
|
if (entry === null || entry.parentElement === null) return;
|
|
2667
2662
|
if (state.root === undefined) {entry.insertAdjacentElement('afterend', buildSidebarJobsRoot(state, label));
|
|
@@ -2674,9 +2669,9 @@ applySidebarJobsOpen(state);
|
|
|
2674
2669
|
}
|
|
2675
2670
|
function mountSidebarJobs(toggle, label, openTaskSignal) {if (typeof document === 'undefined') return () => {};
|
|
2676
2671
|
const state = { toggle, openTaskSignal, root: undefined, listEl: undefined, headEl: undefined, open: false };
|
|
2677
|
-
try { state.open = window.localStorage.getItem(SIDEBAR_JOBS_KEY) === '1'; } catch (err) {
|
|
2672
|
+
try { state.open = window.localStorage.getItem(SIDEBAR_JOBS_KEY) === '1'; } catch (err) { void err; }
|
|
2678
2673
|
let rafPending = false;
|
|
2679
|
-
const schedulePlace = () => {if (sidebarJobsSeatIsCurrent(state,
|
|
2674
|
+
const schedulePlace = () => {if (sidebarJobsSeatIsCurrent(state, resolveSidebarAnchor())) return;
|
|
2680
2675
|
if (rafPending) return;
|
|
2681
2676
|
rafPending = true;
|
|
2682
2677
|
const scheduleFn = typeof requestAnimationFrame === 'function' ? requestAnimationFrame : (cb) => setTimeout(cb, 16);
|
|
@@ -2690,7 +2685,7 @@ placeSidebarJobs(state, label);
|
|
|
2690
2685
|
loadSidebarJobs(state);
|
|
2691
2686
|
const fetchTimer = setInterval(() => {
|
|
2692
2687
|
let isOpen = false;
|
|
2693
|
-
try { isOpen = window.localStorage.getItem(SIDEBAR_JOBS_KEY) === '1'; } catch (err) {
|
|
2688
|
+
try { isOpen = window.localStorage.getItem(SIDEBAR_JOBS_KEY) === '1'; } catch (err) { void err; }
|
|
2694
2689
|
if (isOpen) loadSidebarJobs(state);
|
|
2695
2690
|
}, 30000);
|
|
2696
2691
|
return () => {observer.disconnect();
|
|
@@ -2699,39 +2694,6 @@ if (state.root !== undefined && state.root.isConnected) state.root.remove();
|
|
|
2699
2694
|
state.root = undefined;
|
|
2700
2695
|
};
|
|
2701
2696
|
}
|
|
2702
|
-
function placeEntry(target, entry) {
|
|
2703
|
-
let anchor = target;
|
|
2704
|
-
let next = target.nextElementSibling;
|
|
2705
|
-
while (next !== null && next.tagName === 'BUTTON'
|
|
2706
|
-
&& String(next.className).indexOf('sidebar-entry') >= 0) {anchor = next;
|
|
2707
|
-
next = next.nextElementSibling;
|
|
2708
|
-
}
|
|
2709
|
-
anchor.insertAdjacentElement('afterend', entry);
|
|
2710
|
-
}
|
|
2711
|
-
function mountSidebarEntry(toggle, label) {if (typeof document === 'undefined') return () => {};
|
|
2712
|
-
let entry;
|
|
2713
|
-
const tryPlace = () => {if (entry !== undefined && entry.isConnected) return;
|
|
2714
|
-
const target = nativeButton();
|
|
2715
|
-
if (target === undefined || target.parentElement === null) return;
|
|
2716
|
-
if (target.parentElement.querySelector('[' + ENTRY_ATTR + ']') !== null) return;
|
|
2717
|
-
entry = createEntry(target, toggle, label);
|
|
2718
|
-
placeEntry(target, entry);
|
|
2719
|
-
syncActive();
|
|
2720
|
-
};
|
|
2721
|
-
const syncActive = () => {if (entry === undefined) return;
|
|
2722
|
-
if (toggle.isOpen()) entry.dataset.active = 'true';
|
|
2723
|
-
else delete entry.dataset.active;
|
|
2724
|
-
};
|
|
2725
|
-
const observer = new MutationObserver(tryPlace);
|
|
2726
|
-
observer.observe(document.body, { childList: true, subtree: true });
|
|
2727
|
-
const unsubscribe = toggle.subscribe(syncActive);
|
|
2728
|
-
tryPlace();
|
|
2729
|
-
return () => {observer.disconnect();
|
|
2730
|
-
unsubscribe();
|
|
2731
|
-
if (entry !== undefined) entry.remove();
|
|
2732
|
-
entry = undefined;
|
|
2733
|
-
};
|
|
2734
|
-
}
|
|
2735
2697
|
function mountCronScreen(ctx, toggle) {if (typeof document === 'undefined') return () => {};
|
|
2736
2698
|
let root;
|
|
2737
2699
|
let container;
|
|
@@ -2745,6 +2707,10 @@ container = undefined;
|
|
|
2745
2707
|
const ensure = () => {if (!toggle.isOpen()) {teardownPanel();
|
|
2746
2708
|
return;
|
|
2747
2709
|
}
|
|
2710
|
+
if (ctx.layout && typeof ctx.layout.panelInfo?.getSnapshot === 'function') {if (ctx.layout.panelInfo.getSnapshot()?.activePanelId === 'dsh-cron') {teardownPanel();
|
|
2711
|
+
return;
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2748
2714
|
if (container !== undefined && container.isConnected) return;
|
|
2749
2715
|
const column = document.querySelector(COLUMN_SELECTOR);
|
|
2750
2716
|
if (column === null) return;
|
|
@@ -2819,7 +2785,38 @@ if (!cardOk) {console.warn('[dsh-cron] settings.plugin.item slot unavailable —
|
|
|
2819
2785
|
const chipOk = registerIntoMount(ctx, 'conversation.session.header.utilities', {name: 'conversation.session.header.utilities',id: PLUGIN_ID + '.chip',order: 27,locale: NS,inject: () => ({ ctx, toggle }),}, CronChip);
|
|
2820
2786
|
const cardSlot = cardOk ? 'settings.plugin.item' : undefined;
|
|
2821
2787
|
const chipSlot = chipOk ? 'conversation.session.header.utilities' : undefined;
|
|
2822
|
-
|
|
2788
|
+
function CronNavIcon(props) {
|
|
2789
|
+
const size = (props && props.size) || 16;
|
|
2790
|
+
return _h('span', {className: 'dsh-cron-nav-icon','data-dsh-cron-entry': '','data-dsh-plugin': 'dsh-cron',style: { width: size, height: size },dangerouslySetInnerHTML: { __html: ICON_TIMER }
|
|
2791
|
+
});
|
|
2792
|
+
}
|
|
2793
|
+
const navOk = registerIntoMount(ctx, 'sidebar.panellist', {name: 'sidebar.panellist',id: 'dsh-cron',order: 12,label: () => translate('sidebar.label'),locale: NS,}, CronNavIcon);
|
|
2794
|
+
function CronMainPage(props) {
|
|
2795
|
+
return _h(ErrorBoundary, null, _h(CronScreen, {...props,ctx: props.ctx || ctx,toggle: props.toggle || toggle,t: translate,onClose: () => {if (ctx.layout && typeof ctx.layout.selectPanel === 'function') {ctx.layout.selectPanel(null);
|
|
2796
|
+
}
|
|
2797
|
+
toggle.set(false);
|
|
2798
|
+
}
|
|
2799
|
+
}));
|
|
2800
|
+
}
|
|
2801
|
+
const mainOk = registerIntoMount(ctx, 'main', {name: 'main',key: 'dsh-cron',locale: NS,inject: () => ({ ctx, toggle }),}, CronMainPage);
|
|
2802
|
+
const layout = ctx.layout || (typeof ctx.get === 'function' ? ctx.get('layout') : undefined);
|
|
2803
|
+
if (layout && typeof layout.selectPanel === 'function') {toggle.subscribe((isOpen) => {if (isOpen) {layout.selectPanel('dsh-cron');
|
|
2804
|
+
} else if (layout.panelInfo && typeof layout.panelInfo.getSnapshot === 'function') {if (layout.panelInfo.getSnapshot()?.activePanelId === 'dsh-cron') {layout.selectPanel(null);
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
});
|
|
2808
|
+
if (layout.panelInfo && typeof layout.panelInfo.subscribe === 'function') {layout.panelInfo.subscribe(() => {
|
|
2809
|
+
const active = layout.panelInfo.getSnapshot()?.activePanelId === 'dsh-cron';
|
|
2810
|
+
if (toggle.isOpen() !== active) {toggle.set(active);
|
|
2811
|
+
}
|
|
2812
|
+
});
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
const barOk = registerIntoMount(ctx, 'conversation.session.header.actions', {name: 'conversation.session.header.actions',id: PLUGIN_ID + '.sessionBar',order: 28,locale: NS,inject: (slotParam) => {
|
|
2816
|
+
const sid = typeof slotParam === 'string' ? slotParam : (slotParam && (slotParam.sessionId || slotParam.id));
|
|
2817
|
+
const extra = (typeof slotParam === 'object' && slotParam !== null) ? slotParam : {};
|
|
2818
|
+
return { ctx, toggle, sessionId: sid, ...extra };
|
|
2819
|
+
},}, function QuickBarBoundary(props) {
|
|
2823
2820
|
return _h(ErrorBoundary, null, _h(SessionQuickActionBar, props));
|
|
2824
2821
|
});
|
|
2825
2822
|
const barSlot = barOk ? 'conversation.session.header.actions' : undefined;
|
|
@@ -2833,11 +2830,11 @@ dangerouslySetInnerHTML: { __html: ICON_TIMER }
|
|
|
2833
2830
|
}
|
|
2834
2831
|
ctx.effect(() => {
|
|
2835
2832
|
const off = [
|
|
2836
|
-
|
|
2833
|
+
mountSidebarJobs(toggle, translate('sidebar.jobsTitle'), (taskId) => { pendingTaskHighlight = taskId; }),mountCronScreen(ctx, toggle)
|
|
2837
2834
|
];
|
|
2838
2835
|
return () => { for (const dispose of off) dispose(); stopStyleSelfHeal(); };
|
|
2839
2836
|
}, 'dsh-cron: client overlay');
|
|
2840
|
-
exports.slots = { card: cardSlot, chip: chipSlot, sessionBar: barSlot };
|
|
2837
|
+
exports.slots = { card: cardSlot, chip: chipSlot, sessionBar: barSlot, nav: navOk ? 'sidebar.panellist' : undefined, main: mainOk ? 'main' : undefined };
|
|
2841
2838
|
module.exports.panelDismissRule = shouldDismissPanel;
|
|
2842
2839
|
module.exports.sidebarJobsSeatIsCurrent = sidebarJobsSeatIsCurrent;
|
|
2843
2840
|
module.exports.updateHeaderSettings = updateHeaderSettings;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-cron",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.47",
|
|
4
4
|
"packageManager": "pnpm@10.33.2",
|
|
5
5
|
"description": "Background automation runner for DSH: isolated agent runs, script/HTTP/SSH/Docker runtimes, cost guard, notifications, heartbeats.",
|
|
6
6
|
"type": "module",
|