diff --git a/ui/app/components/forbidden-message.js b/ui/app/components/forbidden-message.js index 0334535df6a9..f9d0a2cf90a5 100644 --- a/ui/app/components/forbidden-message.js +++ b/ui/app/components/forbidden-message.js @@ -1,5 +1,8 @@ import Component from '@ember/component'; import { tagName } from '@ember-decorators/component'; +import { inject as service } from '@ember/service'; @tagName('') -export default class ForbiddenMessage extends Component {} +export default class ForbiddenMessage extends Component { + @service token; +} diff --git a/ui/app/components/hamburger-menu.js b/ui/app/components/hamburger-menu.js new file mode 100644 index 000000000000..133c7241b3e1 --- /dev/null +++ b/ui/app/components/hamburger-menu.js @@ -0,0 +1,6 @@ +import Component from '@ember/component'; +import { tagName } from '@ember-decorators/component'; + +@tagName('') +export default class HamburgerMenu extends Component { +} diff --git a/ui/app/components/job-subnav.js b/ui/app/components/job-subnav.js new file mode 100644 index 000000000000..5e180f67b770 --- /dev/null +++ b/ui/app/components/job-subnav.js @@ -0,0 +1,6 @@ +import Component from '@ember/component'; +import { tagName } from '@ember-decorators/component'; + +@tagName('') +export default class JobSubnav extends Component { +} diff --git a/ui/app/components/loading-spinner.js b/ui/app/components/loading-spinner.js new file mode 100644 index 000000000000..f1f1f8734bbe --- /dev/null +++ b/ui/app/components/loading-spinner.js @@ -0,0 +1,6 @@ +import Component from '@ember/component'; +import { tagName } from '@ember-decorators/component'; + +@tagName('') +export default class LoadingSpinner extends Component { +} diff --git a/ui/app/components/stats-time-series.js b/ui/app/components/stats-time-series.js index 0bce656165e1..58b9643d545b 100644 --- a/ui/app/components/stats-time-series.js +++ b/ui/app/components/stats-time-series.js @@ -5,11 +5,14 @@ import d3Format from 'd3-format'; import d3Scale from 'd3-scale'; import d3Array from 'd3-array'; import LineChart from 'nomad-ui/components/line-chart'; +import layout from '../templates/components/line-chart'; import formatDuration from 'nomad-ui/utils/format-duration'; import classic from 'ember-classic-decorator'; @classic export default class StatsTimeSeries extends LineChart { + layout = layout; + xProp = 'timestamp'; yProp = 'percent'; timeseries = true; diff --git a/ui/app/components/svg-patterns.js b/ui/app/components/svg-patterns.js new file mode 100644 index 000000000000..0e97ba0b77f5 --- /dev/null +++ b/ui/app/components/svg-patterns.js @@ -0,0 +1,6 @@ +import Component from '@ember/component'; +import { tagName } from '@ember-decorators/component'; + +@tagName('') +export default class SvgPatterns extends Component { +} diff --git a/ui/app/templates/application.hbs b/ui/app/templates/application.hbs index 46da1ce78ef1..c2ed3ae814a2 100644 --- a/ui/app/templates/application.hbs +++ b/ui/app/templates/application.hbs @@ -1,6 +1,6 @@ {{title (if system.shouldShowRegions (concat system.activeRegion " - ")) "Nomad" separator=" - "}} -{{partial "svg-patterns"}} + {{#unless error}} {{outlet}} {{else}} diff --git a/ui/app/templates/clients/index.hbs b/ui/app/templates/clients/index.hbs index 7c58f73cac51..1fb413a4be13 100644 --- a/ui/app/templates/clients/index.hbs +++ b/ui/app/templates/clients/index.hbs @@ -1,7 +1,7 @@ {{title "Clients"}} {{#if isForbidden}} - {{partial "partials/forbidden-message"}} + {{else}} diff --git a/ui/app/templates/clients/loading.hbs b/ui/app/templates/clients/loading.hbs index ae06c3078ee9..1b60ae2223ed 100644 --- a/ui/app/templates/clients/loading.hbs +++ b/ui/app/templates/clients/loading.hbs @@ -1 +1 @@ -{{partial "partials/loading-spinner"}} + diff --git a/ui/app/templates/components/global-header.hbs b/ui/app/templates/components/global-header.hbs index e129a42c3212..7f7c2e4f71ac 100644 --- a/ui/app/templates/components/global-header.hbs +++ b/ui/app/templates/components/global-header.hbs @@ -1,10 +1,10 @@ - {{partial "partials/hamburger-menu"}} + - {{partial "partials/nomad-logo"}} + {{#unless (media "isMobile")}} diff --git a/ui/app/templates/components/gutter-menu.hbs b/ui/app/templates/components/gutter-menu.hbs index 37b78f715a58..959ff6b82e8a 100644 --- a/ui/app/templates/components/gutter-menu.hbs +++ b/ui/app/templates/components/gutter-menu.hbs @@ -2,10 +2,10 @@ - {{partial "partials/hamburger-menu"}} + - {{partial "partials/nomad-logo"}} + {{#if isForbidden}} - {{partial "partials/forbidden-message"}} + {{else}} diff --git a/ui/app/templates/csi/volumes/index.hbs b/ui/app/templates/csi/volumes/index.hbs index 528d02de0ed2..17b259de4c5c 100644 --- a/ui/app/templates/csi/volumes/index.hbs +++ b/ui/app/templates/csi/volumes/index.hbs @@ -7,7 +7,7 @@ {{#if isForbidden}} - {{partial "partials/forbidden-message"}} + {{else}} diff --git a/ui/app/templates/exec-loading.hbs b/ui/app/templates/exec-loading.hbs index 1304be4e807f..ecea678564c2 100644 --- a/ui/app/templates/exec-loading.hbs +++ b/ui/app/templates/exec-loading.hbs @@ -2,7 +2,7 @@ - {{partial "partials/nomad-logo"}} + @@ -13,5 +13,5 @@ - {{partial "partials/loading-spinner"}} + \ No newline at end of file diff --git a/ui/app/templates/exec.hbs b/ui/app/templates/exec.hbs index 8d853b487d9f..9b5b853298c8 100644 --- a/ui/app/templates/exec.hbs +++ b/ui/app/templates/exec.hbs @@ -2,7 +2,7 @@ - {{partial "partials/nomad-logo"}} + {{#if system.shouldShowRegions}} diff --git a/ui/app/templates/jobs/index.hbs b/ui/app/templates/jobs/index.hbs index a5e76785eabe..6b8d966533d5 100644 --- a/ui/app/templates/jobs/index.hbs +++ b/ui/app/templates/jobs/index.hbs @@ -1,7 +1,7 @@ {{title "Jobs"}} {{#if isForbidden}} - {{partial "partials/forbidden-message"}} + {{else}} diff --git a/ui/app/templates/jobs/job/allocations.hbs b/ui/app/templates/jobs/job/allocations.hbs index 2f20508089c5..d49d3678e377 100644 --- a/ui/app/templates/jobs/job/allocations.hbs +++ b/ui/app/templates/jobs/job/allocations.hbs @@ -1,5 +1,5 @@ {{title "Job " job.name " allocations"}} -{{partial "jobs/job/subnav"}} + {{#if allocations.length}} diff --git a/ui/app/templates/jobs/job/definition.hbs b/ui/app/templates/jobs/job/definition.hbs index 1ad50bfaaacc..747f96137393 100644 --- a/ui/app/templates/jobs/job/definition.hbs +++ b/ui/app/templates/jobs/job/definition.hbs @@ -1,5 +1,5 @@ {{title "Job " job.name " definition"}} -{{partial "jobs/job/subnav"}} + {{#unless isEditing}} diff --git a/ui/app/templates/jobs/job/deployments.hbs b/ui/app/templates/jobs/job/deployments.hbs index eb0739a1f8da..f5c78332ba13 100644 --- a/ui/app/templates/jobs/job/deployments.hbs +++ b/ui/app/templates/jobs/job/deployments.hbs @@ -1,5 +1,5 @@ {{title "Job " job.name " deployments"}} -{{partial "jobs/job/subnav"}} + diff --git a/ui/app/templates/jobs/job/evaluations.hbs b/ui/app/templates/jobs/job/evaluations.hbs index 863af33497da..704985b63f4a 100644 --- a/ui/app/templates/jobs/job/evaluations.hbs +++ b/ui/app/templates/jobs/job/evaluations.hbs @@ -1,5 +1,5 @@ {{title "Job " job.name " evaluations"}} -{{partial "jobs/job/subnav"}} + {{#if sortedEvaluations.length}} {{partial "partials/loading-spinner"}} + + diff --git a/ui/app/templates/jobs/job/versions.hbs b/ui/app/templates/jobs/job/versions.hbs index c28dc43be07b..55f187555ecc 100644 --- a/ui/app/templates/jobs/job/versions.hbs +++ b/ui/app/templates/jobs/job/versions.hbs @@ -1,5 +1,5 @@ {{title "Job " job.name " versions"}} -{{partial "jobs/job/subnav"}} + diff --git a/ui/app/templates/jobs/loading.hbs b/ui/app/templates/jobs/loading.hbs index ae06c3078ee9..1b60ae2223ed 100644 --- a/ui/app/templates/jobs/loading.hbs +++ b/ui/app/templates/jobs/loading.hbs @@ -1 +1 @@ -{{partial "partials/loading-spinner"}} + diff --git a/ui/app/templates/loading.hbs b/ui/app/templates/loading.hbs index 78d3b07d9a0c..c70be1061705 100644 --- a/ui/app/templates/loading.hbs +++ b/ui/app/templates/loading.hbs @@ -1,3 +1,3 @@ - {{partial "partials/loading-spinner"}} + diff --git a/ui/app/templates/partials/forbidden-message.hbs b/ui/app/templates/partials/forbidden-message.hbs deleted file mode 100644 index bfa7cd0e805a..000000000000 --- a/ui/app/templates/partials/forbidden-message.hbs +++ /dev/null @@ -1,10 +0,0 @@ - - Not Authorized - - {{#if token.secret}} - Your ACL token does not provide the required permissions. Contact your administrator if this is an error. - {{else}} - Provide an ACL token with requisite permissions to view this. - {{/if}} - - diff --git a/ui/app/templates/servers/index.hbs b/ui/app/templates/servers/index.hbs index 12211c8b0556..b0a02fc95fb5 100644 --- a/ui/app/templates/servers/index.hbs +++ b/ui/app/templates/servers/index.hbs @@ -1,7 +1,7 @@ {{title "Servers"}} {{#if isForbidden}} - {{partial "partials/forbidden-message"}} + {{else}} {{partial "partials/loading-spinner"}} + diff --git a/ui/config/deprecation-workflow.js b/ui/config/deprecation-workflow.js index 7742a99dec24..e7c8c41fed43 100644 --- a/ui/config/deprecation-workflow.js +++ b/ui/config/deprecation-workflow.js @@ -7,5 +7,6 @@ self.deprecationWorkflow.config = { { handler: 'throw', matchId: 'ember-console.deprecate-logger' }, { handler: 'throw', matchId: 'ember-test-helpers.rendering-context.jquery-element' }, { handler: 'throw', matchId: 'ember-cli-page-object.is-property' }, + { handler: 'throw', matchId: 'ember-views.partial' }, ], }; diff --git a/ui/stories/components/header.stories.js b/ui/stories/components/header.stories.js index 22b8a0a96835..5ffc82e00a29 100644 --- a/ui/stories/components/header.stories.js +++ b/ui/stories/components/header.stories.js @@ -11,10 +11,10 @@ export let Header = () => { - {{partial "partials/hamburger-menu"}} + - {{partial "partials/nomad-logo"}} +
- {{#if token.secret}} - Your ACL token does not provide the required permissions. Contact your administrator if this is an error. - {{else}} - Provide an ACL token with requisite permissions to view this. - {{/if}} -