Commit Graph

138 Commits

Author SHA1 Message Date
Michael Lange
92391683da 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
Michael Lange
a019587de5 Use common helpers and utils for formatting hertz 2021-03-31 09:29:14 -07:00
Michael Lange
f82fe6b875 Format all bytes using helpers, even the ones that are already MiBs 2021-03-31 09:29:02 -07:00
Michael Lange
d327b73571 Add startingUnit option to the unit formatting utils 2021-03-31 09:29:02 -07:00
Michael Lange
3771d2dd5a Units utils
Consolidates all the bytes and hertz units logic in one place.
2021-03-31 09:29:01 -07:00
Buck Doyle
3d9464023d 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
d9426df7af Correctly sort tasks in alloc stat tracker so the main task takes precedence 2021-03-24 15:10:46 -07:00
Michael Lange
91521d6256 Updated old tests 2021-03-24 13:52:52 -07:00
Michael Lange
9e6315e655 Convert ScaleEventsChart into a glimmer component 2021-02-23 10:18:58 -08:00
Michael Lange
09a0e4d4a8 Refactor StatsTimeSeries component to be a glimmer component and use composition instead of inheritance 2021-02-23 10:18:58 -08:00
Michael Lange
12fb78c3ab Refactor line chart scales and refactor tests 2021-02-23 10:18:58 -08:00
Buck Doyle
e47ce42548 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
d98265d954 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
24b9a899d8 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
84b8a1930a 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
Michael Lange
7fd0a7c317 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
2103e55daf Update ember-a11y-testing (#9912)
This includes seemingly-unrelated changes because of dependency updates.
2021-02-02 12:45:40 -06:00
Michael Lange
2c13731d95 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
5dfa556983 Test coverage for the messageFromAdapterError util 2021-01-28 12:18:53 -08:00
Michael Lange
b96ca93873 Quietly ignore orphaned allocs in the topo viz 2020-12-17 11:18:43 -08:00
Michael Lange
2af9430db5 Test coverage for the scale event serializer 2020-12-07 12:28:47 -08:00
Tim Gross
8351c3f9d6 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
Buck Doyle
7b9f8b5cb1 Fix job detail crash when recommendations off (#9269)
Without this, visiting any job detail page on Nomad OSS would crash with
an error like this:

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

The problem was twofold.

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

2. Second, I didn’t check permissions at all in the job-fetching or job
detail templates.
2020-11-06 08:21:38 -06:00
Buck Doyle
828487352b 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
13415df25c Unit and integration tests for TopoViz component 2020-10-15 02:54:16 -07:00
Michael Lange
334f72c633 Unit test for for GiB in format-bytes 2020-10-15 02:54:16 -07:00
Buck Doyle
9b5c428a62 Add handling for allocation-less exec URL (#8856)
This closes #8769. This new-window-opening code is not possible
to properly exercise within Ember’s testing facilities 😞
2020-09-15 14:48:29 -05:00
Michael Lange
3147d5c649 Sort keys when converting objects to arrays for stable model fragments 2020-09-04 19:44:21 -07:00
Buck Doyle
6f08becdae Add common serialiser abstractions (#8634)
This extracts some common API-idiosyncracy-handling patterns from model serialisers into properties that are processed by the application serialiser:

* arrayNullOverrides converts a null property value to an empty array
* mapToArray converts a map to an array of maps, using the original map keys as Name properties on the array maps
* separateNanos splits nanosecond-containing timestamps into millisecond timestamps and separate nanosecond properties
2020-08-20 12:14:49 -05:00
Michael Lange
f9cb2ff214 Unit test coverage for the ScaleEventsChart data domain logic 2020-08-05 12:02:22 -07:00
Michael Lange
9882614aa5 Test coverage for the deployment adapter action 2020-07-21 09:02:39 -07:00
Michael Lange
4afedbd06a Add region coverage to node adapter action tests 2020-07-21 09:02:39 -07:00
Michael Lange
4e152a75f5 Test all allocation adapter actions with and without a region
This involves a refactor to prevent immense verbosity.
2020-07-21 09:00:21 -07:00
Michael Lange
08bd435052 Test region query param for job adapter actions 2020-07-21 09:00:20 -07:00
Michael Lange
6bfebe2321 Refactor job adapter test to simplify setting up region and namespace state 2020-07-21 09:00:20 -07:00
Buck Doyle
39d3174207 Add specificity to exec allocation URL generation (#8463)
Thanks to @notnoop for this UX improvement suggestion.
The allocation’s task group is always known, so it
might as well be preselected in the sidebar when the
exec window opens. Also, if the task group only has
one task, might as well preselect it too.
2020-07-20 16:07:39 -05:00
Buck Doyle
fe445a0b27 Improve global search UX (#8249)
This updates the look of the search control, adds a hint about the slash
shortcut, adds highlighting of fuzzy search results, and addresses a few
edge case UX failures. It moves to using a fork of Ember Power Select
to handle an edge case where pressing escape would put the control
in an undesirable active-but-not-open state.
2020-06-25 08:51:52 -05:00
Michael Lange
7fec4d8bc5 Add canScale ability for jobs 2020-06-18 22:08:28 -07:00
Buck Doyle
11d80ae489 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
e49d4e5a81 Adjust header case, which changed with the migration to fetch 2020-05-21 10:35:40 -07:00
Michael Lange
505510915b Replace XHRToken with AbortController 2020-05-21 10:35:39 -07:00
Michael Lange
0a258b1a9f Test coverage for the gauge chart 2020-05-13 08:36:05 -07:00
Buck Doyle
8c3a210839 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
Michael Lange
59636adace Add embedded task group to allocation to reference when allocation is historical 2020-05-01 14:30:02 -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
Michael Lange
f6ed101740 Fix flaky serializer test 2020-04-01 14:54:05 -07:00
Michael Lange
c30a153d1f Use new text encoder for stream frames
This pattern was introduced with Exec and fixes the multibyte encoding
issue that the native window.atob has.
2020-03-30 12:50:43 -07:00
Michael Lange
5f2de59773 Guard against a null value for the HostVolumes hash
When a node has no host volumes, the API response will
have a null value for the HostVolumes attribute, which
in turn becomes a null value instead of an empty array
in the store. This protects against that, ensuring host
volumes is always an array.
2020-03-26 09:54:59 -07:00
Michael Lange
508404ccba UI: Support for CSI (#7446)
Closes #7197 #7199

Note: Test coverage is limited to adapter and serializer unit tests. All
acceptance tests have been stubbed and all features have been manually
tested end-to-end.

This represents Phase 1 of #6993 which is the core workflow of CSI in
the UI. It includes a couple new pages for viewing all external volumes
as well as the allocations associated with each. It also updates
existing volume related views on job and allocation pages to handle both
Host Volumes and CSI Volumes.
2020-03-25 07:51:26 -05:00
Buck Doyle
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