Commit Graph

1316 Commits

Author SHA1 Message Date
Michael Lange 61a693c656 Refactor metrics styles to allow for standalone metrics 2020-05-13 08:36:04 -07:00
Michael Lange 3d7e3e6b9c Gauge chart component 2020-05-13 08:36:04 -07:00
Michael Lange 89afc9ccae Test coverage for the plugin-allocation-row 2020-05-12 21:30:33 -07:00
Michael Lange ea7b8b1a11 Don't double load freshly loaded allocations 2020-05-12 21:30:33 -07:00
Michael Lange de74239430 Properly manage the lifecycle of allocations for storage nodes and controllers 2020-05-12 21:30:33 -07:00
Michael Lange c84070fc42 Key allocation rows to prevent unnecessary re-renders 2020-05-12 21:30:32 -07:00
Buck Doyle c46d5517bb
Add ACL-checking to turn off exec button (#7919)
This closes #7453. It adds an abstraction to handle the common
needs of ability-determination.
2020-05-11 14:43:17 -05:00
Buck Doyle 5956e2e322
Add assertions for title-area buttons (#7836)
This closes #7452.
2020-05-11 11:29:30 -05:00
Mahmood Ali faecf3a760
Add tests for running allocation client count (#7906)
* Add tests for running allocation client count

* remove redundant assertions
2020-05-11 12:28:31 -04:00
Michael Lange 5e6a89836b The active namespace is now shared between jobs and storage 2020-05-08 17:35:27 -07:00
Michael Lange b3fe5b4f75 Changing namespaces now situationally redirects to jobs or volumes
Changing namespaces can be done anywhere in the app even though many
Nomad resources aren't namespace-sensitive (e.g., clients, plugins).

A user changing namespaces is an intent to reset context, "now I want
to begin a task that relates to Namespace X". Where that task begins
used to always be the Jobs list, since it was the only namespace
sensitive resource. Now with CSI Volumes, "square 1" is Volumes if the
namespace is changed from a storage page.
2020-05-08 17:35:27 -07:00
Michael Lange ee2d1eeb39 Introduce shallow to plugin factories to speed up tests 2020-05-07 17:29:42 -07:00
Michael Lange 7610493445 Searchable plugins 2020-05-07 17:25:24 -07:00
Michael Lange be9d9176b1 Searchable volumes 2020-05-07 16:57:51 -07:00
Michael Lange 11a42b6075 Acceptance test for PluginDetail 2020-05-06 17:36:45 -07:00
Michael Lange f3bae3b535 Don't wrap between icons and health text 2020-05-06 17:22:42 -07:00
Michael Lange 38c03f180b Use lazyClick to avoid multiple transitionToRoutes being in flight as once 2020-05-06 17:22:42 -07:00
Michael Lange 2369254a3e Refactor AllocationRow qualifyAllocation
There was a missing edge case where a job is pending. I took the moment
to also refactor the code to use async/await which cleaned up the
promise chaining.
2020-05-06 17:22:42 -07:00
Michael Lange f9882d42e6 Plugin detail page object 2020-05-06 17:21:49 -07:00
Michael Lange 517db723cd Sort allocations on the plugin detail page 2020-05-06 17:21:49 -07:00
Michael Lange 41c4746aaf Test coverage for the plugins list page 2020-05-06 17:21:48 -07:00
Michael Lange e98095bcbd Page object for Plugins List 2020-05-06 17:21:48 -07:00
Michael Lange 59bb9a516e Correct the table headers for dates on the volume page 2020-05-06 17:21:48 -07:00
Michael Lange 665ba3b2f7 Add a nodes table as well 2020-05-06 17:21:48 -07:00
Michael Lange 105e7203cf Set color in addition to fill for the icon class
Structure icons have fill set to currentColor hardcored in their markup.
This mean setting fill to a color in CSS does nothing, but setting color
now does.
2020-05-06 17:21:47 -07:00
Michael Lange 4ec53234d1 Add icons to the plugin alloc row component 2020-05-06 17:21:47 -07:00
Michael Lange 874556704d Use the correct plugin property for the breadcrumb 2020-05-06 17:21:47 -07:00
Michael Lange 778e7fdb07 New PluginAllocationRow derivative of AllocationRow 2020-05-06 17:21:46 -07:00
Michael Lange 7c56fcaecb Emulate belongsTo relationship in storage fragments 2020-05-06 17:21:46 -07:00
Michael Lange 6f84c685b6 Add short option to date formatters 2020-05-06 17:21:46 -07:00
Michael Lange 210f6cdb00 Update storage controller mirage code to accommodate EDMF's lack of relationships 2020-05-06 17:21:46 -07:00
Michael Lange ca6849ebaa Refactor AllocationRow to use AllocationStat 2020-05-06 17:21:45 -07:00
Michael Lange f55133e76e Separate AllocationStat component for containing the multiple states a stat tracker can be in 2020-05-06 17:21:45 -07:00
Michael Lange d94177085e Setup the plugin detail page 2020-05-06 17:21:45 -07:00
Michael Lange ffcaef6b22 Model out the rest of the CSI Plugin properties 2020-05-06 17:21:44 -07:00
Michael Lange b3f140fee6 Plugins table on the plugins list page 2020-05-06 17:21:44 -07:00
Michael Lange bf35d92224 Clean up the csi volume page 2020-05-06 17:21:44 -07:00
Michael Lange 7d524ac341 Set up routes, controllers, and template basics for the plugins page 2020-05-06 17:21:43 -07:00
Michael Lange dba9a25a13 Add a subnav to the volumes page 2020-05-06 17:21:43 -07:00
Michael Lange 1b47885bdb Update plugin model and serializer to match final API 2020-05-06 17:21:42 -07:00
Michael Lange 343d4e0b81 Add constraints table to the volume detail page 2020-05-06 17:21:42 -07:00
Buck Doyle 95c938b75b
Migrate page objects away from jQuery (#7843)
This is part of #7834’s jQuery removal goal. It addresses a couple of jQuery-related deprecation warnings and also uses “native events mode” for ember-cli-page-object, which is needed so it doesn’t have to use jQuery via the Ember global.
2020-05-06 15:14:12 -05:00
Buck Doyle 0b2fc7532d
UI: Remove Ember Freestyle (#7839)
This completes the migration to Storybook by replacing the colour palette and typeface components that I left out.
2020-05-06 15:11:15 -05:00
Michael Lange 034eeb1ddb
Merge pull request #7855 from hashicorp/b-ui/alloc-wrong-reserved-resources
UI: Make allocation reference own task group instead of job's task group when job versions don't match
2020-05-06 10:08:37 -07:00
Mahmood Ali 24e0c7f081 ui: only count running allocations in client view
In the client view list, only show running allocations count for each
client, rather than include already completed tasks.

This is done for two reasons:

First, consitency with the CLI: `nomad node status --allocs` only
shows running allocs.

Second, and more importantly, the count is useful to estimate how loaded
the clients are.  Allocs that have completed (but not GCed yet) have
very little value to operators.
2020-05-05 21:31:58 -04:00
Michael Lange 260da00852 Add embedded task group to allocation to reference when allocation is historical 2020-05-01 14:30:02 -07:00
Michael Lange 91b97e0170 Stabilize job and allocation job versions in fixtures 2020-05-01 14:29:24 -07:00
Michael Lange 9a857a7042 Comment why the allocation has to be reloaded 2020-05-01 14:27:53 -07:00
Jasmine Dahilig a9004faa11
UI: Add representations for task lifecycles (#7659)
This adds details about task lifecycles to allocations, task groups,
and tasks. It includes a live-updating timeline-like chart on allocations.
2020-04-30 08:15:19 -05:00
Michael Lange 21ef3633be Make the no connection error on the logs page dismissable 2020-04-29 17:36:17 -07:00
Michael Lange e74cd16252 Fix race condition where stdout and stderr requests can cause a no connection error
This would happen because a no connection error happens after the second request fails, but
that's because it's assumed the second request is to a server node. However, if a user clicks
stderr fast enough, the first and second requests are both to the client node. This changes
the logic to check if the request is to the server before deeming log streaming a total failure.
2020-04-29 17:36:17 -07:00
Michael Lange aafbeaba75 Clicking stdout/stderr when already on that tab is now a noop 2020-04-29 17:36:16 -07:00
Michael Lange 7452a9a57d Abort log fetch request when failing over from client to server
Typically a failover means that the client can't be reached. However, if
the client does eventually return after the timeout period, the log will
stream indefinitely. This fixes that using an API that wasn't broadly
available at the time this was first written.
2020-04-29 17:34:49 -07:00
Michael Lange 9ba563c48e Always pass credential in fetch requests, but also treat options reasonably
Now options can be provided without also having to remember to pass
credentials. This is convenient for abort controller signals.
2020-04-29 17:34:49 -07:00
Buck Doyle d4708860f0
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
Buck Doyle 438aec636a
UI: update exec styles to match conventions (#7811) 2020-04-28 08:33:07 -05:00
Michael Lange 0dac605902
Merge pull request #7689 from hashicorp/ui/plumb-proxy-config-to-proxy
UI Plumb proxy config to proxy
2020-04-22 19:31:27 -07:00
Buck Doyle 6da959f0ed
UI: Update ember-fetch to 6.7.2 (#7713)
This gets rid of this warning in the console:
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
2020-04-22 09:10:55 -05:00
Buck Doyle 0c2acb01b9 Remove superseded note
This closes #7465.
2020-04-21 19:52:45 -07:00
Michael Lange 82dc694c70 Disable the proxy when Mirage is enabled
This is to prevent max socket connection errors that can stop
the live reload server from responding.
2020-04-21 19:52:44 -07:00
Michael Lange 7a4852d44b Use existing ember proxy config within our custom proxy 2020-04-21 19:52:43 -07:00
Michael Lange a34363efd3 Remove now superfluous lint-staged arguments 2020-04-09 20:46:32 -07:00
Michael Lange 45eb6fd7f3 Upgrade Husky 2020-04-09 20:45:37 -07:00
Michael Lange 03d4afe9e0 Upgrade lint-staged
Version 10 fixes an issue where if lint-staged fails while linting
a partially staged file, all unstaged changes will be removed from
the working tree. Now when this happens, unstaged changes will be
in the stash.
2020-04-09 20:41:35 -07:00
dependabot[bot] f565841782
build(deps): bump acorn from 5.7.3 to 5.7.4 in /ui (#7346)
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-04-07 10:50:21 -04:00
Michael Lange 35d4b48644
Merge pull request #7577 from hashicorp/f-ui/csi-beta-label
UI: Change CSI to Storage and mark it as beta
2020-04-06 13:21:11 -07:00
Buck Doyle f10906e006
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 fc7de8b153
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 bf9887083b
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 23be53a366
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 2955d356e7 Test coverage for the volume detail page 2020-04-04 17:13:40 -07:00
Michael Lange 25f4f5a61d Sort allocation tables by modify index 2020-04-04 17:11:58 -07:00
Michael Lange a1d2e585a1 Update breadcrumb to match side menu 2020-04-04 17:11:29 -07:00
Michael Lange 6b798518b9 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 76bead58a3 Add page size select tests to volumes list tests 2020-04-04 09:58:34 -07:00
Michael Lange e8e41c5757 Acceptance tests for the volumes list page 2020-04-03 19:28:12 -07:00
Michael Lange 0d90d082bc Page object for volumes list 2020-04-03 19:28:11 -07:00
Michael Lange 59427662d0 Handle namespaces in the mirage handler for volumes 2020-04-03 19:28:10 -07:00
Michael Lange fb44f76800 Correctly handle the namespace query param and forbidden state 2020-04-03 19:28:09 -07:00
Michael Lange 280fa5d53b Annotate volume row and make the tr clickable 2020-04-03 19:27:44 -07:00
Michael Lange 62aa943a95 Filter out volumes that don't match the chosen namespace 2020-04-03 19:27:11 -07:00
Michael Lange 62b7a07189 Sort alphabetically, A first 2020-04-03 19:26:26 -07:00
Michael Lange 1729d41509
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 340f9a5e91 ui: explicit reference to window.localStorage 2020-04-03 14:31:19 -04:00
Buck Doyle 2940aa14e5 Remove redundant step assertion 2020-04-03 12:54:47 -05:00
Buck Doyle b9a2d20445 Remove redundant pause 2020-04-03 12:53:57 -05:00
Buck Doyle e6ecd2bf4f Remove redundant assertions
These are more things that are already covered elsewhere.
2020-04-03 12:52:39 -05:00
Buck Doyle 4de1255a31 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 cb6f110b97 Remove intermediate storage variable 2020-04-03 12:27:03 -05:00
Buck Doyle b12f97bb81 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 0ec5e95f46 Add space 2020-04-03 12:21:44 -05:00
Buck Doyle fbe40a5d36
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 cec76a4f66 ui: send authentication ws handshake
Have the UI send the authentication websocket handshake message.
2020-04-03 11:49:22 -04:00
Michael Lange edea9faf22 Refactor page-size-select page object into a reusable component 2020-04-02 15:52:44 -07:00
Michael Lange 49019bd967 Make table foot fields consistent at all breakpoints
This effectively overrides Bulma's default field layout tweaks
at different breakpoints. This includes going from flex to block
and different font-sizes.
2020-04-02 13:41:41 -07:00
Michael Lange b1d5a77e76 Remove extranneous order property
The "default" order values as set by Bulma are different for different
breakpoints. Since this wasn't considering breakpoints, it resulted
in the unexpected reordering of pagination elements as different page
widths. Turns out removing this property gives us what we want.
2020-04-02 13:27:29 -07:00
Michael Lange 81e7296447 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 f08fd23d00 Factor page select tests into their own behavior 2020-04-02 12:50:36 -07:00
Michael Lange 70eb558b65 Acceptance tests for the page size selector on the jobs list view 2020-04-02 12:50:35 -07:00
Michael Lange e0110e1757 Repeat new pagination pattern throughout the app 2020-04-02 12:50:34 -07:00