clementine-agent 1.18.108 → 1.18.109
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/dist/cli/dashboard.js +54 -0
- package/package.json +1 -1
package/dist/cli/dashboard.js
CHANGED
|
@@ -25125,6 +25125,11 @@ var _runListState = {
|
|
|
25125
25125
|
filterTrigger: 'all', // 'all' | manual | scheduled | after | api | webhook (PRD §6 Run.trigger)
|
|
25126
25126
|
filterText: '', // free-text task name match
|
|
25127
25127
|
activeView: 'failures-24h', // PRD §5.3: which Saved View chip is lit
|
|
25128
|
+
// PRD §5.3 Phase 5.3c / 1.18.100: column sort. Default = startedAt
|
|
25129
|
+
// desc (newest first), what most operators want when triaging.
|
|
25130
|
+
// Restored in 1.18.109 after the parallel agent's edits dropped these.
|
|
25131
|
+
sortBy: 'startedAt', // 'startedAt' | 'durationMs' | 'totalCostUsd' | 'jobName'
|
|
25132
|
+
sortDir: 'desc', // 'asc' | 'desc'
|
|
25128
25133
|
data: [], // raw runs from /api/cron/runs
|
|
25129
25134
|
};
|
|
25130
25135
|
|
|
@@ -25191,10 +25196,59 @@ function _runListSaveView() {
|
|
|
25191
25196
|
filterTrigger: _runListState.filterTrigger,
|
|
25192
25197
|
filterText: _runListState.filterText,
|
|
25193
25198
|
activeView: _runListState.activeView,
|
|
25199
|
+
sortBy: _runListState.sortBy,
|
|
25200
|
+
sortDir: _runListState.sortDir,
|
|
25194
25201
|
}));
|
|
25195
25202
|
} catch (e) { /* ignore */ }
|
|
25196
25203
|
}
|
|
25197
25204
|
|
|
25205
|
+
// PRD §5.3 Phase 5.3c / 1.18.100: column sort click handler. Cycle:
|
|
25206
|
+
// click new column → sort by it desc
|
|
25207
|
+
// click same column → flip direction
|
|
25208
|
+
// sort is independent of saved view so users can flip it freely
|
|
25209
|
+
// without dropping out of an active built-in view.
|
|
25210
|
+
//
|
|
25211
|
+
// (Re-added in 1.18.109 after the parallel agent's edits stripped these
|
|
25212
|
+
// functions and broke the Run list — the renderer references them via
|
|
25213
|
+
// onclick but they had no definitions on disk.)
|
|
25214
|
+
function setRunListSort(col) {
|
|
25215
|
+
if (_runListState.sortBy === col) {
|
|
25216
|
+
_runListState.sortDir = _runListState.sortDir === 'asc' ? 'desc' : 'asc';
|
|
25217
|
+
} else {
|
|
25218
|
+
_runListState.sortBy = col;
|
|
25219
|
+
_runListState.sortDir = col === 'jobName' ? 'asc' : 'desc';
|
|
25220
|
+
}
|
|
25221
|
+
_runListSaveView();
|
|
25222
|
+
var panel = document.getElementById('panel-runs');
|
|
25223
|
+
if (panel) panel.innerHTML = renderRunListBody(_runListState.data);
|
|
25224
|
+
}
|
|
25225
|
+
|
|
25226
|
+
// Comparator factory for Array.sort. Stable falsy handling: rows missing
|
|
25227
|
+
// the field sort to the end regardless of direction so the list doesn't
|
|
25228
|
+
// lead with a confusing block of "—" rows.
|
|
25229
|
+
function _runListComparator(by, dir) {
|
|
25230
|
+
var sign = dir === 'asc' ? 1 : -1;
|
|
25231
|
+
return function(a, b) {
|
|
25232
|
+
var av = a[by];
|
|
25233
|
+
var bv = b[by];
|
|
25234
|
+
var aMissing = av == null || av === '';
|
|
25235
|
+
var bMissing = bv == null || bv === '';
|
|
25236
|
+
if (aMissing && bMissing) return 0;
|
|
25237
|
+
if (aMissing) return 1;
|
|
25238
|
+
if (bMissing) return -1;
|
|
25239
|
+
if (by === 'startedAt') {
|
|
25240
|
+
av = new Date(av).getTime();
|
|
25241
|
+
bv = new Date(bv).getTime();
|
|
25242
|
+
} else if (by === 'jobName') {
|
|
25243
|
+
av = String(av).toLowerCase();
|
|
25244
|
+
bv = String(bv).toLowerCase();
|
|
25245
|
+
}
|
|
25246
|
+
if (av < bv) return -1 * sign;
|
|
25247
|
+
if (av > bv) return 1 * sign;
|
|
25248
|
+
return 0;
|
|
25249
|
+
};
|
|
25250
|
+
}
|
|
25251
|
+
|
|
25198
25252
|
function applyRunListView(id) {
|
|
25199
25253
|
if (id === 'custom') { _runListState.activeView = 'custom'; _runListSaveView(); return; }
|
|
25200
25254
|
var view = null;
|