@xeplr/ui-jobs 1.6.10 → 1.6.12
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/README.md +1 -0
- package/package.json +1 -1
- package/src/components/CronScheduleField.css +3 -3
- package/src/components/JobChainSection.css +7 -7
- package/src/components/ParametersField.css +7 -7
- package/src/pages/Jobs.css +77 -68
- package/src/pages/Jobs.jsx +35 -0
- package/src/pages/multiPick.js +22 -0
package/README.md
CHANGED
|
@@ -187,6 +187,7 @@ registerJobsUI({
|
|
|
187
187
|
|
|
188
188
|
- **A kind with no source gets a plain text input.** An empty dropdown looks broken; a text box is what you have without a catalogue.
|
|
189
189
|
- A field with `dependsOn: 'connectionInfoId'` stays disabled until that field has a value, then requests `?connectionInfoId=<value>` and keeps only rows whose `connectionId` equals it.
|
|
190
|
+
- A field of `type: 'array'` with `optionsFrom` is **ticks**: several chosen at once, saved as a list (`["taskie", "taskie_jobs"]`), in the options' order. A saved value the source no longer offers stays ticked, marked "not offered now", so a save never drops it silently.
|
|
190
191
|
- A failed fetch says "Could not load the list" rather than showing an empty one.
|
|
191
192
|
|
|
192
193
|
## Other exports
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
.csf-field { display: grid; gap: 6px; margin-bottom: 14px; }
|
|
2
|
-
.csf-field label { font-size: 13px; color: var(--muted, #6b6a63); }
|
|
2
|
+
.csf-field label { font-size: 13px; color: var(--muted, var(--xeplr-text-secondary, #6b6a63)); }
|
|
3
3
|
.csf-field select, .csf-field input {
|
|
4
4
|
width: 100%; padding: 9px 11px; font: inherit; font-size: 14px;
|
|
5
5
|
color: var(--xeplr-input-text, #1a1a19); background: var(--xeplr-input-bg, #ffffff);
|
|
6
6
|
border: 1px solid var(--xeplr-input-border, #e2e1d9); border-radius: 8px;
|
|
7
7
|
}
|
|
8
|
-
.csf-field select:focus, .csf-field input:focus { outline: none; border-color: var(--accent, #2563eb); }
|
|
8
|
+
.csf-field select:focus, .csf-field input:focus { outline: none; border-color: var(--accent, var(--xeplr-accent, #2563eb)); }
|
|
9
9
|
.csf-cron { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
|
|
10
|
-
.csf-help { font-size: 12px; color: var(--muted, #6b6a63); }
|
|
10
|
+
.csf-help { font-size: 12px; color: var(--muted, var(--xeplr-text-secondary, #6b6a63)); }
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/* "After this job" — the rules list in the job editor. */
|
|
2
2
|
.jb-chain { display: grid; gap: 10px; }
|
|
3
|
-
.jb-chain-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink, #1a1a19); cursor: pointer; }
|
|
3
|
+
.jb-chain-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink, var(--xeplr-text-primary, #1a1a19)); cursor: pointer; }
|
|
4
4
|
.jb-chain-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
|
|
5
5
|
.jb-chain-rule {
|
|
6
|
-
padding: 12px 14px; background: var(--plane, #f7f7f5);
|
|
7
|
-
border: 1px solid var(--hair, #e2e1d9); border-radius: 11px;
|
|
6
|
+
padding: 12px 14px; background: var(--plane, var(--xeplr-bg-tertiary, #f7f7f5));
|
|
7
|
+
border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 11px;
|
|
8
8
|
}
|
|
9
9
|
.jb-chain-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
|
|
10
|
-
.jb-chain-n { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #6b6a63); }
|
|
10
|
+
.jb-chain-n { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, var(--xeplr-text-secondary, #6b6a63)); }
|
|
11
11
|
.jb-chain-tools { display: flex; gap: 6px; }
|
|
12
12
|
.jb-chain-tools button, .jb-chain-add {
|
|
13
|
-
padding: 4px 10px; font: inherit; font-size: 12px; color: var(--ink, #1a1a19);
|
|
14
|
-
background: var(--surface, #ffffff); border: 1px solid var(--hair, #e2e1d9); border-radius: 7px; cursor: pointer;
|
|
13
|
+
padding: 4px 10px; font: inherit; font-size: 12px; color: var(--ink, var(--xeplr-text-primary, #1a1a19));
|
|
14
|
+
background: var(--surface, var(--xeplr-bg-secondary, #ffffff)); border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 7px; cursor: pointer;
|
|
15
15
|
}
|
|
16
16
|
.jb-chain-tools button:disabled { opacity: .45; cursor: default; }
|
|
17
17
|
.jb-chain-add { justify-self: start; font-size: 13px; padding: 6px 12px; }
|
|
18
18
|
.jb-chain-json { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; resize: vertical; }
|
|
19
|
-
.jb-chain-fields { margin: 6px 0 8px; padding-left: 18px; font-size: 13px; color: var(--muted, #6b6a63); display: grid; gap: 3px; }
|
|
19
|
+
.jb-chain-fields { margin: 6px 0 8px; padding-left: 18px; font-size: 13px; color: var(--muted, var(--xeplr-text-secondary, #6b6a63)); display: grid; gap: 3px; }
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
}
|
|
8
8
|
.jb-editor .jb-param input, .jb-editor .jb-param select { width: 100%; min-width: 0; }
|
|
9
9
|
.jb-param-name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
|
|
10
|
-
.jb-param-arrow { color: var(--muted, #6b6a63); }
|
|
10
|
+
.jb-param-arrow { color: var(--muted, var(--xeplr-text-secondary, #6b6a63)); }
|
|
11
11
|
.jb-param-gap { min-width: 0; }
|
|
12
12
|
.jb-param-remove, .jb-param-add {
|
|
13
|
-
padding: 5px 10px; font: inherit; font-size: 12px; color: var(--ink, #1a1a19);
|
|
14
|
-
background: var(--surface, #ffffff); border: 1px solid var(--hair, #e2e1d9); border-radius: 7px; cursor: pointer;
|
|
13
|
+
padding: 5px 10px; font: inherit; font-size: 12px; color: var(--ink, var(--xeplr-text-primary, #1a1a19));
|
|
14
|
+
background: var(--surface, var(--xeplr-bg-secondary, #ffffff)); border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 7px; cursor: pointer;
|
|
15
15
|
}
|
|
16
16
|
.jb-param-add { justify-self: start; font-size: 13px; }
|
|
17
17
|
@media (max-width: 640px) {
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
.jb-namebox-list {
|
|
24
24
|
position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px;
|
|
25
25
|
list-style: none; max-height: 220px; overflow: auto;
|
|
26
|
-
background: var(--surface, #ffffff); border: 1px solid var(--hair, #e2e1d9); border-radius: 8px;
|
|
26
|
+
background: var(--surface, var(--xeplr-bg-secondary, #ffffff)); border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 8px;
|
|
27
27
|
box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
|
|
28
28
|
}
|
|
29
29
|
.jb-namebox-list li {
|
|
30
30
|
padding: 6px 8px; border-radius: 6px; cursor: pointer;
|
|
31
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--ink, #1a1a19);
|
|
31
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--ink, var(--xeplr-text-primary, #1a1a19));
|
|
32
32
|
}
|
|
33
|
-
.jb-namebox-list li:hover, .jb-namebox-list li[aria-selected="true"] { background: var(--xeplr-hover, #f0efe9); }
|
|
34
|
-
.jb-namebox-list .jb-namebox-note { cursor: default; font-family: inherit; font-size: 12px; color: var(--muted, #6b6a63); }
|
|
33
|
+
.jb-namebox-list li:hover, .jb-namebox-list li[aria-selected="true"] { background: var(--xeplr-hover, var(--xeplr-bg-hover, #f0efe9)); }
|
|
34
|
+
.jb-namebox-list .jb-namebox-note { cursor: default; font-family: inherit; font-size: 12px; color: var(--muted, var(--xeplr-text-secondary, #6b6a63)); }
|
|
35
35
|
.jb-namebox-list .jb-namebox-note:hover { background: none; }
|
package/src/pages/Jobs.css
CHANGED
|
@@ -13,24 +13,24 @@
|
|
|
13
13
|
|
|
14
14
|
.jb-search, .jb-sort {
|
|
15
15
|
padding: 9px 12px; font: inherit; font-size: 14px;
|
|
16
|
-
color: var(--ink, #1a1a19); background: var(--surface, #ffffff);
|
|
17
|
-
border: 1px solid var(--hair, #e2e1d9); border-radius: 9px;
|
|
16
|
+
color: var(--ink, var(--xeplr-text-primary, #1a1a19)); background: var(--surface, var(--xeplr-bg-secondary, #ffffff));
|
|
17
|
+
border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 9px;
|
|
18
18
|
}
|
|
19
19
|
.jb-search { width: 220px; }
|
|
20
20
|
.jb-search:focus, .jb-sort:focus {
|
|
21
|
-
outline: none; border-color: var(--accent, #2563eb); box-shadow: 0 0 0 3px var(--xeplr-accent-soft, #e8eefc);
|
|
21
|
+
outline: none; border-color: var(--accent, var(--xeplr-accent, #2563eb)); box-shadow: 0 0 0 3px var(--xeplr-accent-soft, var(--xeplr-accent-muted, #e8eefc));
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.jb-primary {
|
|
25
25
|
padding: 9px 16px; font: inherit; font-weight: 600; white-space: nowrap;
|
|
26
|
-
color: #fff; background: var(--accent, #2563eb); border: 0; border-radius: 9px; cursor: pointer;
|
|
26
|
+
color: #fff; background: var(--accent, var(--xeplr-accent, #2563eb)); border: 0; border-radius: 9px; cursor: pointer;
|
|
27
27
|
}
|
|
28
28
|
.jb-primary:hover { filter: brightness(1.06); }
|
|
29
29
|
.jb-primary:disabled { opacity: .55; cursor: default; filter: none; }
|
|
30
30
|
|
|
31
31
|
/* ── the table ───────────────────────────────────────────────────────── */
|
|
32
32
|
.jb-table-wrap {
|
|
33
|
-
background: var(--surface, #ffffff); border: 1px solid var(--hair, #e2e1d9);
|
|
33
|
+
background: var(--surface, var(--xeplr-bg-secondary, #ffffff)); border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9));
|
|
34
34
|
border-radius: 13px;
|
|
35
35
|
/* SCROLLS rather than clips: if anything ever makes the table wider than
|
|
36
36
|
the page, the person can still reach its right-hand controls (a run's
|
|
@@ -40,22 +40,22 @@
|
|
|
40
40
|
.jb-table { width: 100%; border-collapse: collapse; }
|
|
41
41
|
.jb-table thead th {
|
|
42
42
|
padding: 11px 16px; text-align: left; font-size: 11px; font-weight: 600;
|
|
43
|
-
letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #6b6a63);
|
|
44
|
-
background: var(--plane, #f7f7f5); border-bottom: 1px solid var(--hair, #e2e1d9); white-space: nowrap;
|
|
43
|
+
letter-spacing: .06em; text-transform: uppercase; color: var(--muted, var(--xeplr-text-secondary, #6b6a63));
|
|
44
|
+
background: var(--plane, var(--xeplr-bg-tertiary, #f7f7f5)); border-bottom: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); white-space: nowrap;
|
|
45
45
|
}
|
|
46
46
|
.jb-table td {
|
|
47
47
|
padding: 13px 16px; vertical-align: top; font-size: 14px;
|
|
48
48
|
border-bottom: 1px solid var(--xeplr-border-secondary, #eceada);
|
|
49
49
|
}
|
|
50
50
|
.jb-table tbody tr:last-child td { border-bottom: 0; }
|
|
51
|
-
.jb-table tbody tr:hover { background: var(--xeplr-hover, #f0efe9); }
|
|
51
|
+
.jb-table tbody tr:hover { background: var(--xeplr-hover, var(--xeplr-bg-hover, #f0efe9)); }
|
|
52
52
|
|
|
53
53
|
.jb-name { font-weight: 600; }
|
|
54
|
-
.jb-desc { color: var(--muted, #6b6a63); font-size: 13px; margin-top: 2px; }
|
|
55
|
-
.jb-dim { color: var(--muted, #6b6a63); }
|
|
54
|
+
.jb-desc { color: var(--muted, var(--xeplr-text-secondary, #6b6a63)); font-size: 13px; margin-top: 2px; }
|
|
55
|
+
.jb-dim { color: var(--muted, var(--xeplr-text-secondary, #6b6a63)); }
|
|
56
56
|
.jb-code {
|
|
57
57
|
font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
|
|
58
|
-
background: var(--plane, #f7f7f5); padding: 2px 6px; border-radius: 6px;
|
|
58
|
+
background: var(--plane, var(--xeplr-bg-tertiary, #f7f7f5)); padding: 2px 6px; border-radius: 6px;
|
|
59
59
|
}
|
|
60
60
|
.jb-lastrun { display: inline-flex; align-items: center; gap: 8px; }
|
|
61
61
|
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
.jb-row-actions button {
|
|
64
64
|
margin-right: 4px; padding: 5px 10px; font: inherit; font-size: 13px;
|
|
65
65
|
color: inherit; background: transparent;
|
|
66
|
-
border: 1px solid var(--hair, #e2e1d9); border-radius: 7px; cursor: pointer;
|
|
66
|
+
border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 7px; cursor: pointer;
|
|
67
67
|
}
|
|
68
|
-
.jb-row-actions button:hover:not(:disabled) { background: var(--surface, #ffffff); border-color: var(--xeplr-border-strong, #cfcec4); }
|
|
68
|
+
.jb-row-actions button:hover:not(:disabled) { background: var(--surface, var(--xeplr-bg-secondary, #ffffff)); border-color: var(--xeplr-border-strong, var(--xeplr-border-secondary, #cfcec4)); }
|
|
69
69
|
.jb-row-actions button:disabled { opacity: .45; cursor: default; }
|
|
70
70
|
.jb-danger { color: var(--xeplr-danger, #c2372e); }
|
|
71
71
|
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
font-size: 11px; font-weight: 600; text-transform: capitalize;
|
|
78
78
|
}
|
|
79
79
|
.jb-table td .jb-pill { margin-top: 6px; }
|
|
80
|
-
.jb-pill--running, .jb-pill--busy { background: var(--xeplr-status-warn-soft, #fdf3e0); color: var(--xeplr-status-warn, #a86a00); }
|
|
81
|
-
.jb-pill--scheduled { background: var(--xeplr-accent-soft, #e8eefc); color: var(--accent, #2563eb); }
|
|
80
|
+
.jb-pill--running, .jb-pill--busy { background: var(--xeplr-status-warn-soft, var(--xeplr-warning-bg, #fdf3e0)); color: var(--xeplr-status-warn, var(--xeplr-warning, #a86a00)); }
|
|
81
|
+
.jb-pill--scheduled { background: var(--xeplr-accent-soft, var(--xeplr-accent-muted, #e8eefc)); color: var(--accent, var(--xeplr-accent, #2563eb)); }
|
|
82
82
|
.jb-pill--paused, .jb-pill--manual, .jb-pill--unknown { background: var(--xeplr-tag-bg, #f0efe9); color: var(--xeplr-tag-text, #6b6a63); }
|
|
83
|
-
.jb-pill--good { background: var(--xeplr-status-good-soft, #e7f4ed); color: var(--xeplr-status-good, #1d7a4c); }
|
|
84
|
-
.jb-pill--bad { background: var(--xeplr-status-critical-soft, #fdeceb); color: var(--xeplr-status-critical, #c2372e); }
|
|
83
|
+
.jb-pill--good { background: var(--xeplr-status-good-soft, var(--xeplr-success-bg, #e7f4ed)); color: var(--xeplr-status-good, var(--xeplr-success, #1d7a4c)); }
|
|
84
|
+
.jb-pill--bad { background: var(--xeplr-status-critical-soft, var(--xeplr-danger-bg, #fdeceb)); color: var(--xeplr-status-critical, var(--xeplr-danger, #c2372e)); }
|
|
85
85
|
|
|
86
86
|
/* ── live updates ────────────────────────────────────────────────────── */
|
|
87
87
|
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
display: inline-block; margin: 6px 0 0 6px; padding: 2px 8px; border-radius: 999px;
|
|
94
94
|
font-size: 11px; font-weight: 600;
|
|
95
95
|
font-variant-numeric: tabular-nums;
|
|
96
|
-
background: var(--xeplr-accent-soft, #e8eefc); color: var(--accent, #2563eb);
|
|
96
|
+
background: var(--xeplr-accent-soft, var(--xeplr-accent-muted, #e8eefc)); color: var(--accent, var(--xeplr-accent, #2563eb));
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/* Reporting, then silent. Toned DOWN rather than up: a long final write is
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
.jb-live-count {
|
|
111
111
|
padding: 1px 7px; border-radius: 999px; font-weight: 600;
|
|
112
112
|
font-variant-numeric: tabular-nums;
|
|
113
|
-
background: var(--xeplr-status-warn-soft, #fdf3e0); color: var(--xeplr-status-warn, #a86a00);
|
|
113
|
+
background: var(--xeplr-status-warn-soft, var(--xeplr-warning-bg, #fdf3e0)); color: var(--xeplr-status-warn, var(--xeplr-warning, #a86a00));
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/* ── the editor ──────────────────────────────────────────────────────── */
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
form can have at once. Fields now flow into columns instead of stacking. */
|
|
120
120
|
.jb-editor {
|
|
121
121
|
max-width: 1100px; margin: 0 0 24px; padding: 22px 26px;
|
|
122
|
-
background: var(--surface, #ffffff); border: 1px solid var(--hair, #e2e1d9); border-radius: 13px;
|
|
122
|
+
background: var(--surface, var(--xeplr-bg-secondary, #ffffff)); border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 13px;
|
|
123
123
|
}
|
|
124
124
|
.jb-editor h2 { margin: 0 0 16px; font-size: 17px; }
|
|
125
125
|
.jb-field { display: grid; gap: 5px; margin-bottom: 14px; align-content: start; }
|
|
@@ -132,23 +132,23 @@
|
|
|
132
132
|
/* JSON needs room to be read, so it takes the whole row. */
|
|
133
133
|
.jb-field--wide { grid-column: 1 / -1; }
|
|
134
134
|
.jb-field label {
|
|
135
|
-
font-size: 13px; font-weight: 500; color: var(--ink, #1a1a19);
|
|
135
|
+
font-size: 13px; font-weight: 500; color: var(--ink, var(--xeplr-text-primary, #1a1a19));
|
|
136
136
|
}
|
|
137
137
|
.jb-field input, .jb-field select {
|
|
138
138
|
width: 100%; padding: 9px 11px; font: inherit; font-size: 14px;
|
|
139
139
|
color: var(--xeplr-input-text, #1a1a19); background: var(--xeplr-input-bg, #ffffff);
|
|
140
140
|
border: 1px solid var(--xeplr-input-border, #e2e1d9); border-radius: 8px;
|
|
141
141
|
}
|
|
142
|
-
.jb-field input:focus, .jb-field select:focus { outline: none; border-color: var(--accent, #2563eb); }
|
|
142
|
+
.jb-field input:focus, .jb-field select:focus { outline: none; border-color: var(--accent, var(--xeplr-accent, #2563eb)); }
|
|
143
143
|
.jb-cron { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
|
|
144
|
-
.jb-help { font-size: 12px; color: var(--muted, #6b6a63); }
|
|
145
|
-
.jb-warn { color: var(--xeplr-status-warn, #a86a00); }
|
|
144
|
+
.jb-help { font-size: 12px; color: var(--muted, var(--xeplr-text-secondary, #6b6a63)); }
|
|
145
|
+
.jb-warn { color: var(--xeplr-status-warn, var(--xeplr-warning, #a86a00)); }
|
|
146
146
|
.jb-req { color: var(--xeplr-danger, #c2372e); }
|
|
147
|
-
.jb-type { color: var(--xeplr-muted-2, #8a887f); font-size: 11px; }
|
|
147
|
+
.jb-type { color: var(--xeplr-muted-2, var(--xeplr-text-muted, #8a887f)); font-size: 11px; }
|
|
148
148
|
.jb-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
|
|
149
149
|
.jb-editor-actions button:not(.jb-primary) {
|
|
150
150
|
padding: 9px 16px; font: inherit; color: inherit; background: transparent;
|
|
151
|
-
border: 1px solid var(--hair, #e2e1d9); border-radius: 9px; cursor: pointer;
|
|
151
|
+
border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 9px; cursor: pointer;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
/* ── history ─────────────────────────────────────────────────────────── */
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
.jb-run {
|
|
158
158
|
display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
|
|
159
159
|
padding: 10px 14px; font-size: 13px;
|
|
160
|
-
background: var(--surface, #ffffff); border: 1px solid var(--hair, #e2e1d9); border-radius: 10px;
|
|
160
|
+
background: var(--surface, var(--xeplr-bg-secondary, #ffffff)); border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 10px;
|
|
161
161
|
}
|
|
162
162
|
.jb-run .jb-pill { margin-top: 0; }
|
|
163
163
|
.jb-run-name { font-weight: 600; }
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
/* ── empty ───────────────────────────────────────────────────────────── */
|
|
167
167
|
.jb-empty {
|
|
168
168
|
padding: 40px 24px; text-align: center;
|
|
169
|
-
background: var(--surface, #ffffff); border: 1px dashed var(--hair, #e2e1d9); border-radius: 13px;
|
|
169
|
+
background: var(--surface, var(--xeplr-bg-secondary, #ffffff)); border: 1px dashed var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 13px;
|
|
170
170
|
}
|
|
171
171
|
.jb-empty--inline { border: 0; border-radius: 0; padding: 32px 24px; }
|
|
172
172
|
.jb-empty-title { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
|
|
@@ -193,30 +193,30 @@
|
|
|
193
193
|
background: none; border: 0; padding: 0; margin: 0;
|
|
194
194
|
font: inherit; color: inherit; cursor: pointer; text-align: left;
|
|
195
195
|
}
|
|
196
|
-
.jb-lastrun--btn:hover .jb-caret { color: var(--accent, #2563eb); }
|
|
197
|
-
.jb-lastrun--btn:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 3px; border-radius: 6px; }
|
|
196
|
+
.jb-lastrun--btn:hover .jb-caret { color: var(--accent, var(--xeplr-accent, #2563eb)); }
|
|
197
|
+
.jb-lastrun--btn:focus-visible { outline: 2px solid var(--accent, var(--xeplr-accent, #2563eb)); outline-offset: 3px; border-radius: 6px; }
|
|
198
198
|
|
|
199
199
|
.jb-caret {
|
|
200
|
-
color: var(--muted, #6b6a63); font-size: 15px; line-height: 1;
|
|
200
|
+
color: var(--muted, var(--xeplr-text-secondary, #6b6a63)); font-size: 15px; line-height: 1;
|
|
201
201
|
transition: transform .12s ease; display: inline-block;
|
|
202
202
|
}
|
|
203
203
|
.jb-caret--open { transform: rotate(90deg); }
|
|
204
204
|
|
|
205
205
|
/* The open row and its history read as one block, so the parent loses its
|
|
206
206
|
bottom rule and the panel picks up the accent edge. */
|
|
207
|
-
.jb-row--open > td { border-bottom: 0; background: var(--xeplr-hover, #f0efe9); }
|
|
208
|
-
.jb-runs-row > td { padding: 0 0 14px 0; background: var(--xeplr-hover, #f0efe9); }
|
|
209
|
-
.jb-runs-row:hover > td { background: var(--xeplr-hover, #f0efe9); }
|
|
207
|
+
.jb-row--open > td { border-bottom: 0; background: var(--xeplr-hover, var(--xeplr-bg-hover, #f0efe9)); }
|
|
208
|
+
.jb-runs-row > td { padding: 0 0 14px 0; background: var(--xeplr-hover, var(--xeplr-bg-hover, #f0efe9)); }
|
|
209
|
+
.jb-runs-row:hover > td { background: var(--xeplr-hover, var(--xeplr-bg-hover, #f0efe9)); }
|
|
210
210
|
|
|
211
211
|
.jb-history {
|
|
212
|
-
margin: 0 14px; border: 1px solid var(--hair, #e2e1d9); border-radius: 11px;
|
|
213
|
-
background: var(--surface, #ffffff); overflow-x: auto;
|
|
212
|
+
margin: 0 14px; border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 11px;
|
|
213
|
+
background: var(--surface, var(--xeplr-bg-secondary, #ffffff)); overflow-x: auto;
|
|
214
214
|
}
|
|
215
215
|
.jb-history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
216
216
|
.jb-history-table th {
|
|
217
217
|
text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600;
|
|
218
|
-
letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #6b6a63);
|
|
219
|
-
background: var(--plane, #f7f7f5); border-bottom: 1px solid var(--hair, #e2e1d9); white-space: nowrap;
|
|
218
|
+
letter-spacing: .06em; text-transform: uppercase; color: var(--muted, var(--xeplr-text-secondary, #6b6a63));
|
|
219
|
+
background: var(--plane, var(--xeplr-bg-tertiary, #f7f7f5)); border-bottom: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); white-space: nowrap;
|
|
220
220
|
}
|
|
221
221
|
.jb-history-table td { padding: 8px 12px; border-bottom: 1px solid var(--xeplr-border-secondary, #eceada); vertical-align: top; }
|
|
222
222
|
.jb-history-table tr:last-child td { border-bottom: 0; }
|
|
@@ -226,32 +226,32 @@
|
|
|
226
226
|
/* A retry count belongs NEXT TO the outcome, not in its own column — it is a
|
|
227
227
|
qualifier on "how did it go", not a separate fact. */
|
|
228
228
|
.jb-retry {
|
|
229
|
-
margin-left: 8px; font-size: 12px; color: var(--xeplr-status-warn, #a86a00);
|
|
229
|
+
margin-left: 8px; font-size: 12px; color: var(--xeplr-status-warn, var(--xeplr-warning, #a86a00));
|
|
230
230
|
white-space: nowrap;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
/* A late finish is not a failure: the work completed. It reads as a setting to
|
|
234
234
|
change, which is why it is warn-toned rather than critical. */
|
|
235
|
-
.jb-late { color: var(--xeplr-status-warn, #a86a00); font-size: 12px; }
|
|
235
|
+
.jb-late { color: var(--xeplr-status-warn, var(--xeplr-warning, #a86a00)); font-size: 12px; }
|
|
236
236
|
|
|
237
237
|
/* interrupted / skipped — neither broken nor fine. */
|
|
238
|
-
.jb-pill--warn { background: var(--xeplr-status-warn-soft, #fdf3e0); color: var(--xeplr-status-warn, #a86a00); }
|
|
238
|
+
.jb-pill--warn { background: var(--xeplr-status-warn-soft, var(--xeplr-warning-bg, #fdf3e0)); color: var(--xeplr-status-warn, var(--xeplr-warning, #a86a00)); }
|
|
239
239
|
|
|
240
240
|
/* ── Editor: three sections ────────────────────────────────────────────── */
|
|
241
241
|
|
|
242
242
|
.jb-steps {
|
|
243
243
|
display: flex; gap: 6px; margin: 4px 0 2px;
|
|
244
|
-
border-bottom: 1px solid var(--hair, #e2e1d9); padding-bottom: 0;
|
|
244
|
+
border-bottom: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); padding-bottom: 0;
|
|
245
245
|
}
|
|
246
246
|
.jb-step {
|
|
247
247
|
display: inline-flex; align-items: center; gap: 8px;
|
|
248
248
|
padding: 9px 14px; background: none; border: 0; cursor: pointer;
|
|
249
|
-
font: inherit; font-size: 14px; color: var(--muted, #6b6a63);
|
|
249
|
+
font: inherit; font-size: 14px; color: var(--muted, var(--xeplr-text-secondary, #6b6a63));
|
|
250
250
|
border-bottom: 2px solid transparent; margin-bottom: -1px;
|
|
251
251
|
}
|
|
252
|
-
.jb-step:hover { color: var(--ink, #1a1a19); }
|
|
253
|
-
.jb-step--on { color: var(--ink, #1a1a19); font-weight: 600; border-bottom-color: var(--accent, #2563eb); }
|
|
254
|
-
.jb-step:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: -2px; border-radius: 6px; }
|
|
252
|
+
.jb-step:hover { color: var(--ink, var(--xeplr-text-primary, #1a1a19)); }
|
|
253
|
+
.jb-step--on { color: var(--ink, var(--xeplr-text-primary, #1a1a19)); font-weight: 600; border-bottom-color: var(--accent, var(--xeplr-accent, #2563eb)); }
|
|
254
|
+
.jb-step:focus-visible { outline: 2px solid var(--accent, var(--xeplr-accent, #2563eb)); outline-offset: -2px; border-radius: 6px; }
|
|
255
255
|
|
|
256
256
|
/* The number is the affordance that says "these are ordered" — without it a
|
|
257
257
|
row of three words reads as tabs, which promise no sequence at all. */
|
|
@@ -261,10 +261,10 @@
|
|
|
261
261
|
font-size: 12px; font-weight: 600;
|
|
262
262
|
background: var(--xeplr-tag-bg, #f0efe9); color: var(--xeplr-tag-text, #6b6a63);
|
|
263
263
|
}
|
|
264
|
-
.jb-step--on .jb-step-n { background: var(--accent, #2563eb); color: #fff; }
|
|
265
|
-
.jb-step--done .jb-step-n { background: var(--xeplr-status-good-soft, #e7f4ed); color: var(--xeplr-status-good, #1d7a4c); }
|
|
264
|
+
.jb-step--on .jb-step-n { background: var(--accent, var(--xeplr-accent, #2563eb)); color: #fff; }
|
|
265
|
+
.jb-step--done .jb-step-n { background: var(--xeplr-status-good-soft, var(--xeplr-success-bg, #e7f4ed)); color: var(--xeplr-status-good, var(--xeplr-success, #1d7a4c)); }
|
|
266
266
|
|
|
267
|
-
.jb-step-hint { margin: 10px 0 14px; font-size: 13px; color: var(--muted, #6b6a63); }
|
|
267
|
+
.jb-step-hint { margin: 10px 0 14px; font-size: 13px; color: var(--muted, var(--xeplr-text-secondary, #6b6a63)); }
|
|
268
268
|
|
|
269
269
|
.jb-editor textarea {
|
|
270
270
|
padding: 9px 11px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
@@ -272,32 +272,32 @@
|
|
|
272
272
|
border: 1px solid var(--xeplr-input-border, #e2e1d9); border-radius: 8px;
|
|
273
273
|
resize: vertical; width: 100%; box-sizing: border-box;
|
|
274
274
|
}
|
|
275
|
-
.jb-editor textarea:focus { outline: none; border-color: var(--accent, #2563eb); }
|
|
275
|
+
.jb-editor textarea:focus { outline: none; border-color: var(--accent, var(--xeplr-accent, #2563eb)); }
|
|
276
276
|
|
|
277
277
|
/* Cancel on the left, Save on the right, stepping in between — so the
|
|
278
278
|
destructive and the committing action never sit next to each other. */
|
|
279
279
|
.jb-editor-nav { display: inline-flex; gap: 8px; margin-left: auto; }
|
|
280
280
|
.jb-editor-nav button {
|
|
281
|
-
padding: 7px 14px; font-size: 13px; color: var(--ink, #1a1a19); background: var(--plane, #f7f7f5);
|
|
282
|
-
border: 1px solid var(--hair, #e2e1d9); border-radius: 8px; cursor: pointer;
|
|
281
|
+
padding: 7px 14px; font-size: 13px; color: var(--ink, var(--xeplr-text-primary, #1a1a19)); background: var(--plane, var(--xeplr-bg-tertiary, #f7f7f5));
|
|
282
|
+
border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 8px; cursor: pointer;
|
|
283
283
|
}
|
|
284
|
-
.jb-editor-nav button:hover:not(:disabled) { background: var(--surface, #ffffff); border-color: var(--xeplr-border-strong, #cfcec4); }
|
|
284
|
+
.jb-editor-nav button:hover:not(:disabled) { background: var(--surface, var(--xeplr-bg-secondary, #ffffff)); border-color: var(--xeplr-border-strong, var(--xeplr-border-secondary, #cfcec4)); }
|
|
285
285
|
.jb-editor-nav button:disabled { opacity: .5; cursor: not-allowed; }
|
|
286
286
|
|
|
287
287
|
/* ── advanced, collapsed ───────────────────────────────────────────────── */
|
|
288
288
|
.jb-advanced {
|
|
289
|
-
margin: 4px 0 16px; padding: 0; border-top: 1px solid var(--hair, #e2e1d9);
|
|
289
|
+
margin: 4px 0 16px; padding: 0; border-top: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9));
|
|
290
290
|
}
|
|
291
291
|
.jb-advanced > summary {
|
|
292
292
|
padding: 11px 2px; cursor: pointer; font-size: 13px; font-weight: 500;
|
|
293
|
-
color: var(--ink, #1a1a19); list-style: none; display: flex; gap: 4px;
|
|
293
|
+
color: var(--ink, var(--xeplr-text-primary, #1a1a19)); list-style: none; display: flex; gap: 4px;
|
|
294
294
|
align-items: baseline; white-space: nowrap; overflow: hidden;
|
|
295
295
|
}
|
|
296
296
|
.jb-advanced > summary::-webkit-details-marker { display: none; }
|
|
297
297
|
/* A caret we control, so it can turn — the native marker cannot be animated
|
|
298
298
|
and sits at a different offset in every browser. */
|
|
299
299
|
.jb-advanced > summary::before {
|
|
300
|
-
content: '›'; display: inline-block; font-size: 15px; color: var(--muted, #6b6a63);
|
|
300
|
+
content: '›'; display: inline-block; font-size: 15px; color: var(--muted, var(--xeplr-text-secondary, #6b6a63));
|
|
301
301
|
transition: transform .12s ease;
|
|
302
302
|
}
|
|
303
303
|
.jb-advanced[open] > summary::before { transform: rotate(90deg); }
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
.jb-switch-track {
|
|
323
323
|
position: relative; display: inline-block; flex: 0 0 auto;
|
|
324
324
|
width: 42px; height: 24px; border-radius: 999px;
|
|
325
|
-
background: var(--xeplr-border-strong, #b9b9b9);
|
|
325
|
+
background: var(--xeplr-border-strong, var(--xeplr-border-secondary, #b9b9b9));
|
|
326
326
|
transition: background 140ms ease;
|
|
327
327
|
}
|
|
328
328
|
.jb-switch-thumb {
|
|
@@ -346,7 +346,7 @@
|
|
|
346
346
|
decode the control before they can read the row; "Paused" is the fact they
|
|
347
347
|
came for. */
|
|
348
348
|
.jb-switch-label { font-size: 13px; color: var(--xeplr-text-secondary, #666); }
|
|
349
|
-
.jb-switch input:checked ~ .jb-switch-label { color: var(--xeplr-text, inherit); }
|
|
349
|
+
.jb-switch input:checked ~ .jb-switch-label { color: var(--xeplr-text, var(--xeplr-text-primary, inherit)); }
|
|
350
350
|
|
|
351
351
|
/* ── ONE OCCURRENCE'S LOG, under its row in the history table ─────────────
|
|
352
352
|
Bounded height rather than growing the page: a long-running action writes
|
|
@@ -365,12 +365,12 @@
|
|
|
365
365
|
flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap;
|
|
366
366
|
}
|
|
367
367
|
.jb-log-line--warn .jb-log-msg { color: var(--xeplr-warning, #a15c00); }
|
|
368
|
-
.jb-log-line--error .jb-log-msg { color: var(--xeplr-error, #b3261e); }
|
|
368
|
+
.jb-log-line--error .jb-log-msg { color: var(--xeplr-error, var(--xeplr-danger, #b3261e)); }
|
|
369
369
|
/* A bare button wearing .jb-caret — the UA's own chrome removed so the disc
|
|
370
370
|
the caret draws is the whole control. */
|
|
371
371
|
.jb-log-toggle { padding: 0; font: inherit; cursor: pointer; }
|
|
372
|
-
.jb-log-toggle:hover { color: var(--accent, #2563eb); border-color: var(--accent, #2563eb); }
|
|
373
|
-
.jb-log-toggle:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
|
|
372
|
+
.jb-log-toggle:hover { color: var(--accent, var(--xeplr-accent, #2563eb)); border-color: var(--accent, var(--xeplr-accent, #2563eb)); }
|
|
373
|
+
.jb-log-toggle:focus-visible { outline: 2px solid var(--accent, var(--xeplr-accent, #2563eb)); outline-offset: 2px; }
|
|
374
374
|
|
|
375
375
|
/* ── ONE LINE PER ROW ────────────────────────────────────────────────────
|
|
376
376
|
Every cell stays on its line and ellipsises rather than wrapping. A table
|
|
@@ -395,13 +395,13 @@
|
|
|
395
395
|
.jb-caret {
|
|
396
396
|
display: inline-flex; align-items: center; justify-content: center;
|
|
397
397
|
width: 22px; height: 22px; flex: 0 0 auto;
|
|
398
|
-
font-size: 15px; line-height: 1; color: var(--muted, #6b6a63);
|
|
399
|
-
border: 1px solid var(--hair, #e2e1d9); border-radius: 50%;
|
|
400
|
-
background: var(--surface, #ffffff);
|
|
398
|
+
font-size: 15px; line-height: 1; color: var(--muted, var(--xeplr-text-secondary, #6b6a63));
|
|
399
|
+
border: 1px solid var(--hair, var(--xeplr-border-primary, #e2e1d9)); border-radius: 50%;
|
|
400
|
+
background: var(--surface, var(--xeplr-bg-secondary, #ffffff));
|
|
401
401
|
transition: transform .12s ease, border-color .12s ease, color .12s ease;
|
|
402
402
|
}
|
|
403
|
-
.jb-lastrun--btn:hover .jb-caret { color: var(--accent, #2563eb); border-color: var(--accent, #2563eb); }
|
|
404
|
-
.jb-caret--open { transform: rotate(90deg); color: var(--accent, #2563eb); border-color: var(--accent, #2563eb); }
|
|
403
|
+
.jb-lastrun--btn:hover .jb-caret { color: var(--accent, var(--xeplr-accent, #2563eb)); border-color: var(--accent, var(--xeplr-accent, #2563eb)); }
|
|
404
|
+
.jb-caret--open { transform: rotate(90deg); color: var(--accent, var(--xeplr-accent, #2563eb)); border-color: var(--accent, var(--xeplr-accent, #2563eb)); }
|
|
405
405
|
|
|
406
406
|
/* ── ICON ACTIONS ────────────────────────────────────────────────────────
|
|
407
407
|
Square targets, the label on hover and to a screen reader. Three worded
|
|
@@ -414,14 +414,14 @@
|
|
|
414
414
|
}
|
|
415
415
|
.jb-row-actions button:last-child { margin-right: 0; }
|
|
416
416
|
.jb-row-actions .jb-danger:hover:not(:disabled) {
|
|
417
|
-
color: var(--xeplr-error, #b3261e); border-color: currentColor; background: transparent;
|
|
417
|
+
color: var(--xeplr-error, var(--xeplr-danger, #b3261e)); border-color: currentColor; background: transparent;
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
/* The chevron is an SVG now, so centring the flex box actually centres the
|
|
421
421
|
mark — a rotated '>' glyph never sat straight, whatever the box did. */
|
|
422
422
|
.jb-caret { padding: 0; }
|
|
423
423
|
.jb-caret .jb-icon { transition: none; }
|
|
424
|
-
.jb-linkish { padding: 0; font: inherit; color: var(--accent, #2563eb); background: none; border: 0; cursor: pointer; text-decoration: underline; }
|
|
424
|
+
.jb-linkish { padding: 0; font: inherit; color: var(--accent, var(--xeplr-accent, #2563eb)); background: none; border: 0; cursor: pointer; text-decoration: underline; }
|
|
425
425
|
|
|
426
426
|
/* ── on a phone ──────────────────────────────────────────────────────────
|
|
427
427
|
The search, sort and New button wrap instead of running off the edge; the
|
|
@@ -437,3 +437,12 @@
|
|
|
437
437
|
.jb-caret { width: 32px; height: 32px; }
|
|
438
438
|
.jb-editor { padding: 16px; }
|
|
439
439
|
}
|
|
440
|
+
|
|
441
|
+
/* A list chosen from the host's options (an 'array' input with optionsFrom): ticks. */
|
|
442
|
+
.jb-picks { border: 0; padding: 0; min-width: 0; }
|
|
443
|
+
.jb-picks legend { padding: 0; margin-bottom: 5px; }
|
|
444
|
+
.jb-picks-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 16px; max-height: 240px; overflow: auto; }
|
|
445
|
+
.jb-pick { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
|
|
446
|
+
.jb-pick span { overflow-wrap: anywhere; }
|
|
447
|
+
.jb-pick input[type="checkbox"] { width: 16px; height: 16px; padding: 0; margin: 0; flex: none; accent-color: var(--accent, var(--xeplr-accent, #2563eb)); }
|
|
448
|
+
.jb-pick { font-weight: 400; }
|
package/src/pages/Jobs.jsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { pickedOf, toggled } from './multiPick.js'
|
|
1
2
|
import { Fragment, useCallback, useEffect, useMemo, useState } from 'react'
|
|
2
3
|
import { fieldLabel, raiseConfirm, raiseSnackbar } from '@xeplr/ui-utils'
|
|
3
4
|
import { relativeTime } from './relativeTime.js'
|
|
@@ -399,6 +400,36 @@ function RemoteSelect({ field, value, onChange, dependsOnValue }) {
|
|
|
399
400
|
return () => { alive = false }
|
|
400
401
|
}, [field.optionsFrom, field.dependsOn, dependsOnValue])
|
|
401
402
|
|
|
403
|
+
// A LIST from the host's options (type 'array'): ticks, several at once.
|
|
404
|
+
if (field.type === 'array') {
|
|
405
|
+
const picked = pickedOf(value)
|
|
406
|
+
const waiting = field.dependsOn && !dependsOnValue
|
|
407
|
+
const shown = (options || []).concat(picked.filter((v) => !(options || []).some((o) => String(o.value) === v)).map((v) => ({ value: v, label: v + ' (not offered now)' })))
|
|
408
|
+
return (
|
|
409
|
+
<fieldset className="jb-field jb-field--wide jb-picks" id={id}>
|
|
410
|
+
<legend>{fieldLabel(field)}{field.required && <span className="jb-req"> *</span>}
|
|
411
|
+
{picked.length ? <span className="jb-type"> · {picked.length} chosen</span> : null}</legend>
|
|
412
|
+
{waiting ? <span className="jb-help">{`Choose ${field.dependsOn} first…`}</span>
|
|
413
|
+
: options === null ? <span className="jb-help">Loading…</span>
|
|
414
|
+
: !shown.length ? <span className="jb-help">Nothing to choose from</span>
|
|
415
|
+
: (
|
|
416
|
+
<div className="jb-picks-list">
|
|
417
|
+
{shown.map((o) => (
|
|
418
|
+
<label key={o.value} className="jb-pick">
|
|
419
|
+
<input type="checkbox" checked={picked.includes(String(o.value))}
|
|
420
|
+
onChange={() => onChange(toggled(picked, String(o.value), options))} />
|
|
421
|
+
<span>{o.label}</span>
|
|
422
|
+
</label>
|
|
423
|
+
))}
|
|
424
|
+
</div>
|
|
425
|
+
)}
|
|
426
|
+
{failed
|
|
427
|
+
? <span className="jb-help jb-warn">Could not load the list.</span>
|
|
428
|
+
: field.description && <span className="jb-help">{field.description}</span>}
|
|
429
|
+
</fieldset>
|
|
430
|
+
)
|
|
431
|
+
}
|
|
432
|
+
|
|
402
433
|
return (
|
|
403
434
|
<div className="jb-field">
|
|
404
435
|
<label htmlFor={id}>
|
|
@@ -936,6 +967,10 @@ export default function Jobs({ breadcrumb: Breadcrumb, uploadLink } = {}) {
|
|
|
936
967
|
|
|
937
968
|
useEffect(() => { load() }, [load])
|
|
938
969
|
|
|
970
|
+
// An OPEN history follows the run list: when a run finishes, the live
|
|
971
|
+
// updates reload `runs`, and the history must not keep showing it Running.
|
|
972
|
+
useEffect(() => { setRunsVersion((v) => v + 1) }, [runs])
|
|
973
|
+
|
|
939
974
|
// ── LIVE UPDATES ────────────────────────────────────────────────────────
|
|
940
975
|
//
|
|
941
976
|
// This used to call load() on a timer, which is three requests — the job
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// A LIST INPUT CHOSEN FROM A HOST'S OPTIONS — an action's field of type
|
|
2
|
+
// 'array' with `optionsFrom` (several databases for one backup job) is a set
|
|
3
|
+
// of ticks, not JSON to type. Pure: what is ticked, and ticking one.
|
|
4
|
+
|
|
5
|
+
/** What is ticked: the saved list, the form's JSON text of it, or nothing. */
|
|
6
|
+
export function pickedOf(value) {
|
|
7
|
+
if (Array.isArray(value)) return value.map(String)
|
|
8
|
+
if (typeof value !== 'string' || !value.trim()) return []
|
|
9
|
+
try {
|
|
10
|
+
const v = JSON.parse(value)
|
|
11
|
+
return Array.isArray(v) ? v.map(String) : []
|
|
12
|
+
} catch (e) {
|
|
13
|
+
return []
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Tick or untick one, keeping the options' order. */
|
|
18
|
+
export function toggled(picked, value, options) {
|
|
19
|
+
const on = picked.includes(value) ? picked.filter((v) => v !== value) : picked.concat([value])
|
|
20
|
+
const order = (options || []).map((o) => String(o.value))
|
|
21
|
+
return on.slice().sort((a, b) => (order.indexOf(a) + 1 || Infinity) - (order.indexOf(b) + 1 || Infinity))
|
|
22
|
+
}
|