@goodandready/dsh-cron 0.3.17 → 0.3.18
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.js +807 -787
- package/lib/cron-tool.js +4 -0
- package/lib/runner.js +25 -9
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -4,7 +4,7 @@ factory: (require) => {
|
|
|
4
4
|
var module = { exports: {} }
|
|
5
5
|
var exports = module.exports
|
|
6
6
|
const React = window.React || require('react');
|
|
7
|
-
const
|
|
7
|
+
const _h = (...args) => (React && React.createElement ? React.createElement(...args) : null);
|
|
8
8
|
const ReactDOM = window.ReactDOM || require('react-dom/client');
|
|
9
9
|
const PLUGIN_ID = '@goodandready/dsh-cron';
|
|
10
10
|
const NS = 'dsh-cron';
|
|
@@ -43,7 +43,7 @@ CoreChevron = primitives && primitives.IconChevronDownOutline14;
|
|
|
43
43
|
} catch (e) {
|
|
44
44
|
/* Optional core chevron primitive not available; SVG fallback used */
|
|
45
45
|
}
|
|
46
|
-
const chevronNode = () => (CoreChevron ?
|
|
46
|
+
const chevronNode = () => (CoreChevron ? _h(CoreChevron) : _h('span', { style: { display: 'flex', alignItems: 'center' }, dangerouslySetInnerHTML: { __html: ICON_CHEVRON_DOWN } }));
|
|
47
47
|
const STRINGS = {
|
|
48
48
|
en: {
|
|
49
49
|
'sidebar.label': 'Scheduled tasks', 'sidebar.jobsTitle': 'Active jobs',
|
|
@@ -266,6 +266,9 @@ en: {
|
|
|
266
266
|
'form.agentPresetLabel': 'Agent preset',
|
|
267
267
|
'form.agentPresetPlaceholder': 'standard (leave empty for configured default)',
|
|
268
268
|
'form.agentPresetHint': 'Agent preset from dsh-agent-presets (e.g. standard, minimal, cordis, ptc). Mounts workspace and coding tools.',
|
|
269
|
+
'form.sessionTitleLabel': 'Session Title Template',
|
|
270
|
+
'form.sessionTitlePlaceholder': 'e.g. {{date}} a-share-review (supports {{date}})',
|
|
271
|
+
'form.sessionTitleHint': 'Name given to agent sessions created by this task. Supports {{date}} for YYYY-MM-DD. Defaults to "<YYYY-MM-DD> <title>".',
|
|
269
272
|
'form.targetSessionIdLabel': 'Target persistent session ID',
|
|
270
273
|
'form.targetSessionIdPlaceholder': 'e.g. audit-chat or dev-summary (empty = isolated run)',
|
|
271
274
|
'form.targetSessionIdHint': 'When specified, scheduled runs resume this session to maintain conversation context across runs instead of creating a new isolated session.',
|
|
@@ -352,6 +355,9 @@ zh: {
|
|
|
352
355
|
'form.autoDiagnoseLabel': '任务失败时启用 AI 智能分析诊断', 'form.agentPresetLabel': '智能体预设 (Agent Preset)',
|
|
353
356
|
'form.agentPresetPlaceholder': 'standard (留空使用全局默认预设)',
|
|
354
357
|
'form.agentPresetHint': '来自 dsh-agent-presets 的智能体预设(如 standard, minimal, cordis, ptc),挂载工作区工具与文件读写能力。',
|
|
358
|
+
'form.sessionTitleLabel': '会话标题模板 (Session Title)',
|
|
359
|
+
'form.sessionTitlePlaceholder': '如 {{date}} 市场早报 (支持 {{date}} 变量)',
|
|
360
|
+
'form.sessionTitleHint': '此任务运行生成的会话标题。支持 {{date}} (年-月-日)。留空默认为 "<YYYY-MM-DD> <任务名>"。',
|
|
355
361
|
'form.targetSessionIdLabel': '目标常驻会话 ID (Target Session ID)',
|
|
356
362
|
'form.targetSessionIdPlaceholder': '如 audit-chat 或 dev-summary(留空为单次隔离运行)',
|
|
357
363
|
'form.targetSessionIdHint': '配置后定时任务将在此常驻会话中持续交互,跨周期保留历史上下文对话记忆,不再每次新建孤立会话。',
|
|
@@ -782,10 +788,10 @@ console.error('[dsh-cron] React error:', error, errorInfo);
|
|
|
782
788
|
}
|
|
783
789
|
render() {
|
|
784
790
|
if (this.state.hasError) {
|
|
785
|
-
return
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
791
|
+
return _h('div', { className: 'dsh-cron-status-banner', 'data-type': 'error', style: { margin: '12px 0' } },
|
|
792
|
+
_h('div', { style: { fontWeight: 600, marginBottom: '6px' } }, '⚠️ Cron UI error:'),
|
|
793
|
+
_h('div', { style: { fontSize: '12px', wordBreak: 'break-all' } }, String((this.state.error && this.state.error.message) || this.state.error)),
|
|
794
|
+
_h('button', {
|
|
789
795
|
type: 'button',
|
|
790
796
|
className: 'dsh-cron-btn-secondary',
|
|
791
797
|
style: { marginTop: '10px', fontSize: '12px', padding: '4px 10px' },
|
|
@@ -980,9 +986,9 @@ return out;
|
|
|
980
986
|
}
|
|
981
987
|
function renderDeliverySettings({ T, values, onChange, onChannelTemplate, sections, onToggleSection }) {
|
|
982
988
|
const val = (key) => (values[key] === undefined || values[key] === null ? '' : String(values[key]));
|
|
983
|
-
const field = (f) =>
|
|
984
|
-
|
|
985
|
-
|
|
989
|
+
const field = (f) => _h('div', { className: 'dsh-cron-form-group', key: f.key, style: { marginBottom: '10px' } },
|
|
990
|
+
_h('label', null, T(f.labelKey)),
|
|
991
|
+
_h('input', f.numeric ? {
|
|
986
992
|
type: 'number',
|
|
987
993
|
min: f.min !== undefined ? f.min : 1000,
|
|
988
994
|
step: 1000,
|
|
@@ -1000,49 +1006,49 @@ onChange: (e) => onChange(f.key, e.target.value)
|
|
|
1000
1006
|
);
|
|
1001
1007
|
const section = (key, titleKey, children) => {
|
|
1002
1008
|
const open = Boolean(sections[key]);
|
|
1003
|
-
return
|
|
1004
|
-
|
|
1009
|
+
return _h('div', { className: 'dsh-cron-section', key },
|
|
1010
|
+
_h('button', {
|
|
1005
1011
|
type: 'button',
|
|
1006
1012
|
className: 'dsh-cron-section-head',
|
|
1007
1013
|
'aria-expanded': open ? 'true' : 'false',
|
|
1008
1014
|
onClick: () => onToggleSection(key)
|
|
1009
1015
|
},
|
|
1010
|
-
|
|
1011
|
-
|
|
1016
|
+
_h('span', null, T(titleKey)),
|
|
1017
|
+
_h('span', { className: 'dsh-cron-section-chevron', 'data-open': open ? 'true' : 'false' }, '▾')
|
|
1012
1018
|
),
|
|
1013
|
-
open &&
|
|
1019
|
+
open && _h('div', { className: 'dsh-cron-section-body' }, children)
|
|
1014
1020
|
);
|
|
1015
1021
|
};
|
|
1016
1022
|
return [
|
|
1017
1023
|
section('secrets', 'settings.secretsSection', [
|
|
1018
|
-
|
|
1024
|
+
_h('div', { className: 'dsh-cron-hint', key: 'hint', style: { marginBottom: '10px' } }, T('settings.secretsHint')),
|
|
1019
1025
|
...DELIVERY_SETTING_FIELDS.filter((f) => f.group === 'secrets').map(field),
|
|
1020
1026
|
]),
|
|
1021
1027
|
section('channels', 'settings.deliverySection', [
|
|
1022
|
-
|
|
1028
|
+
_h('div', { className: 'dsh-cron-form-row', key: 'row' },
|
|
1023
1029
|
...DELIVERY_SETTING_FIELDS.filter((f) => f.group === 'channels').map(field)
|
|
1024
1030
|
),
|
|
1025
1031
|
]),
|
|
1026
1032
|
section('automation', 'settings.automationSection', [
|
|
1027
|
-
|
|
1028
|
-
|
|
1033
|
+
_h('div', { className: 'dsh-cron-hint', key: 'hint', style: { marginBottom: '10px' } }, T('settings.automationHint')),
|
|
1034
|
+
_h('div', { className: 'dsh-cron-form-row', key: 'row' },
|
|
1029
1035
|
...DELIVERY_SETTING_FIELDS.filter((f) => f.group === 'automation').map(field)
|
|
1030
1036
|
),
|
|
1031
1037
|
]),
|
|
1032
1038
|
section('templates', 'settings.templatesSection', [
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1039
|
+
_h('div', { className: 'dsh-cron-form-group', key: 'global', style: { marginBottom: '10px' } },
|
|
1040
|
+
_h('label', null, T('settings.templateLabel')),
|
|
1041
|
+
_h('input', {
|
|
1036
1042
|
type: 'text',
|
|
1037
1043
|
value: val('template'),
|
|
1038
1044
|
onChange: (e) => onChange('template', e.target.value)
|
|
1039
1045
|
}),
|
|
1040
|
-
|
|
1046
|
+
_h('div', { className: 'dsh-cron-hint' }, T('settings.templateHint'))
|
|
1041
1047
|
),
|
|
1042
|
-
|
|
1043
|
-
...DELIVERY_CHANNELS.map((id) =>
|
|
1044
|
-
|
|
1045
|
-
|
|
1048
|
+
_h('div', { className: 'dsh-cron-form-row', key: 'perchannel' },
|
|
1049
|
+
...DELIVERY_CHANNELS.map((id) => _h('div', { className: 'dsh-cron-form-group', key: id, style: { marginBottom: '10px' } },
|
|
1050
|
+
_h('label', null, T('settings.channelTemplateLabel', { channel: T(CHANNEL_LABEL_KEYS[id]) })),
|
|
1051
|
+
_h('input', {
|
|
1046
1052
|
type: 'text',
|
|
1047
1053
|
value: (values.channelTemplates && values.channelTemplates[id]) || '',
|
|
1048
1054
|
onChange: (e) => onChannelTemplate(id, e.target.value)
|
|
@@ -1132,68 +1138,68 @@ if (!isOpen) return null;
|
|
|
1132
1138
|
const graph = data?.graph || { nodes: [], edges: [], hasFailure: false };
|
|
1133
1139
|
const chainRunId = data?.chainRunId || '';
|
|
1134
1140
|
const nodes = graph.nodes || [];
|
|
1135
|
-
return
|
|
1141
|
+
return _h('div', {
|
|
1136
1142
|
className: 'dsh-cron-modal-overlay',
|
|
1137
1143
|
onClick: onClose
|
|
1138
1144
|
},
|
|
1139
|
-
|
|
1145
|
+
_h('div', {
|
|
1140
1146
|
className: 'dsh-cron-modal',
|
|
1141
1147
|
style: { maxWidth: '820px', width: '92vw', maxHeight: '88vh', display: 'flex', flexDirection: 'column' },
|
|
1142
1148
|
role: 'dialog',
|
|
1143
1149
|
'aria-modal': 'true',
|
|
1144
1150
|
onClick: (e) => e.stopPropagation()
|
|
1145
1151
|
},
|
|
1146
|
-
|
|
1152
|
+
_h('div', {
|
|
1147
1153
|
className: 'dsh-cron-modal-head',
|
|
1148
1154
|
style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', borderBottom: '1px solid var(--dsw-alias-border-l2)', paddingBottom: '12px' }
|
|
1149
1155
|
},
|
|
1150
|
-
|
|
1151
|
-
|
|
1156
|
+
_h('div', null,
|
|
1157
|
+
_h('div', {
|
|
1152
1158
|
className: 'dsh-cron-modal-title',
|
|
1153
1159
|
style: { margin: 0, display: 'flex', alignItems: 'center', gap: '8px' }
|
|
1154
1160
|
},
|
|
1155
|
-
|
|
1161
|
+
_h('span', { style: { fontSize: '18px' } }, '🕸️'),
|
|
1156
1162
|
T_KEY(t, 'chainGraph.modalTitle')
|
|
1157
1163
|
),
|
|
1158
|
-
chainRunId &&
|
|
1164
|
+
chainRunId && _h('div', {
|
|
1159
1165
|
style: { fontSize: '11px', color: 'var(--dsw-alias-label-secondary, #888)', marginTop: '4px', fontFamily: 'monospace' }
|
|
1160
1166
|
}, 'Run ID: ' + chainRunId)
|
|
1161
1167
|
),
|
|
1162
|
-
|
|
1168
|
+
_h('button', {
|
|
1163
1169
|
type: 'button',
|
|
1164
1170
|
className: 'dsh-cron-icon-btn',
|
|
1165
1171
|
onClick: onClose
|
|
1166
1172
|
}, '✕')
|
|
1167
1173
|
),
|
|
1168
|
-
|
|
1174
|
+
_h('div', {
|
|
1169
1175
|
style: { flex: 1, overflowY: 'auto', padding: '16px 0', minHeight: '260px' }
|
|
1170
1176
|
},
|
|
1171
|
-
loading &&
|
|
1177
|
+
loading && _h('div', {
|
|
1172
1178
|
className: 'dsh-cron-history-empty'
|
|
1173
1179
|
}, T_KEY(t, 'history.loading')),
|
|
1174
|
-
!loading && nodes.length === 0 &&
|
|
1180
|
+
!loading && nodes.length === 0 && _h('div', {
|
|
1175
1181
|
className: 'dsh-cron-history-empty'
|
|
1176
1182
|
}, T_KEY(t, 'chainGraph.noNodes')),
|
|
1177
|
-
!loading && nodes.length > 0 &&
|
|
1183
|
+
!loading && nodes.length > 0 && _h('div', {
|
|
1178
1184
|
style: { display: 'flex', flexDirection: 'column', gap: '16px' }
|
|
1179
1185
|
},
|
|
1180
|
-
|
|
1186
|
+
_h('div', {
|
|
1181
1187
|
style: { display: 'flex', gap: '12px', fontSize: '11px', color: 'var(--dsw-alias-label-secondary, #888)', padding: '0 4px' }
|
|
1182
1188
|
},
|
|
1183
|
-
|
|
1184
|
-
|
|
1189
|
+
_h('span', { style: { display: 'inline-flex', alignItems: 'center', gap: '4px' } },
|
|
1190
|
+
_h('span', { style: { width: '8px', height: '8px', borderRadius: '50%', background: 'var(--dsh-cron-success)' } }),
|
|
1185
1191
|
T_KEY(t, 'chainGraph.stepSuccess')
|
|
1186
1192
|
),
|
|
1187
|
-
|
|
1188
|
-
|
|
1193
|
+
_h('span', { style: { display: 'inline-flex', alignItems: 'center', gap: '4px' } },
|
|
1194
|
+
_h('span', { style: { width: '8px', height: '8px', borderRadius: '50%', background: 'var(--dsh-cron-danger)' } }),
|
|
1189
1195
|
T_KEY(t, 'chainGraph.stepFailed')
|
|
1190
1196
|
),
|
|
1191
|
-
|
|
1192
|
-
|
|
1197
|
+
_h('span', { style: { display: 'inline-flex', alignItems: 'center', gap: '4px' } },
|
|
1198
|
+
_h('span', { style: { width: '8px', height: '8px', borderRadius: '50%', background: 'var(--dsw-alias-label-tertiary, #888)' } }),
|
|
1193
1199
|
T_KEY(t, 'chainGraph.stepPending')
|
|
1194
1200
|
)
|
|
1195
1201
|
),
|
|
1196
|
-
|
|
1202
|
+
_h('div', {
|
|
1197
1203
|
style: {
|
|
1198
1204
|
display: 'flex',
|
|
1199
1205
|
flexWrap: 'wrap',
|
|
@@ -1213,7 +1219,7 @@ const borderColor = isOk
|
|
|
1213
1219
|
: isFailed
|
|
1214
1220
|
? 'var(--dsh-cron-danger)'
|
|
1215
1221
|
: 'var(--dsw-alias-border-l2)';
|
|
1216
|
-
return
|
|
1222
|
+
return _h('div', {
|
|
1217
1223
|
key: n.id || idx,
|
|
1218
1224
|
style: {
|
|
1219
1225
|
flex: '1 1 220px',
|
|
@@ -1228,13 +1234,13 @@ gap: '8px',
|
|
|
1228
1234
|
boxShadow: isFailed ? '0 0 0 1px var(--dsh-cron-danger)' : 'none'
|
|
1229
1235
|
}
|
|
1230
1236
|
},
|
|
1231
|
-
|
|
1237
|
+
_h('div', {
|
|
1232
1238
|
style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: '6px' }
|
|
1233
1239
|
},
|
|
1234
|
-
|
|
1240
|
+
_h('div', {
|
|
1235
1241
|
style: { fontWeight: '600', fontSize: '13px', color: 'var(--dsw-alias-label-primary)' }
|
|
1236
1242
|
}, n.title || n.id),
|
|
1237
|
-
|
|
1243
|
+
_h('span', {
|
|
1238
1244
|
style: {
|
|
1239
1245
|
fontSize: '10px',
|
|
1240
1246
|
padding: '2px 6px',
|
|
@@ -1245,22 +1251,22 @@ color: isOk ? 'var(--dsh-cron-success)' : isFailed ? 'var(--dsh-cron-danger)' :
|
|
|
1245
1251
|
}
|
|
1246
1252
|
}, isOk ? '✓ ' + T_KEY(t, 'chainGraph.stepSuccess') : isFailed ? '✗ ' + T_KEY(t, 'chainGraph.stepFailed') : '⏳ ' + T_KEY(t, 'chainGraph.stepPending'))
|
|
1247
1253
|
),
|
|
1248
|
-
|
|
1254
|
+
_h('div', {
|
|
1249
1255
|
style: { fontSize: '11px', color: 'var(--dsw-alias-label-secondary)', display: 'flex', gap: '8px', flexWrap: 'wrap' }
|
|
1250
1256
|
},
|
|
1251
|
-
n.durationMs > 0 &&
|
|
1252
|
-
n.retryCount > 0 &&
|
|
1253
|
-
n.joinPolicy && n.dependsOn?.length > 0 &&
|
|
1257
|
+
n.durationMs > 0 && _h('span', null, n.durationMs + 'ms'),
|
|
1258
|
+
n.retryCount > 0 && _h('span', { style: { color: 'var(--dsh-cron-warning)' } }, '↻ ' + n.retryCount),
|
|
1259
|
+
n.joinPolicy && n.dependsOn?.length > 0 && _h('span', {
|
|
1254
1260
|
style: { background: 'var(--dsw-alias-bg-layer-3)', padding: '1px 4px', borderRadius: '4px' }
|
|
1255
1261
|
}, n.joinPolicy === 'any_success' ? 'join:any' : 'join:all')
|
|
1256
1262
|
),
|
|
1257
|
-
n.isDecisionNode &&
|
|
1263
|
+
n.isDecisionNode && _h('div', {
|
|
1258
1264
|
style: { fontSize: '11px', color: 'var(--dsh-cron-warning)', fontWeight: '600', display: 'flex', alignItems: 'center', gap: '4px' }
|
|
1259
1265
|
}, '🔀 ' + T_KEY(t, 'chainGraph.decisionNode') + ' (' + n.branchRulesCount + ')'),
|
|
1260
|
-
n.dependsOn?.length > 0 &&
|
|
1266
|
+
n.dependsOn?.length > 0 && _h('div', {
|
|
1261
1267
|
style: { fontSize: '11px', color: 'var(--dsw-alias-label-tertiary)' }
|
|
1262
1268
|
}, '← ' + n.dependsOn.join(', ')),
|
|
1263
|
-
n.outputSnippet &&
|
|
1269
|
+
n.outputSnippet && _h('div', {
|
|
1264
1270
|
style: {
|
|
1265
1271
|
background: 'var(--dsw-alias-bg-layer-2)',
|
|
1266
1272
|
border: '1px solid var(--dsw-alias-border-l2)',
|
|
@@ -1275,7 +1281,7 @@ maxHeight: '60px',
|
|
|
1275
1281
|
overflowY: 'auto'
|
|
1276
1282
|
}
|
|
1277
1283
|
}, n.outputSnippet),
|
|
1278
|
-
isFailed && chainRunId &&
|
|
1284
|
+
isFailed && chainRunId && _h('button', {
|
|
1279
1285
|
type: 'button',
|
|
1280
1286
|
className: 'dsh-cron-btn-secondary',
|
|
1281
1287
|
style: {
|
|
@@ -1296,11 +1302,11 @@ onClick: () => onRetry && onRetry(n.id)
|
|
|
1296
1302
|
)
|
|
1297
1303
|
)
|
|
1298
1304
|
),
|
|
1299
|
-
|
|
1305
|
+
_h('div', {
|
|
1300
1306
|
className: 'dsh-cron-modal-foot',
|
|
1301
1307
|
style: { borderTop: '1px solid var(--dsw-alias-border-l2)', paddingTop: '12px', marginTop: 'auto' }
|
|
1302
1308
|
},
|
|
1303
|
-
|
|
1309
|
+
_h('button', {
|
|
1304
1310
|
type: 'button',
|
|
1305
1311
|
className: 'dsh-cron-btn-primary',
|
|
1306
1312
|
onClick: onClose
|
|
@@ -1318,26 +1324,26 @@ el.scrollTop = el.scrollHeight;
|
|
|
1318
1324
|
};
|
|
1319
1325
|
const isLive = status === 'running' || status === 'connecting';
|
|
1320
1326
|
const statusColor = isLive ? 'var(--dsh-cron-success, #2a2)' : (status === 'completed' ? 'var(--dsw-alias-label-secondary, #888)' : 'var(--dsh-cron-danger, #e33)');
|
|
1321
|
-
return
|
|
1327
|
+
return _h('div', {
|
|
1322
1328
|
className: 'dsh-cron-modal-overlay',
|
|
1323
1329
|
onClick: onClose
|
|
1324
1330
|
},
|
|
1325
|
-
|
|
1331
|
+
_h('div', {
|
|
1326
1332
|
className: 'dsh-cron-modal',
|
|
1327
1333
|
style: { maxWidth: '860px', width: '92vw', height: '80vh', display: 'flex', flexDirection: 'column', background: 'var(--dsw-alias-bg-base, #111)', color: 'var(--dsw-alias-label-primary, #ddd)', border: '1px solid var(--dsw-alias-border-l2, #333)', borderRadius: '8px' },
|
|
1328
1334
|
role: 'dialog',
|
|
1329
1335
|
'aria-modal': 'true',
|
|
1330
1336
|
onClick: (e) => e.stopPropagation()
|
|
1331
1337
|
},
|
|
1332
|
-
|
|
1338
|
+
_h('div', {
|
|
1333
1339
|
style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', borderBottom: '1px solid var(--dsw-alias-border-l2, #333)', background: 'var(--dsw-alias-bg-layer-2, #111)' }
|
|
1334
1340
|
},
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1341
|
+
_h('div', { style: { display: 'flex', alignItems: 'center', gap: '10px' } },
|
|
1342
|
+
_h('span', { style: { fontSize: '18px' } }, '📺'),
|
|
1343
|
+
_h('div', null,
|
|
1344
|
+
_h('div', { style: { fontWeight: '600', fontSize: '14px', color: 'var(--dsw-alias-label-primary, #fff)', display: 'flex', alignItems: 'center', gap: '8px' } },
|
|
1339
1345
|
T_KEY(t, 'liveLog.modalTitle'),
|
|
1340
|
-
|
|
1346
|
+
_h('span', {
|
|
1341
1347
|
style: {
|
|
1342
1348
|
display: 'inline-block',
|
|
1343
1349
|
width: '8px',
|
|
@@ -1348,14 +1354,14 @@ boxShadow: isLive ? '0 0 8px ' + statusColor : 'none'
|
|
|
1348
1354
|
}
|
|
1349
1355
|
})
|
|
1350
1356
|
),
|
|
1351
|
-
|
|
1357
|
+
_h('div', { style: { fontSize: '11px', color: 'var(--dsw-alias-label-secondary, #888)', marginTop: '2px', fontFamily: 'monospace' } },
|
|
1352
1358
|
(taskTitle || taskId) + ' · ' + (isLive ? T_KEY(t, 'liveLog.connecting') : (completed ? T_KEY(t, 'liveLog.completed') : status))
|
|
1353
1359
|
)
|
|
1354
1360
|
)
|
|
1355
1361
|
),
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1362
|
+
_h('div', { style: { display: 'flex', alignItems: 'center', gap: '12px' } },
|
|
1363
|
+
_h('label', { style: { fontSize: '12px', color: 'var(--dsw-alias-label-secondary, #888)', display: 'flex', alignItems: 'center', gap: '4px', cursor: 'pointer' } },
|
|
1364
|
+
_h('input', {
|
|
1359
1365
|
type: 'checkbox',
|
|
1360
1366
|
checked: Boolean(autoScroll),
|
|
1361
1367
|
onChange: onToggleAutoScroll,
|
|
@@ -1363,7 +1369,7 @@ style: { cursor: 'pointer' }
|
|
|
1363
1369
|
}),
|
|
1364
1370
|
T_KEY(t, 'liveLog.autoScroll')
|
|
1365
1371
|
),
|
|
1366
|
-
|
|
1372
|
+
_h('button', {
|
|
1367
1373
|
type: 'button',
|
|
1368
1374
|
className: 'dsh-cron-icon-btn',
|
|
1369
1375
|
style: { color: 'var(--dsw-alias-label-secondary, #888)', background: 'transparent', border: 'none', cursor: 'pointer', fontSize: '16px' },
|
|
@@ -1371,29 +1377,29 @@ onClick: onClose
|
|
|
1371
1377
|
}, '✕')
|
|
1372
1378
|
)
|
|
1373
1379
|
),
|
|
1374
|
-
|
|
1380
|
+
_h('div', {
|
|
1375
1381
|
ref: terminalRef,
|
|
1376
1382
|
style: { flex: 1, overflowY: 'auto', padding: '14px 16px', fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace', fontSize: '12px', lineHeight: '1.5', background: 'var(--dsw-alias-bg-base, #000)' }
|
|
1377
1383
|
},
|
|
1378
|
-
(!logs || logs.length === 0) &&
|
|
1384
|
+
(!logs || logs.length === 0) && _h('div', {
|
|
1379
1385
|
style: { color: 'var(--dsw-alias-label-secondary, #888)', fontStyle: 'italic', padding: '20px 0', textAlign: 'center' }
|
|
1380
1386
|
}, isLive ? T_KEY(t, 'liveLog.waiting') : 'No output captured for this run.'),
|
|
1381
1387
|
logs && logs.length > 0 && logs.map((item, idx) => {
|
|
1382
1388
|
const isErr = item.stream === 'stderr';
|
|
1383
1389
|
const timeStr = item.ts ? new Date(item.ts).toLocaleTimeString() : '';
|
|
1384
|
-
return
|
|
1390
|
+
return _h('div', {
|
|
1385
1391
|
key: idx,
|
|
1386
1392
|
style: { display: 'flex', gap: '8px', color: isErr ? 'var(--dsh-cron-danger, #f55)' : 'var(--dsh-cron-success, #5f5)', wordBreak: 'break-all', whiteSpace: 'pre-wrap' }
|
|
1387
1393
|
},
|
|
1388
|
-
timeStr &&
|
|
1389
|
-
|
|
1394
|
+
timeStr && _h('span', { style: { color: 'var(--dsw-alias-label-secondary, #555)', userSelect: 'none', flexShrink: 0 } }, '[' + timeStr + ']'),
|
|
1395
|
+
_h('span', { style: { flex: 1 } }, item.chunk || item.text || String(item))
|
|
1390
1396
|
);
|
|
1391
1397
|
})
|
|
1392
1398
|
),
|
|
1393
|
-
|
|
1399
|
+
_h('div', {
|
|
1394
1400
|
style: { display: 'flex', justifyContent: 'flex-end', padding: '10px 16px', borderTop: '1px solid var(--dsw-alias-border-l2, #333)', background: 'var(--dsw-alias-bg-layer-2, #111)' }
|
|
1395
1401
|
},
|
|
1396
|
-
|
|
1402
|
+
_h('button', {
|
|
1397
1403
|
type: 'button',
|
|
1398
1404
|
className: 'dsh-cron-btn dsh-cron-btn-secondary',
|
|
1399
1405
|
style: { padding: '6px 14px', fontSize: '12px' },
|
|
@@ -1429,117 +1435,117 @@ const text = [
|
|
|
1429
1435
|
].join(String.fromCharCode(10));
|
|
1430
1436
|
navigator.clipboard.writeText(text).catch(() => {});
|
|
1431
1437
|
};
|
|
1432
|
-
return
|
|
1438
|
+
return _h('div', {
|
|
1433
1439
|
className: 'dsh-cron-modal-overlay',
|
|
1434
1440
|
onClick: onClose
|
|
1435
1441
|
},
|
|
1436
|
-
|
|
1442
|
+
_h('div', {
|
|
1437
1443
|
className: 'dsh-cron-modal',
|
|
1438
1444
|
style: { maxWidth: '780px', width: '92vw', maxHeight: '86vh', display: 'flex', flexDirection: 'column', background: 'var(--dsw-alias-bg-base, #111)', color: 'var(--dsw-alias-label-primary, #ddd)', border: '1px solid var(--dsw-alias-border-l2, #333)', borderRadius: '8px' },
|
|
1439
1445
|
role: 'dialog',
|
|
1440
1446
|
'aria-modal': 'true',
|
|
1441
1447
|
onClick: (e) => e.stopPropagation()
|
|
1442
1448
|
},
|
|
1443
|
-
|
|
1449
|
+
_h('div', {
|
|
1444
1450
|
style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '14px 18px', borderBottom: '1px solid var(--dsw-alias-border-l2, #333)', background: 'var(--dsw-alias-bg-layer-2, #111)' }
|
|
1445
1451
|
},
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1452
|
+
_h('div', { style: { display: 'flex', alignItems: 'center', gap: '10px' } },
|
|
1453
|
+
_h('span', { style: { fontSize: '20px' } }, '📊'),
|
|
1454
|
+
_h('div', null,
|
|
1455
|
+
_h('div', { style: { fontWeight: '600', fontSize: '15px', color: 'var(--dsw-alias-label-primary, #fff)' } },
|
|
1450
1456
|
T_KEY(t, 'digest.modalTitle')
|
|
1451
1457
|
),
|
|
1452
|
-
|
|
1458
|
+
_h('div', { style: { fontSize: '11.5px', color: 'var(--dsw-alias-label-secondary, #888)', marginTop: '2px' } },
|
|
1453
1459
|
(T_KEY(t, 'digest.buttonTitle')) + ' · ' + (periodDays || 7) + 'd'
|
|
1454
1460
|
)
|
|
1455
1461
|
)
|
|
1456
1462
|
),
|
|
1457
|
-
|
|
1458
|
-
|
|
1463
|
+
_h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px' } },
|
|
1464
|
+
_h('button', {
|
|
1459
1465
|
type: 'button',
|
|
1460
1466
|
className: 'dsh-cron-btn-secondary',
|
|
1461
1467
|
style: { padding: '4px 10px', fontSize: '12px', fontWeight: periodDays === 7 ? '600' : '400', background: periodDays === 7 ? 'var(--dsw-alias-bg-layer-3, #222)' : 'transparent' },
|
|
1462
1468
|
onClick: () => onSelectPeriod && onSelectPeriod(7)
|
|
1463
1469
|
}, T_KEY(t, 'digest.period7')),
|
|
1464
|
-
|
|
1470
|
+
_h('button', {
|
|
1465
1471
|
type: 'button',
|
|
1466
1472
|
className: 'dsh-cron-btn-secondary',
|
|
1467
1473
|
style: { padding: '4px 10px', fontSize: '12px', fontWeight: periodDays === 30 ? '600' : '400', background: periodDays === 30 ? 'var(--dsw-alias-bg-layer-3, #222)' : 'transparent' },
|
|
1468
1474
|
onClick: () => onSelectPeriod && onSelectPeriod(30)
|
|
1469
1475
|
}, T_KEY(t, 'digest.period30')),
|
|
1470
|
-
|
|
1476
|
+
_h('button', {
|
|
1471
1477
|
type: 'button',
|
|
1472
1478
|
className: 'dsh-cron-icon-btn',
|
|
1473
1479
|
onClick: onClose,
|
|
1474
1480
|
style: { marginLeft: '8px' }
|
|
1475
|
-
},
|
|
1481
|
+
}, _h('span', null, '✕'))
|
|
1476
1482
|
)
|
|
1477
1483
|
),
|
|
1478
|
-
|
|
1484
|
+
_h('div', {
|
|
1479
1485
|
style: { padding: '16px 18px', overflowY: 'auto', flex: 1, display: 'flex', flexDirection: 'column', gap: '16px' }
|
|
1480
1486
|
},
|
|
1481
|
-
isLoading ?
|
|
1487
|
+
isLoading ? _h('div', { style: { padding: '30px', textAlign: 'center', color: 'var(--dsw-alias-label-secondary, #888)' } }, 'Loading digest metrics...') : _h(React.Fragment, null,
|
|
1482
1488
|
(() => {
|
|
1483
|
-
const renderKpi = (label, val, sub, subCol) =>
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1489
|
+
const renderKpi = (label, val, sub, subCol) => _h('div', { style: { background: 'var(--dsw-alias-bg-layer-2, #111)', border: '1px solid var(--dsw-alias-border-l2, #333)', borderRadius: '6px', padding: '10px 12px' } },
|
|
1490
|
+
_h('div', { style: { fontSize: '11px', color: 'var(--dsw-alias-label-secondary, #888)' } }, label),
|
|
1491
|
+
_h('div', { style: { fontSize: '18px', fontWeight: '700', color: 'var(--dsw-alias-label-primary, #fff)', marginTop: '4px' } }, val),
|
|
1492
|
+
_h('div', { style: { fontSize: '11px', color: subCol || 'var(--dsw-alias-label-secondary, #888)', marginTop: '2px' } }, sub)
|
|
1487
1493
|
);
|
|
1488
|
-
return
|
|
1494
|
+
return _h('div', { style: { display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: '10px' } },
|
|
1489
1495
|
renderKpi(T_KEY(t, 'digest.executions'), digest.totalRuns, digest.successRate + '% SR', digest.successRate >= 90 ? 'var(--dsh-cron-success, #2a2)' : 'var(--dsh-cron-warning, #fa0)'),
|
|
1490
1496
|
renderKpi(T_KEY(t, 'digest.tokens'), Number(digest.totalTokens || 0).toLocaleString(), 'LLM prompt+out'),
|
|
1491
1497
|
renderKpi(T_KEY(t, 'digest.cost'), '$' + Number(digest.totalCostUsd || 0).toFixed(4), 'USD estimated'),
|
|
1492
1498
|
renderKpi(T_KEY(t, 'digest.fleet'), digest.activeTasksCount, digest.pausedTasksCount + ' paused')
|
|
1493
1499
|
);
|
|
1494
1500
|
})(),
|
|
1495
|
-
|
|
1496
|
-
|
|
1501
|
+
_h('div', { style: { background: 'var(--dsw-alias-bg-layer-2, #111)', border: '1px solid var(--dsw-alias-border-l2, #333)', borderRadius: '6px', padding: '12px' } },
|
|
1502
|
+
_h('div', { style: { fontWeight: '600', fontSize: '13px', color: 'var(--dsh-cron-warning, #fa0)', marginBottom: '8px' } },
|
|
1497
1503
|
'⚠️ ' + (T_KEY(t, 'digest.unstableTitle'))
|
|
1498
1504
|
),
|
|
1499
|
-
(digest.topUnstableTasks && digest.topUnstableTasks.length > 0) ?
|
|
1500
|
-
digest.topUnstableTasks.map((tItem, idx) =>
|
|
1505
|
+
(digest.topUnstableTasks && digest.topUnstableTasks.length > 0) ? _h('div', { style: { display: 'flex', flexDirection: 'column', gap: '6px' } },
|
|
1506
|
+
digest.topUnstableTasks.map((tItem, idx) => _h('div', {
|
|
1501
1507
|
key: tItem.id || idx,
|
|
1502
1508
|
style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', fontSize: '12px', padding: '6px 8px', background: 'var(--dsw-alias-bg-base, #111)', borderRadius: '4px', border: '1px solid var(--dsw-alias-border-l2, #222)' }
|
|
1503
1509
|
},
|
|
1504
|
-
|
|
1505
|
-
|
|
1510
|
+
_h('span', { style: { fontFamily: 'monospace' } }, (idx + 1) + '. ' + (tItem.name || tItem.id)),
|
|
1511
|
+
_h('span', { style: { color: 'var(--dsh-cron-danger, #e33)', fontWeight: '600' } },
|
|
1506
1512
|
tItem.failures + ' fail (' + tItem.successRate + '% SR)'
|
|
1507
1513
|
)
|
|
1508
1514
|
))
|
|
1509
|
-
) :
|
|
1515
|
+
) : _h('div', { style: { fontSize: '12px', color: 'var(--dsw-alias-label-secondary, #888)' } }, '✓ All tasks healthy — 0 failures in window!')
|
|
1510
1516
|
),
|
|
1511
|
-
|
|
1512
|
-
|
|
1517
|
+
_h('div', { style: { background: 'var(--dsw-alias-bg-layer-2, #111)', border: '1px solid var(--dsw-alias-border-l2, #333)', borderRadius: '6px', padding: '12px' } },
|
|
1518
|
+
_h('div', { style: { fontWeight: '600', fontSize: '13px', color: 'var(--dsh-cron-info, #4af)', marginBottom: '8px' } },
|
|
1513
1519
|
'💰 ' + (T_KEY(t, 'digest.expensiveTitle'))
|
|
1514
1520
|
),
|
|
1515
|
-
(digest.topExpensiveTasks && digest.topExpensiveTasks.length > 0) ?
|
|
1516
|
-
digest.topExpensiveTasks.map((tItem, idx) =>
|
|
1521
|
+
(digest.topExpensiveTasks && digest.topExpensiveTasks.length > 0) ? _h('div', { style: { display: 'flex', flexDirection: 'column', gap: '6px' } },
|
|
1522
|
+
digest.topExpensiveTasks.map((tItem, idx) => _h('div', {
|
|
1517
1523
|
key: tItem.id || idx,
|
|
1518
1524
|
style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', fontSize: '12px', padding: '6px 8px', background: 'var(--dsw-alias-bg-base, #111)', borderRadius: '4px', border: '1px solid var(--dsw-alias-border-l2, #222)' }
|
|
1519
1525
|
},
|
|
1520
|
-
|
|
1521
|
-
|
|
1526
|
+
_h('span', { style: { fontFamily: 'monospace' } }, (idx + 1) + '. ' + (tItem.name || tItem.id)),
|
|
1527
|
+
_h('span', { style: { color: 'var(--dsw-alias-label-primary, #ddd)' } },
|
|
1522
1528
|
Number(tItem.tokens || 0).toLocaleString() + ' tok ($' + Number(tItem.costUsd || 0).toFixed(4) + ')'
|
|
1523
1529
|
)
|
|
1524
1530
|
))
|
|
1525
|
-
) :
|
|
1531
|
+
) : _h('div', { style: { fontSize: '12px', color: 'var(--dsw-alias-label-secondary, #888)' } }, 'No significant token consumption recorded.')
|
|
1526
1532
|
)
|
|
1527
1533
|
)
|
|
1528
1534
|
),
|
|
1529
|
-
|
|
1535
|
+
_h('div', {
|
|
1530
1536
|
style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 18px', borderTop: '1px solid var(--dsw-alias-border-l2, #333)', background: 'var(--dsw-alias-bg-layer-2, #111)' }
|
|
1531
1537
|
},
|
|
1532
|
-
|
|
1538
|
+
_h('div', { style: { fontSize: '12px', color: 'var(--dsw-alias-label-secondary, #888)' } },
|
|
1533
1539
|
sendStatus || ''
|
|
1534
1540
|
),
|
|
1535
|
-
|
|
1536
|
-
|
|
1541
|
+
_h('div', { style: { display: 'flex', gap: '8px' } },
|
|
1542
|
+
_h('button', {
|
|
1537
1543
|
type: 'button',
|
|
1538
1544
|
className: 'dsh-cron-btn-secondary',
|
|
1539
1545
|
onClick: copyMarkdown,
|
|
1540
1546
|
style: { padding: '6px 14px', fontSize: '12px' }
|
|
1541
1547
|
}, T_KEY(t, 'digest.copyMarkdown')),
|
|
1542
|
-
|
|
1548
|
+
_h('button', {
|
|
1543
1549
|
type: 'button',
|
|
1544
1550
|
className: 'dsh-cron-btn-primary',
|
|
1545
1551
|
onClick: onSendTelegram,
|
|
@@ -1564,70 +1570,70 @@ if (!isOpen) return null;
|
|
|
1564
1570
|
const tab = activeTab || 'timeline';
|
|
1565
1571
|
const timeline = timelineData || { buckets: [], totalRuns: 0, peakHoursCount: 0, maxConcurrent: 3 };
|
|
1566
1572
|
const heatmap = heatmapData || { matrix: [], dayLabels: [], hourLabels: [], totalCostUsd: 0, totalTokens: 0, maxCostHour: 0 };
|
|
1567
|
-
return
|
|
1573
|
+
return _h('div', {
|
|
1568
1574
|
className: 'dsh-cron-modal-overlay',
|
|
1569
1575
|
onClick: onClose
|
|
1570
1576
|
},
|
|
1571
|
-
|
|
1577
|
+
_h('div', {
|
|
1572
1578
|
className: 'dsh-cron-modal',
|
|
1573
1579
|
style: { maxWidth: '960px', width: '94vw', maxHeight: '88vh', display: 'flex', flexDirection: 'column', background: 'var(--dsw-alias-bg-base, #111)', color: 'var(--dsw-alias-label-primary, #ddd)', border: '1px solid var(--dsw-alias-border-l2, #333)', borderRadius: '8px' },
|
|
1574
1580
|
role: 'dialog',
|
|
1575
1581
|
'aria-modal': 'true',
|
|
1576
1582
|
onClick: (e) => e.stopPropagation()
|
|
1577
1583
|
},
|
|
1578
|
-
|
|
1584
|
+
_h('div', {
|
|
1579
1585
|
style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '14px 18px', borderBottom: '1px solid var(--dsw-alias-border-l2, #333)', background: 'var(--dsw-alias-bg-layer-2, #111)' }
|
|
1580
1586
|
},
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1587
|
+
_h('div', { style: { display: 'flex', alignItems: 'center', gap: '10px' } },
|
|
1588
|
+
_h('span', { style: { fontSize: '20px' } }, tab === 'timeline' ? '⏱' : '🔥'),
|
|
1589
|
+
_h('div', null,
|
|
1590
|
+
_h('div', { style: { fontWeight: '600', fontSize: '15px', color: 'var(--dsw-alias-label-primary, #fff)' } },
|
|
1585
1591
|
tab === 'timeline' ? (T_KEY(t, 'timeline.modalTitle')) : (T_KEY(t, 'heatmap.modalTitle'))
|
|
1586
1592
|
),
|
|
1587
|
-
|
|
1593
|
+
_h('div', { style: { fontSize: '11.5px', color: 'var(--dsw-alias-label-secondary, #888)', marginTop: '2px' } },
|
|
1588
1594
|
tab === 'timeline'
|
|
1589
1595
|
? (timeline.totalRuns + ' runs projected · ' + (timeline.peakHoursCount ? '⚠️ ' + timeline.peakHoursCount + ' peak hours' : '✓ balanced concurrency'))
|
|
1590
1596
|
: ('$' + Number(heatmap.totalCostUsd || 0).toFixed(4) + ' USD · ' + Number(heatmap.totalTokens || 0).toLocaleString() + ' tokens')
|
|
1591
1597
|
)
|
|
1592
1598
|
)
|
|
1593
1599
|
),
|
|
1594
|
-
|
|
1595
|
-
|
|
1600
|
+
_h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px' } },
|
|
1601
|
+
_h('button', {
|
|
1596
1602
|
type: 'button',
|
|
1597
1603
|
className: 'dsh-cron-btn-secondary',
|
|
1598
1604
|
style: { padding: '4px 12px', fontSize: '12px', fontWeight: tab === 'timeline' ? '600' : '400', background: tab === 'timeline' ? 'var(--dsw-alias-bg-layer-3, #222)' : 'transparent' },
|
|
1599
1605
|
onClick: () => onSelectTab && onSelectTab('timeline')
|
|
1600
1606
|
}, '⏱ ' + (T_KEY(t, 'timeline.tabTimeline'))),
|
|
1601
|
-
|
|
1607
|
+
_h('button', {
|
|
1602
1608
|
type: 'button',
|
|
1603
1609
|
className: 'dsh-cron-btn-secondary',
|
|
1604
1610
|
style: { padding: '4px 12px', fontSize: '12px', fontWeight: tab === 'heatmap' ? '600' : '400', background: tab === 'heatmap' ? 'var(--dsw-alias-bg-layer-3, #222)' : 'transparent' },
|
|
1605
1611
|
onClick: () => onSelectTab && onSelectTab('heatmap')
|
|
1606
1612
|
}, '🔥 ' + (T_KEY(t, 'heatmap.tabHeatmap'))),
|
|
1607
|
-
|
|
1613
|
+
_h('button', {
|
|
1608
1614
|
type: 'button',
|
|
1609
1615
|
className: 'dsh-cron-icon-btn',
|
|
1610
1616
|
onClick: onClose,
|
|
1611
1617
|
style: { marginLeft: '8px' }
|
|
1612
|
-
},
|
|
1618
|
+
}, _h('span', null, '✕'))
|
|
1613
1619
|
)
|
|
1614
1620
|
),
|
|
1615
|
-
|
|
1621
|
+
_h('div', {
|
|
1616
1622
|
style: { padding: '16px 18px', overflowY: 'auto', flex: 1, display: 'flex', flexDirection: 'column', gap: '14px' }
|
|
1617
1623
|
},
|
|
1618
|
-
isLoading ?
|
|
1624
|
+
isLoading ? _h('div', { style: { padding: '40px', textAlign: 'center', color: 'var(--dsw-alias-label-secondary, #888)' } }, 'Loading visualization data...') : (
|
|
1619
1625
|
tab === 'timeline' ? (
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1626
|
+
_h('div', { style: { display: 'flex', flexDirection: 'column', gap: '8px' } },
|
|
1627
|
+
_h('div', { style: { fontSize: '12px', color: 'var(--dsw-alias-label-secondary, #888)', display: 'flex', justifyContent: 'space-between' } },
|
|
1628
|
+
_h('span', null, T_KEY(t, 'timeline.legendDesc')),
|
|
1629
|
+
_h('span', { style: { color: 'var(--dsh-cron-warning, #fa0)' } }, '⚠️ ' + (T_KEY(t, 'timeline.peakWarning')) + ' (' + timeline.maxConcurrent + ')')
|
|
1624
1630
|
),
|
|
1625
|
-
|
|
1631
|
+
_h('div', {
|
|
1626
1632
|
style: { display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: '8px', marginTop: '6px' }
|
|
1627
1633
|
},
|
|
1628
1634
|
(timeline.buckets || []).map((b) => {
|
|
1629
1635
|
const isPeak = b.isPeak, hasRuns = b.count > 0;
|
|
1630
|
-
return
|
|
1636
|
+
return _h('div', {
|
|
1631
1637
|
key: b.index,
|
|
1632
1638
|
style: {
|
|
1633
1639
|
background: isPeak ? 'color-mix(in srgb, var(--dsh-cron-danger, #e33) 12%, var(--dsw-alias-bg-layer-2, #111))' : (hasRuns ? 'var(--dsw-alias-bg-layer-2, #111)' : 'var(--dsw-alias-bg-base, #111)'),
|
|
@@ -1635,12 +1641,12 @@ border: isPeak ? '1px solid var(--dsh-cron-danger, #e33)' : (hasRuns ? '1px soli
|
|
|
1635
1641
|
borderRadius: '6px', padding: '8px', minHeight: '75px', display: 'flex', flexDirection: 'column', justifyContent: 'space-between'
|
|
1636
1642
|
}
|
|
1637
1643
|
},
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
hasRuns ?
|
|
1644
|
+
_h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', fontSize: '11px' } },
|
|
1645
|
+
_h('span', { style: { fontWeight: '600', color: isPeak ? 'var(--dsh-cron-danger, #e33)' : 'var(--dsw-alias-label-primary, #fff)' } }, b.label),
|
|
1646
|
+
hasRuns ? _h('span', { style: { fontSize: '10px', padding: '1px 5px', borderRadius: '8px', background: isPeak ? 'var(--dsh-cron-danger, #e33)' : 'var(--dsw-alias-bg-layer-3, #222)', color: '#fff' } }, b.count) : null
|
|
1641
1647
|
),
|
|
1642
|
-
|
|
1643
|
-
(b.runs || []).slice(0, 3).map((r, rIdx) =>
|
|
1648
|
+
_h('div', { style: { display: 'flex', flexWrap: 'wrap', gap: '3px', marginTop: '4px' } },
|
|
1649
|
+
(b.runs || []).slice(0, 3).map((r, rIdx) => _h('span', {
|
|
1644
1650
|
key: rIdx, title: (r.title || r.taskId) + ' (' + r.time + ')',
|
|
1645
1651
|
style: { fontSize: '9.5px', fontFamily: 'monospace', padding: '1px 4px', borderRadius: '3px', background: 'var(--dsw-alias-bg-base, #111)', border: '1px solid var(--dsw-alias-border-l2, #333)', maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }
|
|
1646
1652
|
}, r.title || r.taskId))
|
|
@@ -1650,36 +1656,36 @@ style: { fontSize: '9.5px', fontFamily: 'monospace', padding: '1px 4px', borderR
|
|
|
1650
1656
|
)
|
|
1651
1657
|
)
|
|
1652
1658
|
) : (
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1659
|
+
_h('div', { style: { display: 'flex', flexDirection: 'column', gap: '10px' } },
|
|
1660
|
+
_h('div', { style: { fontSize: '12px', color: 'var(--dsw-alias-label-secondary, #888)', display: 'flex', justifyContent: 'space-between' } },
|
|
1661
|
+
_h('span', null, T_KEY(t, 'heatmap.matrixDesc')),
|
|
1662
|
+
_h('span', null, 'Max hour spend: $' + Number(heatmap.maxCostHour || 0).toFixed(4))
|
|
1657
1663
|
),
|
|
1658
|
-
|
|
1664
|
+
_h('div', {
|
|
1659
1665
|
style: { overflowX: 'auto', paddingBottom: '8px' }
|
|
1660
1666
|
},
|
|
1661
|
-
|
|
1667
|
+
_h('table', {
|
|
1662
1668
|
style: { borderCollapse: 'collapse', width: '100%', minWidth: '700px', fontSize: '10.5px' }
|
|
1663
1669
|
},
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
Array.from({ length: 24 }, (_,
|
|
1668
|
-
key:
|
|
1670
|
+
_h('thead', null,
|
|
1671
|
+
_h('tr', null,
|
|
1672
|
+
_h('th', { style: { padding: '4px 6px', textAlign: 'left', color: 'var(--dsw-alias-label-secondary, #888)' } }, 'Day'),
|
|
1673
|
+
Array.from({ length: 24 }, (_, hour) => _h('th', {
|
|
1674
|
+
key: hour,
|
|
1669
1675
|
style: { padding: '4px 2px', textAlign: 'center', color: 'var(--dsw-alias-label-secondary, #888)', fontWeight: '400' }
|
|
1670
|
-
}, String(
|
|
1676
|
+
}, String(hour).padStart(2, '0')))
|
|
1671
1677
|
)
|
|
1672
1678
|
),
|
|
1673
|
-
|
|
1674
|
-
(heatmap.matrix || []).map((row, dIdx) =>
|
|
1675
|
-
|
|
1679
|
+
_h('tbody', null,
|
|
1680
|
+
(heatmap.matrix || []).map((row, dIdx) => _h('tr', { key: dIdx },
|
|
1681
|
+
_h('td', { style: { padding: '4px 6px', fontWeight: '600', color: 'var(--dsw-alias-label-primary, #ddd)' } }, (heatmap.dayLabels && heatmap.dayLabels[dIdx]) || 'Day'),
|
|
1676
1682
|
row.map((cell, hIdx) => {
|
|
1677
1683
|
const intensity = cell.costIntensity || 0;
|
|
1678
1684
|
const hasSpend = cell.costUsd > 0;
|
|
1679
1685
|
const bg = hasSpend
|
|
1680
1686
|
? 'color-mix(in srgb, var(--dsh-cron-primary, #4af) ' + Math.max(15, Math.round(intensity * 100)) + '%, transparent)'
|
|
1681
1687
|
: 'transparent';
|
|
1682
|
-
return
|
|
1688
|
+
return _h('td', {
|
|
1683
1689
|
key: hIdx,
|
|
1684
1690
|
title: cell.dayLabel + ' ' + cell.hourLabel + ': $' + cell.costUsd + ' (' + cell.tokens.toLocaleString() + ' tokens, ' + cell.runs + ' runs)',
|
|
1685
1691
|
style: {
|
|
@@ -1689,7 +1695,7 @@ background: bg,
|
|
|
1689
1695
|
border: '1px solid var(--dsw-alias-border-l2, #222)',
|
|
1690
1696
|
cursor: hasSpend ? 'pointer' : 'default'
|
|
1691
1697
|
}
|
|
1692
|
-
}, hasSpend ?
|
|
1698
|
+
}, hasSpend ? _h('span', { style: { fontSize: '9px', color: intensity > 0.5 ? '#fff' : 'var(--dsw-alias-label-primary, #ddd)' } }, '$' + (cell.costUsd >= 0.01 ? cell.costUsd.toFixed(2) : cell.costUsd.toFixed(3).slice(1))) : '·');
|
|
1693
1699
|
})
|
|
1694
1700
|
))
|
|
1695
1701
|
)
|
|
@@ -1699,10 +1705,10 @@ cursor: hasSpend ? 'pointer' : 'default'
|
|
|
1699
1705
|
)
|
|
1700
1706
|
)
|
|
1701
1707
|
),
|
|
1702
|
-
|
|
1708
|
+
_h('div', {
|
|
1703
1709
|
style: { display: 'flex', justifyContent: 'flex-end', padding: '12px 18px', borderTop: '1px solid var(--dsw-alias-border-l2, #333)', background: 'var(--dsw-alias-bg-layer-2, #111)' }
|
|
1704
1710
|
},
|
|
1705
|
-
|
|
1711
|
+
_h('button', {
|
|
1706
1712
|
type: 'button',
|
|
1707
1713
|
className: 'dsh-cron-btn-secondary',
|
|
1708
1714
|
onClick: onClose,
|
|
@@ -1810,6 +1816,7 @@ const [formMisfirePolicy, setFormMisfirePolicy] = React.useState('skip');
|
|
|
1810
1816
|
const [formMaxRetries, setFormMaxRetries] = React.useState(0);
|
|
1811
1817
|
const [formPermissionPreset, setFormPermissionPreset] = React.useState('default');
|
|
1812
1818
|
const [formAgentPreset, setFormAgentPreset] = React.useState('');
|
|
1819
|
+
const [formSessionTitle, setFormSessionTitle] = React.useState('');
|
|
1813
1820
|
const [formTargetSessionId, setFormTargetSessionId] = React.useState('');
|
|
1814
1821
|
const [formTargetSessionReset, setFormTargetSessionReset] = React.useState('never');
|
|
1815
1822
|
const [formEnv, setFormEnv] = React.useState('');
|
|
@@ -2585,6 +2592,7 @@ misfirePolicy: 'skip',
|
|
|
2585
2592
|
maxRetries: 0,
|
|
2586
2593
|
permissionPreset: 'default',
|
|
2587
2594
|
agentPreset: '',
|
|
2595
|
+
sessionTitle: '',
|
|
2588
2596
|
targetSessionId: '',
|
|
2589
2597
|
targetSessionReset: 'never',
|
|
2590
2598
|
env: '',
|
|
@@ -2719,6 +2727,7 @@ setFormMisfirePolicy(task.misfirePolicy || 'skip');
|
|
|
2719
2727
|
setFormMaxRetries(task.maxRetries !== undefined ? task.maxRetries : 0);
|
|
2720
2728
|
setFormPermissionPreset(task.permissionPreset || 'default');
|
|
2721
2729
|
setFormAgentPreset(task.agentPreset || '');
|
|
2730
|
+
setFormSessionTitle(task.sessionTitle || '');
|
|
2722
2731
|
setFormTargetSessionId(task.targetSessionId || '');
|
|
2723
2732
|
setFormTargetSessionReset(task.targetSessionReset || 'never');
|
|
2724
2733
|
setFormEnv(formatEnvText(task.env));
|
|
@@ -2777,6 +2786,7 @@ misfirePolicy: formMisfirePolicy,
|
|
|
2777
2786
|
maxRetries: Number(formMaxRetries) || 0,
|
|
2778
2787
|
permissionPreset: isAgentType ? formPermissionPreset : 'default',
|
|
2779
2788
|
agentPreset: formAgentPreset.trim() || undefined,
|
|
2789
|
+
sessionTitle: formSessionTitle.trim() || undefined,
|
|
2780
2790
|
targetSessionId: formTargetSessionId.trim() || undefined,
|
|
2781
2791
|
targetSessionReset: formTargetSessionReset || 'never',
|
|
2782
2792
|
kanbanMode: formKanbanMode,
|
|
@@ -3011,82 +3021,82 @@ setTimelineLoading(false);
|
|
|
3011
3021
|
const onSelectTimelineTab = (tab) => {
|
|
3012
3022
|
setTimelineTab(tab);
|
|
3013
3023
|
};
|
|
3014
|
-
return
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3024
|
+
return _h('div', { className: 'dsh-cron-overlay' },
|
|
3025
|
+
_h('div', { className: 'dsh-cron-container' },
|
|
3026
|
+
_h('div', { className: 'dsh-cron-top-bar' },
|
|
3027
|
+
_h('button', {
|
|
3018
3028
|
type: 'button',
|
|
3019
3029
|
className: 'dsh-cron-back-btn',
|
|
3020
3030
|
title: T_KEY(t, 'panel.back'),
|
|
3021
3031
|
onClick: () => { if (onClose) onClose(); else toggle.set(false); }
|
|
3022
3032
|
},
|
|
3023
|
-
|
|
3024
|
-
|
|
3033
|
+
_h('span', svgProps(BACK_ICON)),
|
|
3034
|
+
_h('span', null, T_KEY(t, 'panel.back'))
|
|
3025
3035
|
)
|
|
3026
3036
|
),
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3037
|
+
_h('div', { className: 'dsh-cron-header' },
|
|
3038
|
+
_h('div', null,
|
|
3039
|
+
_h('div', { className: 'dsh-cron-title' }, T_KEY(t, 'panel.title')),
|
|
3040
|
+
_h('div', { className: 'dsh-cron-subtitle' }, T_KEY(t, 'panel.subtitle'))
|
|
3031
3041
|
),
|
|
3032
|
-
|
|
3033
|
-
|
|
3042
|
+
_h('div', { style: { display: 'flex', alignItems: 'center', gap: '10px' } },
|
|
3043
|
+
_h('button', {
|
|
3034
3044
|
type: 'button',
|
|
3035
3045
|
className: 'dsh-cron-btn-secondary',
|
|
3036
3046
|
style: { display: 'flex', alignItems: 'center', gap: '6px', height: '36px', padding: '0 12px' },
|
|
3037
3047
|
title: T_KEY(t, 'timeline.buttonTitle'),
|
|
3038
3048
|
onClick: () => openTimelineModal('timeline')
|
|
3039
3049
|
},
|
|
3040
|
-
|
|
3050
|
+
_h('span', { style: { fontSize: '14px' } }, '⏱'),
|
|
3041
3051
|
T_KEY(t, 'timeline.buttonLabel')
|
|
3042
3052
|
),
|
|
3043
|
-
|
|
3053
|
+
_h('button', {
|
|
3044
3054
|
type: 'button',
|
|
3045
3055
|
className: 'dsh-cron-btn-secondary',
|
|
3046
3056
|
style: { display: 'flex', alignItems: 'center', gap: '6px', height: '36px', padding: '0 12px' },
|
|
3047
3057
|
title: T_KEY(t, 'digest.buttonTitle'),
|
|
3048
3058
|
onClick: openAnalyticsDigest
|
|
3049
3059
|
},
|
|
3050
|
-
|
|
3060
|
+
_h('span', { style: { fontSize: '14px' } }, '📊'),
|
|
3051
3061
|
T_KEY(t, 'digest.buttonLabel')
|
|
3052
3062
|
),
|
|
3053
|
-
|
|
3063
|
+
_h('button', {
|
|
3054
3064
|
type: 'button',
|
|
3055
3065
|
className: 'dsh-cron-btn-secondary',
|
|
3056
3066
|
style: { display: 'flex', alignItems: 'center', gap: '6px', height: '36px', padding: '0 14px' },
|
|
3057
3067
|
title: T_KEY(t, 'actions.settings'),
|
|
3058
3068
|
onClick: openSettingsModal
|
|
3059
3069
|
},
|
|
3060
|
-
|
|
3070
|
+
_h('span', { style: { display: 'flex', alignItems: 'center', color: 'var(--dsh-cron-info)' }, ...iconHtml(ICON_TELEGRAM) }),
|
|
3061
3071
|
T_KEY(t, 'actions.settings')
|
|
3062
3072
|
),
|
|
3063
|
-
|
|
3064
|
-
|
|
3073
|
+
_h('div', { style: { position: 'relative' } },
|
|
3074
|
+
_h('button', { className: 'dsh-cron-create-btn', onClick: () => setDropdownOpen(!dropdownOpen) },
|
|
3065
3075
|
T_KEY(t, 'actions.create'),
|
|
3066
|
-
|
|
3076
|
+
_h('span', iconHtml(ICON_CHEVRON_DOWN))
|
|
3067
3077
|
),
|
|
3068
|
-
dropdownOpen &&
|
|
3069
|
-
|
|
3070
|
-
|
|
3078
|
+
dropdownOpen && _h('div', { className: 'dsh-cron-dropdown' },
|
|
3079
|
+
_h('button', { className: 'dsh-cron-dropdown-item', onClick: openDshModal }, T_KEY(t, 'actions.createWithDsh')),
|
|
3080
|
+
_h('button', { className: 'dsh-cron-dropdown-item', onClick: () => openManualModal(null) }, T_KEY(t, 'actions.setupManually'))
|
|
3071
3081
|
)
|
|
3072
3082
|
),
|
|
3073
|
-
|
|
3083
|
+
_h('button', {
|
|
3074
3084
|
type: 'button',
|
|
3075
3085
|
className: 'dsh-cron-icon-btn',
|
|
3076
3086
|
title: T_KEY(t, 'transfer.exportTitle'),
|
|
3077
3087
|
'aria-label': T_KEY(t, 'transfer.exportTitle'),
|
|
3078
3088
|
disabled: transferBusy,
|
|
3079
3089
|
onClick: handleExport
|
|
3080
|
-
},
|
|
3081
|
-
|
|
3090
|
+
}, _h('span', svgProps(ICON_DOWNLOAD))),
|
|
3091
|
+
_h('button', {
|
|
3082
3092
|
type: 'button',
|
|
3083
3093
|
className: 'dsh-cron-icon-btn',
|
|
3084
3094
|
title: T_KEY(t, 'transfer.importTitle'),
|
|
3085
3095
|
'aria-label': T_KEY(t, 'transfer.importTitle'),
|
|
3086
3096
|
disabled: transferBusy,
|
|
3087
3097
|
onClick: () => { if (importFileRef.current) importFileRef.current.click(); }
|
|
3088
|
-
},
|
|
3089
|
-
|
|
3098
|
+
}, _h('span', svgProps(ICON_UPLOAD))),
|
|
3099
|
+
_h('input', {
|
|
3090
3100
|
type: 'file',
|
|
3091
3101
|
accept: '.json,application/json',
|
|
3092
3102
|
ref: importFileRef,
|
|
@@ -3095,9 +3105,9 @@ onChange: handleImportFile
|
|
|
3095
3105
|
})
|
|
3096
3106
|
)
|
|
3097
3107
|
),
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3108
|
+
_h('div', { className: 'dsh-cron-search-bar' },
|
|
3109
|
+
_h('span', { className: 'dsh-cron-search-icon', ...iconHtml(ICON_SEARCH) }),
|
|
3110
|
+
_h('input', {
|
|
3101
3111
|
className: 'dsh-cron-search-input',
|
|
3102
3112
|
type: 'search',
|
|
3103
3113
|
'aria-label': T_KEY(t, 'search.placeholder'),
|
|
@@ -3106,27 +3116,27 @@ value: query,
|
|
|
3106
3116
|
onChange: (e) => setQuery(e.target.value)
|
|
3107
3117
|
})
|
|
3108
3118
|
),
|
|
3109
|
-
stats &&
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3119
|
+
stats && _h('div', { className: 'dsh-cron-stats-bar' },
|
|
3120
|
+
_h('div', { className: 'dsh-cron-stat-card' },
|
|
3121
|
+
_h('div', { className: 'dsh-cron-stat-val' }, stats.activeTasks || 0),
|
|
3122
|
+
_h('div', { className: 'dsh-cron-stat-lbl' }, T_KEY(t, 'stats.activeTasks'))
|
|
3113
3123
|
),
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3124
|
+
_h('div', { className: 'dsh-cron-stat-card' },
|
|
3125
|
+
_h('div', { className: 'dsh-cron-stat-val' }, stats.totalRuns || 0),
|
|
3126
|
+
_h('div', { className: 'dsh-cron-stat-lbl' }, T_KEY(t, 'stats.totalRuns'))
|
|
3117
3127
|
),
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3128
|
+
_h('div', { className: 'dsh-cron-stat-card' },
|
|
3129
|
+
_h('div', { className: 'dsh-cron-stat-val' }, (stats.totalTokens || 0).toLocaleString()),
|
|
3130
|
+
_h('div', { className: 'dsh-cron-stat-lbl' }, T_KEY(t, 'stats.totalTokens'))
|
|
3121
3131
|
),
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3132
|
+
_h('div', { className: 'dsh-cron-stat-card' },
|
|
3133
|
+
_h('div', { className: 'dsh-cron-stat-val', style: { color: 'var(--dsh-cron-success)' } }, '$' + (stats.totalCostUsd || 0).toFixed(4)),
|
|
3134
|
+
_h('div', { className: 'dsh-cron-stat-lbl' }, T_KEY(t, 'stats.totalCost'))
|
|
3125
3135
|
)
|
|
3126
3136
|
),
|
|
3127
|
-
|
|
3137
|
+
_h('div', { className: 'dsh-cron-tabs' },
|
|
3128
3138
|
['all', 'active', 'paused', 'completed'].map((tabName) =>
|
|
3129
|
-
|
|
3139
|
+
_h('button', {
|
|
3130
3140
|
key: tabName,
|
|
3131
3141
|
className: 'dsh-cron-tab',
|
|
3132
3142
|
'data-active': tab === tabName ? 'true' : undefined,
|
|
@@ -3138,8 +3148,8 @@ tabName === 'all' ? T_KEY(t, 'tabs.all')
|
|
|
3138
3148
|
: T_KEY(t, 'tabs.completed'))
|
|
3139
3149
|
)
|
|
3140
3150
|
),
|
|
3141
|
-
|
|
3142
|
-
|
|
3151
|
+
_h('div', { className: 'dsh-cron-filters' },
|
|
3152
|
+
_h('button', {
|
|
3143
3153
|
type: 'button',
|
|
3144
3154
|
className: 'dsh-cron-filter-toggle',
|
|
3145
3155
|
'aria-expanded': filtersOpen ? 'true' : 'false',
|
|
@@ -3148,73 +3158,73 @@ onClick: () => setFiltersOpen(!filtersOpen)
|
|
|
3148
3158
|
T_KEY(t, 'filters.title'),
|
|
3149
3159
|
(filterType || filterModel || filterChannel) ? ' •' : ''
|
|
3150
3160
|
),
|
|
3151
|
-
filtersOpen &&
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3161
|
+
filtersOpen && _h('div', { className: 'dsh-cron-filter-panel' },
|
|
3162
|
+
_h('label', { className: 'dsh-cron-filter-field' },
|
|
3163
|
+
_h('span', null, T_KEY(t, 'filters.type')),
|
|
3164
|
+
_h('select', {
|
|
3155
3165
|
value: filterType,
|
|
3156
3166
|
onChange: (e) => setFilterType(e.target.value)
|
|
3157
3167
|
},
|
|
3158
|
-
|
|
3159
|
-
...filterTypeOptions.map((value) =>
|
|
3168
|
+
_h('option', { value: '' }, T_KEY(t, 'filters.any')),
|
|
3169
|
+
...filterTypeOptions.map((value) => _h('option', { key: value, value }, value))
|
|
3160
3170
|
)
|
|
3161
3171
|
),
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3172
|
+
_h('label', { className: 'dsh-cron-filter-field' },
|
|
3173
|
+
_h('span', null, T_KEY(t, 'filters.model')),
|
|
3174
|
+
_h('select', {
|
|
3165
3175
|
value: filterModel,
|
|
3166
3176
|
onChange: (e) => setFilterModel(e.target.value)
|
|
3167
3177
|
},
|
|
3168
|
-
|
|
3169
|
-
...filterModelOptions.map((value) =>
|
|
3178
|
+
_h('option', { value: '' }, T_KEY(t, 'filters.any')),
|
|
3179
|
+
...filterModelOptions.map((value) => _h('option', { key: value, value }, value))
|
|
3170
3180
|
)
|
|
3171
3181
|
),
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3182
|
+
_h('label', { className: 'dsh-cron-filter-field' },
|
|
3183
|
+
_h('span', null, T_KEY(t, 'filters.channel')),
|
|
3184
|
+
_h('select', {
|
|
3175
3185
|
value: filterChannel,
|
|
3176
3186
|
onChange: (e) => setFilterChannel(e.target.value)
|
|
3177
3187
|
},
|
|
3178
|
-
|
|
3179
|
-
...DELIVERY_CHANNELS.map((id) =>
|
|
3188
|
+
_h('option', { value: '' }, T_KEY(t, 'filters.any')),
|
|
3189
|
+
...DELIVERY_CHANNELS.map((id) => _h('option', { key: id, value: id }, T_KEY(t, CHANNEL_LABEL_KEYS[id])))
|
|
3180
3190
|
)
|
|
3181
3191
|
)
|
|
3182
3192
|
)
|
|
3183
3193
|
),
|
|
3184
|
-
fetchError ?
|
|
3194
|
+
fetchError ? _h('div', {
|
|
3185
3195
|
className: 'dsh-cron-status-banner',
|
|
3186
3196
|
'data-type': 'error',
|
|
3187
3197
|
style: { margin: '8px 0', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }
|
|
3188
3198
|
},
|
|
3189
|
-
|
|
3190
|
-
|
|
3199
|
+
_h('span', null, T_KEY(t, 'banner.loadError', { error: fetchError })),
|
|
3200
|
+
_h('button', {
|
|
3191
3201
|
type: 'button',
|
|
3192
3202
|
className: 'dsh-cron-btn-secondary',
|
|
3193
3203
|
style: { marginLeft: '8px', padding: '2px 8px', fontSize: '12px' },
|
|
3194
3204
|
onClick: () => fetchTasks()
|
|
3195
3205
|
}, T_KEY(t, 'banner.retry'))
|
|
3196
3206
|
) : null,
|
|
3197
|
-
(filterType || filterModel || filterChannel) ?
|
|
3207
|
+
(filterType || filterModel || filterChannel) ? _h('div', {
|
|
3198
3208
|
className: 'dsh-cron-filter-summary',
|
|
3199
3209
|
style: { fontSize: '12px', color: 'var(--dsw-alias-label-tertiary, #888)', marginBottom: '8px', display: 'flex', gap: '8px', alignItems: 'center' }
|
|
3200
3210
|
},
|
|
3201
|
-
|
|
3202
|
-
|
|
3211
|
+
_h('span', null, T_KEY(t, 'filters.showing', { shown: visibleTasks.length, total: tasks.length })),
|
|
3212
|
+
_h('button', {
|
|
3203
3213
|
type: 'button',
|
|
3204
3214
|
className: 'dsh-cron-btn-secondary',
|
|
3205
3215
|
style: { padding: '2px 8px', fontSize: '11px' },
|
|
3206
3216
|
onClick: resetFilters
|
|
3207
3217
|
}, T_KEY(t, 'filters.reset'))
|
|
3208
3218
|
) : null,
|
|
3209
|
-
|
|
3219
|
+
_h('div', { className: 'dsh-cron-task-list' },
|
|
3210
3220
|
loading && tasks.length === 0
|
|
3211
|
-
?
|
|
3221
|
+
? _h('div', { style: { color: 'var(--dsw-alias-label-tertiary, #888)', padding: '16px 0', fontSize: '14px' } }, T_KEY(t, 'list.loading'))
|
|
3212
3222
|
: tasks.length === 0
|
|
3213
|
-
?
|
|
3223
|
+
? _h('div', { style: { color: 'var(--dsw-alias-label-tertiary, #777)', padding: '16px 0', fontSize: '14px' } }, T_KEY(t, 'list.empty'))
|
|
3214
3224
|
: visibleTasks.length === 0
|
|
3215
|
-
?
|
|
3216
|
-
|
|
3217
|
-
|
|
3225
|
+
? _h('div', { style: { color: 'var(--dsw-alias-label-tertiary, #777)', padding: '16px 0', fontSize: '14px', display: 'flex', gap: '10px', alignItems: 'center' } },
|
|
3226
|
+
_h('span', null, T_KEY(t, 'filters.empty')),
|
|
3227
|
+
_h('button', {
|
|
3218
3228
|
type: 'button',
|
|
3219
3229
|
className: 'dsh-cron-btn-secondary',
|
|
3220
3230
|
style: { padding: '2px 8px', fontSize: '12px' },
|
|
@@ -3222,7 +3232,7 @@ onClick: resetFilters
|
|
|
3222
3232
|
}, T_KEY(t, 'filters.reset'))
|
|
3223
3233
|
)
|
|
3224
3234
|
: visibleTasks.map((task) =>
|
|
3225
|
-
|
|
3235
|
+
_h('div', {
|
|
3226
3236
|
key: task.id,
|
|
3227
3237
|
className: 'dsh-cron-task-item',
|
|
3228
3238
|
'data-task-id': task.id,
|
|
@@ -3238,127 +3248,127 @@ openEditModal(task);
|
|
|
3238
3248
|
}
|
|
3239
3249
|
}
|
|
3240
3250
|
},
|
|
3241
|
-
isConfigManaged(task) ? null :
|
|
3251
|
+
isConfigManaged(task) ? null : _h('button', {
|
|
3242
3252
|
type: 'button',
|
|
3243
3253
|
className: 'dsh-cron-task-status-btn' + (task.running ? ' dsh-cron-pulse' : ''),
|
|
3244
3254
|
'data-active': task.status === 'active' ? 'true' : undefined,
|
|
3245
3255
|
title: task.status === 'active' ? T_KEY(t, 'actions.pause') : T_KEY(t, 'actions.resume'),
|
|
3246
3256
|
'aria-label': task.status === 'active' ? T_KEY(t, 'actions.pause') : T_KEY(t, 'actions.resume'),
|
|
3247
3257
|
onClick: (e) => { e.stopPropagation(); handleToggleTask(task.id); }
|
|
3248
|
-
},
|
|
3249
|
-
|
|
3250
|
-
|
|
3258
|
+
}, _h('span', svgProps(task.status === 'active' ? ICON_PAUSE : ICON_PLAY))),
|
|
3259
|
+
_h('div', { className: 'dsh-cron-task-info' },
|
|
3260
|
+
_h('div', { className: 'dsh-cron-task-title' },
|
|
3251
3261
|
task.title,
|
|
3252
|
-
|
|
3262
|
+
_h('span', {
|
|
3253
3263
|
className: 'dsh-cron-type-tag',
|
|
3254
3264
|
style: task.type === 'script'
|
|
3255
3265
|
? { background: 'var(--dsh-cron-info-bg)', color: 'var(--dsh-cron-info)' }
|
|
3256
3266
|
: { background: 'var(--dsh-cron-success-bg)', color: 'var(--dsh-cron-success)' }
|
|
3257
3267
|
}, task.type === 'script' ? T_KEY(t, 'list.typeShell') : T_KEY(t, 'list.typeLlm')),
|
|
3258
|
-
task.model ?
|
|
3259
|
-
task.oneShot ?
|
|
3260
|
-
isConfigManaged(task) ?
|
|
3268
|
+
task.model ? _h('span', { className: 'dsh-cron-task-model-tag' }, task.model.split('/').pop()) : null,
|
|
3269
|
+
task.oneShot ? _h('span', { className: 'dsh-cron-oneshot-tag' }, T_KEY(t, 'list.oneShot')) : null,
|
|
3270
|
+
isConfigManaged(task) ? _h('span', {
|
|
3261
3271
|
className: 'dsh-cron-config-tag',
|
|
3262
3272
|
title: T_KEY(t, 'list.configManagedHint')
|
|
3263
3273
|
}, T_KEY(t, 'list.configManaged')) : null,
|
|
3264
|
-
task.lastDurationMs > 0 ?
|
|
3265
|
-
task.onSuccess ?
|
|
3266
|
-
task.onFailure ?
|
|
3267
|
-
(task.dependsOn && (Array.isArray(task.dependsOn) ? task.dependsOn.length > 0 : Boolean(task.dependsOn))) ?
|
|
3268
|
-
task.adaptive?.enabled ?
|
|
3274
|
+
task.lastDurationMs > 0 ? _h('span', { className: 'dsh-cron-cost-tag', title: 'Last execution duration' }, task.lastDurationMs + 'ms') : null,
|
|
3275
|
+
task.onSuccess ? _h('span', { className: 'dsh-cron-type-tag dsh-cron-tag-success', title: 'On success: triggers ' + task.onSuccess }, '➜ ' + task.onSuccess) : null,
|
|
3276
|
+
task.onFailure ? _h('span', { className: 'dsh-cron-type-tag dsh-cron-tag-failure', title: 'On failure: triggers ' + task.onFailure }, '↳ ' + task.onFailure) : null,
|
|
3277
|
+
(task.dependsOn && (Array.isArray(task.dependsOn) ? task.dependsOn.length > 0 : Boolean(task.dependsOn))) ? _h('span', { className: 'dsh-cron-type-tag dsh-cron-tag-heartbeat', title: 'Depends on: ' + (Array.isArray(task.dependsOn) ? task.dependsOn.join(', ') : task.dependsOn) }, '⛓️ ' + (Array.isArray(task.dependsOn) ? task.dependsOn.join(', ') : task.dependsOn)) : null,
|
|
3278
|
+
task.adaptive?.enabled ? _h('span', {
|
|
3269
3279
|
className: 'dsh-cron-type-tag' + (task.adaptiveState?.backedOff ? ' dsh-cron-tag-failure' : ' dsh-cron-tag-success'),
|
|
3270
3280
|
title: 'Adaptive: ' + (task.adaptiveState?.effectiveIntervalStr || task.adaptive.minInterval || '5m') + ' (idle: ' + (task.adaptiveState?.idleCount || 0) + ')'
|
|
3271
3281
|
}, (task.adaptiveState?.backedOff ? '⏳ ' : '⚡ ') + (task.adaptiveState?.effectiveIntervalStr || task.adaptive.minInterval || '5m')) : null,
|
|
3272
|
-
task.heartbeatIntervalSeconds > 0 ?
|
|
3273
|
-
task.targetSessionId ?
|
|
3274
|
-
task.preflightType && task.preflightType !== 'none' ?
|
|
3275
|
-
task.totalCostUsd > 0 ?
|
|
3276
|
-
task.totalTokens > 0 ?
|
|
3277
|
-
task.status === 'paused' && task.pausedReason ?
|
|
3278
|
-
),
|
|
3279
|
-
|
|
3282
|
+
task.heartbeatIntervalSeconds > 0 ? _h('span', { className: 'dsh-cron-type-tag dsh-cron-tag-heartbeat', title: 'Heartbeat: every ' + task.heartbeatIntervalSeconds + 's' }, '💓 ' + task.heartbeatIntervalSeconds + 's') : null,
|
|
3283
|
+
task.targetSessionId ? _h('span', { className: 'dsh-cron-type-tag dsh-cron-tag-session', title: 'Target session: ' + task.targetSessionId + (task.targetSessionReset && task.targetSessionReset !== 'never' ? ' (' + task.targetSessionReset + ')' : '') }, '🧵 ' + task.targetSessionId) : null,
|
|
3284
|
+
task.preflightType && task.preflightType !== 'none' ? _h('span', { className: 'dsh-cron-type-tag dsh-cron-tag-preflight', title: 'Preflight: ' + task.preflightType }, '🛡️ ' + task.preflightType) : null,
|
|
3285
|
+
task.totalCostUsd > 0 ? _h('span', { className: 'dsh-cron-cost-tag' }, '$' + task.totalCostUsd.toFixed(4)) : null,
|
|
3286
|
+
task.totalTokens > 0 ? _h('span', { className: 'dsh-cron-tokens-tag' }, (task.totalTokens > 1000 ? Math.round(task.totalTokens / 1000) + 'k' : task.totalTokens) + ' tok') : null,
|
|
3287
|
+
task.status === 'paused' && task.pausedReason ? _h('span', { className: 'dsh-cron-type-tag dsh-cron-tag-failure', title: task.pausedReason }, '🛑 ' + task.pausedReason) : null
|
|
3288
|
+
),
|
|
3289
|
+
_h('div', { className: 'dsh-cron-task-sched' },
|
|
3280
3290
|
task.scheduleText || task.schedule,
|
|
3281
3291
|
task.nextRunAt ? T_KEY(t, 'list.next', { time: new Date(task.nextRunAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) }) : '',
|
|
3282
3292
|
task.running && task.runningSince
|
|
3283
3293
|
? ' · ' + T_KEY(t, 'list.runningNow') + ' ' + Math.max(0, Math.round((Date.now() - task.runningSince) / 1000)) + 's'
|
|
3284
3294
|
: ''
|
|
3285
3295
|
),
|
|
3286
|
-
task.prompt ?
|
|
3296
|
+
task.prompt ? _h('div', {
|
|
3287
3297
|
className: 'dsh-cron-task-prompt-preview',
|
|
3288
3298
|
title: task.prompt
|
|
3289
3299
|
}, task.prompt.slice(0, 140) + (task.prompt.length > 140 ? '…' : '')) : null
|
|
3290
3300
|
),
|
|
3291
|
-
|
|
3301
|
+
_h('div', {
|
|
3292
3302
|
className: 'dsh-cron-task-actions',
|
|
3293
3303
|
onClick: (e) => e.stopPropagation()
|
|
3294
3304
|
},
|
|
3295
|
-
|
|
3305
|
+
_h('button', {
|
|
3296
3306
|
type: 'button',
|
|
3297
3307
|
className: 'dsh-cron-icon-btn',
|
|
3298
3308
|
title: T_KEY(t, 'actions.dryRunTitle'),
|
|
3299
3309
|
onClick: () => handleDryRun(task.id)
|
|
3300
3310
|
}, '🧪'),
|
|
3301
|
-
|
|
3311
|
+
_h('button', {
|
|
3302
3312
|
type: 'button',
|
|
3303
3313
|
className: 'dsh-cron-icon-btn' + (task.running ? ' dsh-cron-pulse' : ''),
|
|
3304
3314
|
title: T_KEY(t, 'liveLog.viewLog'),
|
|
3305
3315
|
onClick: () => handleOpenLiveLogs(task)
|
|
3306
3316
|
}, '📺'),
|
|
3307
|
-
|
|
3317
|
+
_h('button', {
|
|
3308
3318
|
type: 'button',
|
|
3309
3319
|
className: 'dsh-cron-icon-btn',
|
|
3310
3320
|
title: T_KEY(t, 'actions.archiveTitle'),
|
|
3311
3321
|
onClick: () => openArchiveModal(task, 0)
|
|
3312
3322
|
}, '📜'),
|
|
3313
|
-
(task.onSuccess || task.onFailure || (task.dependsOn && (Array.isArray(task.dependsOn) ? task.dependsOn.length > 0 : Boolean(task.dependsOn)))) ?
|
|
3323
|
+
(task.onSuccess || task.onFailure || (task.dependsOn && (Array.isArray(task.dependsOn) ? task.dependsOn.length > 0 : Boolean(task.dependsOn)))) ? _h('button', {
|
|
3314
3324
|
type: 'button',
|
|
3315
3325
|
className: 'dsh-cron-icon-btn',
|
|
3316
3326
|
title: T_KEY(t, 'chainGraph.viewGraph'),
|
|
3317
3327
|
onClick: () => openChainGraphModal(task)
|
|
3318
3328
|
}, '🕸️') : null,
|
|
3319
|
-
|
|
3329
|
+
_h('button', {
|
|
3320
3330
|
type: 'button',
|
|
3321
3331
|
className: 'dsh-cron-icon-btn',
|
|
3322
3332
|
title: T_KEY(t, 'actions.runNow'),
|
|
3323
3333
|
onClick: () => handleRunNow(task.id)
|
|
3324
3334
|
}, T_KEY(t, 'actions.runNowShort')),
|
|
3325
|
-
isConfigManaged(task) ? null :
|
|
3335
|
+
isConfigManaged(task) ? null : _h('button', {
|
|
3326
3336
|
type: 'button',
|
|
3327
3337
|
className: 'dsh-cron-icon-btn',
|
|
3328
3338
|
title: T_KEY(t, 'actions.edit'),
|
|
3329
3339
|
'aria-label': T_KEY(t, 'actions.edit'),
|
|
3330
3340
|
onClick: () => openEditModal(task)
|
|
3331
|
-
},
|
|
3332
|
-
isConfigManaged(task) ? null :
|
|
3341
|
+
}, _h('span', svgProps(ICON_EDIT))),
|
|
3342
|
+
isConfigManaged(task) ? null : _h('button', {
|
|
3333
3343
|
type: 'button',
|
|
3334
3344
|
className: 'dsh-cron-icon-btn',
|
|
3335
3345
|
title: T_KEY(t, 'actions.tuneWithDsh'),
|
|
3336
3346
|
'aria-label': T_KEY(t, 'actions.tuneWithDsh'),
|
|
3337
3347
|
onClick: () => handleTuneWithDsh(task)
|
|
3338
|
-
},
|
|
3339
|
-
isConfigManaged(task) ? null :
|
|
3348
|
+
}, _h('span', svgProps(ICON_TUNE))),
|
|
3349
|
+
isConfigManaged(task) ? null : _h('button', {
|
|
3340
3350
|
type: 'button',
|
|
3341
3351
|
className: 'dsh-cron-icon-btn',
|
|
3342
3352
|
title: T_KEY(t, 'actions.duplicate'),
|
|
3343
3353
|
'aria-label': T_KEY(t, 'actions.duplicate'),
|
|
3344
3354
|
onClick: () => handleDuplicate(task)
|
|
3345
|
-
},
|
|
3346
|
-
isConfigManaged(task) ? null :
|
|
3355
|
+
}, _h('span', svgProps(ICON_COPY))),
|
|
3356
|
+
isConfigManaged(task) ? null : _h('button', {
|
|
3347
3357
|
type: 'button',
|
|
3348
3358
|
className: 'dsh-cron-icon-btn dsh-cron-danger',
|
|
3349
3359
|
title: T_KEY(t, 'actions.delete'),
|
|
3350
3360
|
'aria-label': T_KEY(t, 'actions.delete'),
|
|
3351
3361
|
onClick: () => handleDelete(task.id)
|
|
3352
|
-
},
|
|
3362
|
+
}, _h('span', svgProps(ICON_TRASH)))
|
|
3353
3363
|
)
|
|
3354
3364
|
)
|
|
3355
3365
|
)
|
|
3356
3366
|
),
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3367
|
+
_h('div', { className: 'dsh-cron-recs-title' }, T_KEY(t, 'recs.title')),
|
|
3368
|
+
_h('div', { className: 'dsh-cron-hint', style: { marginBottom: '8px' } }, T_KEY(t, 'recs.hint')),
|
|
3369
|
+
_h('div', { className: 'dsh-cron-recs-list' },
|
|
3360
3370
|
recs.map((rec) =>
|
|
3361
|
-
|
|
3371
|
+
_h('div', {
|
|
3362
3372
|
key: rec.id,
|
|
3363
3373
|
className: 'dsh-cron-rec-card',
|
|
3364
3374
|
role: 'button',
|
|
@@ -3371,36 +3381,36 @@ openManualModal(rec);
|
|
|
3371
3381
|
}
|
|
3372
3382
|
}
|
|
3373
3383
|
},
|
|
3374
|
-
|
|
3375
|
-
|
|
3384
|
+
_h('div', { className: 'dsh-cron-rec-icon' },
|
|
3385
|
+
_h('span', iconHtml(rec.icon === 'bell' ? ICON_BELL : rec.icon === 'clipboard' ? ICON_CLIPBOARD : ICON_ACTIVITY))
|
|
3376
3386
|
),
|
|
3377
|
-
|
|
3378
|
-
|
|
3387
|
+
_h('div', { className: 'dsh-cron-rec-content' },
|
|
3388
|
+
_h('div', { className: 'dsh-cron-rec-title' },
|
|
3379
3389
|
rec.title,
|
|
3380
|
-
|
|
3390
|
+
_h('span', { className: 'dsh-cron-rec-time' }, rec.scheduleText)
|
|
3381
3391
|
),
|
|
3382
|
-
|
|
3392
|
+
_h('div', { className: 'dsh-cron-rec-desc' }, rec.description)
|
|
3383
3393
|
)
|
|
3384
3394
|
)
|
|
3385
3395
|
)
|
|
3386
3396
|
)
|
|
3387
3397
|
),
|
|
3388
|
-
manualModalOpen &&
|
|
3398
|
+
manualModalOpen && _h('div', {
|
|
3389
3399
|
className: 'dsh-cron-modal-overlay',
|
|
3390
3400
|
onClick: (e) => {
|
|
3391
3401
|
if (e.target === e.currentTarget) closeManualModalWithConfirm();
|
|
3392
3402
|
}
|
|
3393
3403
|
},
|
|
3394
|
-
|
|
3404
|
+
_h('div', {
|
|
3395
3405
|
className: 'dsh-cron-modal dsh-cron-modal-scroll',
|
|
3396
3406
|
style: { maxWidth: '640px' },
|
|
3397
3407
|
role: 'dialog',
|
|
3398
3408
|
'aria-modal': 'true',
|
|
3399
3409
|
onClick: (e) => e.stopPropagation()
|
|
3400
3410
|
},
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
selectedTaskMeta &&
|
|
3411
|
+
_h('div', { className: 'dsh-cron-modal-head', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: formId ? '12px' : '18px' } },
|
|
3412
|
+
_h('div', { className: 'dsh-cron-modal-title', style: { margin: 0 } }, formId ? T_KEY(t, 'modal.editTitle') : T_KEY(t, 'modal.newTitle')),
|
|
3413
|
+
selectedTaskMeta && _h('span', {
|
|
3404
3414
|
style: {
|
|
3405
3415
|
fontSize: '12px',
|
|
3406
3416
|
padding: '3px 8px',
|
|
@@ -3410,65 +3420,65 @@ color: selectedTaskMeta.status === 'active' ? 'var(--dsh-cron-success)' : 'var(-
|
|
|
3410
3420
|
}
|
|
3411
3421
|
}, selectedTaskMeta.status === 'active' ? T_KEY(t, 'modal.statusActive') : T_KEY(t, 'modal.statusPaused'))
|
|
3412
3422
|
),
|
|
3413
|
-
formId &&
|
|
3414
|
-
|
|
3423
|
+
formId && _h('div', { className: 'dsh-cron-modal-nav' },
|
|
3424
|
+
_h('button', {
|
|
3415
3425
|
type: 'button',
|
|
3416
3426
|
className: 'dsh-cron-modal-tab',
|
|
3417
3427
|
'data-active': modalTab === 'params' ? 'true' : undefined,
|
|
3418
3428
|
onClick: () => setModalTab('params')
|
|
3419
3429
|
}, T_KEY(t, 'modal.params')),
|
|
3420
|
-
|
|
3430
|
+
_h('button', {
|
|
3421
3431
|
type: 'button',
|
|
3422
3432
|
className: 'dsh-cron-modal-tab',
|
|
3423
3433
|
'data-active': modalTab === 'history' ? 'true' : undefined,
|
|
3424
3434
|
onClick: () => { setModalTab('history'); if (formId) loadTaskHistory(formId); }
|
|
3425
3435
|
}, T_KEY(t, 'modal.history', { count: taskHistory.length || 0 }))
|
|
3426
3436
|
),
|
|
3427
|
-
modalTab === 'history' && formId ?
|
|
3428
|
-
historyLoading ?
|
|
3429
|
-
taskHistory.length === 0 ?
|
|
3430
|
-
|
|
3431
|
-
taskHistory.map((run) =>
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3437
|
+
modalTab === 'history' && formId ? _h('div', null,
|
|
3438
|
+
historyLoading ? _h('div', { className: 'dsh-cron-history-empty' }, T_KEY(t, 'history.loading')) :
|
|
3439
|
+
taskHistory.length === 0 ? _h('div', { className: 'dsh-cron-history-empty' }, T_KEY(t, 'history.empty')) :
|
|
3440
|
+
_h('div', { className: 'dsh-cron-history-list' },
|
|
3441
|
+
taskHistory.map((run) => _h('div', { key: run.id, className: 'dsh-cron-history-item' },
|
|
3442
|
+
_h('div', { className: 'dsh-cron-history-head' },
|
|
3443
|
+
_h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px' } },
|
|
3444
|
+
_h('span', {
|
|
3435
3445
|
className: 'dsh-cron-history-status',
|
|
3436
3446
|
'data-status': run.status
|
|
3437
3447
|
}, statusLabel(t, run.status)),
|
|
3438
|
-
|
|
3448
|
+
_h('span', { className: 'dsh-cron-history-time' }, run.at ? new Date(run.at).toLocaleString() : '')
|
|
3439
3449
|
),
|
|
3440
|
-
|
|
3441
|
-
run.costUsd > 0 &&
|
|
3442
|
-
run.usage && (run.usage.inputTokens > 0 || run.usage.outputTokens > 0) &&
|
|
3443
|
-
|
|
3450
|
+
_h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px' } },
|
|
3451
|
+
run.costUsd > 0 && _h('span', { className: 'dsh-cron-cost-tag' }, '$' + run.costUsd.toFixed(5)),
|
|
3452
|
+
run.usage && (run.usage.inputTokens > 0 || run.usage.outputTokens > 0) && _h('span', { className: 'dsh-cron-tokens-tag' }, (run.usage.inputTokens + run.usage.outputTokens) + ' tok'),
|
|
3453
|
+
_h('span', { style: { color: 'var(--dsw-alias-label-tertiary, #888)', fontSize: '11.5px' } }, (run.durationMs || 0) + ' ms')
|
|
3444
3454
|
)
|
|
3445
3455
|
),
|
|
3446
|
-
run.stoppedReason &&
|
|
3456
|
+
run.stoppedReason && _h('div', {
|
|
3447
3457
|
className: 'dsh-cron-hint',
|
|
3448
3458
|
style: { display: 'flex', gap: '6px', alignItems: 'center', marginTop: '6px' }
|
|
3449
3459
|
},
|
|
3450
|
-
|
|
3451
|
-
|
|
3460
|
+
_h('span', { className: 'dsh-cron-badge-ref' }, T_KEY(t, 'history.stoppedReasonTitle')),
|
|
3461
|
+
_h('span', null, run.stoppedReason)
|
|
3452
3462
|
),
|
|
3453
|
-
Array.isArray(run.stages) && run.stages.length > 0 &&
|
|
3463
|
+
Array.isArray(run.stages) && run.stages.length > 0 && _h('div', {
|
|
3454
3464
|
className: 'dsh-cron-stages-flow',
|
|
3455
3465
|
style: { display: 'flex', gap: '6px', flexWrap: 'wrap', marginTop: '6px' }
|
|
3456
3466
|
},
|
|
3457
|
-
run.stages.map((st) =>
|
|
3467
|
+
run.stages.map((st) => _h('span', {
|
|
3458
3468
|
key: st.name,
|
|
3459
3469
|
className: 'dsh-cron-stage-pill',
|
|
3460
3470
|
'data-status': st.status || 'unknown',
|
|
3461
3471
|
title: st.error ? (st.name + ': ' + st.error) : (st.name + (st.durationMs !== undefined ? ' (' + st.durationMs + 'ms)' : ''))
|
|
3462
3472
|
}, (T_KEY(t, 'history.stage_' + st.name) || st.name) + (st.durationMs !== undefined ? ' ' + st.durationMs + 'ms' : '')))
|
|
3463
3473
|
),
|
|
3464
|
-
run.delivery &&
|
|
3474
|
+
run.delivery && _h('div', {
|
|
3465
3475
|
style: { display: 'flex', alignItems: 'center', gap: '8px', marginTop: '6px' }
|
|
3466
3476
|
},
|
|
3467
|
-
|
|
3477
|
+
_h('span', {
|
|
3468
3478
|
className: 'dsh-cron-badge-ref',
|
|
3469
3479
|
'data-status': run.delivery.status
|
|
3470
3480
|
}, 'Delivery: ' + run.delivery.status),
|
|
3471
|
-
(run.delivery.status === 'failed' || run.delivery.status === 'partial') &&
|
|
3481
|
+
(run.delivery.status === 'failed' || run.delivery.status === 'partial') && _h('button', {
|
|
3472
3482
|
type: 'button',
|
|
3473
3483
|
className: 'dsh-cron-btn-secondary',
|
|
3474
3484
|
style: { padding: '2px 8px', fontSize: '11px' },
|
|
@@ -3476,11 +3486,11 @@ disabled: retryingDeliveryId === run.id,
|
|
|
3476
3486
|
onClick: () => handleRetryDelivery(formId, run.id)
|
|
3477
3487
|
}, retryingDeliveryId === run.id ? T_KEY(t, 'history.retryingDelivery') : T_KEY(t, 'history.retryDelivery'))
|
|
3478
3488
|
),
|
|
3479
|
-
run.artifacts && run.artifacts.length > 0 &&
|
|
3489
|
+
run.artifacts && run.artifacts.length > 0 && _h('div', {
|
|
3480
3490
|
style: { display: 'flex', flexWrap: 'wrap', gap: '6px', marginTop: '6px', alignItems: 'center' }
|
|
3481
3491
|
},
|
|
3482
|
-
|
|
3483
|
-
run.artifacts.map((art) =>
|
|
3492
|
+
_h('span', { className: 'dsh-cron-hint', style: { fontSize: '11px' } }, '📦 ' + T_KEY(t, 'history.artifacts') + ':'),
|
|
3493
|
+
run.artifacts.map((art) => _h('a', {
|
|
3484
3494
|
key: art.name || art.id,
|
|
3485
3495
|
href: '/dsh-cron/runs/' + encodeURIComponent(run.id) + '/artifacts/' + encodeURIComponent(art.name) + '/preview',
|
|
3486
3496
|
target: '_blank',
|
|
@@ -3490,20 +3500,20 @@ style: { padding: '2px 8px', fontSize: '11px', textDecoration: 'none' },
|
|
|
3490
3500
|
title: art.name + ' (' + Math.round((art.size || 0) / 1024 * 10) / 10 + ' KB)'
|
|
3491
3501
|
}, art.name))
|
|
3492
3502
|
),
|
|
3493
|
-
run.status === 'uncertain' &&
|
|
3503
|
+
run.status === 'uncertain' && _h('div', {
|
|
3494
3504
|
className: 'dsh-cron-status-banner',
|
|
3495
3505
|
'data-type': 'warning',
|
|
3496
3506
|
style: { marginTop: '8px', display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '8px' }
|
|
3497
3507
|
},
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3508
|
+
_h('span', null, '⚠️ ' + T_KEY(t, 'history.statusUncertainHint')),
|
|
3509
|
+
_h('div', { style: { display: 'flex', gap: '6px' } },
|
|
3510
|
+
_h('button', {
|
|
3501
3511
|
type: 'button',
|
|
3502
3512
|
className: 'dsh-cron-btn-secondary',
|
|
3503
3513
|
style: { padding: '2px 8px', fontSize: '11px' },
|
|
3504
3514
|
onClick: () => handleResolveUncertain(formId, run.id, 'completed')
|
|
3505
3515
|
}, '✓ ' + T_KEY(t, 'history.resolveCompleted')),
|
|
3506
|
-
|
|
3516
|
+
_h('button', {
|
|
3507
3517
|
type: 'button',
|
|
3508
3518
|
className: 'dsh-cron-btn-secondary',
|
|
3509
3519
|
style: { padding: '2px 8px', fontSize: '11px' },
|
|
@@ -3511,25 +3521,25 @@ onClick: () => handleResolveUncertain(formId, run.id, 'failed')
|
|
|
3511
3521
|
}, '✕ ' + T_KEY(t, 'history.resolveFailed'))
|
|
3512
3522
|
)
|
|
3513
3523
|
),
|
|
3514
|
-
(run.diagnosis || run.doctorReport) &&
|
|
3524
|
+
(run.diagnosis || run.doctorReport) && _h('div', {
|
|
3515
3525
|
className: 'dsh-cron-status-banner',
|
|
3516
3526
|
'data-type': 'info',
|
|
3517
3527
|
style: { marginTop: '8px', display: 'flex', flexDirection: 'column', gap: '6px' }
|
|
3518
3528
|
},
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
(run.autoHealed || run.doctorReport?.autoHealed) &&
|
|
3529
|
+
_h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } },
|
|
3530
|
+
_h('strong', null, '🩺 ' + T_KEY(t, run.doctorReport ? 'history.doctorDiagnosis' : 'history.diagnosis')),
|
|
3531
|
+
_h('div', { style: { display: 'flex', gap: '6px', alignItems: 'center' } },
|
|
3532
|
+
(run.autoHealed || run.doctorReport?.autoHealed) && _h('span', {
|
|
3523
3533
|
style: { fontSize: '10px', background: 'var(--dsh-cron-success-bg)', color: 'var(--dsh-cron-success)', padding: '1px 6px', borderRadius: '8px', fontWeight: '600' }
|
|
3524
3534
|
}, '✨ ' + T_KEY(t, 'history.autoHealed')),
|
|
3525
|
-
(run.doctorReport?.category || run.category) &&
|
|
3535
|
+
(run.doctorReport?.category || run.category) && _h('span', {
|
|
3526
3536
|
style: { fontSize: '10px', background: 'var(--dsw-alias-bg-layer-3)', padding: '1px 6px', borderRadius: '4px' }
|
|
3527
3537
|
}, run.doctorReport?.category || run.category),
|
|
3528
|
-
run.confidence ?
|
|
3538
|
+
run.confidence ? _h('span', { style: { fontSize: '10px', color: 'var(--dsw-alias-label-secondary)' } }, '(' + run.confidence + ')') : null
|
|
3529
3539
|
)
|
|
3530
3540
|
),
|
|
3531
|
-
|
|
3532
|
-
run.doctorReport?.diff &&
|
|
3541
|
+
_h('div', null, run.doctorReport?.cause || run.diagnosis),
|
|
3542
|
+
run.doctorReport?.diff && _h('div', {
|
|
3533
3543
|
style: {
|
|
3534
3544
|
background: 'var(--dsw-alias-bg-layer-2)',
|
|
3535
3545
|
border: '1px solid var(--dsw-alias-border-l2)',
|
|
@@ -3542,14 +3552,14 @@ overflowY: 'auto',
|
|
|
3542
3552
|
whiteSpace: 'pre'
|
|
3543
3553
|
}
|
|
3544
3554
|
}, run.doctorReport.diff),
|
|
3545
|
-
(run.doctorReport?.suggestedFix || run.suggestion) &&
|
|
3546
|
-
typeof handleApplyDoctorFix === 'function' &&
|
|
3555
|
+
(run.doctorReport?.suggestedFix || run.suggestion) && _h('div', { style: { display: 'flex', gap: '8px', marginTop: '4px' } },
|
|
3556
|
+
typeof handleApplyDoctorFix === 'function' && _h('button', {
|
|
3547
3557
|
type: 'button',
|
|
3548
3558
|
className: 'dsh-cron-btn-primary',
|
|
3549
3559
|
style: { padding: '3px 10px', fontSize: '12px' },
|
|
3550
3560
|
onClick: () => handleApplyDoctorFix(formId, run.doctorReport || { suggestedFix: run.suggestion })
|
|
3551
3561
|
}, '⚡ ' + T_KEY(t, 'history.doctorApply')),
|
|
3552
|
-
|
|
3562
|
+
_h('button', {
|
|
3553
3563
|
type: 'button',
|
|
3554
3564
|
className: 'dsh-cron-btn-secondary',
|
|
3555
3565
|
style: { padding: '3px 10px', fontSize: '12px' },
|
|
@@ -3557,29 +3567,29 @@ onClick: () => openEditModal(selectedTaskMeta, { prompt: run.suggestion })
|
|
|
3557
3567
|
}, T_KEY(t, 'history.applySuggestion'))
|
|
3558
3568
|
)
|
|
3559
3569
|
),
|
|
3560
|
-
run.subtaskRuns && Array.isArray(run.subtaskRuns) && run.subtaskRuns.length > 0 &&
|
|
3570
|
+
run.subtaskRuns && Array.isArray(run.subtaskRuns) && run.subtaskRuns.length > 0 && _h('div', {
|
|
3561
3571
|
style: { marginTop: '8px', padding: '8px', background: 'var(--dsw-alias-bg-layer-2)', borderRadius: '6px', fontSize: '12px' }
|
|
3562
3572
|
},
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
run.subtaskRuns.map((st, sidx) =>
|
|
3573
|
+
_h('div', { style: { fontWeight: '600', marginBottom: '4px' } }, '🐝 ' + T_KEY(t, 'history.swarmBadge') + ' (' + run.subtaskRuns.filter(r => r.status === 'success').length + '/' + run.subtaskRuns.length + ')'),
|
|
3574
|
+
_h('div', { style: { display: 'flex', flexDirection: 'column', gap: '4px' } },
|
|
3575
|
+
run.subtaskRuns.map((st, sidx) => _h('div', {
|
|
3566
3576
|
key: sidx,
|
|
3567
3577
|
style: { display: 'flex', justifyContent: 'space-between', padding: '2px 6px', background: 'var(--dsw-alias-bg-layer-3)', borderRadius: '4px' }
|
|
3568
3578
|
},
|
|
3569
|
-
|
|
3570
|
-
|
|
3579
|
+
_h('span', null, (st.status === 'success' ? '✅ ' : '❌ ') + st.title),
|
|
3580
|
+
_h('span', { style: { color: 'var(--dsw-alias-label-tertiary)', fontSize: '11px' } }, (st.durationMs || 0) + 'ms')
|
|
3571
3581
|
))
|
|
3572
3582
|
)
|
|
3573
3583
|
),
|
|
3574
|
-
run.gitDiff && run.gitDiff.hasChanges &&
|
|
3584
|
+
run.gitDiff && run.gitDiff.hasChanges && _h('div', {
|
|
3575
3585
|
className: 'dsh-cron-status-banner',
|
|
3576
3586
|
style: { marginTop: '8px', display: 'flex', flexDirection: 'column', gap: '6px' }
|
|
3577
3587
|
},
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3588
|
+
_h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } },
|
|
3589
|
+
_h('strong', null, '📝 ' + T_KEY(t, 'history.gitDiff')),
|
|
3590
|
+
_h('span', { style: { fontSize: '11px', color: 'var(--dsw-alias-label-secondary)' } }, run.gitDiff.stat || '')
|
|
3581
3591
|
),
|
|
3582
|
-
run.gitDiff.diff &&
|
|
3592
|
+
run.gitDiff.diff && _h('div', {
|
|
3583
3593
|
style: {
|
|
3584
3594
|
background: 'var(--dsw-alias-bg-layer-2)',
|
|
3585
3595
|
border: '1px solid var(--dsw-alias-border-l2)',
|
|
@@ -3592,8 +3602,8 @@ overflowY: 'auto',
|
|
|
3592
3602
|
whiteSpace: 'pre'
|
|
3593
3603
|
}
|
|
3594
3604
|
}, run.gitDiff.diff),
|
|
3595
|
-
|
|
3596
|
-
|
|
3605
|
+
_h('div', { style: { display: 'flex', gap: '8px', marginTop: '4px' } },
|
|
3606
|
+
_h('button', {
|
|
3597
3607
|
type: 'button',
|
|
3598
3608
|
className: 'dsh-cron-btn-secondary',
|
|
3599
3609
|
style: { padding: '2px 8px', fontSize: '12px' },
|
|
@@ -3613,7 +3623,7 @@ else alert(d.error || 'Failed to discard changes');
|
|
|
3613
3623
|
finally { if (tId) clearTimeout(tId); }
|
|
3614
3624
|
}
|
|
3615
3625
|
}, '🗑️ ' + T_KEY(t, 'history.discardDiff')),
|
|
3616
|
-
|
|
3626
|
+
_h('button', {
|
|
3617
3627
|
type: 'button',
|
|
3618
3628
|
className: 'dsh-cron-btn-primary',
|
|
3619
3629
|
style: { padding: '2px 8px', fontSize: '12px' },
|
|
@@ -3636,16 +3646,16 @@ finally { if (tId) clearTimeout(tId); }
|
|
|
3636
3646
|
}, '✅ ' + T_KEY(t, 'history.applyDiff'))
|
|
3637
3647
|
)
|
|
3638
3648
|
),
|
|
3639
|
-
run.silentSkip &&
|
|
3649
|
+
run.silentSkip && _h('div', {
|
|
3640
3650
|
className: 'dsh-cron-hint',
|
|
3641
3651
|
style: { display: 'flex', gap: '6px', alignItems: 'center' }
|
|
3642
3652
|
},
|
|
3643
|
-
|
|
3644
|
-
|
|
3653
|
+
_h('span', { className: 'dsh-cron-badge-ref' }, T_KEY(t, 'history.silentSkip')),
|
|
3654
|
+
_h('span', null, run.silentReason || '')
|
|
3645
3655
|
),
|
|
3646
|
-
run.output &&
|
|
3647
|
-
run.error &&
|
|
3648
|
-
run.sessionId &&
|
|
3656
|
+
run.output && _h('div', { className: 'dsh-cron-history-output' }, run.output),
|
|
3657
|
+
run.error && _h('div', { className: 'dsh-cron-history-output', style: { color: 'var(--dsh-cron-danger)', borderColor: 'var(--dsh-cron-danger-bg)' } }, run.error),
|
|
3658
|
+
run.sessionId && _h('button', {
|
|
3649
3659
|
type: 'button',
|
|
3650
3660
|
className: 'dsh-cron-btn-secondary',
|
|
3651
3661
|
style: { marginTop: '8px', fontSize: '12px', padding: '4px 10px' },
|
|
@@ -3653,23 +3663,23 @@ onClick: () => openSession(ctx, run.sessionId)
|
|
|
3653
3663
|
}, T_KEY(t, 'history.openSession'))
|
|
3654
3664
|
))
|
|
3655
3665
|
),
|
|
3656
|
-
|
|
3657
|
-
|
|
3666
|
+
_h('div', { className: 'dsh-cron-modal-foot', style: { marginTop: '18px' } },
|
|
3667
|
+
_h('button', {
|
|
3658
3668
|
type: 'button',
|
|
3659
3669
|
className: 'dsh-cron-btn-secondary',
|
|
3660
3670
|
onClick: () => { if (formId) loadTaskHistory(formId); }
|
|
3661
3671
|
}, T_KEY(t, 'history.refresh')),
|
|
3662
|
-
|
|
3672
|
+
_h('button', {
|
|
3663
3673
|
type: 'button',
|
|
3664
3674
|
className: 'dsh-cron-btn-primary',
|
|
3665
3675
|
onClick: closeManualModalWithConfirm
|
|
3666
3676
|
}, T_KEY(t, 'modal.close'))
|
|
3667
3677
|
)
|
|
3668
3678
|
) :
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3679
|
+
_h('form', { onSubmit: handleSaveManual },
|
|
3680
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3681
|
+
_h('label', null, T_KEY(t, 'form.nameLabel')),
|
|
3682
|
+
_h('input', {
|
|
3673
3683
|
required: true,
|
|
3674
3684
|
autoFocus: true,
|
|
3675
3685
|
value: formTitle,
|
|
@@ -3677,40 +3687,40 @@ placeholder: T_KEY(t, 'form.namePlaceholder'),
|
|
|
3677
3687
|
onChange: (e) => setFormTitle(e.target.value)
|
|
3678
3688
|
})
|
|
3679
3689
|
),
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3690
|
+
_h('div', { className: 'dsh-cron-form-row' },
|
|
3691
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3692
|
+
_h('label', null, T_KEY(t, 'form.typeLabel')),
|
|
3693
|
+
_h('select', {
|
|
3684
3694
|
value: formType,
|
|
3685
3695
|
onChange: (e) => setFormType(e.target.value)
|
|
3686
3696
|
},
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3697
|
+
_h('option', { value: 'llm' }, T_KEY(t, 'form.typeLlm')),
|
|
3698
|
+
_h('option', { value: 'script' }, T_KEY(t, 'form.typeScript')),
|
|
3699
|
+
_h('option', { value: 'node' }, T_KEY(t, 'form.typeNode')),
|
|
3700
|
+
_h('option', { value: 'python' }, T_KEY(t, 'form.typePython')),
|
|
3701
|
+
_h('option', { value: 'http' }, T_KEY(t, 'form.typeHttp')),
|
|
3702
|
+
_h('option', { value: 'ssh' }, T_KEY(t, 'form.typeSsh')),
|
|
3703
|
+
_h('option', { value: 'docker' }, T_KEY(t, 'form.typeDocker')),
|
|
3704
|
+
_h('option', { value: 'skill' }, T_KEY(t, 'form.typeSkill')),
|
|
3705
|
+
_h('option', { value: 'workflow' }, T_KEY(t, 'form.typeWorkflow'))
|
|
3696
3706
|
)
|
|
3697
3707
|
),
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3708
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3709
|
+
_h('label', null, T_KEY(t, 'form.scheduleLabel')),
|
|
3710
|
+
_h('input', {
|
|
3701
3711
|
required: true,
|
|
3702
3712
|
value: formSchedule,
|
|
3703
3713
|
placeholder: T_KEY(t, 'form.schedulePlaceholder'),
|
|
3704
3714
|
onChange: (e) => setFormSchedule(e.target.value)
|
|
3705
3715
|
}),
|
|
3706
|
-
|
|
3716
|
+
_h('div', { style: { display: 'flex', gap: '5px', flexWrap: 'wrap', marginTop: '5px' } },
|
|
3707
3717
|
[
|
|
3708
3718
|
{ label: '15m', expr: '*/15 * * * *' },
|
|
3709
3719
|
{ label: '1h', expr: '0 * * * *' },
|
|
3710
3720
|
{ label: 'Daily 09:00', expr: '0 9 * * *' },
|
|
3711
3721
|
{ label: 'Weekdays', expr: '0 9 * * 1-5' },
|
|
3712
3722
|
{ label: 'Weekly Mon', expr: '0 9 * * 1' },
|
|
3713
|
-
].map((p) =>
|
|
3723
|
+
].map((p) => _h('button', {
|
|
3714
3724
|
key: p.label,
|
|
3715
3725
|
type: 'button',
|
|
3716
3726
|
className: 'dsh-cron-btn-secondary',
|
|
@@ -3718,23 +3728,23 @@ style: { padding: '2px 7px', fontSize: '11px', borderRadius: '4px' },
|
|
|
3718
3728
|
onClick: () => { setFormSchedule(p.expr); handlePreviewSchedule(p.expr); }
|
|
3719
3729
|
}, p.label))
|
|
3720
3730
|
),
|
|
3721
|
-
|
|
3722
|
-
|
|
3731
|
+
_h('div', { style: { display: 'flex', gap: '8px', alignItems: 'center', marginTop: '6px' } },
|
|
3732
|
+
_h('button', {
|
|
3723
3733
|
type: 'button',
|
|
3724
3734
|
className: 'dsh-cron-btn-secondary',
|
|
3725
3735
|
style: { padding: '3px 8px', fontSize: '11.5px' },
|
|
3726
3736
|
onClick: () => handlePreviewSchedule(formSchedule)
|
|
3727
3737
|
}, T_KEY(t, 'form.previewSchedule')),
|
|
3728
|
-
schedulePreviewRuns && schedulePreviewRuns.length > 0 &&
|
|
3738
|
+
schedulePreviewRuns && schedulePreviewRuns.length > 0 && _h('div', { style: { fontSize: '11px', color: 'var(--dsw-alias-label-secondary, #999)' } },
|
|
3729
3739
|
T_KEY(t, 'form.previewScheduleTitle') + ' ' + schedulePreviewRuns.slice(0, 3).map(r => new Date(r).toLocaleTimeString()).join(', ')
|
|
3730
3740
|
)
|
|
3731
3741
|
)
|
|
3732
3742
|
)
|
|
3733
3743
|
),
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3744
|
+
_h('div', { className: 'dsh-cron-form-row' },
|
|
3745
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3746
|
+
_h('label', null, T_KEY(t, 'form.timeoutLabel')),
|
|
3747
|
+
_h('input', {
|
|
3738
3748
|
type: 'number',
|
|
3739
3749
|
min: 1,
|
|
3740
3750
|
value: formTimeoutSeconds,
|
|
@@ -3742,44 +3752,44 @@ placeholder: '1800',
|
|
|
3742
3752
|
onChange: (e) => setFormTimeoutSeconds(e.target.value)
|
|
3743
3753
|
})
|
|
3744
3754
|
),
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3755
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3756
|
+
_h('label', null, T_KEY(t, 'form.overlapLabel')),
|
|
3757
|
+
_h('select', {
|
|
3748
3758
|
value: formOverlapPolicy,
|
|
3749
3759
|
onChange: (e) => setFormOverlapPolicy(e.target.value)
|
|
3750
3760
|
},
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3761
|
+
_h('option', { value: 'skip' }, T_KEY(t, 'form.overlapSkip')),
|
|
3762
|
+
_h('option', { value: 'queue' }, T_KEY(t, 'form.overlapQueue')),
|
|
3763
|
+
_h('option', { value: 'replace' }, T_KEY(t, 'form.overlapReplace'))
|
|
3754
3764
|
)
|
|
3755
3765
|
)
|
|
3756
3766
|
),
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3767
|
+
_h('div', { className: 'dsh-cron-form-row' },
|
|
3768
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3769
|
+
_h('label', null, T_KEY(t, 'form.timezoneLabel')),
|
|
3770
|
+
_h('input', {
|
|
3761
3771
|
value: formTimezone,
|
|
3762
3772
|
placeholder: T_KEY(t, 'form.timezonePlaceholder'),
|
|
3763
3773
|
onChange: (e) => setFormTimezone(e.target.value)
|
|
3764
3774
|
})
|
|
3765
3775
|
),
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3776
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3777
|
+
_h('label', null, T_KEY(t, 'form.misfireLabel')),
|
|
3778
|
+
_h('select', {
|
|
3769
3779
|
value: formMisfirePolicy,
|
|
3770
3780
|
onChange: (e) => setFormMisfirePolicy(e.target.value)
|
|
3771
3781
|
},
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3782
|
+
_h('option', { value: 'skip' }, T_KEY(t, 'form.misfireSkip')),
|
|
3783
|
+
_h('option', { value: 'runOnce' }, T_KEY(t, 'form.misfireRunOnce')),
|
|
3784
|
+
_h('option', { value: 'catchUpAll' }, T_KEY(t, 'form.misfireCatchUp'))
|
|
3775
3785
|
)
|
|
3776
3786
|
)
|
|
3777
3787
|
),
|
|
3778
3788
|
AGENT_FORM_TYPES.includes(formType) ? (
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3789
|
+
_h('div', { className: 'dsh-cron-form-row' },
|
|
3790
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3791
|
+
_h('label', null, T_KEY(t, 'form.retriesLabel')),
|
|
3792
|
+
_h('input', {
|
|
3783
3793
|
type: 'number',
|
|
3784
3794
|
min: 0,
|
|
3785
3795
|
value: formMaxRetries,
|
|
@@ -3787,23 +3797,23 @@ placeholder: '0',
|
|
|
3787
3797
|
onChange: (e) => setFormMaxRetries(e.target.value)
|
|
3788
3798
|
})
|
|
3789
3799
|
),
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3800
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3801
|
+
_h('label', null, T_KEY(t, 'form.permissionLabel')),
|
|
3802
|
+
_h('select', {
|
|
3793
3803
|
value: formPermissionPreset,
|
|
3794
3804
|
onChange: (e) => setFormPermissionPreset(e.target.value)
|
|
3795
3805
|
},
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3806
|
+
_h('option', { value: 'default' }, T_KEY(t, 'form.permissionDefault')),
|
|
3807
|
+
_h('option', { value: 'read-only' }, T_KEY(t, 'form.permissionReadonly')),
|
|
3808
|
+
_h('option', { value: 'workspace-write' }, T_KEY(t, 'form.permissionWrite')),
|
|
3809
|
+
_h('option', { value: 'full' }, T_KEY(t, 'form.permissionFull'))
|
|
3800
3810
|
)
|
|
3801
3811
|
)
|
|
3802
3812
|
)
|
|
3803
3813
|
) : (
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3814
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3815
|
+
_h('label', null, T_KEY(t, 'form.retriesLabel')),
|
|
3816
|
+
_h('input', {
|
|
3807
3817
|
type: 'number',
|
|
3808
3818
|
min: 0,
|
|
3809
3819
|
value: formMaxRetries,
|
|
@@ -3812,114 +3822,124 @@ onChange: (e) => setFormMaxRetries(e.target.value)
|
|
|
3812
3822
|
})
|
|
3813
3823
|
)
|
|
3814
3824
|
),
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3825
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3826
|
+
_h('label', null, T_KEY(t, 'form.kanbanLabel')),
|
|
3827
|
+
_h('select', {
|
|
3818
3828
|
value: formKanbanMode,
|
|
3819
3829
|
onChange: (e) => setFormKanbanMode(e.target.value)
|
|
3820
3830
|
},
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3831
|
+
_h('option', { value: 'none' }, T_KEY(t, 'form.kanbanNone')),
|
|
3832
|
+
_h('option', { value: 'on_failure' }, T_KEY(t, 'form.kanbanOnFailure')),
|
|
3833
|
+
_h('option', { value: 'always' }, T_KEY(t, 'form.kanbanAlways'))
|
|
3824
3834
|
)
|
|
3825
3835
|
),
|
|
3826
|
-
AGENT_FORM_TYPES.includes(formType) &&
|
|
3827
|
-
|
|
3828
|
-
|
|
3836
|
+
AGENT_FORM_TYPES.includes(formType) && _h('div', { className: 'dsh-cron-form-group' },
|
|
3837
|
+
_h('label', null, T_KEY(t, 'form.agentPresetLabel')),
|
|
3838
|
+
_h('input', {
|
|
3829
3839
|
type: 'text',
|
|
3830
3840
|
value: formAgentPreset,
|
|
3831
3841
|
placeholder: T_KEY(t, 'form.agentPresetPlaceholder'),
|
|
3832
3842
|
onChange: (e) => setFormAgentPreset(e.target.value)
|
|
3833
3843
|
}),
|
|
3834
|
-
|
|
3844
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.agentPresetHint'))
|
|
3835
3845
|
),
|
|
3836
|
-
AGENT_FORM_TYPES.includes(formType) &&
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3846
|
+
AGENT_FORM_TYPES.includes(formType) && _h('div', { className: 'dsh-cron-form-group' },
|
|
3847
|
+
_h('label', null, T_KEY(t, 'form.sessionTitleLabel')),
|
|
3848
|
+
_h('input', {
|
|
3849
|
+
type: 'text',
|
|
3850
|
+
value: formSessionTitle,
|
|
3851
|
+
placeholder: T_KEY(t, 'form.sessionTitlePlaceholder'),
|
|
3852
|
+
onChange: (e) => setFormSessionTitle(e.target.value)
|
|
3853
|
+
}),
|
|
3854
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.sessionTitleHint'))
|
|
3855
|
+
),
|
|
3856
|
+
AGENT_FORM_TYPES.includes(formType) && _h('div', { className: 'dsh-cron-form-row' },
|
|
3857
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3858
|
+
_h('label', null, T_KEY(t, 'form.targetSessionIdLabel')),
|
|
3859
|
+
_h('input', {
|
|
3840
3860
|
type: 'text',
|
|
3841
3861
|
value: formTargetSessionId,
|
|
3842
3862
|
placeholder: T_KEY(t, 'form.targetSessionIdPlaceholder'),
|
|
3843
3863
|
onChange: (e) => setFormTargetSessionId(e.target.value)
|
|
3844
3864
|
}),
|
|
3845
|
-
|
|
3865
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.targetSessionIdHint'))
|
|
3846
3866
|
),
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3867
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3868
|
+
_h('label', null, T_KEY(t, 'form.targetSessionResetLabel')),
|
|
3869
|
+
_h('select', {
|
|
3850
3870
|
value: formTargetSessionReset,
|
|
3851
3871
|
onChange: (e) => setFormTargetSessionReset(e.target.value)
|
|
3852
3872
|
},
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3873
|
+
_h('option', { value: 'never' }, T_KEY(t, 'form.targetSessionResetNever')),
|
|
3874
|
+
_h('option', { value: 'daily' }, T_KEY(t, 'form.targetSessionResetDaily')),
|
|
3875
|
+
_h('option', { value: 'weekly' }, T_KEY(t, 'form.targetSessionResetWeekly'))
|
|
3856
3876
|
),
|
|
3857
|
-
|
|
3877
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.targetSessionResetHint'))
|
|
3858
3878
|
)
|
|
3859
3879
|
),
|
|
3860
|
-
AGENT_FORM_TYPES.includes(formType) &&
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3880
|
+
AGENT_FORM_TYPES.includes(formType) && _h('div', { className: 'dsh-cron-form-row' },
|
|
3881
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3882
|
+
_h('label', null, T_KEY(t, 'form.providerLabel')),
|
|
3883
|
+
_h('select', {
|
|
3864
3884
|
value: formProvider,
|
|
3865
3885
|
onChange: handleProviderChange
|
|
3866
3886
|
},
|
|
3867
|
-
|
|
3868
|
-
providers.map((p) =>
|
|
3887
|
+
_h('option', { value: '' }, T_KEY(t, 'form.providerDefault')),
|
|
3888
|
+
providers.map((p) => _h('option', { key: p.id, value: p.id }, p.name || p.id))
|
|
3869
3889
|
)
|
|
3870
3890
|
),
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3891
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3892
|
+
_h('label', null, T_KEY(t, 'form.modelLabel')),
|
|
3893
|
+
_h('select', {
|
|
3874
3894
|
value: formModel,
|
|
3875
3895
|
onChange: (e) => setFormModel(e.target.value)
|
|
3876
3896
|
},
|
|
3877
|
-
|
|
3878
|
-
models.map((m) =>
|
|
3897
|
+
_h('option', { value: '' }, T_KEY(t, 'form.modelDefault')),
|
|
3898
|
+
models.map((m) => _h('option', { key: m.id, value: m.id }, m.name || m.id))
|
|
3879
3899
|
)
|
|
3880
3900
|
),
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3901
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3902
|
+
_h('label', null, T_KEY(t, 'form.fallbackModelLabel')),
|
|
3903
|
+
_h('input', {
|
|
3884
3904
|
type: 'text',
|
|
3885
3905
|
value: formFallbackModel,
|
|
3886
3906
|
placeholder: T_KEY(t, 'form.fallbackModelPlaceholder'),
|
|
3887
3907
|
onChange: (e) => setFormFallbackModel(e.target.value)
|
|
3888
3908
|
}),
|
|
3889
|
-
|
|
3909
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.fallbackModelHint'))
|
|
3890
3910
|
),
|
|
3891
|
-
|
|
3892
|
-
|
|
3911
|
+
_h('label', { className: 'dsh-cron-checkbox-row', style: { marginTop: '4px' } },
|
|
3912
|
+
_h('input', {
|
|
3893
3913
|
type: 'checkbox',
|
|
3894
3914
|
checked: formInspectOnFailure,
|
|
3895
3915
|
onChange: (e) => setFormInspectOnFailure(e.target.checked)
|
|
3896
3916
|
}),
|
|
3897
|
-
|
|
3917
|
+
_h('span', null, T_KEY(t, 'form.inspectOnFailureLabel'))
|
|
3898
3918
|
),
|
|
3899
|
-
formInspectOnFailure &&
|
|
3900
|
-
|
|
3901
|
-
|
|
3919
|
+
formInspectOnFailure && _h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.inspectOnFailureHint')),
|
|
3920
|
+
_h('label', { className: 'dsh-cron-checkbox-row', style: { marginTop: '8px' } },
|
|
3921
|
+
_h('input', {
|
|
3902
3922
|
type: 'checkbox',
|
|
3903
3923
|
checked: formRequireApproval,
|
|
3904
3924
|
onChange: (e) => setFormRequireApproval(e.target.checked)
|
|
3905
3925
|
}),
|
|
3906
|
-
|
|
3926
|
+
_h('span', null, T_KEY(t, 'form.requireApprovalLabel'))
|
|
3907
3927
|
),
|
|
3908
|
-
formRequireApproval &&
|
|
3928
|
+
formRequireApproval && _h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.requireApprovalHint'))
|
|
3909
3929
|
),
|
|
3910
|
-
formType === 'http' &&
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3930
|
+
formType === 'http' && _h('div', { className: 'dsh-cron-form-row' },
|
|
3931
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3932
|
+
_h('label', null, T_KEY(t, 'form.httpMethodLabel')),
|
|
3933
|
+
_h('select', {
|
|
3914
3934
|
value: formHttpMethod,
|
|
3915
3935
|
onChange: (e) => setFormHttpMethod(e.target.value)
|
|
3916
3936
|
},
|
|
3917
|
-
['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD'].map((m) =>
|
|
3937
|
+
['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD'].map((m) => _h('option', { key: m, value: m }, m))
|
|
3918
3938
|
)
|
|
3919
3939
|
),
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3940
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3941
|
+
_h('label', null, T_KEY(t, 'form.httpUrlLabel')),
|
|
3942
|
+
_h('input', {
|
|
3923
3943
|
required: true,
|
|
3924
3944
|
value: formHttpUrl,
|
|
3925
3945
|
placeholder: 'https://example.test/webhook',
|
|
@@ -3927,41 +3947,41 @@ onChange: (e) => setFormHttpUrl(e.target.value)
|
|
|
3927
3947
|
})
|
|
3928
3948
|
)
|
|
3929
3949
|
),
|
|
3930
|
-
formType === 'http' &&
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3950
|
+
formType === 'http' && _h('div', { className: 'dsh-cron-form-row' },
|
|
3951
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3952
|
+
_h('label', null, T_KEY(t, 'form.httpHeadersLabel')),
|
|
3953
|
+
_h('input', {
|
|
3934
3954
|
value: formHttpHeaders,
|
|
3935
3955
|
placeholder: '{"Authorization":"Bearer ..."}',
|
|
3936
3956
|
onChange: (e) => setFormHttpHeaders(e.target.value)
|
|
3937
3957
|
})
|
|
3938
3958
|
),
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3959
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3960
|
+
_h('label', null, T_KEY(t, 'form.httpBodyLabel')),
|
|
3961
|
+
_h('input', {
|
|
3942
3962
|
value: formHttpBody,
|
|
3943
3963
|
onChange: (e) => setFormHttpBody(e.target.value)
|
|
3944
3964
|
})
|
|
3945
3965
|
)
|
|
3946
3966
|
),
|
|
3947
|
-
formType === 'ssh' &&
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3967
|
+
formType === 'ssh' && _h('div', { className: 'dsh-cron-form-row' },
|
|
3968
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3969
|
+
_h('label', null, T_KEY(t, 'form.sshProfileLabel')),
|
|
3970
|
+
_h('input', {
|
|
3951
3971
|
value: formSshProfileId,
|
|
3952
3972
|
placeholder: 'prod-web',
|
|
3953
3973
|
onChange: (e) => setFormSshProfileId(e.target.value)
|
|
3954
3974
|
}),
|
|
3955
|
-
|
|
3975
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.sshProfileHint'))
|
|
3956
3976
|
),
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3977
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
3978
|
+
_h('label', null, T_KEY(t, 'form.sshTargetLabel')),
|
|
3979
|
+
_h('input', {
|
|
3960
3980
|
value: formSshTarget,
|
|
3961
3981
|
placeholder: 'user@example.com',
|
|
3962
3982
|
onChange: (e) => setFormSshTarget(e.target.value)
|
|
3963
3983
|
}),
|
|
3964
|
-
|
|
3984
|
+
_h('input', {
|
|
3965
3985
|
style: { marginTop: '6px' },
|
|
3966
3986
|
value: formSshKeyPath,
|
|
3967
3987
|
placeholder: '~/.ssh/id_ed25519',
|
|
@@ -3969,107 +3989,107 @@ onChange: (e) => setFormSshKeyPath(e.target.value)
|
|
|
3969
3989
|
})
|
|
3970
3990
|
)
|
|
3971
3991
|
),
|
|
3972
|
-
formType === 'docker' &&
|
|
3973
|
-
|
|
3974
|
-
|
|
3992
|
+
formType === 'docker' && _h('div', { className: 'dsh-cron-form-group' },
|
|
3993
|
+
_h('label', null, T_KEY(t, 'form.dockerImageLabel')),
|
|
3994
|
+
_h('input', {
|
|
3975
3995
|
required: true,
|
|
3976
3996
|
value: formDockerImage,
|
|
3977
3997
|
placeholder: 'alpine:3.20',
|
|
3978
3998
|
onChange: (e) => setFormDockerImage(e.target.value)
|
|
3979
3999
|
})
|
|
3980
4000
|
),
|
|
3981
|
-
formType === 'skill' &&
|
|
3982
|
-
|
|
3983
|
-
|
|
4001
|
+
formType === 'skill' && _h('div', { className: 'dsh-cron-form-group' },
|
|
4002
|
+
_h('label', null, T_KEY(t, 'form.skillNameLabel')),
|
|
4003
|
+
_h('input', {
|
|
3984
4004
|
value: formSkillName,
|
|
3985
4005
|
placeholder: 'gitea',
|
|
3986
4006
|
onChange: (e) => setFormSkillName(e.target.value)
|
|
3987
4007
|
})
|
|
3988
4008
|
),
|
|
3989
|
-
formType === 'workflow' &&
|
|
3990
|
-
|
|
3991
|
-
|
|
4009
|
+
formType === 'workflow' && _h('div', { className: 'dsh-cron-form-group' },
|
|
4010
|
+
_h('label', null, T_KEY(t, 'form.workflowNameLabel')),
|
|
4011
|
+
_h('input', {
|
|
3992
4012
|
value: formWorkflowName,
|
|
3993
4013
|
placeholder: 'nightly-release',
|
|
3994
4014
|
onChange: (e) => setFormWorkflowName(e.target.value)
|
|
3995
4015
|
})
|
|
3996
4016
|
),
|
|
3997
|
-
(formType === 'node' || formType === 'python') &&
|
|
3998
|
-
|
|
3999
|
-
|
|
4017
|
+
(formType === 'node' || formType === 'python') && _h('div', { className: 'dsh-cron-form-group' },
|
|
4018
|
+
_h('label', null, formType === 'node' ? 'Node.js binary (optional)' : 'Python interpreter (optional)'),
|
|
4019
|
+
_h('input', {
|
|
4000
4020
|
value: formType === 'node' ? formNodePath : formPythonPath,
|
|
4001
4021
|
placeholder: formType === 'node' ? 'auto' : '.venv/bin/python',
|
|
4002
4022
|
onChange: (e) => (formType === 'node' ? setFormNodePath(e.target.value) : setFormPythonPath(e.target.value))
|
|
4003
4023
|
})
|
|
4004
4024
|
),
|
|
4005
|
-
!AGENT_FORM_TYPES.includes(formType) &&
|
|
4006
|
-
|
|
4007
|
-
|
|
4025
|
+
!AGENT_FORM_TYPES.includes(formType) && _h('div', { className: 'dsh-cron-form-group' },
|
|
4026
|
+
_h('label', null, T_KEY(t, 'form.envLabel')),
|
|
4027
|
+
_h('textarea', {
|
|
4008
4028
|
rows: 3,
|
|
4009
4029
|
style: { fontFamily: 'monospace', fontSize: '12.5px' },
|
|
4010
4030
|
value: formEnv,
|
|
4011
4031
|
placeholder: T_KEY(t, 'form.envPlaceholder'),
|
|
4012
4032
|
onChange: (e) => setFormEnv(e.target.value)
|
|
4013
4033
|
}),
|
|
4014
|
-
|
|
4034
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.envHint'))
|
|
4015
4035
|
),
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4036
|
+
_h('div', { className: 'dsh-cron-form-row' },
|
|
4037
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4038
|
+
_h('label', null, T_KEY(t, 'form.cwdLabel')),
|
|
4039
|
+
_h('input', {
|
|
4020
4040
|
value: formCwd,
|
|
4021
4041
|
placeholder: '/srv/app',
|
|
4022
4042
|
onChange: (e) => setFormCwd(e.target.value)
|
|
4023
4043
|
})
|
|
4024
4044
|
),
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4045
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4046
|
+
_h('label', null, T_KEY(t, 'form.workspaceLabel')),
|
|
4047
|
+
_h('input', {
|
|
4028
4048
|
value: formWorkspaceId,
|
|
4029
4049
|
onChange: (e) => setFormWorkspaceId(e.target.value)
|
|
4030
4050
|
})
|
|
4031
4051
|
)
|
|
4032
4052
|
),
|
|
4033
|
-
AGENT_FORM_TYPES.includes(formType) &&
|
|
4034
|
-
|
|
4035
|
-
|
|
4053
|
+
AGENT_FORM_TYPES.includes(formType) && _h('div', { className: 'dsh-cron-form-group' },
|
|
4054
|
+
_h('label', { className: 'dsh-cron-checkbox-row' },
|
|
4055
|
+
_h('input', {
|
|
4036
4056
|
type: 'checkbox',
|
|
4037
4057
|
checked: formWorktree,
|
|
4038
4058
|
onChange: (e) => setFormWorktree(e.target.checked)
|
|
4039
4059
|
}),
|
|
4040
|
-
|
|
4060
|
+
_h('span', null, T_KEY(t, 'form.worktreeLabel'))
|
|
4041
4061
|
),
|
|
4042
|
-
formWorktree &&
|
|
4043
|
-
|
|
4062
|
+
formWorktree && _h('label', { className: 'dsh-cron-checkbox-row', style: { marginLeft: '24px', marginTop: '6px' } },
|
|
4063
|
+
_h('input', {
|
|
4044
4064
|
type: 'checkbox',
|
|
4045
4065
|
checked: formKeepWorktree,
|
|
4046
4066
|
onChange: (e) => setFormKeepWorktree(e.target.checked)
|
|
4047
4067
|
}),
|
|
4048
|
-
|
|
4068
|
+
_h('span', null, T_KEY(t, 'form.keepWorktreeLabel'))
|
|
4049
4069
|
)
|
|
4050
4070
|
),
|
|
4051
|
-
formType !== 'http' &&
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
(selectedTaskMeta && selectedTaskMeta.promptHistory && selectedTaskMeta.promptHistory.length > 0) ?
|
|
4055
|
-
|
|
4071
|
+
formType !== 'http' && _h('div', { className: 'dsh-cron-form-group' },
|
|
4072
|
+
_h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '4px' } },
|
|
4073
|
+
_h('label', { style: { margin: 0 } }, AGENT_FORM_TYPES.includes(formType) ? T_KEY(t, 'form.promptLabelLlm') : T_KEY(t, 'form.promptLabelScript')),
|
|
4074
|
+
(selectedTaskMeta && selectedTaskMeta.promptHistory && selectedTaskMeta.promptHistory.length > 0) ? _h('div', { style: { display: 'flex', gap: '6px', alignItems: 'center' } },
|
|
4075
|
+
_h('span', {
|
|
4056
4076
|
style: { fontSize: '11px', padding: '1px 6px', borderRadius: '4px', background: 'var(--dsw-alias-bg-layer-3, #222)', color: 'var(--dsh-cron-info, #4af)', border: '1px solid var(--dsw-alias-border-l2, #333)' }
|
|
4057
4077
|
}, 'v' + (selectedTaskMeta.promptVersion || 1) + ' (' + (selectedTaskMeta.promptHistory[selectedTaskMeta.promptHistory.length - 1]?.successRate !== undefined ? Math.round(selectedTaskMeta.promptHistory[selectedTaskMeta.promptHistory.length - 1].successRate * 100) : 100) + '% SR)'),
|
|
4058
|
-
|
|
4078
|
+
_h('select', {
|
|
4059
4079
|
style: { fontSize: '11px', padding: '1px 4px', background: 'var(--dsw-alias-bg-base, #111)', color: 'var(--dsw-alias-label-primary, #ddd)', border: '1px solid var(--dsw-alias-border-l2, #333)', borderRadius: '4px' },
|
|
4060
4080
|
onChange: (e) => {
|
|
4061
4081
|
const targetV = Number(e.target.value);
|
|
4062
|
-
const entry = selectedTaskMeta.promptHistory.find((
|
|
4082
|
+
const entry = selectedTaskMeta.promptHistory.find((rev) => rev.version === targetV);
|
|
4063
4083
|
if (entry && entry.prompt) {
|
|
4064
4084
|
setFormPrompt(entry.prompt);
|
|
4065
4085
|
}
|
|
4066
4086
|
}
|
|
4067
4087
|
},
|
|
4068
|
-
selectedTaskMeta.promptHistory.map((
|
|
4088
|
+
selectedTaskMeta.promptHistory.map((rev) => _h('option', { key: rev.version, value: rev.version }, 'v' + rev.version + ' (' + Math.round((rev.successRate || 1) * 100) + '%)'))
|
|
4069
4089
|
)
|
|
4070
4090
|
) : null
|
|
4071
4091
|
),
|
|
4072
|
-
|
|
4092
|
+
_h('textarea', {
|
|
4073
4093
|
required: true,
|
|
4074
4094
|
rows: 9,
|
|
4075
4095
|
style: { fontFamily: 'monospace', fontSize: '12.5px', lineHeight: '1.45' },
|
|
@@ -4088,7 +4108,7 @@ placeholder: AGENT_FORM_TYPES.includes(formType)
|
|
|
4088
4108
|
onChange: (e) => setFormPrompt(e.target.value)
|
|
4089
4109
|
})
|
|
4090
4110
|
),
|
|
4091
|
-
|
|
4111
|
+
_h('div', {
|
|
4092
4112
|
style: {
|
|
4093
4113
|
background: 'var(--dsw-alias-bg-layer-3, color-mix(in srgb, var(--dsw-alias-label-primary) 2%, transparent))',
|
|
4094
4114
|
border: '1px solid var(--dsw-alias-border-l2)',
|
|
@@ -4097,31 +4117,31 @@ padding: '12px 14px',
|
|
|
4097
4117
|
marginBottom: '16px'
|
|
4098
4118
|
}
|
|
4099
4119
|
},
|
|
4100
|
-
|
|
4101
|
-
|
|
4120
|
+
_h('div', { style: { fontWeight: 500, fontSize: '13px', color: 'var(--dsw-alias-label-primary, #eee)', marginBottom: '8px', display: 'flex', alignItems: 'center', gap: '6px' } },
|
|
4121
|
+
_h('span', { style: { display: 'flex', alignItems: 'center', color: 'var(--dsh-cron-info)' }, ...iconHtml(ICON_TELEGRAM) }),
|
|
4102
4122
|
T_KEY(t, 'form.notifyTitle')
|
|
4103
4123
|
),
|
|
4104
|
-
|
|
4105
|
-
|
|
4124
|
+
_h('label', { className: 'dsh-cron-checkbox-row', style: { marginBottom: formNotifyTelegram ? '8px' : '0' } },
|
|
4125
|
+
_h('input', {
|
|
4106
4126
|
type: 'checkbox',
|
|
4107
4127
|
checked: formNotifyTelegram,
|
|
4108
4128
|
onChange: (e) => setFormNotifyTelegram(e.target.checked)
|
|
4109
4129
|
}),
|
|
4110
|
-
|
|
4130
|
+
_h('span', null, T_KEY(t, 'form.notifyTelegram'))
|
|
4111
4131
|
),
|
|
4112
|
-
(formNotifyTelegram || formChannels.length > 0) &&
|
|
4113
|
-
|
|
4132
|
+
(formNotifyTelegram || formChannels.length > 0) && _h('label', { className: 'dsh-cron-checkbox-row', style: { marginLeft: '24px', marginTop: '6px' } },
|
|
4133
|
+
_h('input', {
|
|
4114
4134
|
type: 'checkbox',
|
|
4115
4135
|
checked: formOnlyOnFailure,
|
|
4116
4136
|
onChange: (e) => setFormOnlyOnFailure(e.target.checked)
|
|
4117
4137
|
}),
|
|
4118
|
-
|
|
4138
|
+
_h('span', null, T_KEY(t, 'form.notifyOnlyFailure'))
|
|
4119
4139
|
),
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
...DELIVERY_CHANNELS.map((id) =>
|
|
4124
|
-
|
|
4140
|
+
_h('div', { style: { marginTop: '12px', paddingTop: '10px', borderTop: '1px solid var(--dsw-alias-border-l2)' } },
|
|
4141
|
+
_h('div', { style: { fontWeight: 500, fontSize: '12.5px', color: 'var(--dsw-alias-label-secondary, #aaa)', marginBottom: '8px' } }, T_KEY(t, 'form.channelsTitle')),
|
|
4142
|
+
_h('div', { className: 'dsh-cron-channel-grid' },
|
|
4143
|
+
...DELIVERY_CHANNELS.map((id) => _h('label', { key: id, className: 'dsh-cron-checkbox-row' },
|
|
4144
|
+
_h('input', {
|
|
4125
4145
|
type: 'checkbox',
|
|
4126
4146
|
checked: formChannels.indexOf(id) >= 0,
|
|
4127
4147
|
onChange: (e) => {
|
|
@@ -4132,56 +4152,56 @@ return DELIVERY_CHANNELS.filter((c) => set.has(c));
|
|
|
4132
4152
|
});
|
|
4133
4153
|
}
|
|
4134
4154
|
}),
|
|
4135
|
-
|
|
4155
|
+
_h('span', null, T_KEY(t, CHANNEL_LABEL_KEYS[id]))
|
|
4136
4156
|
))
|
|
4137
4157
|
),
|
|
4138
|
-
|
|
4158
|
+
_h('div', { className: 'dsh-cron-hint', style: { marginTop: '6px' } }, T_KEY(t, 'form.channelsHint'))
|
|
4139
4159
|
),
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4160
|
+
_h('div', { className: 'dsh-cron-form-group', style: { marginTop: '12px', marginBottom: 0 } },
|
|
4161
|
+
_h('label', null, T_KEY(t, 'form.templateLabel')),
|
|
4162
|
+
_h('input', {
|
|
4143
4163
|
type: 'text',
|
|
4144
4164
|
value: formTemplate,
|
|
4145
4165
|
placeholder: T_KEY(t, 'form.templatePlaceholder'),
|
|
4146
4166
|
onChange: (e) => setFormTemplate(e.target.value)
|
|
4147
4167
|
}),
|
|
4148
|
-
|
|
4168
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.templateHint'))
|
|
4149
4169
|
),
|
|
4150
|
-
!AGENT_FORM_TYPES.includes(formType) &&
|
|
4151
|
-
|
|
4152
|
-
|
|
4170
|
+
!AGENT_FORM_TYPES.includes(formType) && _h('div', { className: 'dsh-cron-form-group', style: { marginTop: '12px', marginBottom: 0 } },
|
|
4171
|
+
_h('label', null, T_KEY(t, 'form.silentRuleLabel')),
|
|
4172
|
+
_h('input', {
|
|
4153
4173
|
type: 'text',
|
|
4154
4174
|
value: formSilentRule,
|
|
4155
4175
|
placeholder: T_KEY(t, 'form.silentRulePlaceholder'),
|
|
4156
4176
|
onChange: (e) => setFormSilentRule(e.target.value)
|
|
4157
4177
|
}),
|
|
4158
|
-
|
|
4178
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.silentRuleHint'))
|
|
4159
4179
|
)
|
|
4160
4180
|
),
|
|
4161
|
-
|
|
4181
|
+
_h('div', {
|
|
4162
4182
|
style: {
|
|
4163
4183
|
marginTop: '16px',
|
|
4164
4184
|
paddingTop: '14px',
|
|
4165
4185
|
borderTop: '1px solid var(--dsw-alias-border-l2)'
|
|
4166
4186
|
}
|
|
4167
4187
|
},
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4188
|
+
_h('div', { style: { fontWeight: '600', fontSize: '13px', marginBottom: '10px' } }, T_KEY(t, 'form.reliabilityTitle')),
|
|
4189
|
+
_h('div', { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '10px' } },
|
|
4190
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4191
|
+
_h('label', null, T_KEY(t, 'form.preflightLabel')),
|
|
4192
|
+
_h('select', {
|
|
4173
4193
|
value: formPreflightType,
|
|
4174
4194
|
onChange: (e) => setFormPreflightType(e.target.value)
|
|
4175
4195
|
},
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4196
|
+
_h('option', { value: 'none' }, T_KEY(t, 'form.preflightNone')),
|
|
4197
|
+
_h('option', { value: 'http' }, T_KEY(t, 'form.preflightHttp')),
|
|
4198
|
+
_h('option', { value: 'shell' }, T_KEY(t, 'form.preflightShell')),
|
|
4199
|
+
_h('option', { value: 'disk' }, T_KEY(t, 'form.preflightDisk'))
|
|
4180
4200
|
)
|
|
4181
4201
|
),
|
|
4182
|
-
formPreflightType !== 'none' &&
|
|
4183
|
-
|
|
4184
|
-
|
|
4202
|
+
formPreflightType !== 'none' && _h('div', { className: 'dsh-cron-form-group' },
|
|
4203
|
+
_h('label', null, T_KEY(t, 'form.preflightTargetLabel')),
|
|
4204
|
+
_h('input', {
|
|
4185
4205
|
type: 'text',
|
|
4186
4206
|
value: formPreflightTarget,
|
|
4187
4207
|
placeholder: T_KEY(t, 'form.preflightTargetPlaceholder'),
|
|
@@ -4189,19 +4209,19 @@ onChange: (e) => setFormPreflightTarget(e.target.value)
|
|
|
4189
4209
|
})
|
|
4190
4210
|
)
|
|
4191
4211
|
),
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4212
|
+
_h('div', { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '10px' } },
|
|
4213
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4214
|
+
_h('label', null, T_KEY(t, 'form.heartbeatIntervalLabel')),
|
|
4215
|
+
_h('input', {
|
|
4196
4216
|
type: 'number',
|
|
4197
4217
|
value: formHeartbeatIntervalSeconds,
|
|
4198
4218
|
min: 0,
|
|
4199
4219
|
onChange: (e) => setFormHeartbeatIntervalSeconds(Number(e.target.value))
|
|
4200
4220
|
})
|
|
4201
4221
|
),
|
|
4202
|
-
formHeartbeatIntervalSeconds > 0 &&
|
|
4203
|
-
|
|
4204
|
-
|
|
4222
|
+
formHeartbeatIntervalSeconds > 0 && _h('div', { className: 'dsh-cron-form-group' },
|
|
4223
|
+
_h('label', null, T_KEY(t, 'form.gracePeriodLabel')),
|
|
4224
|
+
_h('input', {
|
|
4205
4225
|
type: 'number',
|
|
4206
4226
|
value: formGracePeriodSeconds,
|
|
4207
4227
|
min: 1,
|
|
@@ -4209,10 +4229,10 @@ onChange: (e) => setFormGracePeriodSeconds(Number(e.target.value))
|
|
|
4209
4229
|
})
|
|
4210
4230
|
)
|
|
4211
4231
|
),
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4232
|
+
_h('div', { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '10px' } },
|
|
4233
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4234
|
+
_h('label', null, T_KEY(t, 'form.priorityLabel')),
|
|
4235
|
+
_h('input', {
|
|
4216
4236
|
type: 'number',
|
|
4217
4237
|
value: formPriority,
|
|
4218
4238
|
min: 1,
|
|
@@ -4220,138 +4240,138 @@ max: 10,
|
|
|
4220
4240
|
onChange: (e) => setFormPriority(Number(e.target.value))
|
|
4221
4241
|
})
|
|
4222
4242
|
),
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4243
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4244
|
+
_h('label', null, T_KEY(t, 'form.concurrencyGroupLabel')),
|
|
4245
|
+
_h('input', {
|
|
4226
4246
|
type: 'text',
|
|
4227
4247
|
value: formConcurrencyGroup,
|
|
4228
4248
|
onChange: (e) => setFormConcurrencyGroup(e.target.value)
|
|
4229
4249
|
})
|
|
4230
4250
|
)
|
|
4231
4251
|
),
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4252
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4253
|
+
_h('label', null, T_KEY(t, 'form.selfHealingLabel')),
|
|
4254
|
+
_h('input', {
|
|
4235
4255
|
type: 'text',
|
|
4236
4256
|
value: formSelfHealingCommand,
|
|
4237
4257
|
placeholder: T_KEY(t, 'form.selfHealingPlaceholder'),
|
|
4238
4258
|
onChange: (e) => setFormSelfHealingCommand(e.target.value)
|
|
4239
4259
|
})
|
|
4240
4260
|
),
|
|
4241
|
-
|
|
4242
|
-
|
|
4261
|
+
_h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', marginTop: '6px' } },
|
|
4262
|
+
_h('input', {
|
|
4243
4263
|
type: 'checkbox',
|
|
4244
4264
|
id: 'formAutoDiagnoseCheckbox',
|
|
4245
4265
|
checked: formAutoDiagnose,
|
|
4246
4266
|
onChange: (e) => setFormAutoDiagnose(e.target.checked)
|
|
4247
4267
|
}),
|
|
4248
|
-
|
|
4268
|
+
_h('label', { htmlFor: 'formAutoDiagnoseCheckbox', style: { margin: 0, fontSize: '12.5px', cursor: 'pointer' } }, T_KEY(t, 'form.autoDiagnoseLabel'))
|
|
4249
4269
|
)
|
|
4250
4270
|
),
|
|
4251
|
-
|
|
4271
|
+
_h('div', {
|
|
4252
4272
|
style: {
|
|
4253
4273
|
marginTop: '16px',
|
|
4254
4274
|
paddingTop: '14px',
|
|
4255
4275
|
borderTop: '1px solid var(--dsw-alias-border-l2)'
|
|
4256
4276
|
}
|
|
4257
4277
|
},
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4278
|
+
_h('div', { style: { fontWeight: '600', fontSize: '13px', marginBottom: '10px' } }, '⛓️ ' + T_KEY(t, 'form.chainingTitle')),
|
|
4279
|
+
_h('div', { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '10px' } },
|
|
4280
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4281
|
+
_h('label', null, T_KEY(t, 'form.onSuccessLabel')),
|
|
4282
|
+
_h('input', {
|
|
4263
4283
|
type: 'text',
|
|
4264
4284
|
value: formOnSuccess,
|
|
4265
4285
|
placeholder: 'task-build, task-test',
|
|
4266
4286
|
onChange: (e) => setFormOnSuccess(e.target.value)
|
|
4267
4287
|
}),
|
|
4268
|
-
|
|
4288
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.onSuccessHint'))
|
|
4269
4289
|
),
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4290
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4291
|
+
_h('label', null, T_KEY(t, 'form.onFailureLabel')),
|
|
4292
|
+
_h('input', {
|
|
4273
4293
|
type: 'text',
|
|
4274
4294
|
value: formOnFailure,
|
|
4275
4295
|
placeholder: 'task-alert',
|
|
4276
4296
|
onChange: (e) => setFormOnFailure(e.target.value)
|
|
4277
4297
|
}),
|
|
4278
|
-
|
|
4298
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.onFailureHint'))
|
|
4279
4299
|
)
|
|
4280
4300
|
),
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4301
|
+
_h('div', { style: { display: 'grid', gridTemplateColumns: '2fr 1fr', gap: '10px', marginTop: '8px' } },
|
|
4302
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4303
|
+
_h('label', null, T_KEY(t, 'form.dependsOnLabel')),
|
|
4304
|
+
_h('input', {
|
|
4285
4305
|
type: 'text',
|
|
4286
4306
|
value: formDependsOn,
|
|
4287
4307
|
placeholder: 'task-build, task-lint',
|
|
4288
4308
|
onChange: (e) => setFormDependsOn(e.target.value)
|
|
4289
4309
|
}),
|
|
4290
|
-
|
|
4310
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.dependsOnHint'))
|
|
4291
4311
|
),
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4312
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4313
|
+
_h('label', null, T_KEY(t, 'form.joinPolicyLabel')),
|
|
4314
|
+
_h('select', {
|
|
4295
4315
|
value: formJoinPolicy,
|
|
4296
4316
|
onChange: (e) => setFormJoinPolicy(e.target.value)
|
|
4297
4317
|
},
|
|
4298
|
-
|
|
4299
|
-
|
|
4318
|
+
_h('option', { value: 'all_success' }, T_KEY(t, 'form.joinPolicyAll')),
|
|
4319
|
+
_h('option', { value: 'any_success' }, T_KEY(t, 'form.joinPolicyAny'))
|
|
4300
4320
|
)
|
|
4301
4321
|
)
|
|
4302
4322
|
),
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4323
|
+
_h('div', { className: 'dsh-cron-form-group', style: { marginTop: '8px' } },
|
|
4324
|
+
_h('label', null, T_KEY(t, 'form.elseTaskLabel')),
|
|
4325
|
+
_h('input', {
|
|
4306
4326
|
type: 'text',
|
|
4307
4327
|
value: formElseTask || '',
|
|
4308
4328
|
placeholder: T_KEY(t, 'form.elseTaskPlaceholder'),
|
|
4309
4329
|
onChange: (e) => setFormElseTask(e.target.value)
|
|
4310
4330
|
}),
|
|
4311
|
-
|
|
4331
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.elseTaskHint'))
|
|
4312
4332
|
),
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4333
|
+
_h('div', { className: 'dsh-cron-form-group', style: { marginTop: '8px' } },
|
|
4334
|
+
_h('label', { style: { display: 'flex', alignItems: 'center', gap: '8px', cursor: 'pointer' } },
|
|
4335
|
+
_h('input', {
|
|
4316
4336
|
type: 'checkbox',
|
|
4317
4337
|
checked: Boolean(formAutoHeal),
|
|
4318
4338
|
onChange: (e) => setFormAutoHeal(e.target.checked)
|
|
4319
4339
|
}),
|
|
4320
|
-
|
|
4340
|
+
_h('span', { style: { fontWeight: '600' } }, '🩺 ' + T_KEY(t, 'form.autoHealLabel'))
|
|
4321
4341
|
),
|
|
4322
|
-
|
|
4342
|
+
_h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.autoHealHint'))
|
|
4323
4343
|
),
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4344
|
+
_h('div', { style: { marginTop: '12px', padding: '10px', background: 'var(--dsw-alias-bg-layer-2)', borderRadius: '6px' } },
|
|
4345
|
+
_h('label', { style: { display: 'flex', alignItems: 'center', gap: '8px', cursor: 'pointer', fontWeight: '500' } },
|
|
4346
|
+
_h('input', {
|
|
4327
4347
|
type: 'checkbox',
|
|
4328
4348
|
checked: formAdaptiveEnabled,
|
|
4329
4349
|
onChange: (e) => setFormAdaptiveEnabled(e.target.checked)
|
|
4330
4350
|
}),
|
|
4331
4351
|
T_KEY(t, 'form.adaptiveEnabled')
|
|
4332
4352
|
),
|
|
4333
|
-
|
|
4334
|
-
formAdaptiveEnabled &&
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4353
|
+
_h('div', { className: 'dsh-cron-hint', style: { marginLeft: '24px' } }, T_KEY(t, 'form.adaptiveHint')),
|
|
4354
|
+
formAdaptiveEnabled && _h('div', { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr 1fr', gap: '8px', marginTop: '8px', marginLeft: '24px' } },
|
|
4355
|
+
_h('div', null,
|
|
4356
|
+
_h('label', { style: { fontSize: '11px' } }, 'Min'),
|
|
4357
|
+
_h('input', { type: 'text', value: formAdaptiveMinInterval, placeholder: '5m', onChange: (e) => setFormAdaptiveMinInterval(e.target.value) })
|
|
4338
4358
|
),
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4359
|
+
_h('div', null,
|
|
4360
|
+
_h('label', { style: { fontSize: '11px' } }, 'Max'),
|
|
4361
|
+
_h('input', { type: 'text', value: formAdaptiveMaxInterval, placeholder: '2h', onChange: (e) => setFormAdaptiveMaxInterval(e.target.value) })
|
|
4342
4362
|
),
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4363
|
+
_h('div', null,
|
|
4364
|
+
_h('label', { style: { fontSize: '11px' } }, 'Factor'),
|
|
4365
|
+
_h('input', { type: 'number', step: '0.1', value: formAdaptiveBackoffFactor, placeholder: '1.5', onChange: (e) => setFormAdaptiveBackoffFactor(e.target.value) })
|
|
4346
4366
|
),
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4367
|
+
_h('div', null,
|
|
4368
|
+
_h('label', { style: { fontSize: '11px' } }, 'Idle Runs'),
|
|
4369
|
+
_h('input', { type: 'number', value: formAdaptiveIdleThreshold, placeholder: '3', onChange: (e) => setFormAdaptiveIdleThreshold(e.target.value) })
|
|
4350
4370
|
)
|
|
4351
4371
|
)
|
|
4352
4372
|
)
|
|
4353
4373
|
),
|
|
4354
|
-
selectedTaskMeta &&
|
|
4374
|
+
selectedTaskMeta && _h('div', {
|
|
4355
4375
|
style: {
|
|
4356
4376
|
background: 'var(--dsw-alias-bg-layer-3, color-mix(in srgb, var(--dsw-alias-label-primary) 3%, transparent))',
|
|
4357
4377
|
border: '1px solid var(--dsw-alias-border-l2)',
|
|
@@ -4365,11 +4385,11 @@ justifyContent: 'space-between',
|
|
|
4365
4385
|
alignItems: 'center'
|
|
4366
4386
|
}
|
|
4367
4387
|
},
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4388
|
+
_h('div', null,
|
|
4389
|
+
_h('span', null, T_KEY(t, 'form.nextRunLabel')),
|
|
4390
|
+
_h('strong', { style: { color: 'var(--dsw-alias-label-primary, #eee)' } }, selectedTaskMeta.nextRunAt ? new Date(selectedTaskMeta.nextRunAt).toLocaleString() : T_KEY(t, 'form.notScheduled'))
|
|
4371
4391
|
),
|
|
4372
|
-
|
|
4392
|
+
_h('button', {
|
|
4373
4393
|
type: 'button',
|
|
4374
4394
|
className: 'dsh-cron-btn-secondary',
|
|
4375
4395
|
style: { padding: '4px 10px', fontSize: '12px' },
|
|
@@ -4379,13 +4399,13 @@ if (formId) loadTaskHistory(formId);
|
|
|
4379
4399
|
}
|
|
4380
4400
|
}, T_KEY(t, 'actions.runNow'))
|
|
4381
4401
|
),
|
|
4382
|
-
|
|
4383
|
-
|
|
4402
|
+
_h('div', { className: 'dsh-cron-modal-foot' },
|
|
4403
|
+
_h('button', {
|
|
4384
4404
|
type: 'button',
|
|
4385
4405
|
className: 'dsh-cron-btn-secondary',
|
|
4386
4406
|
onClick: closeManualModalWithConfirm
|
|
4387
4407
|
}, T_KEY(t, 'modal.cancel')),
|
|
4388
|
-
|
|
4408
|
+
_h('button', {
|
|
4389
4409
|
type: 'submit',
|
|
4390
4410
|
className: 'dsh-cron-btn-primary'
|
|
4391
4411
|
}, formId ? T_KEY(t, 'modal.save') : T_KEY(t, 'modal.create'))
|
|
@@ -4393,28 +4413,28 @@ className: 'dsh-cron-btn-primary'
|
|
|
4393
4413
|
)
|
|
4394
4414
|
)
|
|
4395
4415
|
),
|
|
4396
|
-
dryRunResult &&
|
|
4397
|
-
|
|
4416
|
+
dryRunResult && _h('div', { className: 'dsh-cron-modal-overlay', onClick: () => setDryRunResult(null) },
|
|
4417
|
+
_h('div', {
|
|
4398
4418
|
className: 'dsh-cron-modal',
|
|
4399
4419
|
style: { maxWidth: '580px' },
|
|
4400
4420
|
role: 'dialog',
|
|
4401
4421
|
'aria-modal': 'true',
|
|
4402
4422
|
onClick: (e) => e.stopPropagation()
|
|
4403
4423
|
},
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4424
|
+
_h('div', { className: 'dsh-cron-modal-head', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } },
|
|
4425
|
+
_h('div', { className: 'dsh-cron-modal-title', style: { margin: 0 } }, T_KEY(t, 'dryRun.title')),
|
|
4426
|
+
_h('button', {
|
|
4407
4427
|
type: 'button',
|
|
4408
4428
|
className: 'dsh-cron-icon-btn',
|
|
4409
4429
|
onClick: () => setDryRunResult(null)
|
|
4410
4430
|
}, '✕')
|
|
4411
4431
|
),
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
((dryRunResult.result && dryRunResult.result.preflight) || dryRunResult.preflight) &&
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4432
|
+
_h('div', { style: { marginTop: '12px', display: 'flex', flexDirection: 'column', gap: '8px', fontSize: '13px' } },
|
|
4433
|
+
_h('div', null, _h('strong', null, T_KEY(t, 'dryRun.status') + ': '), _h('span', { style: { color: dryRunResult.ok ? 'var(--dsh-cron-success)' : 'var(--dsh-cron-danger)' } }, dryRunResult.ok ? ((dryRunResult.result && dryRunResult.result.status) || dryRunResult.status || 'success') : 'failed')),
|
|
4434
|
+
((dryRunResult.result && dryRunResult.result.preflight) || dryRunResult.preflight) && _h('div', null, _h('strong', null, T_KEY(t, 'dryRun.preflight') + ': '), _h('span', null, (((dryRunResult.result && dryRunResult.result.preflight) || dryRunResult.preflight).passed) ? '✓ Passed' : '✗ Failed (' + ((((dryRunResult.result && dryRunResult.result.preflight) || dryRunResult.preflight).reason) || '') + ')')),
|
|
4435
|
+
_h('div', null, _h('strong', null, T_KEY(t, 'dryRun.duration') + ': '), _h('span', null, (((dryRunResult.result && dryRunResult.result.durationMs) !== undefined ? dryRunResult.result.durationMs : dryRunResult.durationMs) || 0) + 'ms')),
|
|
4436
|
+
_h('div', { style: { marginTop: '6px' } }, _h('strong', null, T_KEY(t, 'dryRun.output') + ':')),
|
|
4437
|
+
_h('pre', {
|
|
4418
4438
|
style: {
|
|
4419
4439
|
background: 'var(--dsw-alias-bg-layer-2)',
|
|
4420
4440
|
border: '1px solid var(--dsw-alias-border-l2)',
|
|
@@ -4429,8 +4449,8 @@ color: 'var(--dsw-alias-label-primary)'
|
|
|
4429
4449
|
}
|
|
4430
4450
|
}, ((dryRunResult.result && dryRunResult.result.output) !== undefined ? dryRunResult.result.output : (dryRunResult.output !== undefined ? dryRunResult.output : ((dryRunResult.result && dryRunResult.result.error) || dryRunResult.error || '(no output)'))))
|
|
4431
4451
|
),
|
|
4432
|
-
|
|
4433
|
-
|
|
4452
|
+
_h('div', { className: 'dsh-cron-modal-foot', style: { marginTop: '16px' } },
|
|
4453
|
+
_h('button', {
|
|
4434
4454
|
type: 'button',
|
|
4435
4455
|
className: 'dsh-cron-btn-primary',
|
|
4436
4456
|
onClick: () => setDryRunResult(null)
|
|
@@ -4438,29 +4458,29 @@ onClick: () => setDryRunResult(null)
|
|
|
4438
4458
|
)
|
|
4439
4459
|
)
|
|
4440
4460
|
),
|
|
4441
|
-
archiveModalOpen &&
|
|
4442
|
-
|
|
4461
|
+
archiveModalOpen && _h('div', { className: 'dsh-cron-modal-overlay', onClick: () => setArchiveModalOpen(false) },
|
|
4462
|
+
_h('div', {
|
|
4443
4463
|
className: 'dsh-cron-modal',
|
|
4444
4464
|
style: { maxWidth: '700px' },
|
|
4445
4465
|
role: 'dialog',
|
|
4446
4466
|
'aria-modal': 'true',
|
|
4447
4467
|
onClick: (e) => e.stopPropagation()
|
|
4448
4468
|
},
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4469
|
+
_h('div', { className: 'dsh-cron-modal-head', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } },
|
|
4470
|
+
_h('div', { className: 'dsh-cron-modal-title', style: { margin: 0 } }, T_KEY(t, 'archive.title') + (archiveTask ? ' - ' + archiveTask.title : '')),
|
|
4471
|
+
_h('button', {
|
|
4452
4472
|
type: 'button',
|
|
4453
4473
|
className: 'dsh-cron-icon-btn',
|
|
4454
4474
|
onClick: () => setArchiveModalOpen(false)
|
|
4455
4475
|
}, '✕')
|
|
4456
4476
|
),
|
|
4457
|
-
|
|
4477
|
+
_h('div', { style: { fontSize: '12px', color: 'var(--dsw-alias-label-secondary, #999)', margin: '4px 0 12px 0' } },
|
|
4458
4478
|
T_KEY(t, 'archive.totalRuns', { total: archiveTotal })
|
|
4459
4479
|
),
|
|
4460
|
-
archiveLoading ?
|
|
4461
|
-
archiveRuns.length === 0 ?
|
|
4462
|
-
|
|
4463
|
-
archiveRuns.map((r, idx) =>
|
|
4480
|
+
archiveLoading ? _h('div', { className: 'dsh-cron-history-empty' }, T_KEY(t, 'history.loading')) :
|
|
4481
|
+
archiveRuns.length === 0 ? _h('div', { className: 'dsh-cron-history-empty' }, T_KEY(t, 'archive.empty')) :
|
|
4482
|
+
_h('div', { style: { display: 'flex', flexDirection: 'column', gap: '8px', maxHeight: '380px', overflowY: 'auto' } },
|
|
4483
|
+
archiveRuns.map((r, idx) => _h('div', {
|
|
4464
4484
|
key: idx,
|
|
4465
4485
|
style: {
|
|
4466
4486
|
background: 'var(--dsw-alias-bg-layer-2)',
|
|
@@ -4470,21 +4490,21 @@ padding: '8px 12px',
|
|
|
4470
4490
|
fontSize: '12px'
|
|
4471
4491
|
}
|
|
4472
4492
|
},
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4493
|
+
_h('div', { style: { display: 'flex', justifyContent: 'space-between', marginBottom: '4px' } },
|
|
4494
|
+
_h('span', { style: { fontWeight: '600', color: r.status === 'success' ? 'var(--dsh-cron-success)' : 'var(--dsh-cron-danger)' } }, (r.status || 'unknown').toUpperCase()),
|
|
4495
|
+
_h('span', { style: { color: 'var(--dsw-alias-label-secondary, #888)' } }, (r.at || r.timestamp || r.startedAt) ? new Date(r.at || r.timestamp || r.startedAt).toLocaleString() : "")
|
|
4476
4496
|
),
|
|
4477
|
-
r.durationMs > 0 &&
|
|
4478
|
-
r.chainRunId &&
|
|
4479
|
-
|
|
4497
|
+
r.durationMs > 0 && _h('div', { style: { color: 'var(--dsw-alias-label-secondary, #888)', marginBottom: '4px' } }, 'Duration: ' + r.durationMs + 'ms'),
|
|
4498
|
+
r.chainRunId && _h('div', { style: { marginBottom: '4px' } },
|
|
4499
|
+
_h('button', {
|
|
4480
4500
|
type: 'button',
|
|
4481
4501
|
className: 'dsh-cron-btn-secondary',
|
|
4482
4502
|
style: { padding: '2px 8px', fontSize: '11px', display: 'inline-flex', alignItems: 'center', gap: '4px' },
|
|
4483
4503
|
onClick: () => openChainGraphModal(null, r.chainRunId)
|
|
4484
4504
|
}, '🕸️ ' + T_KEY(t, 'chainGraph.viewGraph'))
|
|
4485
4505
|
),
|
|
4486
|
-
r.error &&
|
|
4487
|
-
r.output &&
|
|
4506
|
+
r.error && _h('div', { style: { color: 'var(--dsh-cron-danger)', marginBottom: '4px' } }, 'Error: ' + r.error),
|
|
4507
|
+
r.output && _h('div', {
|
|
4488
4508
|
style: {
|
|
4489
4509
|
color: 'var(--dsw-alias-label-primary, #ccc)',
|
|
4490
4510
|
whiteSpace: 'pre-wrap',
|
|
@@ -4495,16 +4515,16 @@ overflowY: 'auto'
|
|
|
4495
4515
|
}, r.output.slice(0, 300) + (r.output.length > 300 ? '...' : ''))
|
|
4496
4516
|
))
|
|
4497
4517
|
),
|
|
4498
|
-
|
|
4499
|
-
archiveRuns.length < archiveTotal ?
|
|
4518
|
+
_h('div', { className: 'dsh-cron-modal-foot', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginTop: '16px' } },
|
|
4519
|
+
archiveRuns.length < archiveTotal ? _h('button', {
|
|
4500
4520
|
type: 'button',
|
|
4501
4521
|
className: 'dsh-cron-btn-secondary',
|
|
4502
4522
|
onClick: () => {
|
|
4503
4523
|
const nextOffset = archiveRuns.length;
|
|
4504
4524
|
if (archiveTask) openArchiveModal(archiveTask, nextOffset);
|
|
4505
4525
|
}
|
|
4506
|
-
}, T_KEY(t, 'archive.loadMore', { shown: archiveRuns.length, total: archiveTotal })) :
|
|
4507
|
-
|
|
4526
|
+
}, T_KEY(t, 'archive.loadMore', { shown: archiveRuns.length, total: archiveTotal })) : _h('div', null),
|
|
4527
|
+
_h('button', {
|
|
4508
4528
|
type: 'button',
|
|
4509
4529
|
className: 'dsh-cron-btn-primary',
|
|
4510
4530
|
onClick: () => setArchiveModalOpen(false)
|
|
@@ -4512,54 +4532,54 @@ onClick: () => setArchiveModalOpen(false)
|
|
|
4512
4532
|
)
|
|
4513
4533
|
)
|
|
4514
4534
|
),
|
|
4515
|
-
settingsModalOpen &&
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4535
|
+
settingsModalOpen && _h('div', { className: 'dsh-cron-modal-overlay', onClick: () => setSettingsModalOpen(false) },
|
|
4536
|
+
_h('div', { className: 'dsh-cron-modal dsh-cron-modal-scroll', role: 'dialog', 'aria-modal': 'true', onClick: (e) => e.stopPropagation() },
|
|
4537
|
+
_h('div', { className: 'dsh-cron-modal-head', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '18px' } },
|
|
4538
|
+
_h('div', { className: 'dsh-cron-modal-title', style: { margin: 0, display: 'flex', alignItems: 'center', gap: '8px' } },
|
|
4539
|
+
_h('span', { style: { display: 'flex', alignItems: 'center', color: 'var(--dsh-cron-info)' }, ...iconHtml(ICON_TELEGRAM) }),
|
|
4520
4540
|
T_KEY(t, 'settings.modalTitle')
|
|
4521
4541
|
),
|
|
4522
|
-
|
|
4542
|
+
_h('button', {
|
|
4523
4543
|
type: 'button',
|
|
4524
4544
|
style: { background: 'none', border: 'none', color: 'var(--dsw-alias-label-tertiary, #888)', cursor: 'pointer', fontSize: '18px' },
|
|
4525
4545
|
onClick: () => setSettingsModalOpen(false)
|
|
4526
4546
|
}, '✕')
|
|
4527
4547
|
),
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4548
|
+
_h('form', { onSubmit: handleSaveSettings },
|
|
4549
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4550
|
+
_h('label', null, T_KEY(t, 'settings.tokenLabel')),
|
|
4551
|
+
_h('input', {
|
|
4532
4552
|
type: 'password',
|
|
4533
4553
|
value: settingsBotToken,
|
|
4534
4554
|
placeholder: settingsHasDefault ? T_KEY(t, 'settings.tokenPlaceholderDefault') : T_KEY(t, 'settings.tokenPlaceholder'),
|
|
4535
4555
|
onChange: (e) => setSettingsBotToken(e.target.value)
|
|
4536
4556
|
}),
|
|
4537
|
-
settingsHasDefault &&
|
|
4557
|
+
settingsHasDefault && _h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'settings.defaultHint'))
|
|
4538
4558
|
),
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4559
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4560
|
+
_h('label', null, T_KEY(t, 'settings.chatIdLabel')),
|
|
4561
|
+
_h('input', {
|
|
4542
4562
|
value: settingsChatId,
|
|
4543
4563
|
placeholder: T_KEY(t, 'settings.chatIdPlaceholder'),
|
|
4544
4564
|
onChange: (e) => setSettingsChatId(e.target.value)
|
|
4545
4565
|
})
|
|
4546
4566
|
),
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4567
|
+
_h('div', { style: { background: 'var(--dsw-alias-bg-layer-3, color-mix(in srgb, var(--dsw-alias-label-primary) 2%, transparent))', border: '1px solid var(--dsw-alias-border-l2)', borderRadius: '8px', padding: '12px 14px', marginBottom: '16px' } },
|
|
4568
|
+
_h('label', { className: 'dsh-cron-checkbox-row', style: { marginBottom: '8px' } },
|
|
4569
|
+
_h('input', {
|
|
4550
4570
|
type: 'checkbox',
|
|
4551
4571
|
checked: settingsNotifyGlobal,
|
|
4552
4572
|
onChange: (e) => setSettingsNotifyGlobal(e.target.checked)
|
|
4553
4573
|
}),
|
|
4554
|
-
|
|
4574
|
+
_h('span', null, T_KEY(t, 'settings.globalNotify'))
|
|
4555
4575
|
),
|
|
4556
|
-
|
|
4557
|
-
|
|
4576
|
+
_h('label', { className: 'dsh-cron-checkbox-row' },
|
|
4577
|
+
_h('input', {
|
|
4558
4578
|
type: 'checkbox',
|
|
4559
4579
|
checked: settingsOnlyOnFailureGlobal,
|
|
4560
4580
|
onChange: (e) => setSettingsOnlyOnFailureGlobal(e.target.checked)
|
|
4561
4581
|
}),
|
|
4562
|
-
|
|
4582
|
+
_h('span', null, T_KEY(t, 'settings.globalOnlyFailure'))
|
|
4563
4583
|
)
|
|
4564
4584
|
),
|
|
4565
4585
|
...renderDeliverySettings({
|
|
@@ -4570,8 +4590,8 @@ onChannelTemplate: updateChannelTemplate,
|
|
|
4570
4590
|
sections: settingsSections,
|
|
4571
4591
|
onToggleSection: toggleDeliverySection,
|
|
4572
4592
|
}),
|
|
4573
|
-
|
|
4574
|
-
|
|
4593
|
+
_h('div', { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: '14px' } },
|
|
4594
|
+
_h('button', {
|
|
4575
4595
|
type: 'button',
|
|
4576
4596
|
className: 'dsh-cron-btn-secondary',
|
|
4577
4597
|
style: { display: 'inline-flex', alignItems: 'center', gap: '6px' },
|
|
@@ -4579,17 +4599,17 @@ disabled: testStatus?.loading,
|
|
|
4579
4599
|
onClick: handleTestTelegram
|
|
4580
4600
|
}, testStatus?.loading ? T_KEY(t, 'settings.sending') : T_KEY(t, 'settings.testTelegram'))
|
|
4581
4601
|
),
|
|
4582
|
-
testStatus && testStatus.message &&
|
|
4602
|
+
testStatus && testStatus.message && _h('div', {
|
|
4583
4603
|
className: 'dsh-cron-status-banner',
|
|
4584
4604
|
'data-type': testStatus.success ? 'success' : 'error'
|
|
4585
4605
|
}, testStatus.message),
|
|
4586
|
-
|
|
4587
|
-
|
|
4606
|
+
_h('div', { className: 'dsh-cron-modal-foot' },
|
|
4607
|
+
_h('button', {
|
|
4588
4608
|
type: 'button',
|
|
4589
4609
|
className: 'dsh-cron-btn-secondary',
|
|
4590
4610
|
onClick: () => setSettingsModalOpen(false)
|
|
4591
4611
|
}, T_KEY(t, 'modal.cancel')),
|
|
4592
|
-
|
|
4612
|
+
_h('button', {
|
|
4593
4613
|
type: 'submit',
|
|
4594
4614
|
className: 'dsh-cron-btn-primary'
|
|
4595
4615
|
}, T_KEY(t, 'settings.save'))
|
|
@@ -4597,12 +4617,12 @@ className: 'dsh-cron-btn-primary'
|
|
|
4597
4617
|
)
|
|
4598
4618
|
)
|
|
4599
4619
|
),
|
|
4600
|
-
importDoc &&
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
importSummary &&
|
|
4605
|
-
|
|
4620
|
+
importDoc && _h('div', { className: 'dsh-cron-modal-overlay', onClick: () => !transferBusy && setImportDoc(null) },
|
|
4621
|
+
_h('div', { className: 'dsh-cron-modal', role: 'dialog', 'aria-modal': 'true', onClick: (e) => e.stopPropagation() },
|
|
4622
|
+
_h('div', { className: 'dsh-cron-modal-title' }, T_KEY(t, 'transfer.importTitleModal')),
|
|
4623
|
+
_h('div', { className: 'dsh-cron-hint', style: { marginBottom: '10px' } }, T_KEY(t, 'transfer.importHint')),
|
|
4624
|
+
importSummary && _h('div', null,
|
|
4625
|
+
_h('div', { style: { fontSize: '13px', marginBottom: '12px' } },
|
|
4606
4626
|
T_KEY(t, 'transfer.summary', {
|
|
4607
4627
|
total: (importSummary.add || 0) + (importSummary.replace || 0) + (importSummary.skip || 0),
|
|
4608
4628
|
add: importSummary.add || 0,
|
|
@@ -4610,26 +4630,26 @@ replace: importSummary.replace || 0,
|
|
|
4610
4630
|
skip: importSummary.skip || 0
|
|
4611
4631
|
})
|
|
4612
4632
|
),
|
|
4613
|
-
|
|
4614
|
-
...['add', 'replace', 'skip'].map((mode) =>
|
|
4615
|
-
|
|
4633
|
+
_h('div', { style: { display: 'flex', flexDirection: 'column', gap: '8px', marginBottom: '14px' } },
|
|
4634
|
+
...['add', 'replace', 'skip'].map((mode) => _h('label', { key: mode, className: 'dsh-cron-checkbox-row' },
|
|
4635
|
+
_h('input', {
|
|
4616
4636
|
type: 'radio',
|
|
4617
4637
|
name: 'dsh-cron-import-strategy',
|
|
4618
4638
|
checked: importStrategy === mode,
|
|
4619
4639
|
onChange: () => setImportStrategy(mode)
|
|
4620
4640
|
}),
|
|
4621
|
-
|
|
4641
|
+
_h('span', null, T_KEY(t, mode === 'add' ? 'transfer.strategyAdd' : mode === 'replace' ? 'transfer.strategyReplace' : 'transfer.strategySkip'))
|
|
4622
4642
|
))
|
|
4623
4643
|
)
|
|
4624
4644
|
),
|
|
4625
|
-
|
|
4626
|
-
|
|
4645
|
+
_h('div', { className: 'dsh-cron-modal-foot' },
|
|
4646
|
+
_h('button', {
|
|
4627
4647
|
type: 'button',
|
|
4628
4648
|
className: 'dsh-cron-btn-secondary',
|
|
4629
4649
|
disabled: transferBusy,
|
|
4630
4650
|
onClick: () => setImportDoc(null)
|
|
4631
4651
|
}, T_KEY(t, 'modal.cancel')),
|
|
4632
|
-
|
|
4652
|
+
_h('button', {
|
|
4633
4653
|
type: 'button',
|
|
4634
4654
|
className: 'dsh-cron-btn-primary',
|
|
4635
4655
|
disabled: transferBusy || !importSummary,
|
|
@@ -4638,13 +4658,13 @@ onClick: handleImportConfirm
|
|
|
4638
4658
|
)
|
|
4639
4659
|
)
|
|
4640
4660
|
),
|
|
4641
|
-
dshModalOpen &&
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4661
|
+
dshModalOpen && _h('div', { className: 'dsh-cron-modal-overlay', onClick: () => !dshLoading && setDshModalOpen(false) },
|
|
4662
|
+
_h('div', { className: 'dsh-cron-modal', role: 'dialog', 'aria-modal': 'true', onClick: (e) => e.stopPropagation() },
|
|
4663
|
+
_h('div', { className: 'dsh-cron-modal-title' }, T_KEY(t, 'dsh.modalTitle')),
|
|
4664
|
+
_h('div', { className: 'dsh-cron-form-group' },
|
|
4665
|
+
_h('label', null, T_KEY(t, 'dsh.descLabel')),
|
|
4666
|
+
_h('div', { className: 'dsh-cron-chat-box' },
|
|
4667
|
+
_h('textarea', {
|
|
4648
4668
|
className: 'dsh-cron-chat-input',
|
|
4649
4669
|
rows: 4,
|
|
4650
4670
|
autoFocus: true,
|
|
@@ -4659,22 +4679,22 @@ handleStartWithDSH();
|
|
|
4659
4679
|
},
|
|
4660
4680
|
onChange: (e) => setDshPrompt(e.target.value)
|
|
4661
4681
|
}),
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4682
|
+
_h('div', { className: 'dsh-cron-chat-foot' },
|
|
4683
|
+
_h('span', { className: 'dsh-cron-chat-hint' }, T_KEY(t, 'dsh.sendHint')),
|
|
4684
|
+
_h('button', {
|
|
4665
4685
|
type: 'button',
|
|
4666
4686
|
className: 'dsh-cron-send-btn',
|
|
4667
4687
|
disabled: dshLoading || !dshPrompt.trim(),
|
|
4668
4688
|
title: T_KEY(t, 'dsh.sendTitle'),
|
|
4669
4689
|
onClick: handleStartWithDSH
|
|
4670
4690
|
},
|
|
4671
|
-
|
|
4691
|
+
_h('span', svgProps(ICON_SEND))
|
|
4672
4692
|
)
|
|
4673
4693
|
)
|
|
4674
4694
|
)
|
|
4675
4695
|
),
|
|
4676
|
-
|
|
4677
|
-
|
|
4696
|
+
_h('div', { className: 'dsh-cron-modal-foot' },
|
|
4697
|
+
_h('button', {
|
|
4678
4698
|
type: 'button',
|
|
4679
4699
|
className: 'dsh-cron-btn-secondary',
|
|
4680
4700
|
disabled: dshLoading,
|
|
@@ -4885,15 +4905,15 @@ setTestInfo({ success: false, message: T_KEY(t, 'settings.kanbanFail', { error:
|
|
|
4885
4905
|
}
|
|
4886
4906
|
};
|
|
4887
4907
|
if (loadState !== 'ready') {
|
|
4888
|
-
return
|
|
4889
|
-
|
|
4890
|
-
|
|
4908
|
+
return _h('div', { className: 'dsh-cron-card' },
|
|
4909
|
+
_h('div', { className: 'dsh-cron-card-title' }, T_KEY(t, 'settings.cardTitle')),
|
|
4910
|
+
_h('div', {
|
|
4891
4911
|
className: 'dsh-cron-status-banner',
|
|
4892
4912
|
'data-type': loadState === 'error' ? 'error' : 'info',
|
|
4893
4913
|
style: { marginTop: '10px', display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: '10px' }
|
|
4894
4914
|
},
|
|
4895
|
-
|
|
4896
|
-
loadState === 'error' &&
|
|
4915
|
+
_h('span', null, loadState === 'error' ? T_KEY(t, 'settings.unavailable') : T_KEY(t, 'settings.loading')),
|
|
4916
|
+
loadState === 'error' && _h('button', {
|
|
4897
4917
|
type: 'button',
|
|
4898
4918
|
className: 'dsh-cron-btn-secondary',
|
|
4899
4919
|
onClick: () => setReloadTick(x => x + 1)
|
|
@@ -4902,88 +4922,88 @@ onClick: () => setReloadTick(x => x + 1)
|
|
|
4902
4922
|
);
|
|
4903
4923
|
}
|
|
4904
4924
|
if (props && props.view === 'summary') {
|
|
4905
|
-
return
|
|
4925
|
+
return _h('span', { className: 'dsh-cron-card-desc' }, T_KEY(t, 'settings.cardDesc'));
|
|
4906
4926
|
}
|
|
4907
4927
|
const page = !!(props && props.view === 'page');
|
|
4908
|
-
return
|
|
4909
|
-
|
|
4928
|
+
return _h('div', { className: page ? 'dsh-cron-page' : 'dsh-cron-card' },
|
|
4929
|
+
_h('button', {
|
|
4910
4930
|
type: 'button',
|
|
4911
4931
|
className: 'dsh-cron-card-head-btn',
|
|
4912
4932
|
style: page ? { display: 'none' } : undefined,
|
|
4913
4933
|
'aria-expanded': (page || cardOpen) ? 'true' : 'false',
|
|
4914
4934
|
onClick: () => setCardOpen(!cardOpen)
|
|
4915
4935
|
},
|
|
4916
|
-
|
|
4917
|
-
|
|
4936
|
+
_h('span', { className: 'dsh-cron-card-title' }, T_KEY(t, 'settings.cardTitle')),
|
|
4937
|
+
_h('span', { className: 'dsh-cron-chev' + (cardOpen ? ' dsh-cron-chev-open' : '') }, chevronNode())
|
|
4918
4938
|
),
|
|
4919
|
-
(page || cardOpen) &&
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4939
|
+
(page || cardOpen) && _h('div', { className: 'dsh-cron-card-body' },
|
|
4940
|
+
_h('div', { className: 'dsh-cron-card-desc' }, T_KEY(t, 'settings.cardDesc')),
|
|
4941
|
+
_h('div', { style: { display: 'flex', justifyContent: 'flex-end', marginBottom: '12px' } },
|
|
4942
|
+
_h('button', {
|
|
4923
4943
|
type: 'button',
|
|
4924
4944
|
className: 'dsh-cron-btn-primary',
|
|
4925
4945
|
onClick: () => { if (toggle) toggle.set(true); }
|
|
4926
4946
|
}, T_KEY(t, 'settings.openPanel'))
|
|
4927
4947
|
),
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4948
|
+
_h('form', { onSubmit: saveSettings, style: { display: 'flex', flexDirection: 'column', gap: '12px' } },
|
|
4949
|
+
_h('div', { className: 'dsh-cron-form-group', style: { marginBottom: 0 } },
|
|
4950
|
+
_h('label', null, T_KEY(t, 'settings.tokenLabel')),
|
|
4951
|
+
_h('input', {
|
|
4932
4952
|
type: 'password',
|
|
4933
4953
|
value: token,
|
|
4934
4954
|
placeholder: hasDefault ? T_KEY(t, 'settings.tokenPlaceholderDefault') : T_KEY(t, 'settings.tokenPlaceholder'),
|
|
4935
4955
|
onChange: (e) => setToken(e.target.value)
|
|
4936
4956
|
}),
|
|
4937
|
-
hasDefault &&
|
|
4957
|
+
hasDefault && _h('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'settings.defaultHint'))
|
|
4938
4958
|
),
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4959
|
+
_h('div', { className: 'dsh-cron-form-group', style: { marginBottom: 0 } },
|
|
4960
|
+
_h('label', null, T_KEY(t, 'settings.chatIdLabel')),
|
|
4961
|
+
_h('input', {
|
|
4942
4962
|
value: chatId,
|
|
4943
4963
|
placeholder: T_KEY(t, 'settings.chatIdPlaceholder'),
|
|
4944
4964
|
onChange: (e) => setChatId(e.target.value)
|
|
4945
4965
|
})
|
|
4946
4966
|
),
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4967
|
+
_h('div', { className: 'dsh-cron-form-group', style: { marginBottom: 0 } },
|
|
4968
|
+
_h('label', null, T_KEY(t, 'settings.kanbanUrlLabel')),
|
|
4969
|
+
_h('input', {
|
|
4950
4970
|
value: kanbanUrl,
|
|
4951
4971
|
placeholder: 'http://127.0.0.1:3000',
|
|
4952
4972
|
onChange: (e) => setKanbanUrl(e.target.value)
|
|
4953
4973
|
})
|
|
4954
4974
|
),
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4975
|
+
_h('div', { style: { background: 'var(--dsw-alias-bg-layer-3, color-mix(in srgb, var(--dsw-alias-label-primary) 2%, transparent))', border: '1px solid var(--dsw-alias-border-l2)', borderRadius: '6px', padding: '10px 12px', display: 'flex', flexDirection: 'column', gap: '8px' } },
|
|
4976
|
+
_h('label', { className: 'dsh-cron-checkbox-row' },
|
|
4977
|
+
_h('input', {
|
|
4958
4978
|
type: 'checkbox',
|
|
4959
4979
|
checked: notify,
|
|
4960
4980
|
onChange: (e) => setNotify(e.target.checked)
|
|
4961
4981
|
}),
|
|
4962
|
-
|
|
4982
|
+
_h('span', null, T_KEY(t, 'settings.globalNotify'))
|
|
4963
4983
|
),
|
|
4964
|
-
|
|
4965
|
-
|
|
4984
|
+
_h('label', { className: 'dsh-cron-checkbox-row' },
|
|
4985
|
+
_h('input', {
|
|
4966
4986
|
type: 'checkbox',
|
|
4967
4987
|
checked: onlyFailure,
|
|
4968
4988
|
onChange: (e) => setOnlyFailure(e.target.checked)
|
|
4969
4989
|
}),
|
|
4970
|
-
|
|
4990
|
+
_h('span', null, T_KEY(t, 'settings.globalOnlyFailure'))
|
|
4971
4991
|
),
|
|
4972
|
-
|
|
4973
|
-
|
|
4992
|
+
_h('label', { className: 'dsh-cron-checkbox-row' },
|
|
4993
|
+
_h('input', {
|
|
4974
4994
|
type: 'checkbox',
|
|
4975
4995
|
checked: llmActionsEnabled,
|
|
4976
4996
|
onChange: (e) => setLlmActionsEnabled(e.target.checked)
|
|
4977
4997
|
}),
|
|
4978
|
-
|
|
4998
|
+
_h('span', null, 'Enable Structured LLM Actions (trigger tasks, notify, create issues)')
|
|
4979
4999
|
),
|
|
4980
|
-
|
|
4981
|
-
|
|
5000
|
+
_h('label', { className: 'dsh-cron-checkbox-row' },
|
|
5001
|
+
_h('input', {
|
|
4982
5002
|
type: 'checkbox',
|
|
4983
5003
|
checked: enableDynamicCredentials,
|
|
4984
5004
|
onChange: (e) => setEnableDynamicCredentials(e.target.checked)
|
|
4985
5005
|
}),
|
|
4986
|
-
|
|
5006
|
+
_h('span', null, T_KEY(t, 'settings.dynamicCredentials'))
|
|
4987
5007
|
)
|
|
4988
5008
|
),
|
|
4989
5009
|
...renderDeliverySettings({
|
|
@@ -5004,12 +5024,12 @@ return Object.assign({}, prev, { channelTemplates: templates });
|
|
|
5004
5024
|
sections,
|
|
5005
5025
|
onToggleSection: (key) => setSections((prev) => Object.assign({}, prev, { [key]: !prev[key] })),
|
|
5006
5026
|
}),
|
|
5007
|
-
testInfo && testInfo.message &&
|
|
5027
|
+
testInfo && testInfo.message && _h('div', {
|
|
5008
5028
|
className: 'dsh-cron-status-banner',
|
|
5009
5029
|
'data-type': testInfo.success ? 'success' : 'error',
|
|
5010
5030
|
style: { margin: 0, padding: '8px 12px' }
|
|
5011
5031
|
}, testInfo.message),
|
|
5012
|
-
|
|
5032
|
+
_h('div', {
|
|
5013
5033
|
className: 'dsh-cron-form-group',
|
|
5014
5034
|
style: {
|
|
5015
5035
|
background: 'var(--dsw-alias-bg-layer-2, color-mix(in srgb, var(--dsw-alias-label-primary) 3%, transparent))',
|
|
@@ -5019,19 +5039,19 @@ padding: '14px',
|
|
|
5019
5039
|
marginBottom: '16px'
|
|
5020
5040
|
}
|
|
5021
5041
|
},
|
|
5022
|
-
|
|
5042
|
+
_h('div', {
|
|
5023
5043
|
style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '8px' }
|
|
5024
5044
|
},
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5045
|
+
_h('div', { style: { fontWeight: '600', fontSize: '14px' } }, `🚀 ${T_KEY(t, 'updater.title')}`),
|
|
5046
|
+
_h('div', { style: { display: 'flex', gap: '8px' } },
|
|
5047
|
+
_h('button', {
|
|
5028
5048
|
type: 'button',
|
|
5029
5049
|
className: 'dsh-cron-btn-secondary',
|
|
5030
5050
|
style: { padding: '4px 10px', fontSize: '12px' },
|
|
5031
5051
|
disabled: updateState.checking || updateState.updating,
|
|
5032
5052
|
onClick: checkUpdates
|
|
5033
5053
|
}, updateState.checking ? T_KEY(t, 'updater.checking') : T_KEY(t, 'updater.btnCheck')),
|
|
5034
|
-
updateState.updateAvailable ?
|
|
5054
|
+
updateState.updateAvailable ? _h('button', {
|
|
5035
5055
|
type: 'button',
|
|
5036
5056
|
className: 'dsh-cron-btn-primary',
|
|
5037
5057
|
style: { padding: '4px 10px', fontSize: '12px' },
|
|
@@ -5040,39 +5060,39 @@ onClick: runUpdate
|
|
|
5040
5060
|
}, updateState.updating ? T_KEY(t, 'updater.updating') : T_KEY(t, 'updater.btnUpdate', { version: updateState.latestVersion })) : null
|
|
5041
5061
|
)
|
|
5042
5062
|
),
|
|
5043
|
-
|
|
5063
|
+
_h('div', {
|
|
5044
5064
|
style: { fontSize: '12px', color: 'var(--dsw-alias-label-secondary, #999)', marginBottom: '8px' }
|
|
5045
5065
|
}, T_KEY(t, 'updater.desc')),
|
|
5046
|
-
|
|
5066
|
+
_h('div', {
|
|
5047
5067
|
style: { display: 'flex', alignItems: 'center', gap: '12px', fontSize: '13px' }
|
|
5048
5068
|
},
|
|
5049
|
-
|
|
5069
|
+
_h('span', { style: { color: 'var(--dsw-alias-label-secondary, #aaa)' } },
|
|
5050
5070
|
updateState.currentVersion ? T_KEY(t, 'updater.current', { version: updateState.currentVersion }) : ''
|
|
5051
5071
|
),
|
|
5052
|
-
updateState.checking ?
|
|
5053
|
-
updateState.updateAvailable ?
|
|
5054
|
-
updateState.currentVersion && !updateState.error && !updateState.checking ?
|
|
5072
|
+
updateState.checking ? _h('span', { className: 'dsh-cron-badge dsh-cron-badge-info' }, T_KEY(t, 'updater.checking')) :
|
|
5073
|
+
updateState.updateAvailable ? _h('span', { className: 'dsh-cron-badge dsh-cron-badge-warn' }, T_KEY(t, 'updater.available', { version: updateState.latestVersion })) :
|
|
5074
|
+
updateState.currentVersion && !updateState.error && !updateState.checking ? _h('span', { className: 'dsh-cron-badge dsh-cron-badge-ok' }, `✓ ${T_KEY(t, 'updater.upToDate')}`) : null
|
|
5055
5075
|
),
|
|
5056
|
-
updateState.notice ?
|
|
5076
|
+
updateState.notice ? _h('div', {
|
|
5057
5077
|
style: { marginTop: '8px', color: 'var(--dsw-alias-success)', fontSize: '12px' }
|
|
5058
5078
|
}, updateState.notice) : null,
|
|
5059
|
-
updateState.error ?
|
|
5079
|
+
updateState.error ? _h('div', {
|
|
5060
5080
|
style: { marginTop: '8px', color: 'var(--dsw-alias-error)', fontSize: '12px' }
|
|
5061
5081
|
}, updateState.error) : null
|
|
5062
5082
|
),
|
|
5063
|
-
|
|
5064
|
-
|
|
5083
|
+
_h('div', { style: { display: 'flex', gap: '8px', alignItems: 'center', flexWrap: 'wrap', marginTop: '4px' } },
|
|
5084
|
+
_h('button', {
|
|
5065
5085
|
type: 'submit',
|
|
5066
5086
|
className: 'dsh-cron-btn-primary',
|
|
5067
5087
|
style: { minWidth: '140px' }
|
|
5068
5088
|
}, saved ? T_KEY(t, 'settings.saved') : T_KEY(t, 'settings.save')),
|
|
5069
|
-
|
|
5089
|
+
_h('button', {
|
|
5070
5090
|
type: 'button',
|
|
5071
5091
|
className: 'dsh-cron-btn-secondary',
|
|
5072
5092
|
onClick: testTelegram,
|
|
5073
5093
|
disabled: testInfo?.loading
|
|
5074
5094
|
}, T_KEY(t, 'settings.testTelegram')),
|
|
5075
|
-
|
|
5095
|
+
_h('button', {
|
|
5076
5096
|
type: 'button',
|
|
5077
5097
|
className: 'dsh-cron-btn-secondary',
|
|
5078
5098
|
onClick: testKanban,
|
|
@@ -5297,9 +5317,9 @@ container.setAttribute('data-dsh-plugin', 'dsh-cron');
|
|
|
5297
5317
|
column.appendChild(container);
|
|
5298
5318
|
if (ReactDOM && typeof ReactDOM.createRoot === 'function') {
|
|
5299
5319
|
root = ReactDOM.createRoot(container);
|
|
5300
|
-
root.render(
|
|
5320
|
+
root.render(_h(ErrorBoundary, null, _h(CronScreen, { ctx, toggle, onClose: () => toggle.set(false), t: translate })));
|
|
5301
5321
|
} else if (ReactDOM && typeof ReactDOM.render === 'function') {
|
|
5302
|
-
ReactDOM.render(
|
|
5322
|
+
ReactDOM.render(_h(CronScreen, { ctx, toggle, onClose: () => toggle.set(false), t: translate }), container);
|
|
5303
5323
|
}
|
|
5304
5324
|
};
|
|
5305
5325
|
const applyActive = () => {
|
|
@@ -5367,7 +5387,7 @@ translate = ctx.locale.bind(NS);
|
|
|
5367
5387
|
}
|
|
5368
5388
|
const toggle = createToggle();
|
|
5369
5389
|
function SettingsCardWithBoundary(props) {
|
|
5370
|
-
return
|
|
5390
|
+
return _h(ErrorBoundary, null, CronSettingsCard(props));
|
|
5371
5391
|
}
|
|
5372
5392
|
const itemOk = registerIntoMount(ctx, 'plugins.item', {
|
|
5373
5393
|
name: 'plugins.item',
|
|
@@ -5406,7 +5426,7 @@ const cardSlot = cardOk ? 'settings.plugin.item' : undefined;
|
|
|
5406
5426
|
const chipSlot = chipOk ? 'conversation.session.header.utilities' : undefined;
|
|
5407
5427
|
function CronChip(props) {
|
|
5408
5428
|
const chipT = props.t || translate;
|
|
5409
|
-
return
|
|
5429
|
+
return _h('button', {
|
|
5410
5430
|
type: 'button',
|
|
5411
5431
|
style: { background: 'none', border: 'none', color: 'var(--dsw-alias-label-secondary, #999)', cursor: 'pointer', padding: '4px', display: 'inline-flex', alignItems: 'center' },
|
|
5412
5432
|
title: T_KEY(chipT, 'chip.title'),
|