Commit Graph

391 Commits

Author SHA1 Message Date
Buck Doyle
90ec5e6457 UI: add exec handling for dead jobs/task states (#7637)
This closes #7456. It hides the terminal when the job is dead and
displays an error when trying to open an exec session for a task
that isn’t running. There’s a skipped test for the latter behaviour
that I’ll have to come back for.
2020-04-06 14:08:22 -05:00
Buck Doyle
f32780355d UI: add live-updating to exec sidebar (#7499)
This closes #7454. It makes use of the existing watchable tools to
allow the exec popup sidebar to be live-updating. It also adds
alphabetic sorting of task groups and tasks.
2020-04-06 13:52:42 -05:00
Michael Lange
61a15ba223 Merge pull request #7630 from hashicorp/f-ui/csi-acceptance-tests
UI: CSI Acceptance Tests
2020-04-06 09:37:45 -07:00
Mahmood Ali
6021ea6d25 Merge pull request #7612 from hashicorp/b-auth-alloc-exec-ws
Authenticate alloc/exec websocket requests
2020-04-06 09:24:51 -04:00
Michael Lange
c64467320e Test coverage for the volume detail page 2020-04-04 17:13:40 -07:00
Michael Lange
b55a0e462c Fix the allocations page compoent to support multiple prop keys
It was designed to be used this way, but allocationFor has never
worked as intended 🤦
2020-04-04 10:56:12 -07:00
Michael Lange
5a84d731c0 Add page size select tests to volumes list tests 2020-04-04 09:58:34 -07:00
Michael Lange
283e112d96 Acceptance tests for the volumes list page 2020-04-03 19:28:12 -07:00
Michael Lange
0463df0e03 Page object for volumes list 2020-04-03 19:28:11 -07:00
Michael Lange
98cbe43c9b Merge pull request #7574 from hashicorp/f-ui/configurable-page-sizes
UI Configurable Page Sizes
2020-04-03 16:06:17 -07:00
Mahmood Ali
4a92a27db7 ui: explicit reference to window.localStorage 2020-04-03 14:31:19 -04:00
Buck Doyle
c75657774a Remove redundant step assertion 2020-04-03 12:54:47 -05:00
Buck Doyle
dd1b2dc37d Remove redundant pause 2020-04-03 12:53:57 -05:00
Buck Doyle
2afe4441b4 Remove redundant assertions
These are more things that are already covered elsewhere.
2020-04-03 12:52:39 -05:00
Buck Doyle
4fa139a2fd Remove redundant assertions from token exec test
This only needs to check that the token is sent, the rest of
the assertions were covered by the previous test.
2020-04-03 12:35:51 -05:00
Buck Doyle
f1d9e878a7 Remove intermediate storage variable 2020-04-03 12:27:03 -05:00
Buck Doyle
4fccaaa2e3 Change to setting token directly
Most tests bypass setting the token via the UI, instead choosing
to set it in localStorage directly, because the acceptance tests
for the token UI are sufficient to exercise that part of the UI,
so this speeds up the test a bit.
2020-04-03 12:26:25 -05:00
Buck Doyle
b7999b31fb Add space 2020-04-03 12:21:44 -05:00
Buck Doyle
a3645e2ce7 UI: add handling for exec command-editing keys (#7601)
This is a minimal implementation that closes #7463. It doesn’t include
true support for moving around within the command to edit using arrow
keys because it gets too complex when managing wrapping at the edge of
the terminal. Instead, arrow keys are ignored. It also ignores ^A and
^E, which are cursor manipulations that pose similar problems to arrow
keys. It does support ^U, which deletes the entire command.

It also allows a command to be pasted, which was previously unsupported.
This is accomplished by migrating from Xterm.js’s onKey handler to
onData, which is recommended here:
https://github.com/xtermjs/xterm.js/issues/2673#issuecomment-574897733

onData is a higher-level handler that issues events with the final
interpreted data instead of the individual key events. That means the
processing in this PR has changed from inspecting DOM key events to
inspecting their ASCII equivalents, which I’ve extracted into a utility
dictionary for use in tests and implementation.

One consequence of ignoring most control characters is that if you paste
a string that includes a control character, that character will be
stripped. It’s somewhat strange for compound sequences like arrow keys; 
if you run copy('/bin/b' + '\x1b[D' + 'ash') in a Javascript console and
paste what’s on the clipboard, you get "/bin/b[Dash". That’s because
the left arrow key, as in that centre portion of the string,
is represented by the escape character and a coded sequence. Stripping
the control character leaves the coded sequence as part of the paste.
That seems like an acceptable compromise vs either ignoring any pasted
string with control characters (confusing UX) or trying to interpret and
strip all such compound control sequences (difficult to be exhaustive).
2020-04-03 12:14:47 -05:00
Mahmood Ali
cad5261ec1 ui: send authentication ws handshake
Have the UI send the authentication websocket handshake message.
2020-04-03 11:49:22 -04:00
Michael Lange
a03009746b Refactor page-size-select page object into a reusable component 2020-04-02 15:52:44 -07:00
Michael Lange
990e723c2e Apply the page size select behavior to the other pages with the page size selector 2020-04-02 12:50:37 -07:00
Michael Lange
c99214441f Factor page select tests into their own behavior 2020-04-02 12:50:36 -07:00
Michael Lange
5cc55b79e0 Acceptance tests for the page size selector on the jobs list view 2020-04-02 12:50:35 -07:00
Michael Lange
f6ed101740 Fix flaky serializer test 2020-04-01 14:54:05 -07:00
Buck Doyle
502d2734ce UI: Add localStorage persistence of exec command (#7563)
This closes #7469. Trivial thanks to localStorageProperty! 🥳
2020-04-01 08:08:42 -05:00
Michael Lange
21b8986139 Tests for the new volumes facet 2020-03-30 17:33:46 -07:00
Michael Lange
c30a153d1f Use new text encoder for stream frames
This pattern was introduced with Exec and fixes the multibyte encoding
issue that the native window.atob has.
2020-03-30 12:50:43 -07:00
Michael Lange
5f2de59773 Guard against a null value for the HostVolumes hash
When a node has no host volumes, the API response will
have a null value for the HostVolumes attribute, which
in turn becomes a null value instead of an empty array
in the store. This protects against that, ensuring host
volumes is always an array.
2020-03-26 09:54:59 -07:00
Michael Lange
508404ccba UI: Support for CSI (#7446)
Closes #7197 #7199

Note: Test coverage is limited to adapter and serializer unit tests. All
acceptance tests have been stubbed and all features have been manually
tested end-to-end.

This represents Phase 1 of #6993 which is the core workflow of CSI in
the UI. It includes a couple new pages for viewing all external volumes
as well as the allocations associated with each. It also updates
existing volume related views on job and allocation pages to handle both
Host Volumes and CSI Volumes.
2020-03-25 07:51:26 -05:00
Buck Doyle
27df92a967 UI: add exec terminal (#6697)
This connects Xterm.js to a Nomad exec websocket so people
can interact on clients via live sessions. There are buttons on
job, allocation, task group, and task detail pages that open a
popup that lets them edit their shell command and start a
session.

More is to come, as recorded in issues.
2020-03-24 18:22:16 -05:00
Michael Lange
6024b9c1b6 Correct a test and a dependent key 2020-02-14 16:44:28 -08:00
Michael Lange
4fce8b4a54 Improve the node serializer tests 2020-02-13 17:42:41 -08:00
Michael Lange
88c2af2f8d Add assertion for the volume k/v pairs in task rows 2020-02-13 17:11:39 -08:00
Michael Lange
060e84135c Refactor task row info test to use 'as' 2020-02-13 17:11:38 -08:00
Michael Lange
75e9d6ce11 Test coverage for the volume table on the task group page 2020-02-13 17:11:37 -08:00
Michael Lange
31945880e7 Test coverage for the task detail volumes table 2020-02-13 17:11:35 -08:00
Michael Lange
0733c1e86e Test coverage for change in resource rows 2020-02-13 17:11:30 -08:00
Michael Lange
787dedcd5c Fix flaky host volumes test 2020-02-13 17:11:28 -08:00
Michael Lange
961691248b Test coverage for the host volumes table 2020-02-13 17:11:25 -08:00
Michael Lange
5f621e2d68 Data layer for Host Volumes in the UI 2020-02-13 17:11:22 -08:00
Michael Lange
234b7efee8 Acceptance test for disabled node write controls 2020-01-31 09:41:37 -08:00
Michael Lange
f5662817ff Account for disabled ACLs in ability tests 2020-01-31 09:41:36 -08:00
Michael Lange
fbb137bdb2 Refactor ability tests to use a setup hook for ability lookup 2020-01-30 21:29:21 -08:00
Michael Lange
88d646b48d Add an ability for client permissions 2020-01-30 21:29:19 -08:00
Michael Lange
4793dc9afb Replace custom parse-duration implementation with an existing lib 2020-01-23 16:34:38 -08:00
Michael Lange
b9b6cda5b4 Update client detail test given change to the compositeStatus property 2020-01-23 16:34:38 -08:00
Michael Lange
deb2b310f6 Remove superfluous information from the client details ribbon 2020-01-23 16:34:36 -08:00
Michael Lange
4cc6702075 Use qunit-dom where applicable 2020-01-23 16:34:35 -08:00
Michael Lange
93eaaab77e New test coverage for the drain capabilities 2020-01-23 16:34:34 -08:00