fix(frontend): flag gone-agent columns in the schedules table (#1586)
The schedules table builds a column per target, including agents that have since been destroyed (their past schedules linger). Those columns showed identically to live agents, so the operator couldn't tell a schedule still targets something that no longer exists. Flag them: renderSchedulesTableHead now checks each agent column against the live roster (containersState) and, for any that isn't there (and isn't 'operator', which is always valid), greys + strikes through the column label and titles it 'no longer exists (gone)'. The rows stay visible + cancellable — the operator can see the stale targets and clear them rather than be surprised by phantom columns. Build green.
This commit is contained in:
parent
6f672c2162
commit
0dc85e8261
2 changed files with 17 additions and 2 deletions
|
|
@ -1181,6 +1181,14 @@ footer .banner-thin {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0 4px 1px;
|
padding: 0 4px 1px;
|
||||||
}
|
}
|
||||||
|
/* Column for an agent no longer in the live roster — its past schedules
|
||||||
|
linger but the agent is gone. Greyed + struck through so the operator
|
||||||
|
can still see (and cancel) the stale entries rather than be surprised. */
|
||||||
|
.schedules-table-agent-th--gone > div {
|
||||||
|
color: var(--muted);
|
||||||
|
text-decoration: line-through;
|
||||||
|
opacity: 0.75;
|
||||||
|
}
|
||||||
.schedules-table-row-cancelled td { opacity: 0.55; }
|
.schedules-table-row-cancelled td { opacity: 0.55; }
|
||||||
.schedules-table-body-cell {
|
.schedules-table-body-cell {
|
||||||
max-width: 30em;
|
max-width: 30em;
|
||||||
|
|
|
||||||
|
|
@ -619,9 +619,16 @@ function renderSchedulesTableHead(agents) {
|
||||||
el('th', {}, 'owner'),
|
el('th', {}, 'owner'),
|
||||||
el('th', { class: 'schedules-table-body-th' }, 'body'),
|
el('th', { class: 'schedules-table-body-th' }, 'body'),
|
||||||
);
|
);
|
||||||
|
// 'operator' is always a valid target; every other column maps to a
|
||||||
|
// container, so flag any column whose agent is no longer in the live
|
||||||
|
// roster — its past schedules linger in the table but the agent is gone.
|
||||||
|
const liveNames = new Set(Array.from(containersState.values()).map((c) => c.name));
|
||||||
for (const a of agents) {
|
for (const a of agents) {
|
||||||
headerRow.append(el('th', { class: 'schedules-table-agent-th', title: a },
|
const gone = a !== 'operator' && !liveNames.has(a);
|
||||||
el('div', {}, el('span', {}, a))));
|
headerRow.append(el('th', {
|
||||||
|
class: 'schedules-table-agent-th' + (gone ? ' schedules-table-agent-th--gone' : ''),
|
||||||
|
title: gone ? a + ' — no longer exists (gone)' : a,
|
||||||
|
}, el('div', {}, el('span', {}, a))));
|
||||||
}
|
}
|
||||||
headerRow.append(el('th', { class: 'schedules-table-actions-th' }, ''));
|
headerRow.append(el('th', { class: 'schedules-table-actions-th' }, ''));
|
||||||
thead.append(headerRow);
|
thead.append(headerRow);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue