Commit Graph

1728 Commits

Author SHA1 Message Date
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