Commit Graph

230 Commits

Author SHA1 Message Date
Buck Doyle
67e9690b7d 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
06baadd01e 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
756069c9a2 Remove jquery from gauge chart 2020-05-26 14:13:29 -07:00
Michael Lange
718114cb98 Remove jquery from the distribution bar chart 2020-05-26 14:11:08 -07:00
Michael Lange
6ffa836a64 Remove jquery from line-chart 2020-05-26 14:05:45 -07:00
Michael Lange
115923d890 Type-check the ForbiddenError rather than ducktype it
Going off of the error message being "Forbidden" was brittle to begin
with and no longer works with Fetch due to the error message coming from
jquery underpinnings that were unobserved by Ember Data's attempted
recreation.
2020-05-21 10:35:40 -07:00
Michael Lange
dc06b460e4 Use the AbortController provided by the fetch polyfill 2020-05-21 10:35:39 -07:00
Michael Lange
1e7f1871bd 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
dfc45f4dcd Gauge chart component 2020-05-13 08:36:04 -07:00
Michael Lange
30715b8b37 Test coverage for the plugin-allocation-row 2020-05-12 21:30:33 -07:00
Michael Lange
db8e43949d Don't double load freshly loaded allocations 2020-05-12 21:30:33 -07:00
Michael Lange
32b4e5e8ab Properly manage the lifecycle of allocations for storage nodes and controllers 2020-05-12 21:30:33 -07:00
Michael Lange
c5b1fd3aa7 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
7c373a2340 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
16296f1332 New PluginAllocationRow derivative of AllocationRow 2020-05-06 17:21:46 -07:00
Michael Lange
64fa26b4b9 Separate AllocationStat component for containing the multiple states a stat tracker can be in 2020-05-06 17:21:45 -07:00
Michael Lange
d9aaaa0107 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
2c82dc9060 Comment why the allocation has to be reloaded 2020-05-01 14:27:53 -07:00
Jasmine Dahilig
c10ac6394f 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
e5a5fc7744 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
e186554651 Clicking stdout/stderr when already on that tab is now a noop 2020-04-29 17:36:16 -07:00
Michael Lange
fab6fcbd88 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
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
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
498ca21159 Reset current page when changing page size 2020-04-02 12:50:33 -07:00
Michael Lange
90794c1cce Page size select component 2020-04-02 12:50:29 -07:00
Buck Doyle
189b52212e UI: Change determination of exec sidebar active tasks (#7491)
This closes #7476. The decomposition of computed properties
is necessary to avoid nested aggregate dependent keys; the
previous dependent key of `taskGroup` will be inadequate
when the sidebar becomes live-updating.
2020-03-25 12:08:33 -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
4419510652 Call out the 'down' status too, since it's a pretty bad one 2020-01-31 12:56:15 -08:00
Michael Lange
c6a677dc4a Disable options for popover and drain-popover 2020-01-30 21:29:29 -08:00
Michael Lange
4793dc9afb Replace custom parse-duration implementation with an existing lib 2020-01-23 16:34:38 -08:00
Michael Lange
413681e317 PopoverMenu integration tests 2020-01-23 16:34:32 -08:00
Michael Lange
8dadd3db46 Integration tests for the toggle component 2020-01-23 16:34:32 -08:00
Michael Lange
2e39c0a529 New toggle component 2020-01-23 16:34:27 -08:00
Michael Lange
504a7afa03 Modifiers to the two-step-button 2020-01-23 16:34:25 -08:00
Michael Lange
96522e7f53 Drain stop and update and notifications 2020-01-23 16:34:24 -08:00
Michael Lange
2ddc54e7a1 Polish for the drain popover 2020-01-23 16:34:21 -08:00
Michael Lange
faffb83d1d Extract the duration parsing into a util 2020-01-23 16:34:19 -08:00
Michael Lange
e47d255b07 Factor out the drain popover and implement its behaviors 2020-01-23 16:34:18 -08:00
Michael Lange
d401a11d0c Add triggerClass support to the popover menu 2020-01-23 16:34:18 -08:00
Michael Lange
de03d82df9 PopoverMenu component 2020-01-23 16:34:14 -08:00
Buck Doyle
9f86f5a1fc UI: Migrate to Storybook (#6507)
I originally planned to add component documentation, but as this dragged on and I found that JSDoc-to-Markdown sometimes needed hand-tuning, I decided to skip it and focus on replicating what was already present in Freestyle. Adding documentation is a finite task that can be revisited in the future.

My goal was to migrate everything from Freestyle with as few changes as possible. Some adaptations that I found necessary:
• the DelayedArray and DelayedTruth utilities that delay component rendering until slightly after initial render because without them:
  ◦ charts were rendering with zero width
  ◦ the JSON viewer was rendering with empty content
• Storybook in Ember renders components in a routerless/controllerless context by default, so some component stories needed changes:
  ◦ table pagination/sorting stories access to query params, which necessitates some reaching into Ember internals to start routing and dynamically generate a Storybook route/controller to render components into
  ◦ some stories have a faux controller as part of their Storybook context that hosts setInterval-linked dynamic computed properties
• some jiggery-pokery with anchor tags
  ◦ inert href='#' had to become href='javascript:;
  ◦ links that are actually meant to navigate need target='_parent' so they don’t navigate inside the Storybook iframe

Maybe some of these could be addressed by fixes in ember-cli-storybook but I’m wary of digging around in there any more than I already have, as I’ve lost a lot of time to Storybook confusion and frustrations already 😞

The STORYBOOK=true environment variable tweaks some environment settings to get things working as expected in the Storybook context.

I chose to:
• use angle bracket invocation within stories rather than have to migrate them soon after having moved to Storybook
• keep Freestyle around for now for its palette and typeface components
2020-01-21 15:46:32 -06:00
Buck Doyle
83d92251c5 UI: Fix client sorting (#6817)
There are two changes here, and some caveats/commentary:

1. The “State“ table column was actually sorting only by status. The state was not an actual property, just something calculated in each client row, as a product of status, isEligible, and isDraining. This PR adds isDraining as a component of compositeState so it can be used for sorting.

2. The Sortable mixin declares dependent keys that cause the sort to be live-updating, but only if the members of the array change, such as if a new client is added, but not if any of the sortable properties change. This PR adds a SortableFactory function that generates a mixin whose listSorted computed property includes dependent keys for the sortable properties, so the table will live-update if any of the sortable properties change, not just the array members. There’s a warning if you use SortableFactory without dependent keys and via the original Sortable interface, so we can eventually migrate away from it.
2019-12-12 13:06:54 -06: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
Buck Doyle
e6c66354d0 UI: Update to Ember 3.8 LTS (#5968) 2019-10-08 13:44:19 -05:00
Buck Doyle
dfb88cc787 UI: add Consul Connect features (#6108) 2019-09-04 09:39:56 -05:00
Michael Lange
c29d836dd9 Merge pull request #5871 from hashicorp/f-ui/alloc-fs
UI: Allocation file system explorer
2019-08-20 10:18:23 -07:00
Michael Lange
a321145457 Encode characters in file paths to ensure proper URIs 2019-08-14 12:54:11 -07:00
Buck Doyle
a8c90f5352 Fix navigation via clicking recent allocation row (#6087)
This fixes the recent allocation rows to navigate when clicking within them
rather than just on the link, which matches the cursor behaviour.
2019-08-08 09:26:46 -05:00
Michael Lange
038fc27ef0 Always preload the alloc node so the client can be dialed first 2019-08-07 17:35:15 -07:00