Commit Graph

2291 Commits

Author SHA1 Message Date
Luiz Aoqui
99e54da9a9 ui: fix websocket connections on dev proxy (#18791)
* ui: fix websocket connections on dev proxy

`ember-cli` includes a handler for websocket upgrade requests to start
proxying requests. Handling the same upgrade event by also proxying in
`api.js` causes some kind of conflict where the connection is closed
unexpectedly.

The only change necessary on upgrade is to overwrite the Origin header
so Nomad accepts the connection.

* ui: remove unused variables
2023-10-18 09:50:10 -04:00
Phil Renaud
533f293fa8 Wrap the passed path prop as a handlebars tag (#18598) 2023-10-05 12:47:18 -04:00
Phil Renaud
8da40465af fallback to get definition if submission 404s when restarting job in ui (#18621) 2023-09-29 14:52:21 -04:00
Phil Renaud
badaecea66 Access Control CRUD: Make name fields for Policies and Roles required (#18605) 2023-09-29 12:33:03 -04:00
Phil Renaud
859087640a [ui] Simplify times in task events (#18595)
* Regexy time simplification in task events

* Oops, dont assume these are all task restart messages

* Update mirage to provide displayMessage instead of message

* Have a few acceptance tests look for .displayMessage instead of .message for equality now
2023-09-27 17:01:34 -04:00
Phil Renaud
ef7bccbd40 [ui] ACL Roles in the UI, plus Role, Policy and Token management (#17770)
* Rename pages to include roles

* Models and adapters

* [ui] Any policy checks in the UI now check for roles' policies as well as token policies (#18346)

* combinedPolicies as a concept

* Classic decorator on role adapter

* We added a new request for roles, so the test based on a specific order of requests got fickle fast

* Mirage roles cluster scaffolded

* Acceptance test for roles and policies on the login page

* Update mirage mock for nodes fetch to account for role policies / empty token.policies

* Roles-derived policies checks

* [ui] Access Control with Roles and Tokens (#18413)

* top level policies routes moved into access control

* A few more routes and name cleanup

* Delog and test fixes to account for new url prefix and document titles

* Overview page

* Tokens and Roles routes

* Tokens helios table

* Add a role

* Hacky role page and deletion

* New policy keyboard shortcut and roles breadcrumb nav

* If you leave New Role but havent made any changes, remove the newly-created record from store

* Roles index list and general role route crud

* Roles index actually links to roles now

* Helios button styles for new roles and policies

* Handle when you try to create a new role without having any policies

* Token editing generally

* Create Token functionality

* Cant delete self-token but management token editing and deleting is fine

* Upgrading helios caused codemirror to explode, shimmed

* Policies table fix

* without bang-element condition, modifier would refire over and over

* Token TTL or Time setting

* time will take you on

* Mirage hooks for create and list roles

* Ensure policy names only use allow characters in mirage mocks

* Mirage mocked roles and policies in the default cluster

* log and lintfix

* chromedriver to 2.1.2

* unused unit tests removed

* Nice profile dropdown

* With the HDS accordion, rename our internal component scss ref

* design revisions after discussion

* Tooltip on deleted-policy tokens

* Two-step button peripheral isDeleting gcode removed

* Never to null on token save

* copywrite headers added and empty routefiles removed

* acceptance test fixes for policies endpoint

* Route for updating a token

* Policies testfixes

* Ember on-click-outside modifier upgraded with general ember-modifier upgrade

* Test adjustments to account for new profile header dropdown

* Test adjustments for tokens via policy pages

* Removed an unused route

* Access Control index page tests

* a11y tests

* Tokens index acceptance tests generally

* Lintfix

* Token edit page tests

* Token editing tests

* New token expiration tests

* Roles Index tests

* Role editing policies tests

* A complete set of Access Control Roles tests

* Policies test

* Be more specific about which row to check for expiration time

* Nil check on expirationTime equality

* Management tokens shouldnt show No Roles/Policies, give them their own designation

* Route guard on selftoken, conditional columns, and afterModel at parent to prevent orphaned policies on tokens/roles from stopping a new save

* Policy unloading on delete and other todos plus autofocus conditionally re-enabled

* Invalid policies non-links now a concept for Roles index

* HDS style links to make job.variables.alert links look like links again

* Mirage finding looks weird so making model async in hash even though redundant

* Drop rsvp

* RSVP wasnt the problem, cached lookups were

* remove old todo comments

* de-log
2023-09-27 14:53:09 -04:00
Phil Renaud
cf8dde0850 [ui] Color indicators for server/client status (#18318)
* Color the status cell for servers and nodes

* Testfix and changelog

* Leader indicator moved post-word

* Icon and badge treatment

* Capitalizing test checks

* HDS badges dont expose statusClass like we used to, so stop checking for it
2023-09-20 17:05:04 -04:00
Андрей Неустроев
3e61b3a37d Add multiple times in periodic jobs (#17858) 2023-08-22 15:42:31 -04:00
Phil Renaud
30a9b6eda7 ui: Use ]] and [[ to paginate index pages (#18210)
* bracket keynav enabled

* Use the right testcluster

* Modifier made to be conditional

* Lintfix

* Custom ignore rule

* changelog
2023-08-18 09:18:15 -04:00
Phil Renaud
ba7892d0d2 Trim variable path before save (#18198) 2023-08-17 10:46:44 -04:00
Phil Renaud
d1a24309e2 [ui] Preserve HCL2 on stop/start via the web UI (#18120)
* long walk for a ham sandwich

* testfix for service job start

* hold point, breaks identified

* Testfixes for job start/stop helper
2023-08-17 09:32:42 -04:00
hashicorp-copywrite[bot]
a9d61ea3fd Update copyright file headers to BUSL-1.1 2023-08-10 17:27:29 -05:00
dependabot[bot]
511cb55633 build(deps): bump word-wrap from 1.2.3 to 1.2.4 in /ui (#17972)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-31 15:57:22 -04:00
Phil Renaud
18dd9e722f [ui] Job Variables page (#17964)
* Bones of a component that has job variable awareness

* Got vars listed woo

* Variables as its own subnav and some pathLinkedVariable perf fixes

* Automatic Access to Variables alerter

* Helper and component to conditionally render the right link

* A bit of cleanup post-template stuff

* testfix for looping right-arrow keynav bc we have a new subnav section

* A very roundabout way of ensuring that, if a job exists when saving a variable with a pathLinkedEntity of that job, its saved right through to the job itself

* hacky but an async version of pathLinkedVariable

* model-driven and async fetcher driven with cleanup

* Only run the update-job func if jobname is detected in var path

* Test cases begun

* Management token for variables to appear in tests

* Its a management token so it gets to see the clients tab under system jobs

* Pre-review cleanup

* More tests

* Number of requests test and small fix to groups-by-way-or-resource-arrays elsewhere

* Variable intro text tests

* Variable name re-use

* Simplifying our wording a bit

* parse json vs plainId

* Addressed PR feedback, including de-waterfalling
2023-07-31 15:04:36 -04:00
Phil Renaud
66649d12a7 [ui] Search results are overloading filter with sorted results (#18053)
* Attempt at a varied end-result when sorting and searching

* Consider sort direction as well

* computed property dep update

* prioritizeSearchOrder and test

* Side-effecty but resets sort on search etc

* changelog
2023-07-31 13:07:27 -04:00
Phil Renaud
937d927af7 Default-sort variable keyvalues at serialization (#18051) 2023-07-24 14:25:29 -04:00
Luiz Aoqui
2b3dd86dc5 ui: handle node pool requests to older regions (#18021)
When accessing a region running a version of Nomad without node pools an
error was thrown because the request is handled by the nodes endpoint
which fails because it assumes `pools` is the node ID.
2023-07-21 09:16:49 -04:00
Luiz Aoqui
5d3639f304 ui: handle errors from unimplemented services (#18020)
When a request is made to an RPC service that doesn't exist (for
example, a cross-region request from a newer version of Nomad to an
older version that doesn't implement the endpoint) the application
should return an empty list as well.
2023-07-21 09:16:35 -04:00
Phil Renaud
94112d8cfd Copy button added to variables title (#17935) 2023-07-20 14:16:33 -04:00
Phil Renaud
6bed12f693 Copy change to include the nomad/jobs all-access variable prefix (#17933) 2023-07-20 14:16:14 -04:00
Phil Renaud
51393ddde7 Adds N V for variable creation as a keyboard shortcut (#17932) 2023-07-20 12:38:35 -04:00
Phil Renaud
287ad19f0f [ui] When a purged/404-ing job is detected, boot the user out of that job and back to the index (#17915)
* Boot the user off the job if it gets deleted

* de-yoink

* watching the job watcher

* Unload record so history.back has to refire a (failing) request

* Acceptance tests for boot-out and notification
2023-07-20 12:36:43 -04:00
Luiz Aoqui
969ea54628 ui: fix Topology node state filter (#17940)
"Ineligible" and "Draining" are not determined by the node status, but
are rather inferred from other fields.
2023-07-19 16:38:20 -04:00
Phil Renaud
437941816c Tells the token to be 2 seconds faster in a 5.5 second test (#17924) 2023-07-12 16:59:22 -04:00
Phil Renaud
17f63cfd9a Report shows a 3rd party browser extension puts a banner at the top of page and awkwardly shifts nav; this fixes that (#17783) 2023-06-30 17:09:42 -04:00
Phil Renaud
6124c1a6fd [ui] Text wrap long lines of code and logs (#17754)
* Text and code wrapping as a localStorage var

* task-log uses wrapping and kb shortcut

* Word wrap keyboard labels

* Wrapper as a toggle not a button

* Changelog and fixed an extra space trailing log lines

* Moves toggle to inside

* Acceptance tests for ww and toggle click
2023-06-30 17:07:57 -04:00
Phil Renaud
fccfb1d19d [ui] HCL-in-UI: Re-arrange buttons, add save-as-file (#17752)
* Move buttons over as expected

* Let a user download file locally

* test mock fns for jobeditor

* Changelog
2023-06-28 21:57:03 -04:00
Phil Renaud
43587c5852 Link to allocations.allocation by ID reference, not by model (#17753) 2023-06-28 10:00:59 -04:00
Phil Renaud
f3df01e422 [ui] Move Placement Failures notification above job status panel (#17750)
* Moves the Placement Failures box above job status, should it exist

* Move it for non-service job-types as well
2023-06-27 19:32:51 -04:00
Phil Renaud
72a9f2b551 [ui] links to allocations explicitly go through their route model hook (#17737)
* links to allocations explicitly go through their route model hook

* Acceptance test to make sure alloc clicking loads alloc endpoint obj
2023-06-27 10:01:50 -04:00
Phil Renaud
d06dfd2abc Node Pools moved to after Type in jobs index columns (#17738) 2023-06-26 17:00:01 -04:00
Phil Renaud
d20faf5855 [ui] alignment and spacing for job status panel (#17708)
* CSS alignment and spacing for job status panel

* Only fade the count, not the legend icon, when count is 0

* Unrounded version corners

* changelog

* css has to only remove border radius when count is present

* Seed stabilization for services test

* Try consolidating the testfixes from before

* Total test isolation and bonus logs

* Drop the isolation but keep the logs

* Remove bonus logging
2023-06-26 12:18:12 -04:00
Michael Lange
ed5160514e Merge pull request #17691 from hashicorp/f/missing-chart-stories
[UI] Missing chart stories
2023-06-23 08:17:34 -07:00
Luiz Aoqui
2dec8baac1 ci: fix flaky UI test (#17676) 2023-06-22 23:07:36 -04:00
Michael Lange
2e2e396d26 TopoViz story that is sourced from Mirage
Unfortunately due to the split build nature of the ember app and
storybook it isn't possible to import mirage in the storybook context to
control scenarios via a knob :(
2023-06-22 16:55:36 -07:00
Michael Lange
e7952b6e25 Full TopoViz story 2023-06-22 16:55:25 -07:00
Michael Lange
ea713212bb TopoViz child component stories 2023-06-22 15:03:32 -07:00
Michael Lange
7e1516b436 Standard usage story 2023-06-22 13:53:21 -07:00
Michael Lange
b4a72b5641 Basic recommendation-chart story with knobs 2023-06-22 13:53:21 -07:00
Phil Renaud
908ce47c1b [ui] Versions added to deploying status panel (#17629)
* Versions added to deploying status panel

* Wrap the running and healthy title in a span

* Versions in the deployment UI next to titles

* Version count and label styles updated
2023-06-22 16:19:41 -04:00
Phil Renaud
e617962251 [ui, deployments] job status panel legend: counts of 0 don't get links (#17644) 2023-06-22 14:40:11 -04:00
Jai
4da63e3ded ui: create node pool model (#17301)
Co-authored-by: Phil Renaud <phil@riotindustries.com>
Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2023-06-22 13:11:44 -04:00
Luiz Aoqui
28206f7210 ci: fix some flaky UI tests (#17648)
These tests would fail depending on the value of the seed used.
2023-06-22 10:51:07 -04:00
Luiz Aoqui
876117fadd ui: display mirage scenario in header label (#17649)
This information is useful when switching between different scenarios
for testing.
2023-06-22 10:38:17 -04:00
Luiz Aoqui
df37f2d022 ui: add tooltips to the Topology labels (#17647)
Add tooltips to labels in nodes and datacenters for the Topology view
page to clarify what each value represents.
2023-06-22 10:33:42 -04:00
Luiz Aoqui
a29048b3e7 ui: remove redundant columns from child job table (#17645)
Namespace, job type, and priority are already available from the parent
job header, so displaying them in the table caused it to be too crowded.
2023-06-22 10:22:41 -04:00
Phil Renaud
fe49f22247 Moves to the current LTS release of Node for our build and release workflows (#17639) 2023-06-21 15:17:24 -04:00
Phil Renaud
873acf04b9 [ui] General status for steady-state jobs (#17599)
* Degraded vs Healthy etc. status

* Standardize the look of a deploying status panel

* badge styles

* remove job.status from title component in favour of in-panel status

* Remove a redundant check

* re-attrd fail-deployment button considered
2023-06-21 11:57:28 -04:00
Michael Lange
7d80d0ed37 Rip out the xUnit test reporter
This was used to integrate with Circle CI's deeper test reporting
(failures, flakes, reporting). It's strictly vestigial now that we're on
GHA.
2023-06-20 14:49:56 -07:00
Michael Lange
8a19375672 New generic exam:parallel yarn script
This is intended to be used like `yarn exam:parallel -- more --options`

This way a split and partition can be provided by CI without CI also
needing to deal with percy details.
2023-06-20 13:51:45 -07:00