Commit Graph

103 Commits

Author SHA1 Message Date
Michael Lange
856743983e Create new AbortController with each tick of the ec task loops
This was a disturbing discovery. Requests in watch loops would recycle
AbortControllers meaning once any request was aborted, all requests
forever after were skipped. I noticed it with deployments and job
summary on the job detail page.

I suspect this regression occurred when jQuery was removed. This needs
test coverage still to make sure it doesn't happen again.
2020-06-18 22:08:27 -07:00
Buck Doyle
e993a71f6f Add manually-converted classes
I don’t know why the codemod ignored these files 🧐
2020-06-15 10:14:26 -05:00
Buck Doyle
24eadd269c Add massaged results of class codemod
Manual interventions:
• decorators on the same line for service and controller
  injections and most computed property macros
• preserving import order when possible, both per-line
  and intra-line
• moving new imports to the bottom
• removal of classic decorator for trivial cases
• conversion of init to constructor when appropriate
2020-06-10 16:18:42 -05:00
Buck Doyle
11d80ae489 Add Ember ESLint plugin (#8134)
This is extracted from #8094, where I have run into some snags. Since
these ESLint fixes aren’t actually connected to the Ember 3.16 update
but involve changes to many files, we might as well address them
separately. Where possible I fixed the problems but in cases where
a fix seemed too involved, I added per-line or -file exceptions.
2020-06-09 16:03:28 -05:00
Michael Lange
505510915b Replace XHRToken with AbortController 2020-05-21 10:35:39 -07:00
Michael Lange
7fc380d35d Merge pull request #7971 from hashicorp/b-ui/plugin-extend-watchable
UI: Make the Plugin adapter extend Watchable
2020-05-15 09:15:59 -07:00
Michael Lange
278b8499c6 Protect against making watch requests using adapters that don't extend Watchable 2020-05-14 14:36:38 -07:00
Buck Doyle
f491c86d91 Change exec URL-generation to use Ember get (#7963)
This fixes a bug in #7815 where you can’t open an exec window from
the allocation overview because accessing `allocation.job.plainId`
fails across the proxied relationship.
2020-05-14 14:09:09 -05:00
Buck Doyle
d913f05503 UI: Fix exec popup link for job id ≠ name (#7815)
This closes #7814. It makes URL-generation more central and changes
the exec URL to include job id instead of name.
2020-04-29 07:54:04 -05: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
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
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
b3a23c9b07 Merge pull request #7470 from kybin/kybin-patch-1
UI: decode unicode properly in log page
2020-03-30 12:06:51 -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
kim yongbin
339801852a UI: decode unicode properly in log page 2020-03-25 01:03:39 +09:00
Michael Lange
60c80696b7 Don't initialize variables before you need them 2019-12-05 10:51:51 -08:00
Michael Lange
a8f668667d Fix a race condition where a response sent after the logger stops never gets canceled 2019-12-05 00:19:35 -08:00
Buck Doyle
882a0210fe UI: Update Ember to 3.12 LTS (#6419)
This is mostly deprecation fixes and blueprint changes. There
are some dependency updates too; the changes to Ember
Basic Dropdown necessitated changing it to angle bracket
component invocation. The conversion of the rest of the
templates will happen separately.
2019-10-15 13:32:58 -05:00
Michael Lange
bd9d73ba5d Fix a bug where tail calls for files weren't getting the correct params 2019-07-30 17:25:41 -07:00
Michael Lange
ccbe31f0d6 Always escape < and > to avoid inadvertently rendering html 2019-07-30 17:22:54 -07:00
Michael Lange
a609606901 Add a plainText mode 2019-07-30 17:22:53 -07:00
Michael Lange
07f1c89cc5 Use the stream decode util and never opt to use the plain query param 2019-07-30 17:22:45 -07:00
Michael Lange
a21ae52783 Move common stream frame decoding to a util 2019-07-30 17:22:44 -07:00
Michael Lange
203b54b246 Move addToPath to its own util 2019-05-20 11:52:47 -07:00
Michael Lange
3c1de2df91 Standardize on Abort over Cancel 2019-05-20 11:08:16 -07:00
Michael Lange
c68962078a Replace the adapter cancellation methods with a cancellation token system 2019-05-20 10:29:22 -07:00
Conor Mongey
aa4c1288f3 Return a htmlSafe string rather than use triple curlies 2019-05-02 21:47:24 +01:00
Conor Mongey
d2323e0cb8 Converts ANSI terminal codes to HTML in logs 2019-05-02 21:47:23 +01:00
Michael Lange
f6232f1817 ES5 getters codemod 2019-04-10 14:54:36 -07:00
Michael Lange
e74873f9c1 Address the Ember.Logger deprecations 2019-04-10 14:54:35 -07:00
Michael Lange
23729ad5a7 Address the copy/copyable deprecation 2019-04-10 14:54:35 -07:00
Michael Lange
7e6a4f74fc Address inflector deprecations 2019-04-10 14:54:35 -07:00
Michael Lange
401b5997a3 Refactor qp helpers from the jobs faceted search 2019-04-10 10:34:10 -05:00
Michael Lange
c95821e84e Make your tests orders of magnitude faster with One Neat Trick™ 2018-11-06 16:17:21 -08:00
Michael Lange
9f98029898 Gracefully handle response errors in stat trackers
1. Check if the response is a 4xx/5xx
2. If it is, skip the append step and track a frame miss
3. If enough frame misses occur in a row, treat it as a pause

A "pause" is when a null data frame is added, which shows up as a
gap in line charts.
2018-11-01 22:08:57 -07:00
Michael Lange
022573a072 Move jsonWithDefault to a util 2018-11-01 22:07:58 -07:00
Michael Lange
f02d99a2c0 Merge pull request #4718 from hashicorp/f-ui-a11y-line-chart
UI: Add some simple accessibility labels for line charts
2018-10-17 09:43:27 -07:00
Michael Lange
35b933a2e0 Add more documentation to the format-duration util 2018-10-17 08:10:16 -07:00
Michael Lange
9a6d2bee10 Add a longForm option to format-duration 2018-09-27 12:55:17 -07:00
Michael Lange
4d5fa15ea7 Remove no longer used allocation-stats class 2018-09-26 10:59:26 -07:00
Michael Lange
47ec74eb3a Update stat tracker unit tests 2018-09-19 19:30:18 -07:00
Michael Lange
866f650de8 Acceptance test coverage for all the pages with resource utilization graphs 2018-09-19 16:33:51 -07:00
Michael Lange
01195a810c Unit tests for the stats trackers service 2018-09-19 15:33:29 -07:00
Michael Lange
8de545c1b7 Add cancelation support to stats trackers 2018-09-17 16:59:09 -07:00
Michael Lange
f0208c0a24 Add request throttling to the abstract stats tracker
This is the best of three options

1. Users of stats trackers control polling (old method)
2. Stat tracker is stateful and has start/stop methods (like logging)
3. Stat trackers blindly throttle requests

This is the best option because it means N number of concurrent users of
a stats tracker can request polling without inundating the tracker with
redundant frames (or the network with redundant requests), but they also
don't have to coordinate amongst themselves to determine what state a
tracker should be in.
2018-09-17 15:58:28 -07:00
Michael Lange
f84b145401 Use the appropriate methods and types in the stat trackers 2018-09-14 10:21:01 -07:00
Michael Lange
adc05976c2 Use the prototype instead of "private" property backups 2018-09-14 09:38:17 -07:00
Michael Lange
9a102b73b9 Make rollingArray work with mutable array extension methods 2018-09-14 08:57:26 -07:00