Commit Graph

55 Commits

Author SHA1 Message Date
Michael Lange
970ed734df Reset the system and refetch namespaces with every token change 2020-07-10 15:18:36 -07:00
Michael Lange
2a78133330 Persist the log stream/mode setting to localStorage 2020-06-30 17:09:52 -07:00
Buck Doyle
62abb11bab Add phase 1 of global search (#8175)
This introduces a DataCaches service so recently-updated collections don’t need
to be requeried within a minute, or based on the current route. It only searches
jobs and nodes. There are known bugs that will be addressed in upcoming PRs.
2020-06-19 13:05:28 -05:00
Buck Doyle
ddfd9cc750 Add fixes for ESLint getter-return
…I GUESS
2020-06-10 16:18:56 -05:00
Buck Doyle
24eadd269c Add massaged results of class codemod
Manual interventions:
• decorators on the same line for service and controller
  injections and most computed property macros
• preserving import order when possible, both per-line
  and intra-line
• moving new imports to the bottom
• removal of classic decorator for trivial cases
• conversion of init to constructor when appropriate
2020-06-10 16:18:42 -05: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
Buck Doyle
bd8d418705 UI: Remove Ember Freestyle (#7839)
This completes the migration to Storybook by replacing the colour palette and typeface components that I left out.
2020-05-06 15:11:15 -05:00
Michael Lange
6af31fed7a Always pass credential in fetch requests, but also treat options reasonably
Now options can be provided without also having to remember to pass
credentials. This is convenient for abort controller signals.
2020-04-29 17:34:49 -07:00
Mahmood Ali
6021ea6d25 Merge pull request #7612 from hashicorp/b-auth-alloc-exec-ws
Authenticate alloc/exec websocket requests
2020-04-06 09:24:51 -04:00
Mahmood Ali
cad5261ec1 ui: send authentication ws handshake
Have the UI send the authentication websocket handshake message.
2020-04-03 11:49:22 -04:00
Michael Lange
fef1d91606 New service for storing user settings 2020-04-02 12:50:28 -07:00
Buck Doyle
557f913899 UI: Fix check for Mirage presence setting up sockets (#7497)
Without this, exec UI doesn’t work at all in the binary. I made an
unfortunate error in not copying the environment check from
app/utils/fetch.js.
2020-03-25 13:23:23 -05: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
Michael Lange
35d7744ba7 Handle the case where ACLs aren't enabled in abilities 2020-01-31 09:41:36 -08:00
Michael Lange
e7067f0cc9 Fix token referencing from the token controller, as well as resetting 2020-01-31 09:41:35 -08:00
Buck Doyle
3adb3cd1fe ui: Change Run Job availability based on ACLs (#5944)
This builds on API changes in #6017 and #6021 to conditionally turn off the
“Run Job” button based on the current token’s capabilities, or the capabilities
of the anonymous policy if no token is present.

If you try to visit the job-run route directly, it redirects to the job list.
2020-01-20 14:57:01 -06:00
Buck Doyle
882a0210fe UI: Update Ember to 3.12 LTS (#6419)
This is mostly deprecation fixes and blueprint changes. There
are some dependency updates too; the changes to Ember
Basic Dropdown necessitated changing it to angle bracket
component invocation. The conversion of the rest of the
templates will happen separately.
2019-10-15 13:32:58 -05:00
Michael Lange
f6232f1817 ES5 getters codemod 2019-04-10 14:54:36 -07:00
Michael Lange
23729ad5a7 Address the copy/copyable deprecation 2019-04-10 14:54:35 -07:00
Michael Lange
a0e893ed84 Reattach resources to stats trackers in the event they were destroyed 2019-03-29 16:09:14 -07:00
Michael Lange
c45efccee6 Merge pull request #4833 from hashicorp/b-ui-gracefully-handle-stat-errors
UI: Gracefully handle stat errors
2018-11-09 14:35:48 -08:00
Michael Lange
022573a072 Move jsonWithDefault to a util 2018-11-01 22:07:58 -07:00
Michael Lange
4e36c52935 Test coverage for breadcrumb qp change 2018-10-31 13:27:35 -07:00
Michael Lange
01195a810c Unit tests for the stats trackers service 2018-09-19 15:33:29 -07:00
Michael Lange
cf9490ce04 New service to manage stats trackers
This solves two problems:

1. redundant trackers making redundant requests
2. trackers being obliterated as soon as the primary metric component
   is destroyed

It introduces a new problem where visiting more and more node and
allocation pages adds to an ever-growing list of trackers that can
assume lots of memory, but it solves the problem by using a
least-recently-used cache to limit the number of trackers tracked.
2018-09-17 15:53:59 -07:00
Michael Lange
130e951a37 Merge pull request #4600 from hashicorp/f-ui-job-writes
UI: Job Writes
2018-08-30 10:41:14 -07:00
Michael Lange
12bdfbdf47 Switch token storage to localStorage from sessionStorage 2018-08-28 10:05:15 -07:00
Michael Lange
e9190f49ba Fix a blocking queries bug
The lowest valid blocking query index is 1, but the API will return 0 if
there has yet to be an index set (no response). This in conjunction with
that 0 being stored as a string made the "fallback to 1" guard not work.
2018-08-21 13:47:01 -07:00
Michael Lange
362aff0fab Simplify the control flow around changing namespaces and regions
The UI will no longer try to redirect to the appropriate namespace or
region if one is found in localStorage. Instead, it will assume that
the lack of query param means the default namespaces or region is
desired.
2018-08-09 18:22:39 -07:00
Michael Lange
822d99833b Handle errors when getting regions or the default regions
This protects against volatility in the server and, more commonly, ACLs
returning forbidden responses.
2018-08-09 18:22:39 -07:00
Michael Lange
ae0bf90b79 Only deal with the region param (in the app and in api calls) when necessary 2018-08-09 18:22:39 -07:00
Michael Lange
d690709462 Get the server's region (aka default region) from the API
The default region shouldn't be used as a qp since no qp means the same
thing.
2018-08-09 18:22:38 -07:00
Michael Lange
c5439df03a Add the region qp to all requests made through the token service 2018-08-09 18:22:38 -07:00
Michael Lange
4715696959 Clear up the data flow for namespaces
This is incredibly tricky with query params, since there is a bundle of
timing issues, lifecycle issues, missing features, and all around
gotchas with query params.

This solution has no observers and no instances of the system service
being set from the jobs controller.

The upside to this is no observers, much easier to follow logic, no more
dependent key chain reactions.
2018-08-09 18:22:38 -07:00
Michael Lange
840069de2b Harden up the system service for the event of store unloading 2018-08-09 18:22:37 -07:00
Michael Lange
dc1a031460 Add three-way region property (query param, service, localStorage) 2018-08-09 18:22:37 -07:00
Michael Lange
954d1283e1 Update tests to match new test selectors 2018-07-06 11:12:12 -07:00
Michael Lange
da61ab2282 Recompute breadcrumbs when a model changes but the current route does not
Example: parent job to child job navigation
2018-07-06 11:12:11 -07:00
Michael Lange
dd6f12696f New breadcrumb service and component for describing breadcrumbs in routes
Works by segmenting the currentRouteName from the router service
and walking over each route in the current hierarchy to collect crumbs.
2018-07-06 11:12:10 -07:00
Michael Lange
e658a3a9a0 Clear out the localStorage namespace when it's no longer valid
In the event that a namespace in localStorage is not found in the
response for /namespaces, clear the localStorage value and assume
the default namespace.
2018-03-28 14:55:07 -07:00
Michael Lange
44922c9d3a The initial index value should be 1, not 0 2018-03-21 13:28:56 -07:00
Michael Lange
504ff2d4b7 Tests for watching and canceling requests 2018-03-02 16:21:37 -08:00
Michael Lange
9b2080d41e Prototype watching resources
- Service to manage X-Nomad-Index values
- Adapter method for reloading relationships with additional params
- Pattern for watching models and model relationships using EC
2018-03-02 16:21:34 -08:00
Michael Lange
c8fcb4c710 Reorganize the styleguide using components for sections 2018-01-17 09:04:01 -08:00
Michael Lange
2e19c2d877 Use the new ember modules imports
Generated with a codemode:
https://github.com/ember-cli/ember-modules-codemod
2018-01-17 09:02:04 -08:00
Michael Schurter
4c859dc0aa Include credentials in fetch requests
Fixes #3701

Relevant spec section:
https://fetch.spec.whatwg.org/#concept-request-credentials-mode
2018-01-08 12:18:03 -08:00
Michael Lange
89ef279ffb Prefer native fetch 2017-11-21 11:22:41 -08:00
Michael Lange
5374854a63 Redo the logic around showing namespaces
Don't show namespaces if the only namespace is `default`
2017-10-23 17:42:36 -07:00
Michael Lange
8bece2f89a Don't scroll to top on transition in tests
It's mega annoying
2017-10-23 17:42:36 -07:00