Commit Graph

1468 Commits

Author SHA1 Message Date
Michael Lange 136b4ec354 Wire up the +/- buttons in task group rows to the job scale action 2020-06-18 22:08:28 -07:00
Michael Lange aebc896ff6 New scale action for jobs (and a convenience task group method) 2020-06-18 22:08:27 -07:00
Michael Lange 57f4e9a62e 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
Michael Lange 64cfa62c71 Make sure buttons in a button bar have a very visible focus state 2020-06-18 22:08:27 -07:00
Michael Lange c583c00088 Add the elements of the manual scaling actions to the task-group-row component 2020-06-18 22:08:27 -07:00
Michael Lange 1182e76383 Add the min/max and policy y/n of a task group to the details ribbon 2020-06-18 22:08:27 -07:00
Michael Lange 76c6a9d89f Prevent inline definition key/value pairs from breaking the key and value onto separate lines 2020-06-18 22:08:27 -07:00
Michael Lange 2739da75d6 Additional button-bar treatments for use in a table row 2020-06-18 22:08:27 -07:00
Michael Lange dfcfdf0293 Extend button-bar support to buttons 2020-06-18 22:08:27 -07:00
Michael Lange b4b00282dd When an icon is intended as text, it shouldn't have pointer events
This prevents the svg from being a target in click events.
2020-06-18 22:08:27 -07:00
Michael Lange f9819105c3 New xsmall button size 2020-06-18 22:08:27 -07:00
Michael Lange c5bf7fc7a7 LazyClick should also get interrupted by buttons 2020-06-18 22:08:26 -07:00
Michael Lange d8c2853d65 Model the scaling properties of a task group as a fragment 2020-06-18 22:08:26 -07:00
Michael Lange da76edcabd Code review feedback 2020-06-17 14:56:16 -07:00
Michael Lange 3c03ee5621 Guard the request animation frame with the existing requestFrame flag 2020-06-17 14:50:55 -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 56e66e76e6 Redesign the server detail page to be inline with everything else 2020-06-16 10:23:36 -07:00
Michael Lange 3381c835b1 Add nested monitor route to servers/server 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 bb499bba72 Show a helpful forbidden message when monitor access is not authorized 2020-06-16 10:23:36 -07:00
Michael Lange 129ccec82c New component version of the forbidden-message partial 2020-06-16 10:23:36 -07:00
Michael Lange 58df659fdb Ability for agent:read 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
Michael Lange c515a59b44 Preserve the log when switching log levels on monitor 2020-06-16 10:23:36 -07:00
Michael Lange 6cb83c6297 Inline-block the buttons to remove weird text-flow spacing 2020-06-16 10:23:36 -07:00
Michael Lange cdc7db07c6 Refactor AgentMonitor levels handling to be simpler 2020-06-16 10:23:36 -07:00
Michael Lange 38af76e277 Reimplement synchronizeScrollPosition in a way that actually works 2020-06-16 10:23:36 -07:00
Michael Lange ca99ec774b Implement the log streaming portion of the AgentMonitor component 2020-06-16 10:23:36 -07:00
Michael Lange e0fbd88d26 Monitor component and query param interaction 2020-06-16 10:23:35 -07:00
Michael Lange 10e1371d34 Create new monitor route for clients 2020-06-16 10:23:35 -07:00
Buck Doyle 97c5a85ee6 Remove stray commented-out line 2020-06-16 08:36:39 -05:00
Michael Lange de82051d14 Data cannot be a field in the base class and a CP in the child classes 2020-06-15 11:37:40 -05:00
Buck Doyle c1cc51a057 Remove superfluous uses of Object.freeze
This is no longer needed!
https://guides.emberjs.com/release/upgrading/current-edition/native-classes/#toc_properties-and-fields
2020-06-15 10:15:11 -05:00
Buck Doyle a4be011141 Rename clashing property 2020-06-15 10:14:36 -05:00
Buck Doyle 3de475f8e4 Convert field to overridable computed property
StatsTimeSeries defines description as a computed property,
which isn’t possible when this is a class field.
2020-06-15 10:14:36 -05:00
Buck Doyle 782bc3b7c0 Rename clashing action 2020-06-15 10:14:36 -05:00
Buck Doyle a950ae661d Remove problem field
It appears this gets turned into a getter-only computed property
somehow, which causes problems when subclasses override it.
2020-06-15 10:14:35 -05:00
Buck Doyle cd11cd290c Add manually-converted classes
I don’t know why the codemod ignored these files 🧐
2020-06-15 10:14:26 -05:00
Buck Doyle 577e85b007 Fix query parameters structures
I’d think the codemod would handle this if it’s a requirement
but apparently not, is it a bug?
2020-06-15 09:52:31 -05:00
Michael Lange c4e29f8afa Change URL-generation for job-updating
The id-processing in the WatchableNamespaceIds adapter was
happening twice; this removes urlForUpdate record so it
only happens once. @DingoEatingFuzz figured it out! 🥳
2020-06-15 09:51:15 -05:00
Michael Lange 16ed5451d2 Change with-namespace-ids mixin to a base class
This is a merge of 5d9fce5.
2020-06-15 09:47:15 -05:00
Buck Doyle c56726abd1 Remove unnecessary fetch-setting
Originally this was failing because it only had a getter.
I tried replacing it with a computed property and that
succeeded, but since we have already stopped using
jQuery, we might as well remove it.
2020-06-15 09:41:57 -05:00
Buck Doyle 6efc64818b Add fixes for ESLint getter-return
…I GUESS
2020-06-10 16:18:56 -05:00
Buck Doyle 89136cbf6a 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 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
Michael Lange d53b8e48e1 Remove vendored xterm.js files 2020-06-03 09:25:19 -07: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 30ad9b6c63 Disable and remove the jquery integration 2020-05-27 09:16:36 -07:00
Michael Lange c395b83f5a Remove test code 2020-05-26 14:54:59 -07:00
Michael Lange e436d01b01 Remove jquery from the window resize helper 2020-05-26 14:35:57 -07:00
Michael Lange 083e82e6b7 Remove jquery from the lazy-click helper 2020-05-26 14:31:15 -07:00
Michael Lange d84df5dbe6 Remove jquery from gauge chart 2020-05-26 14:13:29 -07:00
Michael Lange 849c22845f Remove jquery from the distribution bar chart 2020-05-26 14:11:08 -07:00
Michael Lange 71308334d5 Remove jquery from line-chart 2020-05-26 14:05:45 -07: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 1f82e19e2d 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 388bb138c2 Always lower case headers now 2020-05-21 10:35:40 -07:00
Michael Lange e1f3086ba3 Don't double query params for findQuery 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 20f209c4fb Use the AbortController provided by the fetch polyfill 2020-05-21 10:35:39 -07:00
Michael Lange 899d8266f4 Instrument jquery ajax method to see if it is getting called anywhere 2020-05-21 10:35:39 -07:00
Michael Lange d5e8c1ca8c Force the use of fetch despite jquery still being integrated 2020-05-21 10:35:39 -07:00
Michael Lange e263d2821e Prevent sticky query params for plugin alloc filtering 2020-05-20 14:34:16 -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 f683529b29 Limit the length of the alloc tables on the plugin overview page 2020-05-19 17:30:00 -07:00
Michael Lange 993cbe6bdb Add a title to the plugin/allocations page
Typically these filterable list views don't have titles beyond the
breadcrumbs, but since this page has no search bar, the title really
helps balance it out.
2020-05-19 17:29:05 -07:00
Michael Lange 98933e12a0 Expose existing qp serialization util as a helper 2020-05-19 17:28:23 -07:00
Michael Lange e611b6fcb9 Add filtering to the plugin allocations page 2020-05-18 23:55:52 -07:00
Michael Lange 02ca35e718 Scaffold the plugin allocations page 2020-05-18 23:36:12 -07:00
Michael Lange 3c6983370c Add a subnav to the plugin page 2020-05-18 23:24:02 -07:00
Michael Lange 05da9a51b7 Fix scrunched availability chart bug on double chart layout 2020-05-18 22:48:55 -07:00
Michael Lange c68b737fb5 Add plugin/allocations route 2020-05-18 22:48:23 -07:00
Michael Lange 22cc9bec74 Work around a mirage bug 2020-05-18 17:23:55 -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 19916dc028 Handle node-only views 2020-05-18 15:30:00 -07:00
Buck Doyle 86cf076a3c
Remove Ember server from Storybook startup (#7980)
The presence of Storybook’s preview-head.html file in the repository
is a constant annoyance: it’s only needed for Storybook and it changes
all the time, producing a lot of Git noise. By making it a separate
step to have the Ember CLI server running before starting Storybook,
we no longer need to have preview-head in the repository. It needed to
be present because there was a race condition where it was sometimes
not generated in time for the Storybook parallel startup.
2020-05-15 13:53:31 -05:00
Michael Lange fb48f3de39
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 b8cbc34675 Make the Plugin adapter extend Watchable 2020-05-14 14:37:07 -07:00
Michael Lange 9de6165510 Protect against making watch requests using adapters that don't extend Watchable 2020-05-14 14:36:38 -07:00
Nomad Release bot 189a378549 Generate files for 0.11.2 release 2020-05-14 20:49:42 +00:00
Buck Doyle 588164ef44
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
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 070f1003e2 Adjust gauge chart stories 2020-05-13 08:36:05 -07:00
Michael Lange 72ca69811c Add gauge charts to the plugin detail page to measure availability 2020-05-13 08:36:05 -07:00
Michael Lange fd27e83ba5 Bottom aligned columns variant 2020-05-13 08:36:05 -07:00
Michael Lange ef4e7ad401 Add gauge chart stories 2020-05-13 08:36:05 -07:00
Michael Lange 42e107851c Style the gauge chart component 2020-05-13 08:36:05 -07:00
Michael Lange 60d9dd47f3 Treat null and undefined equally 2020-05-13 08:36:04 -07:00
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