@andrian.yablonskyy/thub-coordinator 1.1.5 → 1.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrian.yablonskyy/thub-coordinator",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "TestHub Coordinator — job queue, resource registry, scheduler, heartbeat monitor, log/artifact store and web dashboard",
5
5
  "main": "src/server.js",
6
6
  "engines": {
@@ -93,8 +93,9 @@
93
93
  keeps their height (and still takes them out of the tab order and of what
94
94
  screen readers read). The device tabs sit inside their shared
95
95
  <form>/<fieldset> (one Save for all of them), so that fieldset stacks its
96
- panes the same way. The USB tab's output scrolls in its own box (360 px),
97
- so a long lsusb doesn't make every tab that tall. */
96
+ panes the same way. The USB tab's output fills that height and scrolls
97
+ inside it (.thub-usb-pane below), so a long lsusb doesn't make every tab
98
+ that tall. */
98
99
  .thub-resource-card .tab-content,
99
100
  .thub-resource-card .tab-content > form > fieldset {
100
101
  display: grid;
@@ -111,8 +112,40 @@
111
112
  visibility: hidden;
112
113
  }
113
114
 
115
+ /* Stacked, the device tabs' <form>/<fieldset> (not hidden themselves) lie
116
+ over the other panes: only the visible pane takes the mouse, or they'd
117
+ swallow every hover and click on the Details tab's buttons. */
118
+ .thub-resource-card .tab-content > form,
119
+ .thub-resource-card .tab-content > form > fieldset,
120
+ .thub-resource-card .tab-content .tab-pane {
121
+ pointer-events: none;
122
+ }
123
+
114
124
  .thub-resource-card .tab-content .tab-pane.active {
115
125
  visibility: visible;
126
+ pointer-events: auto;
127
+ }
128
+
129
+ /* Connected USB devices: the lsusb output takes the rest of the modal's
130
+ height — what the tallest other tab sets, at least 12rem — and scrolls in
131
+ it. Its 0 basis keeps it from making the modal taller. */
132
+ .thub-resource-card .tab-content .tab-pane.thub-usb-pane {
133
+ display: flex;
134
+ flex-direction: column;
135
+ }
136
+
137
+ .thub-usb-pane > [data-usb-scan] {
138
+ display: flex;
139
+ flex: 1 1 auto;
140
+ flex-direction: column;
141
+ min-height: 0;
142
+ }
143
+
144
+ .thub-usb-pane [data-usb-output] {
145
+ flex: 1 1 0;
146
+ height: 0;
147
+ min-height: 12rem;
148
+ overflow: auto;
116
149
  }
117
150
 
118
151
  /* Help page (views/help/): sticky table of contents, code blocks with a
@@ -198,3 +198,10 @@ test('Import and Export work for a Client that doesn\'t re-register (no joinKey)
198
198
  method: 'POST', headers: { authorization: `Bearer ${other.resourceToken}`, 'content-type': 'application/json' }, body: '{}'
199
199
  })).status, 403);
200
200
  });
201
+
202
+ test('resource card CSS: stacked tabs let only the visible one take the mouse (else the device tabs\' form covers Details)', () => {
203
+ const css = fs.readFileSync(path.join(__dirname, '../public/css/thub.css'), 'utf8').replace(/\/\*[\s\S]*?\*\//g, ''),
204
+ off = css.slice(css.indexOf('.thub-resource-card .tab-content > form,'));
205
+ assert.match(off, /^[^{]*> form > fieldset,[^{]*\.tab-pane \{\s*pointer-events: none;/);
206
+ assert.match(css, /\.thub-resource-card \.tab-content \.tab-pane\.active \{[^}]*pointer-events: auto;/);
207
+ });
@@ -327,7 +327,7 @@ mixin resourceCard(r, groupsById, returnTo)
327
327
  .tab-pane.fade.show.active(id=`rc-${r.id}-details` role="tabpanel" aria-labelledby=`rc-${r.id}-details-tab` tabindex="0" data-live=`rc-details-${r.id}`)
328
328
  +resourceDetails(r, groupsById, returnTo, local, external)
329
329
  +configPanes(r, returnTo, groupsById)
330
- .tab-pane.fade(id=`rc-${r.id}-usb` role="tabpanel" aria-labelledby=`rc-${r.id}-usb-tab` tabindex="0")
330
+ .tab-pane.fade.thub-usb-pane(id=`rc-${r.id}-usb` role="tabpanel" aria-labelledby=`rc-${r.id}-usb-tab` tabindex="0")
331
331
  +usbScanPane(r)
332
332
 
333
333
  //- "Connected USB devices" (resource card tab): the Client's `lsusb`, run
@@ -364,7 +364,8 @@ mixin usbScanPane(r)
364
364
  else
365
365
  | Not scanned yet#{can.operate ? ' — press Refresh to run lsusb -tvv on the Client' : ''}.
366
366
  .alert.alert-danger.py-2.small(data-usb-error class=scan && scan.error ? null : 'd-none')= scan && scan.error || ''
367
- pre.bg-body-tertiary.p-2.rounded.small.mb-0(data-usb-output style="max-height: 360px; overflow: auto;" class=scan && scan.output ? null : 'd-none')= scan && scan.output || ''
367
+ //- Fills the rest of the tab and scrolls inside (thub.css .thub-usb-pane).
368
+ pre.bg-body-tertiary.p-2.rounded.small.mb-0(data-usb-output class=scan && scan.output ? null : 'd-none')= scan && scan.output || ''
368
369
 
369
370
  //- Reboot the Client's host now (card's Actions row, icon only): confirmed first — naming the
370
371
  //- job that gets canceled, if one is running — then sent with the Client's