Commit Graph

43 Commits

Author SHA1 Message Date
Phil Renaud
cabe05705c [ui] Disconnected Clients: "Unknown" allocations in the UI (#12544)
* Unknown status for allocations accounted for

* Canary string removed

* Test cleanup

* Generate unknown in mirage

* aacidentally oovervoowled

* Update ui/app/components/allocation-status-bar.js

Co-authored-by: Derek Strickland <1111455+DerekStrickland@users.noreply.github.com>

* Disconnected state on job status in client

* Renaming Disconnected to Unknown in the job-status-in-client

* Unknown accounted for on job rows filtering and testsfix

* Adding lostAllocs as a computed dependency

* Unknown client status within acceptance test

* Swatches updated and PR comments addressed

* Unknown and disconnected added to test fixtures

Co-authored-by: Derek Strickland <1111455+DerekStrickland@users.noreply.github.com>
2022-04-22 11:25:02 -04:00
Luiz Aoqui
7f1b838abb ui: fix bug that prevented files streaming (#12719)
During the Ember dependecy upgrade work,
https://github.com/hashicorp/nomad/commit/ce8c039f4ce7359d60ede5dee36b9cef82
moved the `isSupported` method from using Ember's `reopenClass` to a
getter, but `reopenClass` creates a static method, so the getter must be
static as well.
2022-04-20 14:39:18 -04:00
Jai Bhagat
cae4bec3c9 ui: fix remaining linting errors 2022-01-20 10:39:02 -05:00
Jai Bhagat
2032813bb6 ui: apply new qunit linting rules to tests
Async tests should use  in integrations tests.
Acceptance tests are using Mirage and can't use
since we can't know the number of assertions.
2022-01-20 10:01:35 -05:00
Jai Bhagat
8c600acb35 ui: prettify js files 2022-01-20 09:54:56 -05:00
Jai Bhagat
d0f8322786 ui: fix auto-fixable linting errors 2022-01-20 09:46:45 -05:00
Luiz Aoqui
6b488bdad3 Fix ACL requirements for job details UI (#11672) 2022-01-12 21:26:02 -05:00
Jai
0564f9fa68 System Batch UI, Client Status Bar Chart and Client Tab page view (#11078) 2021-10-07 17:11:38 -04:00
Nicholas Cioli
801a7324a3 ui: add parameterized dispatch interface (#10675)
* ui: add parameterized dispatch interface

This commit adds a new interface for dispatching parameteried jobs, if
the user has the right permissions. The UI can be accessed by viewing a
parameterized job and clicking on the "Dispatch Job" button located in
the "Job Launches" section.

* fix failing lint test

* clean up dispatch and remove meta

This commit cleans up a few things that had typos and
inconsistent naming. In line with this, the custom
`meta` view was removed in favor of using the
included `AttributesTable`.

* ui: encode dispatch job payload and start adding tests

* ui: remove unused test imports

* ui: redesign job dispatch form

* ui: initial acceptance tests for dispatch job

* ui: generate parameterized job children with correct id format

* ui: fix job dispatch breadcrumb link

* ui: refactor job dispatch component into glimmer component and add form validation

* ui: remove unused CSS class

* ui: align job dispatch button

* ui: handle namespace-specific requests on job dispatch

* ui: rename payloadMissing to payloadHasError

* ui: don't re-fetch job spec on dispatch job

* ui: keep overview tab selected on job dispatch page

* ui: fix task and task-group linting

* ui: URL encode job id on dispatch job tests

* ui: fix error when job meta is null

* ui: handle job dispatch from adapter

* ui: add more tests for dispatch job page

* ui: add "job dispatch" capability check

* ui: update job dispatch from code review

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2021-07-20 18:27:41 -04:00
Michael Lange
a019587de5 Use common helpers and utils for formatting hertz 2021-03-31 09:29:14 -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
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
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
5dfa556983 Test coverage for the messageFromAdapterError util 2021-01-28 12:18:53 -08: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
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
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
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
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
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
24b0ef6a1b Light test coverage for the stream-logger class 2019-12-05 00:19:36 -08:00
Michael Lange
07f1c89cc5 Use the stream decode util and never opt to use the plain query param 2019-07-30 17:22:45 -07:00
Michael Lange
a21ae52783 Move common stream frame decoding to a util 2019-07-30 17:22:44 -07:00
Michael Lange
203b54b246 Move addToPath to its own util 2019-05-20 11:52:47 -07:00
Conor Mongey
aa4c1288f3 Return a htmlSafe string rather than use triple curlies 2019-05-02 21:47:24 +01:00
Michael Lange
2474ecae4d Remove all andThen and .then usages (except for integration tests)
Since a future ember version does way with the need to manually
making runloop runs, I'm holding off on those tests
2019-04-10 14:54:34 -07:00
Michael Lange
1e669bb56b Fix bug in the stats-tracker-frame-mising behavior 2019-04-10 14:54:33 -07:00
Michael Lange
90278bff04 Ember QUnit Codemod 2019-04-10 14:54:30 -07:00
Michael Lange
333e76ba73 Test coverage for frame misses 2018-11-06 16:17:21 -08:00
Michael Lange
9a6d2bee10 Add a longForm option to format-duration 2018-09-27 12:55:17 -07:00
Michael Lange
47ec74eb3a Update stat tracker unit tests 2018-09-19 19:30:18 -07:00
Michael Lange
f8c8c3cec4 Test coverage for NodeStatsTracker 2018-09-11 16:27:06 -07:00
Michael Lange
405cf822d8 Unit Tests for AllocationStatsTracker 2018-08-31 14:39:22 -07:00
Michael Lange
d25c0d60b9 Unit tests for RollingArray 2018-08-31 14:39:22 -07:00
Michael Lange
83e0b10451 Account for the 0 case in format-duration 2018-05-30 14:30:45 -07:00
Michael Lange
4d00f2f46d Duration formatting utility
The cloest Moment.js has is "homanize" which isn't precise enough.
2018-05-30 11:27:21 -07: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 Lange
d930180c06 Unit tests for the log util 2017-11-21 11:22:43 -08:00