Commit Graph

687 Commits

Author SHA1 Message Date
Buck Doyle 7e4c746c82
Move breadcrumbs objects into shared layout object (#9576)
Various page objects had breadcrumbs and breadcrumbFor within them, this
moves those to the existing Layout page object that contains shared page objects.
2020-12-10 11:51:22 -06:00
Buck Doyle 8348576473
Fix job recommendation test flakiness (#9591)
Instead of creating recommendations for all the jobs used
across these tests, this creates a specific job with
a higher group count, which reduces the likelihood
of having no recommendations to 0.0001%.

It was incorrect to assume that each task group would always
have recommendations, since there’s a 1% chance that a task
won’t have a recommendation. (10% chance for CPU and memory.)
This uses the number of groups with recommendations instead.
2020-12-10 10:10:25 -06:00
Michael Lange 27c16d1f0a Test coverage for the scale event serializer 2020-12-07 12:28:47 -08:00
Buck Doyle 3b0f876ae5
Add DAS namespaces toggle and fix empty card bug (#9337)
This builds on filtering to allow the optimize page to show recommendations
for the active namespace vs all namespaces. If turning off the toggle causes
the summary from the active card to become excluded from the filtered list,
the active summary changes, as with the facets.

It also includes a fix for this bug:
https://github.com/hashicorp/nomad/pull/9294#pullrequestreview-527748994
2020-11-30 08:18:44 -06:00
Tim Gross 4e79ddea45
csi/api: populate ReadAllocs/WriteAllocs fields (#9377)
The API is missing values for `ReadAllocs` and `WriteAllocs` fields, resulting
in allocation claims not being populated in the web UI. These fields mirror
the fields in `nomad/structs.CSIVolume`. Returning a separate list of stubs
for read and write would be ideal, but this can't be done without either
bloating the API response with repeated full `Allocation` data, or causing a
panic in previous versions of the CLI.

The `nomad/structs` fields are persisted with nil values and are populated
during RPC, so we'll do the same in the HTTP API and populate the `ReadAllocs`
and `WriteAllocs` fields with a map of allocation IDs, but with null
values. The web UI will then create its `ReadAllocations` and
`WriteAllocations` fields by mapping from those IDs to the values in
`Allocations`, instead of flattening the map into a list.
2020-11-25 16:44:06 -05:00
Tim Gross aa7c77d324
csi/ui: show Node Only for volumes when controllers aren't required (#9416)
Plugin health for controllers should show "Node Only" in the UI only when both
conditions are true: controllers are not required, and no controllers have
registered themselves (0 expected controllers). This accounts for "monolith"
plugins which might register as both controllers and nodes but not necessarily
have `ControllerRequired = true` because they don't implement the Controller
RPC endpoints we need (this requirement was added in #7844)

This changeset includes the following fixes:

* Update the Plugins tab of the UI so that monolith plugins don't show "Node
  Only" once they've registered.
* Add the missing "Node Only" logic to the Volumes tab of the UI.
2020-11-25 14:50:33 -05:00
Michael Lange c041236629 Fix flaky lifecycle chart tests 2020-11-12 09:16:53 -08:00
Michael Lange f543137ec9 Revert "Temporarily remove poststop from the UI"
This reverts commit f8a505ea2f9def2a7ce7a93e6d0529e1b5da4894.
2020-11-12 09:16:52 -08:00
Michael Lange 9de4351eae Add missing feature fixture that was introduced while this feature was being developed 2020-11-11 16:43:47 -08:00
Michael Lange 4b32265867
Merge pull request #9294 from hashicorp/f-ui/das-filter-toggle
UI: Add DAS summary table filtering
2020-11-11 14:04:25 -08:00
Buck Doyle ba5e6983bb Move page object component to reflect page order 2020-11-10 13:42:15 -06:00
Buck Doyle e5089dec44 Remove unnecessary uses of createList 2020-11-10 13:38:27 -06:00
Buck Doyle 3ef7f9f89e Add redirect to parent when filter excludes all 2020-11-10 09:38:46 -06:00
Buck Doyle 7ed1f4dda8 Fix proceed to use filtered summaries 2020-11-09 15:00:58 -06:00
Buck Doyle 1cfbac5483 Add check that active summary isn’t filtered out 2020-11-09 13:02:16 -06:00
Buck Doyle 87b82a446d Add no matches empty state 2020-11-09 09:41:18 -06:00
Buck Doyle a1ea822ab7 Add count to search field placeholder 2020-11-09 09:32:49 -06:00
Buck Doyle 7b25b43ec6 Add summary-filtering field
This only filters by slug for now… 🧐
2020-11-09 09:28:40 -06:00
Buck Doyle cc0336bf0f Add facets for recommendation summaries
This is mostly copied from the jobs list. One uncertainty
is what to do when changing a facet causes the currently-
active card to be excluded from the filtered list 🤔
2020-11-06 15:53:58 -06:00
Buck Doyle 8b5b2116ec
Fix job detail crash when recommendations off (#9269)
Without this, visiting any job detail page on Nomad OSS would crash with
an error like this:

Error: Ember Data Request GET
/v1/recommendations?job=ping%F0%9F%A5%B3&namespace=default returned a
404 Payload (text/xml)

The problem was twofold.

1. The recommendation ability didn’t include anything about checking
whether the feature was present. This adds a request to
/v1/operator/license on application load to determine which features are
present and store them in the system service. The ability now looks for
'Dynamic Application Sizing' in that feature list.

2. Second, I didn’t check permissions at all in the job-fetching or job
detail templates.
2020-11-06 08:21:38 -06:00
Buck Doyle 20ec481090
Add DAS subroute and copy button (#9201)
This continues iteration on the DAS UI by adding the ability to directly
navigate to a recommendation summary by (namespaced) slug and a copy
button for the direct navigation link.

It includes a change to CopyButton allowing it to take a block that’s
rendered within the button.

It also changes some instances of multi-relationship traversal to use
in-summary attributes, such as summary.jobNamespace instead of
summary.job.namespace.name.
2020-11-04 12:22:24 -06:00
Buck Doyle 6450abfe76
Change node id search to prefix-only (#9244)
This test has been periodically failing, like here:
https://app.circleci.com/pipelines/github/hashicorp/nomad/12879/workflows/40c0445c-b244-4a04-a5a3-d9685b656c94/jobs/114751/tests

The failure was because sometimes the first node contains the
beginning of the ”otherNode” id somewhere within its id. It seems
less useful to match within the node, so this changes id search to
only match at the beginning of the id.
2020-11-04 12:12:31 -06:00
Michael Lange dc6ec319c2
Merge pull request #9074 from Liraim/fix_download
ui: "View Raw File" download using JS instead simple link
2020-11-04 10:09:35 -08:00
Michael Lange b5044250e6 Add tooltips to the topo viz 2020-11-02 13:25:33 -08:00
Vyacheslav Morov c6fc37cf29 Change to button.
Rewrite tests to check that proper urls was called.
2020-10-31 23:11:14 +03:00
Buck Doyle ab4b04e940
Add handling for empty state flaky test edge case (#9234)
This test occasionally fails because the random generation
sometimes produces a node with no allocations, such as here:
https://app.circleci.com/pipelines/github/hashicorp/nomad/12735/workflows/9a407f87-0383-48ee-8e41-7e6e351dce28/jobs/113130/steps

This is a temporary measure to solve it without trying to force the
generated data to always have an allocation.
2020-10-30 15:57:09 -05:00
Michael Lange 628fef86a5 Add namespace and task states query params to the topo viz route 2020-10-29 11:28:41 -07:00
Buck Doyle 31b4ed7a6d
Add DAS UI code from enterprise (#9192)
This is a few combined iterations on the DAS feature.
2020-10-29 07:46:42 -05:00
Michael Lange 4a36f522ce
Merge pull request #9167 from hashicorp/f-ui/topo-viz-refinements
UI: topo viz refinements
2020-10-26 10:51:31 -07:00
Michael Lange 33d901eae9
Merge pull request #9172 from hashicorp/b-ui/logs-for-fails
UI: Always show the file browser for allocations and tasks.
2020-10-26 10:36:18 -07:00
Michael Lange bae7002c73 Show the nomad agent version of the agent the UI is served from 2020-10-25 23:52:06 -07:00
Michael Lange 2072911356 Always show the file browser for allocations and tasks.
Before, we'd show a helpful error message when a task isn't running
instead of erroring in a generic way. Turns out when an alloc is
terminal but reachable, the filesystem is left behind so we were hiding
it.

Now it is always shown and in the event that something errors, it'll
either be generic, or--more commonly--a 404 of the allocation.
2020-10-25 22:24:56 -07:00
Michael Lange 2a1c820c1c Make alloc association lines conditional on alloc count relative to node count 2020-10-23 15:16:31 -07:00
Michael Lange 7f2fba9b23 Reset inline styles on flex-masonry elements when columns is set to 1 2020-10-23 14:17:03 -07:00
Michael Lange 56bf526778 Describe the glimmer-factory better including the motive 2020-10-15 11:45:59 -07:00
Michael Lange 97510a8397 Some light topology acceptance tests 2020-10-15 03:06:51 -07:00
Michael Lange a2b57c15eb Unit and integration tests for TopoViz component 2020-10-15 02:54:16 -07:00
Michael Lange c8ea019629 Test coverage for TopoViz::Datacenter 2020-10-15 02:54:16 -07:00
Michael Lange f918987d51 Unit test for for GiB in format-bytes 2020-10-15 02:54:16 -07:00
Michael Lange 64fc738733 Migrate to the new resources properties for allocs and nodes 2020-10-15 02:54:16 -07:00
Michael Lange b2b7d5e19e Test coverage for TopoViz::Node 2020-10-15 02:54:16 -07:00
Michael Lange 78b1efc531 FlexMasonry integration tests 2020-10-15 02:54:15 -07:00
Michael Lange 7604597041 Acceptance test coverage for the submit time sorting on the periodic and parameterized detail pages 2020-09-19 12:37:38 -07:00
Michael Lange 862137da06 Test coverage for page select and submit time on periodic page 2020-09-19 12:37:38 -07:00
Buck Doyle 5f5090384b
Change compared page object to match by name (#8915)
I believe this test became flaky after #8833, you can see
an example failure here:
https://app.circleci.com/pipelines/github/hashicorp/nomad/11809/workflows/0dc3c8f4-187c-44af-8bdb-6f010d653081/jobs/100848

The goal here is not to assert that the first task group in the
server database matches the first row displayed, but before
#8833 it could be assumed that they did match. This
changes to find the row corresponding to the first server
task group instead of assuming it’ll be first.
2020-09-17 11:08:47 -05:00
Buck Doyle 7ea8dcc799
Add handling for allocation-less exec URL (#8856)
This closes #8769. This new-window-opening code is not possible
to properly exercise within Ember’s testing facilities 😞
2020-09-15 14:48:29 -05:00
Michael Lange 252fa69ce6 Sort keys when converting objects to arrays for stable model fragments 2020-09-04 19:44:21 -07:00
Michael Lange fc31f80880 Temporarily remove poststop from the UI
Since poststart and poststop are shipping separately, we can't ship them
both in the UI at the same time.
2020-08-31 19:32:38 -07:00
Buck Doyle 90e0374926 Merge branch 'f-ui/poststart-poststop' of github.com:hashicorp/nomad into f-ui/poststart-poststop 2020-08-28 10:18:45 -05:00
Buck Doyle 7ed43b0332
Merge branch 'master' into f-ui/poststart-poststop 2020-08-28 10:15:18 -05:00
Buck Doyle eadb91e734
Add exec heartbeat keepalive (#8759)
This closes #8727, thanks to @jfcantu for the suggestion.
The CLI implementation of exec already has a 10-second
heartbeat so this mirrors that:
https://github.com/hashicorp/nomad/blob/v0.12.3/api/allocations.go#L161-L173
2020-08-28 10:13:33 -05:00
Michael Lange 25bb975749 Clean up erroneous and redundant mirage things 2020-08-27 17:58:24 -07:00
Buck Doyle b06700bb63 Fix tragique formatting 2020-08-27 09:38:34 -05:00
Buck Doyle 6447e61078 Remove prestart tasks table
My suggestion is that this table isn’t sufficiently useful to
keep around with the combinatoric explosion of other lifecycle
phases. The logic was that someone might wonder “why isn’t my
main task starting?” and this table would show that the prestart
tasks hadn’t yet completed. One might wonder the same about
any task that has prerequisites, so should a poststart task have
a table that shows main tasks? And so on.

Since the route hierarchy guarantees that one has already passed
through a template that shows the lifecycle chart before one
can reach the template where this table is displayed, I believe
this table is redundant. It also conveys information in a more
abstract way than the chart, which is dense and more easily
understood, to me.
2020-08-26 09:58:44 -05:00
Buck Doyle de3504a738 Add poststart and poststop lifecycle phases 2020-08-26 09:55:42 -05:00
Buck Doyle 29de8f4f76
Add component accessibility auditing and fixes (#8679)
This continues #8455 by adding accessibility audits to component integration
tests and fixing associated errors. It adds audits to existing tests rather than
adding separate ones to facilitate auditing the various permutations a
component’s rendering can go through.

It also adds linting to ensure audits happen in component tests. This
necessitated consolidating test files that were scattered.
2020-08-25 10:56:02 -05:00
Michael Lange 114909c5e8 Always show the scaling events accordion 2020-08-24 10:34:34 -07:00
Buck Doyle 4394c5b9ff
Add common serialiser abstractions (#8634)
This extracts some common API-idiosyncracy-handling patterns from model serialisers into properties that are processed by the application serialiser:

* arrayNullOverrides converts a null property value to an empty array
* mapToArray converts a map to an array of maps, using the original map keys as Name properties on the array maps
* separateNanos splits nanosecond-containing timestamps into millisecond timestamps and separate nanosecond properties
2020-08-20 12:14:49 -05:00
Nick Ethier 3cd5f46613
Update UI to use new allocated ports fields (#8631)
* nomad: canonicalize alloc shared resources to populate ports

* ui: network ports

* ui: remove unused task network references and update tests with new shared ports model

* ui: lint

* ui: revert auto formatting

* ui: remove unused page objects

* structs: remove unrelated test from bad conflict resolution

* ui: formatting
2020-08-20 11:07:13 -04:00
Buck Doyle 2f022a6a5e
Add missing server shutdown (#8677)
This removes repeated instances of this warning from test logs:
You created a second Pretender instance while there was already one running.
2020-08-17 08:17:29 -05:00
Michael Lange 3227b3c342
Merge pull request #8593 from hashicorp/f-ui/scaling-events-chart
UI: Task group scaling timeline
2020-08-07 10:35:00 -07:00
Michael Lange a04d4f2d76 Add integration test for line-chart annotation staggering 2020-08-06 17:37:09 -07:00
Michael Lange 59d98b80ca
Add missing word "two" to test name
Co-authored-by: Buck Doyle <buck@hashicorp.com>
2020-08-06 15:43:29 -07:00
Buck Doyle 9074d33f28
UI: Add truncation of rendered search results (#8571)
This closes #8549. Thanks to @optiz0r for the bug report. Having
the global search attempt to render every returned result is
obviously a mistake!
2020-08-05 15:58:44 -05:00
Michael Lange ebdb0c4101 Conditionally show the scaling timeline or accordion 2020-08-05 12:02:22 -07:00
Michael Lange 4c4e2e505f Unit test coverage for the ScaleEventsChart data domain logic 2020-08-05 12:02:22 -07:00
Michael Lange 792fa64101 Integration tests for the ScaleEventsChart component 2020-08-05 12:02:22 -07:00
Michael Lange a891e907f5 Test coverage for line chart annotations 2020-08-05 12:02:22 -07:00
Buck Doyle c2ce0a1dec
Add linting for acceptance accessibility audits (#8570)
This makes use of the PR I recently had merged to eslint-plugin-ember-a11y-testing
to add linting that ensures an accessibility audit is called at least once per acceptance
test file. When I have added linting for component tests, it can apply there too.

I added exclusions for the filesystem browser tests, which are covered by behaviors/fs
and for the search test which will involve significant overrides to Ember Power Select
default templates.
2020-07-30 12:40:05 -05:00
Buck Doyle 7596cfd5e7
Change job search navigation to use id (#8560)
This fixes #8548. It was a significant oversight to use the
name instead of the id!
2020-07-30 09:10:08 -05:00
Michael Lange 602b6771ba Assert that the scale up/down indicator is not shown when the count is null 2020-07-29 19:26:32 -07:00
Michael Lange 13af67ac80 Integration tests for the scale-events-accordion component 2020-07-29 19:26:32 -07:00
Michael Lange 4b7f431981 Acceptance tests for scaling events 2020-07-29 19:07:24 -07:00
Michael Lange d92ade8c54 Load and watch the job scale endpoint on the task group page 2020-07-29 19:07:24 -07:00
Buck Doyle 7bed453de3
Add acceptance test accessibility auditing and fixes (#8455)
This introduces ember-a11y-testing to acceptance tests via a helper
wrapper that allows us to globally ignore rules that we can address
separately. It also adds fixes for the aXe rules that were failing.
2020-07-28 12:59:14 -05:00
Michael Lange e7d414d9c2 Include the region query param on the View Raw File link in the task fs explorer 2020-07-22 13:46:38 -07:00
Michael Lange 6b984548ab Test coverage for the deployment adapter action 2020-07-21 09:02:39 -07:00
Michael Lange 9fda4412fa Add region coverage to node adapter action tests 2020-07-21 09:02:39 -07:00
Michael Lange 3d1c9283a1 Test all allocation adapter actions with and without a region
This involves a refactor to prevent immense verbosity.
2020-07-21 09:00:21 -07:00
Michael Lange 00b805b500 Test region query param for job adapter actions 2020-07-21 09:00:20 -07:00
Michael Lange 5e01266940 Refactor job adapter test to simplify setting up region and namespace state 2020-07-21 09:00:20 -07:00
Buck Doyle 7f0177548d
Add specificity to exec allocation URL generation (#8463)
Thanks to @notnoop for this UX improvement suggestion.
The allocation’s task group is always known, so it
might as well be preselected in the sidebar when the
exec window opens. Also, if the task group only has
one task, might as well preselect it too.
2020-07-20 16:07:39 -05:00
Buck Doyle 77b4d59f5d
Change edition to Octane (#8418)
This updates the Ember edition setting to Octane, which I removed from #8319
because it required the template-only Glimmer components setting to be turned
on, which this does. These changes to templates accommodate that setting.
2020-07-13 09:26:12 -05:00
Michael Lange aaf32cabf0 Filter out new records from the job list page
When a prefix is set and the run job button is clicked,
the new job causes an error because it has no name yet.
2020-07-10 15:29:52 -07:00
Michael Lange d5b54ad84c Reset the system and refetch namespaces with every token change 2020-07-10 15:18:36 -07:00
Buck Doyle ea2adb3bf6
Update template linting and fix missed curly invocations (#8382)
This includes fixes for newer template lint rules that came along with
updating that dependency, which was necessary to be able to use
the no-curly-component-invocation rule. It also updates some curly
invocations that I missed in #8075.
2020-07-09 12:30:11 -05:00
Michael Lange 970ccedd1f
Merge pull request #8314 from hashicorp/f-ui/scaling-ux
UI: Scaling UI UX Improvements
2020-07-01 09:21:08 -07:00
Michael Lange f786ee5eae Persist the log stream/mode setting to localStorage 2020-06-30 17:09:52 -07:00
Michael Lange 7ad214f34a StepperInput UX improvements
- Click label to focus input
- Focusing input selects value
- Entering an invalid value reverts selection
- Entering a fractional number floors the value
2020-06-30 11:54:11 -07:00
Buck Doyle 196f27aec4
Add multiple substring highlights for search (#8287)
The fuzzy search highlighting was ignoring everything after the first
substring that was matched, this now highlights all substrings.
2020-06-25 15:26:52 -05:00
Buck Doyle bf7ed82def
Improve global search UX (#8249)
This updates the look of the search control, adds a hint about the slash
shortcut, adds highlighting of fuzzy search results, and addresses a few
edge case UX failures. It moves to using a fork of Ember Power Select
to handle an edge case where pressing escape would put the control
in an undesirable active-but-not-open state.
2020-06-25 08:51:52 -05:00
Michael Lange 44556d0acb
Fix flaky task-group-row test. (#8221)
Sometimes a job would be created with a running deployment which made
the increment button disabled.

While I was finding the root cause, I also changed the waitUntil pattern
to match the StepperInput technique which is more resilient to code
changes.
2020-06-20 09:48:32 -05:00
Buck Doyle ee7141a59a
Add phase 1 of global search (#8175)
This introduces a DataCaches service so recently-updated collections don’t need
to be requeried within a minute, or based on the current route. It only searches
jobs and nodes. There are known bugs that will be addressed in upcoming PRs.
2020-06-19 13:05:28 -05:00
Michael Lange 3be9d338cb Remove superfluous property from the StepperInput page object 2020-06-19 10:21:39 -07:00
Michael Lange 02fd45f02b Acceptance tests for task group scaling 2020-06-18 23:23:03 -07:00
Michael Lange ddd5a7e342 Test coverage for the StepperInput 2020-06-18 22:08:29 -07:00
Michael Lange f1fec7430f Test coverage for the task group row scale actions 2020-06-18 22:08:28 -07:00
Michael Lange 3b7b5f9649 Add canScale ability for jobs 2020-06-18 22:08:28 -07:00
Michael Lange 562a957666 Select all shortcut support for the streaming file component 2020-06-16 12:51:52 -07:00
Michael Lange c62db754a3 Server monitor page 2020-06-16 10:23:36 -07:00
Michael Lange f745ce4269 Test coverage for new features of the server detail page 2020-06-16 10:23:36 -07:00
Michael Lange e6928cb01d Refactor the servers/server pages to match the subnav style of nested pages 2020-06-16 10:23:36 -07:00
Michael Lange c080def72e Test coverage for the client monitor page 2020-06-16 10:23:36 -07:00
Michael Lange cfee0f74a4 Test coverage for the AgentMonitor component 2020-06-16 10:23:36 -07:00
Michael Lange 1abbce97ac Temporary helpers for ember-power-select
These are based on the source code for selectChoose. I would have liked
to have used selectChoose, but the implementation has two await
settled()s in it which prevented me from writing the tests I needed to
write.

These new extension helpers separate selectChoose into two pieces so
logic can be placed between the two async actions.
2020-06-16 10:23:36 -07:00
Buck Doyle 1cca7abcab
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
Buck Doyle 2998deac50
Convert to angle bracket invocation (#8075)
This is mostly a direct application of the ember-angle-brackets-codemod.
I manually restored newlines in multi-line component invocations, usually
preserving file line length except for now-non-positional link-to @route.

I needed to rename task to taskState in some cases to avoid Ember
Concurrency naming conflicts.
2020-06-01 14:03:56 -05:00
Buck Doyle 9c0f85d7b6
UI: add filesystem browsing for allocations (#7951)
This partially addresses #7799.

Task state filesystems are contained within a subdirectory of their
parent allocation, so almost everything that existed for browsing task
state filesystems was applicable to browsing allocations, just without
the task name prepended to the path. I aimed to push this differential
handling into as few contained places as possible.

The tests also have significant overlap, so this includes an extracted
behavior to run the same tests for allocations and task states.
2020-06-01 08:15:59 -05:00
Michael Lange 3f40b3e3cd
Merge pull request #8035 from hashicorp/f-ui/ember-fetch
UI: Replace jQuery with fetch within Ember Data
2020-05-26 12:32:03 -07:00
Buck Doyle 222b36ced3
UI: use lazy-loading for Xterm.js (#7964)
This updates Xterm.js to 4.6.0, which includes support for reverse-wraparound
mode, so we no longer need to use a vendored dependency, which closes #7461.
The interface for accessing the buffer that’s used for test assertions changed.

With the dependency now accessed conventionally, we can have it load only when
it’s needed by an exec popup window, which closes #7516. That saves us
≈60kb compressed in the dependency bundle!
2020-05-26 09:56:25 -05:00
Michael Lange 262c558e1c Replace nulls with empty strings to have an empty response body 2020-05-21 10:35:41 -07:00
Michael Lange 6274282948 Fix latent race condition in client detail test
Adding this settled makes this test pass now that Ember Data is using
fetch instead of jquery. The test was presumably always incorrect but
never flaked.
2020-05-21 10:35:40 -07:00
Michael Lange 388bb138c2 Always lower case headers now 2020-05-21 10:35:40 -07:00
Michael Lange 07a604033f Adjust header case, which changed with the migration to fetch 2020-05-21 10:35:40 -07:00
Michael Lange de73b9539d Replace XHRToken with AbortController 2020-05-21 10:35:39 -07:00
Michael Lange 4588f2b5a3 Show the number of allocations in the the goto links on plugin detail 2020-05-20 14:22:47 -07:00
Michael Lange 360a0dfc08 Test coverage for the plugin allocations page 2020-05-19 19:22:12 -07:00
Michael Lange e57d33a6b1 Test coverage for the limited alloc tables and goto links 2020-05-19 18:01:42 -07:00
Michael Lange 49724673d4 Test coverage for node only view of the plugin detail page 2020-05-18 17:23:54 -07:00
Michael Lange eabac917f1 Test coverage for the node-only change to the list view 2020-05-18 15:30:00 -07:00
Michael Lange af5ac78eba Add availability gauges to the plugin page object 2020-05-18 15:30:00 -07:00
Michael Lange dc36b40201
Merge pull request #7942 from hashicorp/b-ui/csi-alloc-relationships
UI: CSI Bug, Imperatively load controller/node plugin allocations
2020-05-13 10:20:09 -07:00
Michael Lange 0d9b9f5976 Test coverage for the gauge chart 2020-05-13 08:36:05 -07:00
Michael Lange 89afc9ccae Test coverage for the plugin-allocation-row 2020-05-12 21:30:33 -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 f9882d42e6 Plugin detail page object 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 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
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
Michael Lange 260da00852 Add embedded task group to allocation to reference when allocation is historical 2020-05-01 14:30:02 -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
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 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 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 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 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 d91de05fc1 Fix flaky serializer test 2020-04-01 14:54:05 -07:00
Buck Doyle eaf64849f6
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 6eaf79f928 Tests for the new volumes facet 2020-03-30 17:33:46 -07:00
Michael Lange fdd2f8df37 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 2db4f5519a 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 1bd6a69067
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 674da96a59
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 fe685f897f Correct a test and a dependent key 2020-02-14 16:44:28 -08:00
Michael Lange c7c37250c8 Improve the node serializer tests 2020-02-13 17:42:41 -08:00
Michael Lange 53c2086a08 Add assertion for the volume k/v pairs in task rows 2020-02-13 17:11:39 -08:00
Michael Lange b47ce637ed Refactor task row info test to use 'as' 2020-02-13 17:11:38 -08:00
Michael Lange 41fad6b649 Test coverage for the volume table on the task group page 2020-02-13 17:11:37 -08:00
Michael Lange 44a961f4f8 Test coverage for the task detail volumes table 2020-02-13 17:11:35 -08:00
Michael Lange 895d74c503 Test coverage for change in resource rows 2020-02-13 17:11:30 -08:00
Michael Lange c0f1aff963 Fix flaky host volumes test 2020-02-13 17:11:28 -08:00
Michael Lange 18cf59b22f Test coverage for the host volumes table 2020-02-13 17:11:25 -08:00
Michael Lange 849c996887 Data layer for Host Volumes in the UI 2020-02-13 17:11:22 -08:00
Michael Lange 31b83b1c70 Acceptance test for disabled node write controls 2020-01-31 09:41:37 -08:00
Michael Lange 5c4c05824a Account for disabled ACLs in ability tests 2020-01-31 09:41:36 -08:00
Michael Lange 2dac1d6705 Refactor ability tests to use a setup hook for ability lookup 2020-01-30 21:29:21 -08:00
Michael Lange 1fae4083eb Add an ability for client permissions 2020-01-30 21:29:19 -08:00
Michael Lange d7a3c15530 Replace custom parse-duration implementation with an existing lib 2020-01-23 16:34:38 -08:00
Michael Lange c0d57149ca Update client detail test given change to the compositeStatus property 2020-01-23 16:34:38 -08:00
Michael Lange b4ab7b02ba Remove superfluous information from the client details ribbon 2020-01-23 16:34:36 -08:00
Michael Lange 41eaec2d9b Use qunit-dom where applicable 2020-01-23 16:34:35 -08:00
Michael Lange 1dd1298626 New test coverage for the drain capabilities 2020-01-23 16:34:34 -08:00
Michael Lange 0f41bfafad Update existing tests 2020-01-23 16:34:33 -08:00
Michael Lange 5e95633481 PopoverMenu integration tests 2020-01-23 16:34:32 -08:00
Michael Lange 3b534bbdf9 Integration tests for the toggle component 2020-01-23 16:34:32 -08:00
Michael Lange bc555f7758 Update the client detail page object 2020-01-23 16:34:31 -08:00