Commit Graph

2319 Commits

Author SHA1 Message Date
Phil Renaud
16876697a1 [ui] Adds group-name tooltips to deploying and steady-state job panels (#19601)
* Adds group-name tooltips to deploying and steady-state job panels

* Default tooltip text for mirage edge cases
2024-01-04 13:10:37 -05:00
Phil Renaud
89cceebb91 [ui] Multi-line variable values and helios upgrades generally (#19544)
* Multi-line variable values and helios upgrades generally

* Variables page titles and actions restyle

* Hacky fix to keyboard shortcut otherwise bumping space on shift

* Related entities heliosified

* Namespace and path fields heliosed

* Paths table heliosified

* Variable view table

* Fixups after design discussion

* Monospaced editing

* De-commented template placeholder

* Acceptance tests updated for helios components across variables

* Tests helios'd in variable-form-test

* PR suggestions
2024-01-03 15:54:22 -05:00
Phil Renaud
005147f850 [ui] Mask token secret when logged in (#19529)
* Sign-in page now hides token secret by default (toggleable) and updates components to Helios

* General helios-ification

* All the notifications get dismissal buttons

* token-details grid for spacing
2023-12-20 10:04:53 -05:00
Phil Renaud
e26c2e243c [ui] node eligibilty taken into consideration when clients list filtered to "ready" (#18607)
* node eligibilty taken into consideration when clients list filtered to 'ready'

* A working draft of complex positive querying

* tags and filter badge

* CompositeStatus -> Status

* Buttons within a Helios SegmentedGroup

* Convert the other dropdowns to helios on clients index

* A bunch of client index test fixes

* Remaining clients list acceptance tests for State facet modified
2023-12-19 16:40:56 -05:00
Luiz Aoqui
dfce76e511 ui: fix AllocationRow for job without action (#19505)
The allocation table header sometimes conditionally renders the
`Actions` table column, but the allocation row would render it
unconditionally, resulting in broken tables when rendering allocations
for jobs without actions, where rows had more columns than the header.

Also fix the conditional class for the deployments allocation table to
read `length` from the right value.
2023-12-18 11:30:20 -05:00
Sanskar Gauchan
e0e8357661 Merge branch 'hashicorp:main' into ui-logs-disabled-message 2023-12-16 10:49:26 +11:00
Phil Renaud
a6e164673e Adds a copy button to Action output (#19496) 2023-12-15 15:57:31 -05:00
Phil Renaud
49b4996d46 overflow-anchor to hold view to bottom of scrollable action output (#19452) 2023-12-13 15:19:22 -05:00
Phil Renaud
b1654016c0 Fix a small regression where accessor is hidden by default when editing a token (#19432) 2023-12-11 13:00:11 -05:00
Phil Renaud
268e92eaba [ui] Small-screen styles for exec window (#19332)
* Phones can exec too

* De-magic breakpoints
2023-12-11 09:42:25 -05:00
Phil Renaud
5d2688a257 [ui] Two small UI quality of life changes (#19377)
* Jobs index without groups

* Download button only appears if you have content in your template

* No longer need to test for the group count in jobs index
2023-12-08 11:21:14 -05:00
Tim Gross
8e8309e58e UI: fix column header typo on job services page (#19370) 2023-12-08 10:58:23 -05:00
Phil Renaud
c381781b42 [ui] Helios upgraded to 3.3.0 (#19247) 2023-12-05 09:25:28 -05:00
Phil Renaud
646445d4ac [ui] example job with actions (#19153)
* An example job with a few interesting actions

* A pretty different example job

* Tests updated with const'd number of default templates

* Removed default jobspec params and formatted
2023-12-04 13:40:00 -05:00
Phil Renaud
a35acdb84e Title bar job start button now observes job submission variables data (#19220) 2023-12-01 10:57:30 -05:00
Phil Renaud
d104432cd3 Actions: API, command, and jobspec docs (#19166)
* API command and jobspec docs

* PR comments addressed

* API docs for job/jobid/action socket

* Removing a perhaps incorrect origin of job_id across the jobs api doc

* PR comments addressed
2023-11-30 14:13:37 -05:00
Phil Renaud
7ab7edf9cd [ui] Display job plan warnings alongside dry run info when attempting to run a job through the web UI (#19225)
* init

* Warnings shown at plan stage

* testfixes for new hds class

* New tests for warning block presence
2023-11-30 10:41:23 -05:00
Phil Renaud
fb14c2b556 [ui] Actions service and flyout (#19084)
* Initial pass at a global actions instance queue

* Action card with a bunch of functionality that needs to be pared back a bit

* Happy little actions button

* runAction performs updated to use actions service

* Stop All and Clear Finished buttons

* Keyboard service now passes element, so we can pseudo-click the actions dropdown

* resizable sidebar code blocks

* Contextual actions within task and job levels

* runAction greatly consolidated

* Pluralize action text

* Peer grouping of flyout action intances

* ShortIDs instead of full alloc IDs

* Testfixes that previously depended on notifications

* Stop and stop all for peered action instances

* Job name in action instance card linkable

* Componentized actions global button

* scss consolidation

* Clear and Stop buttons become mutually exclusive in an action card

* Clean up action card title styles a bit

* todo-bashing

* stopAll and stopPeers separated and fixed up

* Socket handling functions moved to the Actions service

* Error handling on socket message

* Smarter import

* Documentation note: need alloc-exec and alloc-raw-exec for raw_exec jobs

* Tests for flyout and dropdown actions

* Docs link when in empty flyout/queue state and percy snapshot test for it
2023-11-26 23:46:44 -05:00
Phil Renaud
e03e674135 [ui] UI actions implementation on task index (#19036)
* Sidequest: always show actions column on client view

* Task sidebar and task index actions menus

* Fixing test-fixture selector to no longer use old title class

* Remove actions dropdown from fly-out

* PR feedback addressed
2023-11-22 01:18:11 -05:00
Phil Renaud
2e254112f5 addToPath to prevent multiple param string starting chars (#19139) 2023-11-21 09:23:51 -05:00
Phil Renaud
bb6c86d2a4 Shows the client/node name alongside alloc short ID if the job is sys/sysbatch (#19051) 2023-11-15 10:05:12 -05:00
Phil Renaud
62007e3b18 [ui] Small fix to let UI actions passing use job.name instead of job.id, since namespace is passed as an explicit param afterward (#19061) 2023-11-10 10:55:00 -05:00
Phil Renaud
f322bb7efb Nicer comment styles in example jobs (#19037) 2023-11-08 20:13:34 -05:00
Phil Renaud
783572de7d [ui] Actions implementation in the web UI (#18793)
* runAction model and adapter funcs

* Hacky but functional action running from job index

* remove proxy hack

* runAction added to taskSubRow

* Added tty and ws_handshake to job action endpoint call

* delog

* Bunch of streaming work

* action started, running, and finished notification titles, neutral color, and ansi escape

* Handle random alloc selection in the web ui

* Run on All implementation in web ui

* [ui] Helios two-step button and uniform title bar for Actions (#18912)

* Initial pass at title bar button uniformity

* Vertical align on actions dropdown toggle and small edits to prevent keynav overflow issue

* We represent loading state w text and disable now

* Pageheader component to align buttons

* Buttons standardized

* Actions dropdown reveal for multi-alloc job

* Notification code styles

* An action-having single alloc job

* Mirageed

* Actions-laden jobs in mirage

* Separating allocCount and taskCount in mirage mocks

* Unbreak stop job tests

* Permissions for actions dropdown

* tests for running actions from the job index page

* running from a task row actions tests

* some todocleanup

* PR feedback addressed, including page helper for actions
2023-11-07 15:29:43 -05:00
Logan Attwood
0e643501de Fix the "Starting" allocations link (#18866)
Before this commit, it would bring you to the list of allocations
filtered by status=starting. This status does not exist in the Status
drop-down on the Allocations section of a job in the UI.
2023-11-01 15:23:43 -04:00
Kerim Satirli
5e1bbf90fc docs: update all URLs to developer.hashicorp.com (#16247) 2023-10-24 11:00:11 -04:00
Sanskar Gauchan
26b3a368a4 Show message for when log collection is disabled. 2023-10-21 14:25:43 +11:00
Phil Renaud
8902afe651 Nomad Actions (#18794)
* Scaffolding actions (#18639)

* Task-level actions for job submissions and retrieval

* FIXME: Temporary workaround to get ember dev server to pass exec through to 4646

* Update api/tasks.go

Co-authored-by: Tim Gross <tgross@hashicorp.com>

* Update command/agent/job_endpoint.go

Co-authored-by: Tim Gross <tgross@hashicorp.com>

* Diff and copy implementations

* Action structs get their own file, diff updates to behave like our other diffs

* Test to observe actions changes in a version update

* Tests migrated into structs/diff_test and modified with PR comments in mind

* APIActionToSTructsAction now returns a new value

* de-comment some plain parts, remove unused action lookup

* unused param in action converter

---------

Co-authored-by: Tim Gross <tgross@hashicorp.com>

* New endpoint: job/:id/actions (#18690)

* unused param in action converter

* backing out of parse_job level and moved toward new endpoint level

* Adds taskName and taskGroupName to actions at job level

* Unmodified job mock actions tests

* actionless job test

* actionless job test

* Multi group multi task actions test

* HTTP method check for GET, cleaner errors in job_endpoint_test

* decomment

* Actions aggregated at job model level (#18733)

* Removal of temporary fix to proxy to 4646

* Run Action websocket endpoint (#18760)

* Working demo for review purposes

* removal of cors passthru for websockets

* Remove job_endpoint-specific ws handlers and aimed at existing alloc exec handlers instead

* PR comments adressed, no need for taskGroup pass, better group and task lookups from alloc

* early return in action validate and removed jobid from req args per PR comments

* todo removal, we're checking later in the rpc

* boolean style change on tty

* Action CLI command (#18778)

* Action command init and stuck-notes

* Conditional reqpath to aim at Job action endpoint

* De-logged

* General CLI command cleanup, observe namespace, pass action as string, get random alloc w group adherence

* tab and varname cleanup

* Remove action param from Allocations().Exec calls

* changelog

* dont nil-check acl

---------

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2023-10-20 13:05:55 -04:00
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