mirror of
https://github.com/hansjone/dsh-ops-cron.git
synced 2026-10-08 23:20:45 +08:00
Show agent preset on the scheduled-task list and editor hint.
List rows previously hid agentPreset; surface Host-default vs pinned id so selection is visible without opening each job. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
839660d12f
commit
6724332114
1 changed files with 23 additions and 4 deletions
|
|
@ -232,7 +232,7 @@ window.__ModuleLoader__.load({
|
|||
}
|
||||
|
||||
function jobStamp(rows) {
|
||||
return (rows || []).map((row) => `${row.id}:${row.updatedAt}:${row.nextRunAt}:${row.enabled}:${row.lastStatus}:${row.state}:${row.stuck}:${row.model}:${row.provider}:${row.delivery?.kind}:${row.delivery?.targetId}:${JSON.stringify(row.labels || {})}`).join('|')
|
||||
return (rows || []).map((row) => `${row.id}:${row.updatedAt}:${row.nextRunAt}:${row.enabled}:${row.lastStatus}:${row.state}:${row.stuck}:${row.model}:${row.provider}:${row.agentPreset || ''}:${row.delivery?.kind}:${row.delivery?.targetId}:${JSON.stringify(row.labels || {})}`).join('|')
|
||||
}
|
||||
|
||||
function runStamp(rows) {
|
||||
|
|
@ -391,6 +391,7 @@ body>.dsh-ct-main{position:fixed;top:0;right:0;bottom:0;left:var(--dsh-ct-sideba
|
|||
stateFailed: '失败',
|
||||
statePaused: '已暂停',
|
||||
stateStuck: '疑似卡死',
|
||||
presetHostDefault: 'Host默认',
|
||||
labels: '标签',
|
||||
labelsHint: '每行 key=value,或 JSON 对象。用于批量监控与发现。',
|
||||
labelsPlaceholder: 'role=worker\ntask=theory',
|
||||
|
|
@ -458,6 +459,7 @@ body>.dsh-ct-main{position:fixed;top:0;right:0;bottom:0;left:var(--dsh-ct-sideba
|
|||
stateFailed: 'Failed',
|
||||
statePaused: 'Paused',
|
||||
stateStuck: 'Stuck',
|
||||
presetHostDefault: 'Host default',
|
||||
labels: 'Labels',
|
||||
labelsHint: 'One key=value per line, or a JSON object. Used for discovery and batch monitoring.',
|
||||
labelsPlaceholder: 'role=worker\ntask=theory',
|
||||
|
|
@ -877,7 +879,15 @@ body>.dsh-ct-main{position:fixed;top:0;right:0;bottom:0;left:var(--dsh-ct-sideba
|
|||
return ''
|
||||
}
|
||||
|
||||
function JobList({ t, jobs, runs, selection, expanded, viewer, error, onSelectJob, onSelectRun, onNew, onRun, onToggle, onRemove, onToggleGroup }) {
|
||||
function jobPresetLabel(job, t, presets) {
|
||||
const id = typeof job?.agentPreset === 'string' ? job.agentPreset.trim() : ''
|
||||
if (!id) return t('presetHostDefault')
|
||||
const items = Array.isArray(presets?.items) ? presets.items : []
|
||||
const hit = items.find((row) => row.id === id)
|
||||
return hit?.name || id
|
||||
}
|
||||
|
||||
function JobList({ t, jobs, runs, selection, expanded, viewer, presets, error, onSelectJob, onSelectRun, onNew, onRun, onToggle, onRemove, onToggleGroup }) {
|
||||
const skin = workspaceSkin()
|
||||
const [query, setQuery] = useState('')
|
||||
const [searchOn, setSearchOn] = useState(false)
|
||||
|
|
@ -897,6 +907,7 @@ body>.dsh-ct-main{position:fixed;top:0;right:0;bottom:0;left:var(--dsh-ct-sideba
|
|||
job.ownerDisplayName,
|
||||
job.state,
|
||||
labelsInline(job),
|
||||
job.agentPreset,
|
||||
...(runs.filter((run) => run.jobId === job.id).map((run) => run.summary || run.status)),
|
||||
].join(' ').toLowerCase()
|
||||
return hay.includes(needle)
|
||||
|
|
@ -971,6 +982,11 @@ body>.dsh-ct-main{position:fixed;top:0;right:0;bottom:0;left:var(--dsh-ct-sideba
|
|||
'data-state': jobStateKey(job),
|
||||
'data-stuck': job.stuck ? 'true' : 'false',
|
||||
}, jobStateLabel(job, t)),
|
||||
h('span', { className: 'dsh-ct-labels', title: t('agentPreset') },
|
||||
`preset=${jobPresetLabel(job, t, presets)}`),
|
||||
jobModelLabel(job)
|
||||
? h('span', { className: 'dsh-ct-labels' }, jobModelLabel(job))
|
||||
: null,
|
||||
labelsInline(job)
|
||||
? h('span', { className: 'dsh-ct-labels' }, labelsInline(job))
|
||||
: null,
|
||||
|
|
@ -1216,7 +1232,10 @@ body>.dsh-ct-main{position:fixed;top:0;right:0;bottom:0;left:var(--dsh-ct-sideba
|
|||
key: row.id,
|
||||
}, row.name || row.id)),
|
||||
),
|
||||
h('span', { className: 'dsh-ct-cwdHint' }, t('agentPresetHint')),
|
||||
h('span', { className: 'dsh-ct-cwdHint' },
|
||||
selected
|
||||
? `${t('agentPreset')}: ${known ? (items.find((row) => row.id === selected)?.name || selected) : selected}`
|
||||
: `${t('agentPreset')}: ${t('presetHostDefault')} — ${t('agentPresetHint')}`),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -1761,7 +1780,7 @@ body>.dsh-ct-main{position:fixed;top:0;right:0;bottom:0;left:var(--dsh-ct-sideba
|
|||
|
||||
return h(React.Fragment, null,
|
||||
h(JobList, {
|
||||
t, jobs, runs, selection, viewer, expanded, error,
|
||||
t, jobs, runs, selection, viewer, presets, expanded, error,
|
||||
onSelectJob: selectJob,
|
||||
onSelectRun: selectRun,
|
||||
onNew: selectNew,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue