Commit Graph

1907 Commits

Author SHA1 Message Date
Luiz Aoqui d283e90c35
ui: only dipslay "Dispatch Job" button on parameterized jobs (#11019) 2021-08-09 17:49:08 -04:00
Luiz Aoqui a81e6a427d
ui: fix job dispatch page when job doesn't have any meta fields (#10934) 2021-08-03 13:50:43 -04:00
Jai Bhagat e7f0cd28f3 edit fuzzy search callback logic
Namespaces are set-up in Nomad to be an object that has an id property.
However, namespaces actually don't have that shape. Our search was expecting
a namespace object, but we actually don't have a namespace assigned to jobs
in our config and namespace is set to null. Normally, these namespaces would
be set to default, but that would require us to refactor our Mirage config
if we wanted to assert that namespaces are 'default' and not null. So this is
a bandaid solution.
2021-07-26 17:25:43 -04:00
Jai Bhagat 1440b562e0 Merge remote-tracking branch 'origin/main' into b-ui/search-namespaces 2021-07-22 15:16:30 -04:00
Jai Bhagat 0fba0ce778 edit namespace property in handlebar file to use computed property in component 2021-07-22 11:43:45 -04:00
Jai Bhagat e6b579ab8f address merge conflicts 2021-07-21 17:30:11 -04:00
Nicholas Cioli 4d9fa38a5e
ui: add parameterized dispatch interface (#10675)
* ui: add parameterized dispatch interface

This commit adds a new interface for dispatching parameteried jobs, if
the user has the right permissions. The UI can be accessed by viewing a
parameterized job and clicking on the "Dispatch Job" button located in
the "Job Launches" section.

* fix failing lint test

* clean up dispatch and remove meta

This commit cleans up a few things that had typos and
inconsistent naming. In line with this, the custom
`meta` view was removed in favor of using the
included `AttributesTable`.

* ui: encode dispatch job payload and start adding tests

* ui: remove unused test imports

* ui: redesign job dispatch form

* ui: initial acceptance tests for dispatch job

* ui: generate parameterized job children with correct id format

* ui: fix job dispatch breadcrumb link

* ui: refactor job dispatch component into glimmer component and add form validation

* ui: remove unused CSS class

* ui: align job dispatch button

* ui: handle namespace-specific requests on job dispatch

* ui: rename payloadMissing to payloadHasError

* ui: don't re-fetch job spec on dispatch job

* ui: keep overview tab selected on job dispatch page

* ui: fix task and task-group linting

* ui: URL encode job id on dispatch job tests

* ui: fix error when job meta is null

* ui: handle job dispatch from adapter

* ui: add more tests for dispatch job page

* ui: add "job dispatch" capability check

* ui: update job dispatch from code review

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2021-07-20 18:27:41 -04:00
Jai Bhagat cc61ad66bf refactoring for same regression in job versions
In job versions, if you have an ACL token with a write policy
you should be able to revert a job, however, that was not the
case here. This is because we're using ember-can to check if
the user can run a job. That permission relies on policiesSupportRunning
which uses a function called namespaceIncludesCapability. We're going to
need to refactor any cases that use this function.
2021-07-20 16:24:42 -04:00
Jai Bhagat 08a728ac91 edit ember-can to add additional attribute for namespace
We wanted the ability to get our namespace from query params
in order to do this, we're using additional attributes via
ember-can to set a bound property directly from our
handlebar file. This sets us up better in the event that
the namespace filter changes on the UI because our handlebar
file will be aware of the change, whereas our ability may not
update as the namespace filter updates.
2021-07-13 15:14:38 -04:00
Georges-Etienne Legendre d057025ce6
Capture ACL Token from self API call for Reverse Proxy use-case (#10563)
* Proposed fix for #10561

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* Add acceptance tests for reverse proxy use-case

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* Use reads instead of computed/get

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* Move back the line closer to the task

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* skip a11y-audit-called lint rule on reverse proxy tests

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2021-07-12 20:42:08 -04:00
Jai Bhagat 9b756998d3 add name property back to agent schema in ember mirage
The name property had to be added back to the agent schema
in the Agent Factory because the /agent/monitor endpoint in
the config finds agents by their names and since member is not
a proper entity in our Mirage Config we can't just findBy name
of the member. So although we're following the correct schema
we're set-up to rely on this.
2021-07-11 16:09:43 -04:00
Jai Bhagat 46f8b3dc66 refactor tests that depend on Agent fixutres in Mirage 2021-07-08 08:01:15 -04:00
Jai Bhagat 2efa6cc7e4 add agent serializer
This commit adds a serializer for the Agent. When the factory was originally
designed to have the Member properities directly on the Agent class which was
not set-up properly technically, but since we didn't really make use of the
Agent endpoint.
2021-07-06 16:42:07 -04:00
Jai Bhagat b92ab047ff edit the computed agent version property
This PR edits the computed agent version that is returned upon hitting
the agent self request endpoint. The reason is because we believe that
the Agent Member Tag property sometimes returns null because we may have
cases where there are only clients and no servers and only servers are
included in the Serf Gossip Protocol. There may be other cases where we
do in fact have servers but the node is erased for some reason. We are
unsure how to replicate that issue, however.

edit mirage config

This commit updates the Mirage Config because our acceptance tests
depend on the Mirage Config, while we rely on Mirage Factories to
populate fixture data for us to use when to run the Nomad UI locally

Revert "update the open-button disability functionality depending on a job's state"

This reverts commit 5190b308a51d55a7b0617854164c155d36d7e513.
2021-06-14 13:22:36 -04:00
Florian Apolloner ad472e8079 Fixed global-search keyboard shortcut for non-english keyboard layouts.
Closes #10646
2021-06-07 13:32:38 -04:00
Buck Doyle 5f9ad112e4
Add namespace to allocation search result label
Is “@ namespace” sensible? 🧐
2021-05-27 14:03:05 -05:00
Buck Doyle 14bd99196a
Change fuzzy search to search all namespaces
Thanks to @apollo13 for reporting this in #10101.
2021-05-27 13:45:34 -05:00
Buck Doyle e618c06076
Add namespace to job search results 2021-05-27 13:35:30 -05:00
Buck Doyle 7b42bb0e2d
ui: Fix server list leader determination for IPv6 (#10530)
This closes #10513, thanks to @bastelfreak for the report.
GET /status/leader returns an IPv6 host with square brackets
around the IP address as expected, but the rpcAddr property
on the agent model does not.

This fixes rpcAddr, updates the Mirage /status/leader mock
to properly format an IPv6 host, and changes the agent
factory to sometimes produce IPv6 addresses.

I added a formatHost utility function to centralise the
conditional square bracket-wrapping that would have
otherwise been further scattered around.
2021-05-13 12:29:51 -05:00
Georges-Etienne Legendre 5ad8c8136a
Fix exec not working for another region (#10539)
This conditionally includes a region query parameter when
opening the exec socket.
2021-05-13 09:14:16 -05:00
dependabot[bot] 08203e5a34
ui: build(deps): bump underscore from 1.12.0 to 1.13.1 in /ui (#10525)
Bumps [underscore](https://github.com/jashkenas/underscore) from 1.12.0 to 1.13.1.
- [Release notes](https://github.com/jashkenas/underscore/releases)
- [Commits](https://github.com/jashkenas/underscore/compare/1.12.0...1.13.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 09:38:16 -05:00
dependabot[bot] fc68752e7d
ui: build(deps): bump url-parse from 1.4.7 to 1.5.1 in /ui (#10528)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.1.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 09:35:07 -05:00
dependabot[bot] c64025ad70
ui: build(deps): bump lodash from 4.17.20 to 4.17.21 in /ui (#10526)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 15:34:39 -05:00
dependabot[bot] c2fe8902cd
ui: build(deps): bump handlebars from 4.7.6 to 4.7.7 in /ui (#10527)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.7.6 to 4.7.7.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.7.6...v4.7.7)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 13:24:55 -05:00
Buck Doyle 4e4a83039f
ui: Fix bug where switching topo viz allocation highlights doesn’t update charts (#10490)
This closes #10489. It adds `dependentKeyCompat` to the allocation getter so it works
as expected as a dependent key for the `tracker` computed property, as described here:
https://guides.emberjs.com/release/upgrading/current-edition/tracked-properties/#toc_backwards-compatibility
2021-05-03 10:36:18 -05:00
Buck Doyle ef21c5f75b
Add guard against missing namespace in Mirage (#10474)
Similarly to 735f056, this won’t happen with real data,
but can happen in the current Mirage factory setup.
2021-04-30 09:18:23 -05:00
Michael Lange e8593ec1bb
ui: Update namespaces design (#10444)
This rethinks namespaces as a filter on list pages rather than a global setting.

The biggest net-new feature here is being able to select All (*) to list all jobs
or CSI volumes across namespaces.
2021-04-29 15:00:59 -05:00
Buck Doyle b9f462fdc1
ui: Add optional memory max to task details ribbon (#10459)
This is the first step in #10268. If a maximum is not specified, the
task group sum uses the memory number instead. The maximum is only
shown when it’s higher than the memory sum.
2021-04-28 15:38:14 -05:00
Buck Doyle 6d037633da
ui: Change global search to use fuzzy search API (#10412)
This updates the UI to use the new fuzzy search API. It’s a drop-in
replacement so the / shortcut to jump to search is preserved, and
results can be cycled through and chosen via arrow keys and the
enter key.

It doesn’t use everything returned by the API:
* deployments and evaluations: these match by id, doesn’t seem like
  people would know those or benefit from quick navigation to them
* namespaces: doesn’t seem useful as they currently function
* scaling policies
* tasks: the response doesn’t include an allocation id, which means they
  can’t be navigated to in the UI without an additional query
* CSI volumes: aren’t actually returned by the API

Since there’s no API to check the server configuration and know whether
the feature has been disabled, this adds another query in
route:application#beforeModel that acts as feature detection: if the
attempt to query fails (500), the global search field is hidden.

Upon having added another query on load, I realised that beforeModel was
being triggered any time service:router#transitionTo was being called,
which happens upon navigating to a search result, for instance, because
of refreshModel being present on the region query parameter. This PR
adds a check for transition.queryParamsOnly and skips rerunning the
onload queries (token permissions check, license check, fuzzy search
feature detection).

Implementation notes:

* there are changes to unrelated tests to ignore the on-load feature
  detection query
* some lifecycle-related guards against undefined were required to
  address failures when navigating to an allocation
* the minimum search length of 2 characters is hard-coded as there’s
  currently no way to determine min_term_length in the UI
2021-04-28 13:31:05 -05:00
Buck Doyle 90ecbdf522
Add job version revert buttons (#10336)
This adds a Revert two-step button to the JobVersions component for
not-current versions, which redirects to the overview on success. It
checks the job version before and after reversion to mitigate the edge
case where reverting to an otherwise-identical version has no effect, as
discussed in #10337.

It uses existing facilities for handling other errors and disabling the
button when permissions are lacking.
2021-04-20 08:33:16 -05:00
Michael Lange 05f4c5d0bd Stop downloading files in tests 2021-04-13 16:40:17 -07:00
Michael Lange 75ca53c7ea Cleanup: Use this.attr in test templates 2021-04-13 16:40:17 -07:00
Buck Doyle 713b0c4140
Add removal of OTT query parameter with delay (#10319)
This followup to #10066 adds a step to clear the one-time token
from the URL after the application has loaded. The delay is
required for it to actually clear, but only when the OTT is present
to avoid slowing down the entire test suite.
2021-04-13 11:56:59 -05:00
Buck Doyle 6d67e90763
Add exchange of one-time token on UI load (#10066)
This adds UI support for receiving the one-time token passed via query parameter, as in #10134
and related PRs, and exchanging it for its corresponding secret ID. When this works, it’s mostly
invisible, with a brief flash of the OTT onscreen.

The authentication failure message now suggests the -authenticate flag.

When OTT exchange fails, it shows a whole-page error.

This includes a known UX shortcoming in that the OTT will not disappear from the URL when an
identifier is specified on the command line, like nomad ui -authenticate jobname. The goal is to
address that shortcoming in a forthcoming pull request.
2021-04-01 13:21:30 -05:00
Michael Lange b6af7a31e2 Aggregate the BANs in the cluster details panel 2021-03-31 09:29:14 -07:00
Michael Lange a0e59f81ab Use common helpers and utils for formatting hertz 2021-03-31 09:29:14 -07:00
Michael Lange bf6fb48ca6 Format all bytes using helpers, even the ones that are already MiBs 2021-03-31 09:29:02 -07:00
Michael Lange 2a614b18a2 Add startingUnit option to the unit formatting utils 2021-03-31 09:29:02 -07:00
Michael Lange dc41e731ce format-scheduled-bytes helper 2021-03-31 09:29:02 -07:00
Michael Lange 285c9a9b50 Refactor formatBytes helper to use core units util 2021-03-31 09:29:01 -07:00
Michael Lange f6a377cd12 Units utils
Consolidates all the bytes and hertz units logic in one place.
2021-03-31 09:29:01 -07:00
Buck Doyle 07831ab455
Update to v4 of Ember Power Select (#10226)
This closes #10146.

Because of cibernox/ember-power-select#1203, which documents
the current impossibility of attaching test selectors to a
PowerSelect invocation, this uses test selectors on parent
containers instead, occasionally adding wrappers when needed.
I chose to leave the existing test selectors in the hopes that
we can return to using them eventually, but I could easily
remove them if it seems like extra noise now.

Presumably for the same reason, @class no longer works, so
this adjusts the scoping of global search CSS to preserve the style
of the search control.

I also included an update to the latest version of
ember-test-selectors, since we were far behind and I tried
that before finding the aforelinked issue.

Finally, this replaces ember-cli-uglify with ember-cli-terser to address
production build failures as described at ember-cli/ember-cli#9290.
2021-03-26 08:55:12 -05:00
Michael Lange f1f124340b Remove errant log line 2021-03-24 15:34:46 -07:00
Michael Lange 4f51a55293 Correctly sort tasks in alloc stat tracker so the main task takes precedence 2021-03-24 15:10:46 -07:00
Michael Lange c9590ac715 Guard against empty data when determining active linechart data 2021-03-24 15:09:47 -07:00
Michael Lange 7b60146045 Fix line-wrapping issue with chart tooltips 2021-03-24 14:13:30 -07:00
Michael Lange d787dda298 Use more explicit branching of reserved amounts based on metric type 2021-03-24 13:55:18 -07:00
Michael Lange ab9c824c42 Remove old primary metric 2021-03-24 13:52:52 -07:00
Michael Lange 38e7804afc Update topology info box primary metric 2021-03-24 13:52:52 -07:00
Michael Lange 7ea7a1699d Updated old tests 2021-03-24 13:52:52 -07:00
Michael Lange d77c362c09 Tests for PrimaryMetric::Task 2021-03-24 13:52:52 -07:00
Michael Lange ae22c09398 Tests for PrimaryMetric::Allocation 2021-03-24 13:52:52 -07:00
Michael Lange ac4f173389 Tests for PrimaryMetric::Node 2021-03-24 13:52:52 -07:00
Michael Lange 464b51ac03 Remove now unused chartClass arg from LineChart 2021-03-24 13:52:52 -07:00
Michael Lange 747219feb7 Improved language around what the client stat charts represent 2021-03-24 13:52:52 -07:00
Michael Lange 3f46f77f92 New PrimaryMetric::Task component 2021-03-24 13:52:51 -07:00
Michael Lange 0b4a1e510f Apply the new multi-line primary metric to the alloc index page 2021-03-24 13:52:51 -07:00
Michael Lange 0016290871 Memoize the tracker and the series properties to avoid repeat computation
In addition to this computation being wasteful, it introduces a bug
where the allocation on a stats tracker can update twice in one render,
which isn't allowed in Glimmer (ironically, Glimmmer's lack of
auto-memoization introduced the issue).
2021-03-24 13:52:51 -07:00
Michael Lange 6a8d3340b0 Refactored multi-series allocation variant of the primary metric component 2021-03-24 13:52:51 -07:00
Michael Lange 3707e59f37 Refactor stats-time-series to allow for multiple series 2021-03-24 13:52:51 -07:00
Michael Lange c066fdd80f Sort and index multi-series data correctly in line chart
- Sorting must be done on copies to preserve orders.
 - Indices should be reversed since rendering is also reversed (the back
   layer (the tallest) is rendered first to create the stacking effect).
2021-03-24 13:52:51 -07:00
Michael Lange 3c51105a85 Stacked percentages of tasks for alloc charts
This leverages the existing pre-processing being done in the
allocation-stats-tracker to also create additive percentages relative to
the allocation resources vs. the task resources.

This can then be used in a chart to create a stacked area representation
of consumption.
2021-03-24 13:52:51 -07:00
Michael Lange 014e7ef333 Simple bind helper
This binds a function to a target before passing it along to another
component. It's normal to expect to get to use `this` within functions
on components and controllers, but (sans actions) that doesn't happen
automatically.
2021-03-24 13:52:51 -07:00
Michael Lange c01f3c60fc Refactor PrimaryMetric into parts/purposes
Currently, PrimaryMetric is already overloaded on multiple dimensions:
metric and resource type.

This refactor will use multiple components as a form of control flow
instead spidering conditionals, which are only getting worse as the
charts for each resource type diverge.
2021-03-24 13:52:51 -07:00
Michael Lange 1e01228c66 Compute and render reserved annotations for client stats 2021-03-24 13:52:30 -07:00
Michael Lange 45ce4368c5 Pass the LineChart named blocks through to callers of StatsTimeSeries 2021-03-24 13:52:30 -07:00
Drew Bailey befcd11579
add on update to services table in allocation details (#10153)
* add on update to services table in allocation details

* populate onupdate test data
2021-03-11 12:28:38 -05:00
Michael Lange 744f86eb65 Move complex annotation hbs logic into JS
As @backspace pointed out, we're processing a bunch of other stuff
anyway, so might as well process the active state there too where it's
more likely to be expected.
2021-03-09 17:19:52 -08:00
Michael Lange e58f67c417 Update LineChart stories to use new tooltip pattern
Some charts intentionally don't yield a tooltip to show the possibility.
2021-03-08 21:02:40 -08:00
Michael Lange f1633e2be0 No longer include an automatic tooltip in LineChart
It is now required to use the one yielded by the :after named block.
2021-03-08 21:02:01 -08:00
Michael Lange 15b68cc00c Integration test coverage for horizontal annotations and tooltips 2021-03-08 20:22:01 -08:00
Michael Lange afc626b9cb Pre format x and y values for the yielded tooltip component in line chart 2021-03-08 15:41:18 -08:00
Michael Lange 165ebc43cb Document all the tooltip variations
Under a new Charts/Primitives section in Storybook
2021-03-08 15:41:18 -08:00
Michael Lange d48dd688fb Bring the ordinal color sequence from chart-colors to the new color-scales construct
This also required re-ordering the SCSS imports since this depends on
colors introduced by bulma.
2021-03-08 15:41:04 -08:00
Michael Lange 6a1b35e03a Unify the distribution bar tooltip and the line chart tooltip styles/patterns 2021-03-08 15:41:04 -08:00
Michael Lange 94655d1ff6 New storybook CSS helpers (hover region, multiples variations) 2021-03-08 15:41:04 -08:00
Michael Lange 498d9d2b36 Factor the tooltip out of line-chart and into a primitive 2021-03-08 15:41:04 -08:00
Michael Lange 391aef9c4d Use chart scales to generate tooltip swatch options 2021-03-08 15:41:03 -08:00
Michael Lange c753e6a878 New Multi Line LineChart story 2021-03-08 15:41:03 -08:00
Michael Lange 4a4e7f0af2 Don't deal with color classes at all in LineChart
Expect this to be set on the visual yielded components directly
2021-03-08 15:41:03 -08:00
Michael Lange 1905d8ad71 Support multi-dimensional data in LineChart
When a @dataProp is provided, the LineChart component assumes data is an
array of data series. It will map by the data prop and flatten to
compute the domains of the data.
2021-03-08 15:41:03 -08:00
Michael Lange c8778248ab Add chart color scales in scss 2021-03-08 15:41:03 -08:00
Michael Lange a7ae8e468b Document HAnnotations + LineChart with a story 2021-03-08 15:41:03 -08:00
Michael Lange ed7447af81 Yield HAnnotations through LineChart 2021-03-08 15:41:03 -08:00
Michael Lange 1c29f4688d New HAnnotations chart primitive 2021-03-08 15:41:03 -08:00
Tim Gross 2a2e36690a docs: swap master for main in Nomad repo 2021-03-08 14:26:31 -05:00
Buck Doyle 523d868f4c
Fix rendering of DAS interstitial components (#10094)
With the Ember update, when the will-destroy action is called
to check the element height, its height is already zero. That
seems strange but I didn’t look into it any further, as
using did-insert to store the element lets us check its height
before any other actions when a processing button is pressed.
2021-03-01 09:46:22 -06:00
Michael Lange 9095b7b81e Prevent -1 dimension errors in LineChart 2021-02-24 19:28:14 -08:00
Michael Lange 7e4ecd5955 Update LineChart stories to use contextual component interface 2021-02-24 18:58:01 -08:00
Michael Lange f1041fb6e1 Include the named-blocks polyfill compiler in the storybook babel options 2021-02-24 18:58:01 -08:00
Michael Lange 9c73d03332 Use named-blocks and contextual components to reduce the responsibility of LineChart
Now chart primitives are partially applied by LineChart but the
invocations are left to the caller.
2021-02-24 18:58:01 -08:00
Michael Lange a270fd1eba Bring in the ember-named-blocks polyfill
Since some chart elements need to be rendered in the svg and others need
to be outside, we need some form of conditional yielding. This is the
cleanest implementation of this pattern and it will also ship with ember
in 3.25.
2021-02-24 18:58:00 -08:00
Michael Lange b2ea3d495a Bring back the active annotation logic to the v-annotations primitive 2021-02-24 18:58:00 -08:00
Michael Lange 417416ca7d Move curve logic into the area primitive 2021-02-24 18:58:00 -08:00
Michael Lange 6c9f534bec Update the custom xFormat to be a getter, as is expected by LineChart now 2021-02-23 10:34:51 -08:00
Michael Lange 9277ecd2b7 Convert ScaleEventsChart into a glimmer component 2021-02-23 10:18:58 -08:00
Michael Lange 2fff2ac3e4 Refactor StatsTimeSeries component to be a glimmer component and use composition instead of inheritance 2021-02-23 10:18:58 -08:00
Michael Lange 7887bae0fe Refactor line chart scales and refactor tests 2021-02-23 10:18:58 -08:00
Michael Lange b6d31aeee3 Defensive arguments for glimmer-factory 2021-02-23 10:18:58 -08:00
Michael Lange 51092a886c Convert LineChart into a glimmer component 2021-02-23 10:18:58 -08:00
Michael Lange 9a430651c4 Move new glimmer style string to its own home 2021-02-23 10:18:58 -08:00
Michael Lange af0f2ae092 Pull the VAnnotations primitive out of the LineChart component 2021-02-23 10:18:57 -08:00
Michael Lange 21742466e5 ArrayProxy evidently isn't iterable 2021-02-23 10:18:57 -08:00
Michael Lange 7512fcbf0a Pull the Area chart primitive out of the LineChart component 2021-02-23 10:18:57 -08:00
Michael Lange ce8b9c42f2 New computed property: uniquely
Wraps up a common pattern used in charts for building a a string that
incorporates the ember guid
2021-02-23 10:18:57 -08:00
Buck Doyle e9e52e0dfe
Update Ember/Ember CLI to 3.20 (#9641)
This doesn’t include Ember Data, as we are still back on 3.12.

Most changes are deprecation updates, linting fixes, and dependencies. It can
be read commit-by-commit, though many of them are mechanical and skimmable.
For the new linting exclusions, I’ve added them to the Tech Debt list.

The decrease in test count is because linting is no longer included in ember test.

There’s a new deprecation warning in the logs that can be fixed by updating Ember
Power Select but when I tried that it caused it to render incorrectly, so I decided to
ignore it for now and address it separately.
2021-02-17 15:01:44 -06:00
Buck Doyle fc09fdaf10
Fix recommendation test to ensure CPU exists (#10004)
This fixes a flaky test, as seen in this failure:
https://app.circleci.com/pipelines/github/hashicorp/nomad/14726/workflows/f4ae0bf2-0699-4d18-b55e-5221aafe393c/jobs/137128

One part of the test involves toggling off all memory recommendations
and then accepting, but it’s not possible to accept when there are
no CPU recommendations to begin with, which can happen because
there’s a 10% chance of not creating a corresponding recommendation
in the task factory. Since two tasks are created for this module, it’s
only a 1% chance of no CPU task, but that means 1% flakiness!
2021-02-16 08:43:18 -06:00
Buck Doyle 4adf59785d
Fix deployment failure error handling (#10003)
This is a supplement to #9831 to incorporate the extracted
missing-permissions error handling from #9909.

It fixes this failure on the main branch! 😳
https://app.circleci.com/pipelines/github/hashicorp/nomad/14728/workflows/4c147dca-fd1e-4de7-86aa-90ded7aabad2/jobs/137137
2021-02-10 10:23:19 -06:00
Buck Doyle f462d7d1c2
Add button to fail running deployments (#9831)
This closes #8744 and #9826.

It necessitated some customisation options for TwoStepButton. One is inlineText, which puts the confirmation text in the same line as the buttons. Also, there was a single-use configuration option named isInfoAction that I removed in favour of passing a set of class configuration options like this:

                @classes={{hash
                  idleButton="is-warning"
                  confirmationMessage="inherit-color"
                  cancelButton="is-danger is-important"
                  confirmButton="is-warning"}}
2021-02-10 08:38:37 -06:00
Buck Doyle e3392b7da8
Fix exec escaping for emoji task name (#7813)
This closes #7459.

While emoji don’t actually need escaping, expanding the
expression that enumerates all task name characters that
don’t need escaping to include emoji is prohibitive, since
it’s a discontinuous range. The emoji-regex project has
such an expression and it’s 12kB.

This fixes the regular expression to property escape emoji
as a single character instead of as its component bytes.
Thanks to @DingoEatingFuzz for the suggestion.
2021-02-09 09:33:48 -06:00
Buck Doyle 099162a55c
Change exec URLs to use job’s namespace/region (#9968)
This closes #9966. It was looking at the query parameters
for the namespace and region, but allocation (and task!)
routes don’t have a namespace query parameter. Since the URL
generator requires the job for all calls, it makes sense to
extract the namespace and region from the job instead.
2021-02-04 13:14:15 -06:00
Buck Doyle 369d030467
Remove support for IE11 (#9578)
This changes the Babel compilation targets to exclude IE 11,
which results in significant payload size savings.
2021-02-02 13:14:51 -06:00
Michael Lange 455132e990
Merge pull request #9913 from hashicorp/b-ui/cross-region-server-monitor
UI: Cross region server monitor
2021-02-02 11:11:59 -08:00
Buck Doyle e77c685d0d
Update ember-a11y-testing (#9912)
This includes seemingly-unrelated changes because of dependency updates.
2021-02-02 12:45:40 -06:00
Buck Doyle 8d1f823c34
Change down to highest-priority composite status (#9927)
As pointed out by Nick Ethier, if a node was ineligible before
it went down, downness should be displayed, not ineligibility.
2021-02-01 12:00:34 -06:00
Michael Lange f487562955 Don't include the region param in authorizedRequest if it's already in the URL 2021-02-01 09:54:46 -08:00
Michael Lange d44e0772f7 Always include the region param in server monitor requests
The region will naturally be appended to URLs via
token.authorizedRequest but agent members includes all servers across
all regions so relying on the application-level region isn't good
enough.
2021-02-01 09:54:46 -08:00
Michael Lange 0fb853d135 Add an acceptance test exercising errors from an HTTP response to a notification 2021-01-28 13:47:22 -08:00
Michael Lange d4e32d4128 Test coverage for the messageFromAdapterError util 2021-01-28 12:18:53 -08:00
Michael Lange 52a7a48177 Don't use generic ACL error messages
When the error is actually a 403, an ACL error is appropriate, but when
it isn't, fallback on what the API returns.
2021-01-28 12:18:53 -08:00
Michael Lange 320a63dc68 Improve the message-from-adapter-error util
Automatically detect ACL errors
Provide a generic error message as a fallback
2021-01-28 12:18:52 -08:00
Buck Doyle 975ea6d5d1 Merge branch 'master' into b-ui/topo-viz-accounting 2021-01-28 09:56:46 -06:00
Michael Lange 7a9a208c89 Adjust the no-association-lines logic
On very small clusters, the node count heuristic is impractical and
leads to confusion. By additionally requiring 10+ sibling allocs, the
lines will be shown more often.
2021-01-27 10:24:03 -08:00
Michael Lange 82d06f658b Don't render association lines on resize when lines aren't supposed to be shown at all 2021-01-27 10:20:10 -08:00
Michael Lange 6ba229e86c Use Hz instead of hz throughout the UI 2021-01-26 10:53:26 -08:00
Michael Lange 074f6af98d Use dominant-baseline instead of alignment-baseline to get firefox support 2021-01-26 08:56:52 -08:00
Michael Lange 9395f16da6 Test coverage for the topology info panel.
This fixes a couple bugs

1. Overreporting resources reserved due to counting terminal allocs
2. Overreporting unique client placements due to uniquing on object refs
   instead of on client ID.
2021-01-25 19:01:11 -08:00
Michael Lange 7d998745ed Clamp widths at zero to prevent negative width warnings
This would only ever realistically happen with fixture data, but still
good to not have these warnings.
2021-01-25 18:59:55 -08:00
Michael Lange 93195f8e12 Only count the scheduled allocs on the topo viz node stats bar 2021-01-25 11:29:01 -08:00
Michael Lange 886b1b4384 Clip long namespace names but make sure to keep the full name in the title attribute 2021-01-22 13:18:15 -08:00
Michael Lange 875de74503 Use the same prefix pattern from the region switcher for the namespace switcher 2021-01-22 13:18:15 -08:00
Michael Lange 1fabd3240c
Merge pull request #9614 from hashicorp/dependabot/npm_and_yarn/ui/ini-1.3.7
build(deps): bump ini from 1.3.5 to 1.3.7 in /ui
2021-01-07 14:10:03 -08:00
Michael Lange 6d985f05bb When the topo viz filters out nodes, report this to the user via warning alert 2021-01-05 17:11:17 -08:00
Michael Lange 9b488adbf2 Filter out nodes that don't have NodeResources from the topo viz 2021-01-05 17:11:17 -08:00
Michael Lange e221eefdd2 Quietly ignore orphaned allocs in the topo viz 2020-12-17 11:18:43 -08:00
dependabot[bot] 2a8f88b883
build(deps): bump ini from 1.3.5 to 1.3.7 in /ui
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-10 17:52:23 +00:00
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
Michael Lange 58ecacc710 Guard against a null Meta property in the scale event API 2020-12-07 12:28:23 -08:00
Buck Doyle 543fb24764
Fix allocation count in CSI volumes table (#9515)
This closes #9495. As detailed in there, the collection query GET
/v1/volumes?type=csi doesn’t return ReadAllocs and WriteAllocs, so the #
Allocs cell was always showing 0 upon first load because it was derived
from the lengths of those arrays. This uses the heretofore-ignored
CurrentReaders and CurrentWriters values to calculate the total instead.

The single-resource query GET /v1/volume/csi%2F:id doesn’t return
CurrentReaders and CurrentWriters that absence doesn’t override the
stored values when visiting an individual item.

Thanks to @apollo13 for reporting this and to @tgross for the API logs
and suggestion.
2020-12-07 08:51:41 -06:00
Buck Doyle 2d344179d3
Migrate preview deployments from Netlify to Vercel (#9471)
This adds:

* a script for building and deploying the Ember UI and Storybook to
  Vercel
* configuration for that deployment
* a header link to the UI to link to Storybook when built with
  STORYBOOK_LINK=true

It also removes a file used to configure Netlify redirects.

The Netlify setup had two “sites”: nomad-storybook and nomad-ui. I
attempted to replicate that here but ran into some platform limitations
with Vercel: two “projects” cannot share the same root directory without
also sharing the same vercel.json that lets us specify configuration
such as the rewrite needed to handle deep linking into the Ember UI. I
tried having Storybook use /ui/storybook as the root directory (and
adding a symbolically-linked package.json to bypass Vercel’s refusal
to build without it) but that produced broken Storybook deployments.

This instead combines the two projects into one
(nomad-storybook-and-ui), defaults to forwarding / to /ui/, and
adds the header link to the UI to navigate to Storybook.

Rather than have a complex build script in the Vercel configuration UI,
this delegates to a script in the repository.
2020-12-07 08:33:49 -06: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
Buck Doyle ba147a4fca
Add query parameter to override Mirage scenario (#9380) 2020-11-30 08:12:15 -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
Tim Gross 8df5f28dc3
ui/csi: fix links to volume IDs (#9355) 2020-11-13 15:44:34 -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 508adbf0ac Remove unused action
This is a remnant of another approach I tried when rerouting
/optimize when the filter excluded all summaries.
2020-11-10 10:07:48 -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 75861b8b4f Remove copypasted to-be-unused query parameters 2020-11-09 09:04:14 -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
Michael Lange 36ac4ba840
Merge pull request #9271 from hashicorp/b-ui/missing-warning-in-stories
UI: Update lingering instances of the old warning icon in stories
2020-11-05 13:56:07 -08:00
Michael Lange be7b0040d3 Show dismissable no live updating notice on the topology page 2020-11-04 19:25:12 -08:00
Michael Lange 7494188013 Update lingering instances of the old warning icon in stories 2020-11-04 19:24:39 -08:00
Michael Lange 148d4429cf Show a partial view notice when ACLs are enabled and the mgmt token isn't being used 2020-11-04 15:24:34 -08:00
Michael Lange 093a935a71 Update URL for namespace globbing 2020-11-04 15:23:47 -08:00
Michael Lange 4dcf454d81 Forbidden state for the topo viz 2020-11-04 12:32:22 -08: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 34392ea280
Merge pull request #9256 from hashicorp/ui/upgrade-node
Use Node v12 for UI development
2020-11-04 10:06:41 -08:00
Michael Lange 59626344be Use Node v12 for UI development 2020-11-04 09:04:22 -08:00
Michael Lange 67bbd3770f
Merge pull request #9240 from hashicorp/f-ui/topo-viz-tooltips
UI: Topo Viz Tooltips
2020-11-02 13:46:58 -08:00
Michael Lange 521df4db97 Fix the raw 'blue' in recommendation cards to use '$blue' 2020-11-02 13:29:44 -08:00
Michael Lange 5f2ebf7a00 Replace visualViewport with the more compatible scrollX and scrollY 2020-11-02 13:25:50 -08:00
Michael Lange b5044250e6 Add tooltips to the topo viz 2020-11-02 13:25:33 -08:00
Vyacheslav Morov 48ebd36fce Add type=button to View Raw Data buttons. 2020-11-01 02:47:11 +03:00
Vyacheslav Morov c6fc37cf29 Change to button.
Rewrite tests to check that proper urls was called.
2020-10-31 23:11:14 +03:00
Michael Lange 654533229c Make the style-string property glimmer safe 2020-10-30 16:14:31 -07:00
Michael Lange d9cac96e5a Add new is-static chart tooltip variant and decouple from charts 2020-10-30 16:14:31 -07: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 39af5c709b
Fix Firefox positioning of chart resource label (#9209)
alignment-baseline appears to be ignored in Firefox, but dominant-baseline
works. This also moves the anchor into CSS.
2020-10-29 08:13:41 -05: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 a7293a2bfe Remove no longer used warning icon svg 2020-10-26 15:07:12 -07:00
Michael Lange d407809ea5 Replace all instances of the warning icon with the Structure alert-triangle icon 2020-10-26 15:07:12 -07:00
Michael Lange cb1d22519c List all available icons in a story.
This is like the same as using svg-jar, right?
2020-10-26 12:26:42 -07:00
Michael Lange 8fe5c55594 New all-icons helper that's really only meant for development use
This returns an array of all icons. As the comment suggests, it's
because the SVGs file can't be imported in stories since it is generated
as part of the Ember project.
2020-10-26 12:25:34 -07:00
Michael Lange 35ceca7f62
Merge pull request #9166 from mobiltracker/master
Display class in client details
2020-10-26 10:54:14 -07: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
fqborges 498fe414a3 Display class in client details 2020-10-26 11:29:19 -03: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 e0157759a8 Redo column widths on the topology page.
Now the info panel has a fixed width and the TopoViz will display as a
single column if the TopoViz column is too narrow for two columns.
2020-10-23 14:17:03 -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 38a4a027aa Truncate text in the topo viz info panel 2020-10-23 14:17:03 -07:00