From 3859c3b1bb9787e9a624ba7ef607c128c464ada3 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 25 Jul 2018 14:10:51 -0700 Subject: [PATCH 1/8] Redo onNamespaceChange to use the router --- ui/app/components/gutter-menu.js | 9 ++++++++- ui/app/controllers/jobs.js | 6 ------ ui/app/controllers/jobs/index.js | 4 ---- ui/app/routes/jobs.js | 2 +- ui/app/routes/jobs/index.js | 6 ------ ui/app/templates/components/gutter-menu.hbs | 5 +---- ui/app/templates/jobs/index.hbs | 2 +- 7 files changed, 11 insertions(+), 23 deletions(-) diff --git a/ui/app/components/gutter-menu.js b/ui/app/components/gutter-menu.js index 7a5086b76..261516440 100644 --- a/ui/app/components/gutter-menu.js +++ b/ui/app/components/gutter-menu.js @@ -4,6 +4,7 @@ import { computed } from '@ember/object'; export default Component.extend({ system: service(), + router: service(), sortedNamespaces: computed('system.namespaces.@each.name', function() { const namespaces = this.get('system.namespaces').toArray() || []; @@ -31,5 +32,11 @@ export default Component.extend({ }); }), - onNamespaceChange() {}, + gotoJobsForNamespace(namespace) { + if (!namespace || !namespace.get('id')) return; + + this.get('router').transitionTo('jobs', { + queryParams: { namespace: namespace.get('id') }, + }); + }, }); diff --git a/ui/app/controllers/jobs.js b/ui/app/controllers/jobs.js index e7a69a7d8..c8fd48cf5 100644 --- a/ui/app/controllers/jobs.js +++ b/ui/app/controllers/jobs.js @@ -18,12 +18,6 @@ export default Controller.extend({ // But query param defaults can't be CPs: https://github.com/emberjs/ember.js/issues/9819 syncNamespaceService: forwardNamespace('jobNamespace', 'system.activeNamespace'), syncNamespaceParam: forwardNamespace('system.activeNamespace', 'jobNamespace'), - - actions: { - refreshRoute() { - return true; - }, - }, }); function forwardNamespace(source, destination) { diff --git a/ui/app/controllers/jobs/index.js b/ui/app/controllers/jobs/index.js index 769b48115..0dd0eb5a8 100644 --- a/ui/app/controllers/jobs/index.js +++ b/ui/app/controllers/jobs/index.js @@ -58,9 +58,5 @@ export default Controller.extend(Sortable, Searchable, { gotoJob(job) { this.transitionToRoute('jobs.job', job.get('plainId')); }, - - refresh() { - this.send('refreshRoute'); - }, }, }); diff --git a/ui/app/routes/jobs.js b/ui/app/routes/jobs.js index ed9178375..759027c21 100644 --- a/ui/app/routes/jobs.js +++ b/ui/app/routes/jobs.js @@ -21,7 +21,7 @@ export default Route.extend(WithForbiddenState, { model() { return this.get('store') - .findAll('job') + .findAll('job', { reload: true }) .catch(notifyForbidden(this)); }, diff --git a/ui/app/routes/jobs/index.js b/ui/app/routes/jobs/index.js index bb3c0b6a3..7529d4104 100644 --- a/ui/app/routes/jobs/index.js +++ b/ui/app/routes/jobs/index.js @@ -10,10 +10,4 @@ export default Route.extend(WithWatchers, { watch: watchAll('job'), watchers: collect('watch'), - - actions: { - refreshRoute() { - return true; - }, - }, }); diff --git a/ui/app/templates/components/gutter-menu.hbs b/ui/app/templates/components/gutter-menu.hbs index 716a623fd..90d9aa32e 100644 --- a/ui/app/templates/components/gutter-menu.hbs +++ b/ui/app/templates/components/gutter-menu.hbs @@ -14,10 +14,7 @@ selected=system.activeNamespace searchField="name" searchEnabled=(gt sortedNamespaces.length 10) - onchange=(action (queue - (action (mut system.activeNamespace)) - (action onNamespaceChange) - )) + onchange=(action gotoJobsForNamespace) tagName="div" class="namespace-switcher" as |namespace|}} diff --git a/ui/app/templates/jobs/index.hbs b/ui/app/templates/jobs/index.hbs index 7b409cadb..a18b2b1c8 100644 --- a/ui/app/templates/jobs/index.hbs +++ b/ui/app/templates/jobs/index.hbs @@ -1,4 +1,4 @@ -{{#gutter-menu class="page-body" onNamespaceChange=(action "refresh")}} +{{#gutter-menu class="page-body"}}
{{#if isForbidden}} {{partial "partials/forbidden-message"}} From d0c76b844aaa8ab19d4bc8f2d5e452658b1ac2fa Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 25 Jul 2018 14:18:37 -0700 Subject: [PATCH 2/8] Remove all references to onNamespaceChange --- ui/app/components/job-page/abstract.js | 1 - .../templates/components/job-page/batch.hbs | 2 +- .../job-page/parameterized-child.hbs | 2 +- .../components/job-page/parameterized.hbs | 2 +- .../components/job-page/parts/body.hbs | 2 +- .../components/job-page/periodic-child.hbs | 2 +- .../components/job-page/periodic.hbs | 2 +- .../templates/components/job-page/service.hbs | 2 +- .../templates/components/job-page/system.hbs | 2 +- ui/app/templates/jobs/job/definition.hbs | 2 +- ui/app/templates/jobs/job/deployments.hbs | 2 +- ui/app/templates/jobs/job/evaluations.hbs | 2 +- ui/app/templates/jobs/job/index.hbs | 1 - ui/app/templates/jobs/job/task-group.hbs | 2 +- ui/app/templates/jobs/job/versions.hbs | 2 +- .../integration/job-page/parts/body-test.js | 38 +++---------------- 16 files changed, 18 insertions(+), 48 deletions(-) diff --git a/ui/app/components/job-page/abstract.js b/ui/app/components/job-page/abstract.js index 01f63b2cf..931c5c6db 100644 --- a/ui/app/components/job-page/abstract.js +++ b/ui/app/components/job-page/abstract.js @@ -11,7 +11,6 @@ export default Component.extend({ sortDescending: null, // Provide actions that require routing - onNamespaceChange() {}, gotoTaskGroup() {}, gotoJob() {}, diff --git a/ui/app/templates/components/job-page/batch.hbs b/ui/app/templates/components/job-page/batch.hbs index d9f8a1fa6..f11a77849 100644 --- a/ui/app/templates/components/job-page/batch.hbs +++ b/ui/app/templates/components/job-page/batch.hbs @@ -1,4 +1,4 @@ -{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} +{{#job-page/parts/body job=job}} {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} {{job-page/parts/title job=job handleError=(action "handleError")}} diff --git a/ui/app/templates/components/job-page/parameterized-child.hbs b/ui/app/templates/components/job-page/parameterized-child.hbs index f0fcad10e..a5cbfb846 100644 --- a/ui/app/templates/components/job-page/parameterized-child.hbs +++ b/ui/app/templates/components/job-page/parameterized-child.hbs @@ -1,4 +1,4 @@ -{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} +{{#job-page/parts/body job=job}} {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} {{job-page/parts/title job=job title=job.trimmedName handleError=(action "handleError")}} diff --git a/ui/app/templates/components/job-page/parameterized.hbs b/ui/app/templates/components/job-page/parameterized.hbs index 8fca16924..b0b753c24 100644 --- a/ui/app/templates/components/job-page/parameterized.hbs +++ b/ui/app/templates/components/job-page/parameterized.hbs @@ -1,4 +1,4 @@ -{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} +{{#job-page/parts/body job=job}} {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} {{#job-page/parts/title job=job handleError=(action "handleError")}} diff --git a/ui/app/templates/components/job-page/parts/body.hbs b/ui/app/templates/components/job-page/parts/body.hbs index 12c339ce4..f139b52ab 100644 --- a/ui/app/templates/components/job-page/parts/body.hbs +++ b/ui/app/templates/components/job-page/parts/body.hbs @@ -1,4 +1,4 @@ -{{#gutter-menu class="page-body" onNamespaceChange=onNamespaceChange}} +{{#gutter-menu class="page-body"}} {{partial "jobs/job/subnav"}}
{{yield}} diff --git a/ui/app/templates/components/job-page/periodic-child.hbs b/ui/app/templates/components/job-page/periodic-child.hbs index 398cb9327..2accceb84 100644 --- a/ui/app/templates/components/job-page/periodic-child.hbs +++ b/ui/app/templates/components/job-page/periodic-child.hbs @@ -1,4 +1,4 @@ -{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} +{{#job-page/parts/body job=job}} {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} {{job-page/parts/title job=job title=job.trimmedName handleError=(action "handleError")}} diff --git a/ui/app/templates/components/job-page/periodic.hbs b/ui/app/templates/components/job-page/periodic.hbs index bc70771dc..af9d6e989 100644 --- a/ui/app/templates/components/job-page/periodic.hbs +++ b/ui/app/templates/components/job-page/periodic.hbs @@ -1,4 +1,4 @@ -{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} +{{#job-page/parts/body job=job}} {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} {{#job-page/parts/title job=job title=job.trimmedName handleError=(action "handleError")}} diff --git a/ui/app/templates/components/job-page/service.hbs b/ui/app/templates/components/job-page/service.hbs index f65dd4b6f..7df69f730 100644 --- a/ui/app/templates/components/job-page/service.hbs +++ b/ui/app/templates/components/job-page/service.hbs @@ -1,4 +1,4 @@ -{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} +{{#job-page/parts/body job=job}} {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} {{job-page/parts/title job=job handleError=(action "handleError")}} diff --git a/ui/app/templates/components/job-page/system.hbs b/ui/app/templates/components/job-page/system.hbs index d9f8a1fa6..f11a77849 100644 --- a/ui/app/templates/components/job-page/system.hbs +++ b/ui/app/templates/components/job-page/system.hbs @@ -1,4 +1,4 @@ -{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} +{{#job-page/parts/body job=job}} {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} {{job-page/parts/title job=job handleError=(action "handleError")}} diff --git a/ui/app/templates/jobs/job/definition.hbs b/ui/app/templates/jobs/job/definition.hbs index 924d18000..efe10b578 100644 --- a/ui/app/templates/jobs/job/definition.hbs +++ b/ui/app/templates/jobs/job/definition.hbs @@ -1,4 +1,4 @@ -{{#gutter-menu class="page-body" onNamespaceChange=(action "gotoJobs")}} +{{#gutter-menu class="page-body"}} {{partial "jobs/job/subnav"}}
diff --git a/ui/app/templates/jobs/job/deployments.hbs b/ui/app/templates/jobs/job/deployments.hbs index 241a0d32d..bd67069d6 100644 --- a/ui/app/templates/jobs/job/deployments.hbs +++ b/ui/app/templates/jobs/job/deployments.hbs @@ -1,4 +1,4 @@ -{{#gutter-menu class="page-body" onNamespaceChange=(action "gotoJobs")}} +{{#gutter-menu class="page-body"}} {{partial "jobs/job/subnav"}}
{{job-deployments-stream deployments=model.deployments}} diff --git a/ui/app/templates/jobs/job/evaluations.hbs b/ui/app/templates/jobs/job/evaluations.hbs index 4f5a9be8b..ca660ff74 100644 --- a/ui/app/templates/jobs/job/evaluations.hbs +++ b/ui/app/templates/jobs/job/evaluations.hbs @@ -1,4 +1,4 @@ -{{#gutter-menu class="page-body" onNamespaceChange=(action "gotoJobs")}} +{{#gutter-menu class="page-body"}} {{partial "jobs/job/subnav"}}
diff --git a/ui/app/templates/jobs/job/index.hbs b/ui/app/templates/jobs/job/index.hbs index 7d81851b2..8cd4928e6 100644 --- a/ui/app/templates/jobs/job/index.hbs +++ b/ui/app/templates/jobs/job/index.hbs @@ -3,6 +3,5 @@ sortProperty=sortProperty sortDescending=sortDescending currentPage=currentPage - onNamespaceChange=(action "gotoJobs") gotoJob=(action "gotoJob") gotoTaskGroup=(action "gotoTaskGroup")}} diff --git a/ui/app/templates/jobs/job/task-group.hbs b/ui/app/templates/jobs/job/task-group.hbs index b2b08c701..3446a306f 100644 --- a/ui/app/templates/jobs/job/task-group.hbs +++ b/ui/app/templates/jobs/job/task-group.hbs @@ -1,4 +1,4 @@ -{{#gutter-menu class="page-body" onNamespaceChange=(action "gotoJobs")}} +{{#gutter-menu class="page-body"}}
  • {{#link-to "jobs.job.task-group" model.job model activeClass="is-active"}}Overview{{/link-to}}
  • diff --git a/ui/app/templates/jobs/job/versions.hbs b/ui/app/templates/jobs/job/versions.hbs index 9b03e23ad..7e659a237 100644 --- a/ui/app/templates/jobs/job/versions.hbs +++ b/ui/app/templates/jobs/job/versions.hbs @@ -1,4 +1,4 @@ -{{#gutter-menu class="page-body" onNamespaceChange=(action "gotoJobs")}} +{{#gutter-menu class="page-body"}} {{partial "jobs/job/subnav"}}
    {{job-versions-stream versions=model.versions verbose=true}} diff --git a/ui/tests/integration/job-page/parts/body-test.js b/ui/tests/integration/job-page/parts/body-test.js index 042d1048b..3454113ac 100644 --- a/ui/tests/integration/job-page/parts/body-test.js +++ b/ui/tests/integration/job-page/parts/body-test.js @@ -1,11 +1,9 @@ import { run } from '@ember/runloop'; import { getOwner } from '@ember/application'; import { test, moduleForComponent } from 'ember-qunit'; -import { click, find, findAll } from 'ember-native-dom-helpers'; +import { find, findAll } from 'ember-native-dom-helpers'; import wait from 'ember-test-helpers/wait'; import hbs from 'htmlbars-inline-precompile'; -import sinon from 'sinon'; -import { clickTrigger } from 'ember-power-select/test-support/helpers'; import { startMirage } from 'nomad-ui/initializers/ember-cli-mirage'; moduleForComponent('job-page/parts/body', 'Integration | Component | job-page/parts/body', { @@ -23,10 +21,9 @@ moduleForComponent('job-page/parts/body', 'Integration | Component | job-page/pa test('includes a subnav for the job', function(assert) { this.set('job', {}); - this.set('onNamespaceChange', () => {}); this.render(hbs` - {{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} + {{#job-page/parts/body job=job}}
    Inner content
    {{/job-page/parts/body}} `); @@ -48,10 +45,9 @@ test('the subnav includes the deployments link when the job is a service', funct }); this.set('job', job); - this.set('onNamespaceChange', () => {}); this.render(hbs` - {{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} + {{#job-page/parts/body job=job}}
    Inner content
    {{/job-page/parts/body}} `); @@ -76,10 +72,9 @@ test('the subnav does not include the deployments link when the job is not a ser }); this.set('job', job); - this.set('onNamespaceChange', () => {}); this.render(hbs` - {{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} + {{#job-page/parts/body job=job}}
    Inner content
    {{/job-page/parts/body}} `); @@ -94,10 +89,9 @@ test('the subnav does not include the deployments link when the job is not a ser test('body yields content to a section after the subnav', function(assert) { this.set('job', {}); - this.set('onNamespaceChange', () => {}); this.render(hbs` - {{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} + {{#job-page/parts/body job=job}}
    Inner content
    {{/job-page/parts/body}} `); @@ -113,25 +107,3 @@ test('body yields content to a section after the subnav', function(assert) { ); }); }); - -test('onNamespaceChange action is called when the namespace changes in the nested gutter menu', function(assert) { - const namespaceSpy = sinon.spy(); - - this.set('job', {}); - this.set('onNamespaceChange', namespaceSpy); - - this.render(hbs` - {{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} -
    Inner content
    - {{/job-page/parts/body}} - `); - - return wait().then(() => { - clickTrigger('[data-test-namespace-switcher]'); - click(findAll('.ember-power-select-option')[1]); - - return wait().then(() => { - assert.ok(namespaceSpy.calledOnce, 'Switching namespaces calls the onNamespaceChange action'); - }); - }); -}); From 06b3cc87601b67b2548e847f704800b694d09f6b Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 25 Jul 2018 14:46:51 -0700 Subject: [PATCH 3/8] New page-layout component that contains both the header and the gutter menu --- ui/app/components/page-layout.js | 5 +++++ ui/app/templates/components/page-layout.hbs | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 ui/app/components/page-layout.js create mode 100644 ui/app/templates/components/page-layout.hbs diff --git a/ui/app/components/page-layout.js b/ui/app/components/page-layout.js new file mode 100644 index 000000000..4c5658fda --- /dev/null +++ b/ui/app/components/page-layout.js @@ -0,0 +1,5 @@ +import Component from '@ember/component'; + +export default Component.extend({ + classNames: ['page-layout'], +}); diff --git a/ui/app/templates/components/page-layout.hbs b/ui/app/templates/components/page-layout.hbs new file mode 100644 index 000000000..27a5f3133 --- /dev/null +++ b/ui/app/templates/components/page-layout.hbs @@ -0,0 +1,6 @@ +{{#global-header class="page-header"}} + {{app-breadcrumbs}} +{{/global-header}} +{{#gutter-menu class="page-body"}} + {{yield}} +{{/gutter-menu}} From 4319166880ce1909be0a8a7699b7135dc3f6e28d Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 25 Jul 2018 14:47:52 -0700 Subject: [PATCH 4/8] Use page-layout for the settings routes --- ui/app/templates/settings.hbs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/ui/app/templates/settings.hbs b/ui/app/templates/settings.hbs index 2e4ddc936..87dfce6a7 100644 --- a/ui/app/templates/settings.hbs +++ b/ui/app/templates/settings.hbs @@ -1,8 +1,3 @@ -
    - {{#global-header class="page-header"}} - {{app-breadcrumbs}} - {{/global-header}} - {{#gutter-menu class="page-body"}} - {{outlet}} - {{/gutter-menu}} -
    +{{#page-layout}} + {{outlet}} +{{/page-layout}} From 70cc506c8bddafba0ca8d1f6fe6f7e9331fa47d4 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 25 Jul 2018 14:54:10 -0700 Subject: [PATCH 5/8] Use page-layout for servers routes --- ui/app/templates/servers.hbs | 87 +++++++++++++++++------------------- 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/ui/app/templates/servers.hbs b/ui/app/templates/servers.hbs index a2bdbc84d..321325ca1 100644 --- a/ui/app/templates/servers.hbs +++ b/ui/app/templates/servers.hbs @@ -1,46 +1,41 @@ -
    - {{#global-header class="page-header"}} - {{app-breadcrumbs}} - {{/global-header}} - {{#gutter-menu class="page-body"}} -
    - {{#if isForbidden}} - {{partial "partials/forbidden-message"}} - {{else}} - {{#list-pagination - source=sortedAgents - size=pageSize - page=currentPage as |p|}} - {{#list-table - source=p.list - sortProperty=sortProperty - sortDescending=sortDescending - class="with-foot" as |t|}} - {{#t.head}} - {{#t.sort-by prop="name"}}Name{{/t.sort-by}} - {{#t.sort-by prop="status"}}Status{{/t.sort-by}} - {{#t.sort-by prop="isLeader"}}Leader{{/t.sort-by}} - {{#t.sort-by prop="address"}}Address{{/t.sort-by}} - {{#t.sort-by prop="serfPort"}}port{{/t.sort-by}} - {{#t.sort-by prop="datacenter"}}Datacenter{{/t.sort-by}} - {{/t.head}} - {{#t.body as |row|}} - {{server-agent-row data-test-server-agent-row agent=row.model}} - {{/t.body}} - {{/list-table}} -
    - -
    - {{/list-pagination}} - {{outlet}} - {{/if}} -
    - {{/gutter-menu}} -
    +{{#page-layout}} +
    + {{#if isForbidden}} + {{partial "partials/forbidden-message"}} + {{else}} + {{#list-pagination + source=sortedAgents + size=pageSize + page=currentPage as |p|}} + {{#list-table + source=p.list + sortProperty=sortProperty + sortDescending=sortDescending + class="with-foot" as |t|}} + {{#t.head}} + {{#t.sort-by prop="name"}}Name{{/t.sort-by}} + {{#t.sort-by prop="status"}}Status{{/t.sort-by}} + {{#t.sort-by prop="isLeader"}}Leader{{/t.sort-by}} + {{#t.sort-by prop="address"}}Address{{/t.sort-by}} + {{#t.sort-by prop="serfPort"}}port{{/t.sort-by}} + {{#t.sort-by prop="datacenter"}}Datacenter{{/t.sort-by}} + {{/t.head}} + {{#t.body as |row|}} + {{server-agent-row data-test-server-agent-row agent=row.model}} + {{/t.body}} + {{/list-table}} +
    + +
    + {{/list-pagination}} + {{outlet}} + {{/if}} +
    +{{/page-layout}} From 0d0a7f4970f1792bf1a82386a2b4f0af45845f18 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 25 Jul 2018 15:02:49 -0700 Subject: [PATCH 6/8] Use page-layout for clients routes --- ui/app/templates/clients.hbs | 7 +- ui/app/templates/clients/client.hbs | 474 +++++++++++++-------------- ui/app/templates/clients/index.hbs | 116 ++++--- ui/app/templates/clients/loading.hbs | 4 +- 4 files changed, 296 insertions(+), 305 deletions(-) diff --git a/ui/app/templates/clients.hbs b/ui/app/templates/clients.hbs index a766b9ff6..87dfce6a7 100644 --- a/ui/app/templates/clients.hbs +++ b/ui/app/templates/clients.hbs @@ -1,6 +1,3 @@ -
    - {{#global-header class="page-header"}} - {{app-breadcrumbs}} - {{/global-header}} +{{#page-layout}} {{outlet}} -
    +{{/page-layout}} diff --git a/ui/app/templates/clients/client.hbs b/ui/app/templates/clients/client.hbs index f83069ccf..b6e2bcf9f 100644 --- a/ui/app/templates/clients/client.hbs +++ b/ui/app/templates/clients/client.hbs @@ -1,252 +1,250 @@ -{{#gutter-menu class="page-body"}} -
    -

    - - {{or model.name model.shortId}} - {{model.id}} -

    +
    +

    + + {{or model.name model.shortId}} + {{model.id}} +

    -
    +
    +
    + Client Details + + Status + {{model.status}} + + + Address + {{model.httpAddr}} + + + Draining + {{#if model.isDraining}} + true + {{else}} + false + {{/if}} + + + Eligibility + {{#if model.isEligible}} + {{model.schedulingEligibility}} + {{else}} + {{model.schedulingEligibility}} + {{/if}} + + + Datacenter + {{model.datacenter}} + + + Drivers + {{#if model.unhealthyDrivers.length}} + {{x-icon "warning" class="is-text is-warning"}} + {{model.unhealthyDrivers.length}} of {{model.detectedDrivers.length}} {{pluralize "driver" model.detectedDrivers.length}} unhealthy + {{else}} + All healthy + {{/if}} + +
    +
    + + {{#if model.drainStrategy}} +
    - Client Details - - Status - {{model.status}} - - - Address - {{model.httpAddr}} - - - Draining - {{#if model.isDraining}} - true + Drain Strategy + + Deadline + {{#if model.drainStrategy.isForced}} + Forced Drain + {{else if model.drainStrategy.hasNoDeadline}} + No deadline {{else}} - false + {{format-duration model.drainStrategy.deadline}} {{/if}} - - Eligibility - {{#if model.isEligible}} - {{model.schedulingEligibility}} - {{else}} - {{model.schedulingEligibility}} - {{/if}} - - - Datacenter - {{model.datacenter}} - - - Drivers - {{#if model.unhealthyDrivers.length}} - {{x-icon "warning" class="is-text is-warning"}} - {{model.unhealthyDrivers.length}} of {{model.detectedDrivers.length}} {{pluralize "driver" model.detectedDrivers.length}} unhealthy - {{else}} - All healthy - {{/if}} + {{#if model.drainStrategy.forceDeadline}} + + Forced Deadline + {{moment-format model.drainStrategy.forceDeadline "MM/DD/YY HH:mm:ss"}} + ({{moment-from-now model.drainStrategy.forceDeadline interval=1000}}) + + {{/if}} + + Ignore System Jobs? + {{if model.drainStrategy.ignoreSystemJobs "Yes" "No"}}
    + {{/if}} - {{#if model.drainStrategy}} -
    -
    - Drain Strategy - - Deadline - {{#if model.drainStrategy.isForced}} - Forced Drain - {{else if model.drainStrategy.hasNoDeadline}} - No deadline +
    +
    +
    Allocations {{model.allocations.length}}
    + {{search-box + searchTerm=(mut searchTerm) + placeholder="Search allocations..." + class="is-inline pull-right" + inputClass="is-compact"}} +
    +
    + {{#list-pagination + source=sortedAllocations + size=pageSize + page=currentPage as |p|}} + {{#list-table + source=p.list + sortProperty=sortProperty + sortDescending=sortDescending + class="with-foot" as |t|}} + {{#t.head}} + + {{#t.sort-by prop="shortId"}}ID{{/t.sort-by}} + {{#t.sort-by prop="modifyIndex" title="Modify Index"}}Modified{{/t.sort-by}} + {{#t.sort-by prop="name"}}Name{{/t.sort-by}} + {{#t.sort-by prop="statusIndex"}}Status{{/t.sort-by}} + {{#t.sort-by prop="job.name"}}Job{{/t.sort-by}} + {{#t.sort-by prop="jobVersion"}}Version{{/t.sort-by}} + CPU + Memory + {{/t.head}} + {{#t.body as |row|}} + {{allocation-row + allocation=row.model + context="node" + onClick=(action "gotoAllocation" row.model) + data-test-allocation=row.model.id}} + {{/t.body}} + {{/list-table}} +
    + +
    + {{/list-pagination}} +
    +
    + +
    +
    + Client Events +
    +
    + {{#list-table source=sortedEvents class="is-striped" as |t|}} + {{#t.head}} + Time + Subsystem + Message + {{/t.head}} + {{#t.body as |row|}} + + {{moment-format row.model.time "MM/DD/YY HH:mm:ss"}} + {{row.model.subsystem}} + + {{#if row.model.message}} + {{#if row.model.driver}} + {{row.model.driver}} + {{/if}} + {{row.model.message}} + {{else}} + No message + {{/if}} + + + {{/t.body}} + {{/list-table}} +
    +
    + +
    +
    + Driver Status +
    +
    + {{#list-accordion source=sortedDrivers key="name" as |a|}} + {{#a.head buttonLabel="details" isExpandable=a.item.detected}} +
    +
    + {{a.item.name}} +
    +
    + {{#if a.item.detected}} + + + {{if a.item.healthy "Healthy" "Unhealthy"}} + + {{/if}} +
    +
    + + Detected + {{if a.item.detected "Yes" "No"}} + + + + Last Updated + {{moment-from-now a.item.updateTime interval=1000}} + + +
    +
    + {{/a.head}} + {{#a.body}} +

    {{a.item.healthDescription}}

    +
    +
    + {{capitalize a.item.name}} Attributes +
    + {{#if a.item.attributes.attributesStructured}} +
    + {{attributes-table + attributes=a.item.attributesShort + class="attributes-table"}} +
    {{else}} - {{format-duration model.drainStrategy.deadline}} +
    +
    +

    No Driver Attributes

    +
    +
    {{/if}} - - {{#if model.drainStrategy.forceDeadline}} - - Forced Deadline - {{moment-format model.drainStrategy.forceDeadline "MM/DD/YY HH:mm:ss"}} - ({{moment-from-now model.drainStrategy.forceDeadline interval=1000}}) - - {{/if}} - - Ignore System Jobs? - {{if model.drainStrategy.ignoreSystemJobs "Yes" "No"}} - +
    + {{/a.body}} + {{/list-accordion}} +
    +
    + +
    +
    + Attributes +
    +
    + {{attributes-table + data-test-attributes + attributes=model.attributes.attributesStructured + class="attributes-table"}} +
    +
    + Meta +
    + {{#if model.meta.attributesStructured}} +
    + {{attributes-table + data-test-meta + attributes=model.meta.attributesStructured + class="attributes-table"}} +
    + {{else}} +
    +
    +

    No Meta Attributes

    +

    This client is configured with no meta attributes.

    {{/if}} - -
    -
    -
    Allocations {{model.allocations.length}}
    - {{search-box - searchTerm=(mut searchTerm) - placeholder="Search allocations..." - class="is-inline pull-right" - inputClass="is-compact"}} -
    -
    - {{#list-pagination - source=sortedAllocations - size=pageSize - page=currentPage as |p|}} - {{#list-table - source=p.list - sortProperty=sortProperty - sortDescending=sortDescending - class="with-foot" as |t|}} - {{#t.head}} - - {{#t.sort-by prop="shortId"}}ID{{/t.sort-by}} - {{#t.sort-by prop="modifyIndex" title="Modify Index"}}Modified{{/t.sort-by}} - {{#t.sort-by prop="name"}}Name{{/t.sort-by}} - {{#t.sort-by prop="statusIndex"}}Status{{/t.sort-by}} - {{#t.sort-by prop="job.name"}}Job{{/t.sort-by}} - {{#t.sort-by prop="jobVersion"}}Version{{/t.sort-by}} - CPU - Memory - {{/t.head}} - {{#t.body as |row|}} - {{allocation-row - allocation=row.model - context="node" - onClick=(action "gotoAllocation" row.model) - data-test-allocation=row.model.id}} - {{/t.body}} - {{/list-table}} -
    - -
    - {{/list-pagination}} -
    -
    - -
    -
    - Client Events -
    -
    - {{#list-table source=sortedEvents class="is-striped" as |t|}} - {{#t.head}} - Time - Subsystem - Message - {{/t.head}} - {{#t.body as |row|}} - - {{moment-format row.model.time "MM/DD/YY HH:mm:ss"}} - {{row.model.subsystem}} - - {{#if row.model.message}} - {{#if row.model.driver}} - {{row.model.driver}} - {{/if}} - {{row.model.message}} - {{else}} - No message - {{/if}} - - - {{/t.body}} - {{/list-table}} -
    -
    - -
    -
    - Driver Status -
    -
    - {{#list-accordion source=sortedDrivers key="name" as |a|}} - {{#a.head buttonLabel="details" isExpandable=a.item.detected}} -
    -
    - {{a.item.name}} -
    -
    - {{#if a.item.detected}} - - - {{if a.item.healthy "Healthy" "Unhealthy"}} - - {{/if}} -
    -
    - - Detected - {{if a.item.detected "Yes" "No"}} - - - - Last Updated - {{moment-from-now a.item.updateTime interval=1000}} - - -
    -
    - {{/a.head}} - {{#a.body}} -

    {{a.item.healthDescription}}

    -
    -
    - {{capitalize a.item.name}} Attributes -
    - {{#if a.item.attributes.attributesStructured}} -
    - {{attributes-table - attributes=a.item.attributesShort - class="attributes-table"}} -
    - {{else}} -
    -
    -

    No Driver Attributes

    -
    -
    - {{/if}} -
    - {{/a.body}} - {{/list-accordion}} -
    -
    - -
    -
    - Attributes -
    -
    - {{attributes-table - data-test-attributes - attributes=model.attributes.attributesStructured - class="attributes-table"}} -
    -
    - Meta -
    - {{#if model.meta.attributesStructured}} -
    - {{attributes-table - data-test-meta - attributes=model.meta.attributesStructured - class="attributes-table"}} -
    - {{else}} -
    -
    -

    No Meta Attributes

    -

    This client is configured with no meta attributes.

    -
    -
    - {{/if}} -
    -
    -{{/gutter-menu}} +
+
diff --git a/ui/app/templates/clients/index.hbs b/ui/app/templates/clients/index.hbs index 2f7d0894f..528dc6e91 100644 --- a/ui/app/templates/clients/index.hbs +++ b/ui/app/templates/clients/index.hbs @@ -1,60 +1,58 @@ -{{#gutter-menu class="page-body"}} -
- {{#if isForbidden}} - {{partial "partials/forbidden-message"}} - {{else}} - {{#if nodes.length}} -
-
{{search-box searchTerm=(mut searchTerm) placeholder="Search clients..."}}
-
- {{/if}} - {{#list-pagination - source=sortedNodes - size=pageSize - page=currentPage as |p|}} - {{#list-table - source=p.list - sortProperty=sortProperty - sortDescending=sortDescending - class="with-foot" as |t|}} - {{#t.head}} - - {{#t.sort-by prop="id"}}ID{{/t.sort-by}} - {{#t.sort-by class="is-200px is-truncatable" prop="name"}}Name{{/t.sort-by}} - {{#t.sort-by prop="status"}}Status{{/t.sort-by}} - {{#t.sort-by prop="isDraining"}}Drain{{/t.sort-by}} - {{#t.sort-by prop="schedulingEligibility"}}Eligibility{{/t.sort-by}} - Address - {{#t.sort-by prop="datacenter"}}Datacenter{{/t.sort-by}} - # Allocs - {{/t.head}} - {{#t.body as |row|}} - {{client-node-row data-test-client-node-row node=row.model onClick=(action "gotoNode" row.model)}} - {{/t.body}} - {{/list-table}} -
- -
- {{else}} -
- {{#if (eq nodes.length 0)}} -

No Clients

-

- The cluster currently has no client nodes. -

- {{else if searchTerm}} -

No Matches

-

No clients match the term {{searchTerm}}

- {{/if}} -
- {{/list-pagination}} +
+ {{#if isForbidden}} + {{partial "partials/forbidden-message"}} + {{else}} + {{#if nodes.length}} +
+
{{search-box searchTerm=(mut searchTerm) placeholder="Search clients..."}}
+
{{/if}} -
-{{/gutter-menu}} + {{#list-pagination + source=sortedNodes + size=pageSize + page=currentPage as |p|}} + {{#list-table + source=p.list + sortProperty=sortProperty + sortDescending=sortDescending + class="with-foot" as |t|}} + {{#t.head}} + + {{#t.sort-by prop="id"}}ID{{/t.sort-by}} + {{#t.sort-by class="is-200px is-truncatable" prop="name"}}Name{{/t.sort-by}} + {{#t.sort-by prop="status"}}Status{{/t.sort-by}} + {{#t.sort-by prop="isDraining"}}Drain{{/t.sort-by}} + {{#t.sort-by prop="schedulingEligibility"}}Eligibility{{/t.sort-by}} + Address + {{#t.sort-by prop="datacenter"}}Datacenter{{/t.sort-by}} + # Allocs + {{/t.head}} + {{#t.body as |row|}} + {{client-node-row data-test-client-node-row node=row.model onClick=(action "gotoNode" row.model)}} + {{/t.body}} + {{/list-table}} +
+ +
+ {{else}} +
+ {{#if (eq nodes.length 0)}} +

No Clients

+

+ The cluster currently has no client nodes. +

+ {{else if searchTerm}} +

No Matches

+

No clients match the term {{searchTerm}}

+ {{/if}} +
+ {{/list-pagination}} + {{/if}} +
diff --git a/ui/app/templates/clients/loading.hbs b/ui/app/templates/clients/loading.hbs index 3298bc9c0..ae06c3078 100644 --- a/ui/app/templates/clients/loading.hbs +++ b/ui/app/templates/clients/loading.hbs @@ -1,3 +1 @@ -{{#gutter-menu class="page-body"}} -
{{partial "partials/loading-spinner"}}
-{{/gutter-menu}} +
{{partial "partials/loading-spinner"}}
From cd3f8ab1392d6b916d2f21aee6d541b60c3e83b7 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 25 Jul 2018 15:05:24 -0700 Subject: [PATCH 7/8] Use page-layout for allocations routes --- ui/app/templates/allocations.hbs | 7 +- .../allocations/allocation/index.hbs | 192 +++++++++--------- .../allocations/allocation/task/index.hbs | 134 ++++++------ .../allocations/allocation/task/logs.hbs | 10 +- 4 files changed, 167 insertions(+), 176 deletions(-) diff --git a/ui/app/templates/allocations.hbs b/ui/app/templates/allocations.hbs index a766b9ff6..87dfce6a7 100644 --- a/ui/app/templates/allocations.hbs +++ b/ui/app/templates/allocations.hbs @@ -1,6 +1,3 @@ -
- {{#global-header class="page-header"}} - {{app-breadcrumbs}} - {{/global-header}} +{{#page-layout}} {{outlet}} -
+{{/page-layout}} diff --git a/ui/app/templates/allocations/allocation/index.hbs b/ui/app/templates/allocations/allocation/index.hbs index 34389a657..590e3bfaf 100644 --- a/ui/app/templates/allocations/allocation/index.hbs +++ b/ui/app/templates/allocations/allocation/index.hbs @@ -1,100 +1,98 @@ -{{#gutter-menu class="page-body"}} -
-

- Allocation {{model.name}} - {{model.clientStatus}} - {{model.id}} -

+
+

+ Allocation {{model.name}} + {{model.clientStatus}} + {{model.id}} +

-
-
- Allocation Details - Job - {{#link-to "jobs.job" model.job (query-params jobNamespace=model.job.namespace.id) data-test-job-link}}{{model.job.name}}{{/link-to}} - - Client - {{#link-to "clients.client" model.node data-test-client-link}}{{model.node.shortId}}{{/link-to}} - +
+
+ Allocation Details + Job + {{#link-to "jobs.job" model.job (query-params jobNamespace=model.job.namespace.id) data-test-job-link}}{{model.job.name}}{{/link-to}} + + Client + {{#link-to "clients.client" model.node data-test-client-link}}{{model.node.shortId}}{{/link-to}} + +
+
+ +
+
+ Tasks +
+
+ {{#list-table + source=sortedStates + sortProperty=sortProperty + sortDescending=sortDescending + class="is-striped" as |t|}} + {{#t.head}} + + {{#t.sort-by prop="name"}}Name{{/t.sort-by}} + {{#t.sort-by prop="state"}}State{{/t.sort-by}} + Last Event + {{#t.sort-by prop="events.lastObject.time"}}Time{{/t.sort-by}} + Addresses + {{/t.head}} + {{#t.body as |row|}} + + + {{#if (not row.model.driverStatus.healthy)}} + + {{x-icon "warning" class="is-warning"}} + + {{/if}} + + + {{#link-to "allocations.allocation.task" row.model.allocation row.model class="is-primary"}} + {{row.model.name}} + {{/link-to}} + + {{row.model.state}} + + {{#if row.model.events.lastObject.message}} + {{row.model.events.lastObject.message}} + {{else}} + No message + {{/if}} + + {{moment-format row.model.events.lastObject.time "MM/DD/YY HH:mm:ss"}} + +
    + {{#with row.model.resources.networks.firstObject as |network|}} + {{#each network.reservedPorts as |port|}} +
  • + {{port.Label}}: + {{network.ip}}:{{port.Value}} +
  • + {{/each}} + {{#each network.dynamicPorts as |port|}} +
  • + {{port.Label}}: + {{network.ip}}:{{port.Value}} +
  • + {{/each}} + {{/with}} +
+ + + {{/t.body}} + {{/list-table}} +
+
+ + {{#if model.hasRescheduleEvents}} +
+
+ Reschedule Events +
+
+ {{reschedule-event-timeline allocation=model}}
- -
-
- Tasks -
-
- {{#list-table - source=sortedStates - sortProperty=sortProperty - sortDescending=sortDescending - class="is-striped" as |t|}} - {{#t.head}} - - {{#t.sort-by prop="name"}}Name{{/t.sort-by}} - {{#t.sort-by prop="state"}}State{{/t.sort-by}} - Last Event - {{#t.sort-by prop="events.lastObject.time"}}Time{{/t.sort-by}} - Addresses - {{/t.head}} - {{#t.body as |row|}} - - - {{#if (not row.model.driverStatus.healthy)}} - - {{x-icon "warning" class="is-warning"}} - - {{/if}} - - - {{#link-to "allocations.allocation.task" row.model.allocation row.model class="is-primary"}} - {{row.model.name}} - {{/link-to}} - - {{row.model.state}} - - {{#if row.model.events.lastObject.message}} - {{row.model.events.lastObject.message}} - {{else}} - No message - {{/if}} - - {{moment-format row.model.events.lastObject.time "MM/DD/YY HH:mm:ss"}} - -
    - {{#with row.model.resources.networks.firstObject as |network|}} - {{#each network.reservedPorts as |port|}} -
  • - {{port.Label}}: - {{network.ip}}:{{port.Value}} -
  • - {{/each}} - {{#each network.dynamicPorts as |port|}} -
  • - {{port.Label}}: - {{network.ip}}:{{port.Value}} -
  • - {{/each}} - {{/with}} -
- - - {{/t.body}} - {{/list-table}} -
-
- - {{#if model.hasRescheduleEvents}} -
-
- Reschedule Events -
-
- {{reschedule-event-timeline allocation=model}} -
-
- {{/if}} -
-{{/gutter-menu}} + {{/if}} +
diff --git a/ui/app/templates/allocations/allocation/task/index.hbs b/ui/app/templates/allocations/allocation/task/index.hbs index d24ec3819..6746fb05b 100644 --- a/ui/app/templates/allocations/allocation/task/index.hbs +++ b/ui/app/templates/allocations/allocation/task/index.hbs @@ -1,85 +1,83 @@ -{{#gutter-menu class="page-body"}} - {{partial "allocations/allocation/task/subnav"}} -
-

- {{model.name}} - {{model.state}} -

+{{partial "allocations/allocation/task/subnav"}} +
+

+ {{model.name}} + {{model.state}} +

-
-
- Task Details - - Started At - {{moment-format model.startedAt "MM/DD/YY HH:mm:ss"}} - - {{#if model.finishedAt}} - - Finished At - {{moment-format model.finishedAt "MM/DD/YY HH:mm:ss"}} - - {{/if}} +
+
+ Task Details + + Started At + {{moment-format model.startedAt "MM/DD/YY HH:mm:ss"}} + + {{#if model.finishedAt}} - Driver - {{model.task.driver}} + Finished At + {{moment-format model.finishedAt "MM/DD/YY HH:mm:ss"}} -
+ {{/if}} + + Driver + {{model.task.driver}} +
+
- {{#if ports.length}} -
-
- Addresses -
-
- {{#list-table source=ports as |t|}} - {{#t.head}} - Dynamic? - Name - Address - {{/t.head}} - {{#t.body as |row|}} - - {{if row.model.isDynamic "Yes" "No"}} - {{row.model.name}} - - - {{network.ip}}:{{row.model.port}} - - - - {{/t.body}} - {{/list-table}} -
-
- {{/if}} - -
+ {{#if ports.length}} +
- Recent Events + Addresses
- {{#list-table source=(reverse model.events) class="is-striped" as |t|}} + {{#list-table source=ports as |t|}} {{#t.head}} - Time - Type - Description + Dynamic? + Name + Address {{/t.head}} {{#t.body as |row|}} - - {{moment-format row.model.time "MM/DD/YY HH:mm:ss"}} - {{row.model.type}} - - {{#if row.model.message}} - {{row.model.message}} - {{else}} - No message - {{/if}} + + {{if row.model.isDynamic "Yes" "No"}} + {{row.model.name}} + + + {{network.ip}}:{{row.model.port}} + {{/t.body}} {{/list-table}}
-
-{{/gutter-menu}} + {{/if}} + +
+
+ Recent Events +
+
+ {{#list-table source=(reverse model.events) class="is-striped" as |t|}} + {{#t.head}} + Time + Type + Description + {{/t.head}} + {{#t.body as |row|}} + + {{moment-format row.model.time "MM/DD/YY HH:mm:ss"}} + {{row.model.type}} + + {{#if row.model.message}} + {{row.model.message}} + {{else}} + No message + {{/if}} + + + {{/t.body}} + {{/list-table}} +
+
+
diff --git a/ui/app/templates/allocations/allocation/task/logs.hbs b/ui/app/templates/allocations/allocation/task/logs.hbs index 6799e39d6..d9e2e8251 100644 --- a/ui/app/templates/allocations/allocation/task/logs.hbs +++ b/ui/app/templates/allocations/allocation/task/logs.hbs @@ -1,6 +1,4 @@ -{{#gutter-menu class="page-body"}} - {{partial "allocations/allocation/task/subnav"}} -
- {{task-log data-test-task-log allocation=model.allocation task=model.name}} -
-{{/gutter-menu}} +{{partial "allocations/allocation/task/subnav"}} +
+ {{task-log data-test-task-log allocation=model.allocation task=model.name}} +
From 7aeba8007e440e0e5016d2e3e9eed97e5bff4cf7 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 25 Jul 2018 15:19:43 -0700 Subject: [PATCH 8/8] Use page-layout for job routes --- .../components/job-page/parts/body.hbs | 10 +- ui/app/templates/jobs.hbs | 7 +- ui/app/templates/jobs/index.hbs | 116 +++++----- ui/app/templates/jobs/job/definition.hbs | 16 +- ui/app/templates/jobs/job/deployments.hbs | 10 +- ui/app/templates/jobs/job/evaluations.hbs | 93 ++++---- ui/app/templates/jobs/job/loading.hbs | 6 +- ui/app/templates/jobs/job/task-group.hbs | 198 +++++++++--------- ui/app/templates/jobs/job/versions.hbs | 10 +- ui/app/templates/jobs/loading.hbs | 7 +- ui/app/templates/loading.hbs | 11 +- .../integration/job-page/parts/body-test.js | 4 - 12 files changed, 227 insertions(+), 261 deletions(-) diff --git a/ui/app/templates/components/job-page/parts/body.hbs b/ui/app/templates/components/job-page/parts/body.hbs index f139b52ab..4a2b8f89f 100644 --- a/ui/app/templates/components/job-page/parts/body.hbs +++ b/ui/app/templates/components/job-page/parts/body.hbs @@ -1,6 +1,4 @@ -{{#gutter-menu class="page-body"}} - {{partial "jobs/job/subnav"}} -
- {{yield}} -
-{{/gutter-menu}} +{{partial "jobs/job/subnav"}} +
+ {{yield}} +
diff --git a/ui/app/templates/jobs.hbs b/ui/app/templates/jobs.hbs index a766b9ff6..87dfce6a7 100644 --- a/ui/app/templates/jobs.hbs +++ b/ui/app/templates/jobs.hbs @@ -1,6 +1,3 @@ -
- {{#global-header class="page-header"}} - {{app-breadcrumbs}} - {{/global-header}} +{{#page-layout}} {{outlet}} -
+{{/page-layout}} diff --git a/ui/app/templates/jobs/index.hbs b/ui/app/templates/jobs/index.hbs index a18b2b1c8..3985b9f00 100644 --- a/ui/app/templates/jobs/index.hbs +++ b/ui/app/templates/jobs/index.hbs @@ -1,60 +1,58 @@ -{{#gutter-menu class="page-body"}} -
- {{#if isForbidden}} - {{partial "partials/forbidden-message"}} - {{else}} - {{#if filteredJobs.length}} -
-
{{search-box data-test-jobs-search searchTerm=(mut searchTerm) placeholder="Search jobs..."}}
-
- {{/if}} - {{#list-pagination - source=sortedJobs - size=pageSize - page=currentPage as |p|}} - {{#list-table - source=p.list - sortProperty=sortProperty - sortDescending=sortDescending - class="with-foot" as |t|}} - {{#t.head}} - {{#t.sort-by prop="name"}}Name{{/t.sort-by}} - {{#t.sort-by prop="status"}}Status{{/t.sort-by}} - {{#t.sort-by prop="type"}}Type{{/t.sort-by}} - {{#t.sort-by prop="priority"}}Priority{{/t.sort-by}} - Groups - Summary - {{/t.head}} - {{#t.body key="model.id" as |row|}} - {{job-row data-test-job-row job=row.model onClick=(action "gotoJob" row.model)}} - {{/t.body}} - {{/list-table}} -
- -
- {{else}} -
- {{#if (eq filteredJobs.length 0)}} -

No Jobs

-

- The cluster is currently empty. -

- {{else if searchTerm}} -

No Matches

-

No jobs match the term {{searchTerm}}

- {{/if}} -
- {{/list-pagination}} +
+ {{#if isForbidden}} + {{partial "partials/forbidden-message"}} + {{else}} + {{#if filteredJobs.length}} +
+
{{search-box data-test-jobs-search searchTerm=(mut searchTerm) placeholder="Search jobs..."}}
+
{{/if}} -
-{{/gutter-menu}} + {{#list-pagination + source=sortedJobs + size=pageSize + page=currentPage as |p|}} + {{#list-table + source=p.list + sortProperty=sortProperty + sortDescending=sortDescending + class="with-foot" as |t|}} + {{#t.head}} + {{#t.sort-by prop="name"}}Name{{/t.sort-by}} + {{#t.sort-by prop="status"}}Status{{/t.sort-by}} + {{#t.sort-by prop="type"}}Type{{/t.sort-by}} + {{#t.sort-by prop="priority"}}Priority{{/t.sort-by}} + Groups + Summary + {{/t.head}} + {{#t.body key="model.id" as |row|}} + {{job-row data-test-job-row job=row.model onClick=(action "gotoJob" row.model)}} + {{/t.body}} + {{/list-table}} +
+ +
+ {{else}} +
+ {{#if (eq filteredJobs.length 0)}} +

No Jobs

+

+ The cluster is currently empty. +

+ {{else if searchTerm}} +

No Matches

+

No jobs match the term {{searchTerm}}

+ {{/if}} +
+ {{/list-pagination}} + {{/if}} +
diff --git a/ui/app/templates/jobs/job/definition.hbs b/ui/app/templates/jobs/job/definition.hbs index efe10b578..2265ecdbe 100644 --- a/ui/app/templates/jobs/job/definition.hbs +++ b/ui/app/templates/jobs/job/definition.hbs @@ -1,10 +1,8 @@ -{{#gutter-menu class="page-body"}} - {{partial "jobs/job/subnav"}} -
-
-
- {{json-viewer data-test-definition-view json=model.definition}} -
+{{partial "jobs/job/subnav"}} +
+
+
+ {{json-viewer data-test-definition-view json=model.definition}}
-
-{{/gutter-menu}} +
+
diff --git a/ui/app/templates/jobs/job/deployments.hbs b/ui/app/templates/jobs/job/deployments.hbs index bd67069d6..8bc4cb707 100644 --- a/ui/app/templates/jobs/job/deployments.hbs +++ b/ui/app/templates/jobs/job/deployments.hbs @@ -1,6 +1,4 @@ -{{#gutter-menu class="page-body"}} - {{partial "jobs/job/subnav"}} -
- {{job-deployments-stream deployments=model.deployments}} -
-{{/gutter-menu}} +{{partial "jobs/job/subnav"}} +
+ {{job-deployments-stream deployments=model.deployments}} +
diff --git a/ui/app/templates/jobs/job/evaluations.hbs b/ui/app/templates/jobs/job/evaluations.hbs index ca660ff74..212b6ea42 100644 --- a/ui/app/templates/jobs/job/evaluations.hbs +++ b/ui/app/templates/jobs/job/evaluations.hbs @@ -1,49 +1,46 @@ -{{#gutter-menu class="page-body"}} - {{partial "jobs/job/subnav"}} -
-
-
- Evaluations -
-
- {{#if sortedEvaluations.length}} - {{#list-table - source=sortedEvaluations - sortProperty=sortProperty - sortDescending=sortDescending as |t|}} - {{#t.head}} - ID - {{#t.sort-by prop="priority"}}Priority{{/t.sort-by}} - {{#t.sort-by prop="triggeredBy"}}Triggered By{{/t.sort-by}} - {{#t.sort-by prop="status"}}Status{{/t.sort-by}} - {{#t.sort-by prop="hasPlacementFailures"}}Placement Failures{{/t.sort-by}} - {{/t.head}} - {{#t.body as |row|}} - - {{row.model.shortId}} - {{row.model.priority}} - {{row.model.triggeredBy}} - {{row.model.status}} - - {{#if (eq row.model.status "blocked")}} - N/A - In Progress - {{else if row.model.hasPlacementFailures}} - True - {{else}} - False - {{/if}} - - - {{/t.body}} - {{/list-table}} - {{else}} -
-

No Evaluations

-

This is most likely due to garbage collection.

-
- {{/if}} +{{partial "jobs/job/subnav"}} +
+
+
+ Evaluations
-
-
-{{/gutter-menu}} - +
+ {{#if sortedEvaluations.length}} + {{#list-table + source=sortedEvaluations + sortProperty=sortProperty + sortDescending=sortDescending as |t|}} + {{#t.head}} + ID + {{#t.sort-by prop="priority"}}Priority{{/t.sort-by}} + {{#t.sort-by prop="triggeredBy"}}Triggered By{{/t.sort-by}} + {{#t.sort-by prop="status"}}Status{{/t.sort-by}} + {{#t.sort-by prop="hasPlacementFailures"}}Placement Failures{{/t.sort-by}} + {{/t.head}} + {{#t.body as |row|}} + + {{row.model.shortId}} + {{row.model.priority}} + {{row.model.triggeredBy}} + {{row.model.status}} + + {{#if (eq row.model.status "blocked")}} + N/A - In Progress + {{else if row.model.hasPlacementFailures}} + True + {{else}} + False + {{/if}} + + + {{/t.body}} + {{/list-table}} + {{else}} +
+

No Evaluations

+

This is most likely due to garbage collection.

+
+ {{/if}} +
+
+
diff --git a/ui/app/templates/jobs/job/loading.hbs b/ui/app/templates/jobs/job/loading.hbs index a90321c31..911d51173 100644 --- a/ui/app/templates/jobs/job/loading.hbs +++ b/ui/app/templates/jobs/job/loading.hbs @@ -1,4 +1,2 @@ -{{#gutter-menu class="page-body"}} - {{partial "jobs/job/subnav"}} -
{{partial "partials/loading-spinner"}}
-{{/gutter-menu}} +{{partial "jobs/job/subnav"}} +
{{partial "partials/loading-spinner"}}
diff --git a/ui/app/templates/jobs/job/task-group.hbs b/ui/app/templates/jobs/job/task-group.hbs index 3446a306f..0bf01cb84 100644 --- a/ui/app/templates/jobs/job/task-group.hbs +++ b/ui/app/templates/jobs/job/task-group.hbs @@ -1,109 +1,107 @@ -{{#gutter-menu class="page-body"}} -
-
    -
  • {{#link-to "jobs.job.task-group" model.job model activeClass="is-active"}}Overview{{/link-to}}
  • -
+
+
    +
  • {{#link-to "jobs.job.task-group" model.job model activeClass="is-active"}}Overview{{/link-to}}
  • +
+
+
+

+ {{model.name}} +

+ +
+
+ Task Group Details + + # Tasks {{model.tasks.length}} + Reserved CPU {{model.reservedCPU}} MHz + Reserved Memory {{model.reservedMemory}} MiB + Reserved Disk {{model.reservedEphemeralDisk}} MiB +
-
-

- {{model.name}} -

-
-
- Task Group Details - - # Tasks {{model.tasks.length}} - Reserved CPU {{model.reservedCPU}} MHz - Reserved Memory {{model.reservedMemory}} MiB - Reserved Disk {{model.reservedEphemeralDisk}} MiB -
+
+
+
Allocation Status {{allocations.length}}
- -
-
-
Allocation Status {{allocations.length}}
-
-
- {{#allocation-status-bar allocationContainer=model.summary class="split-view" as |chart|}} -
    - {{#each chart.data as |datum index|}} -
  1. - - {{datum.value}} - - {{datum.label}} - -
  2. - {{/each}} -
- {{/allocation-status-bar}} -
+
+ {{#allocation-status-bar allocationContainer=model.summary class="split-view" as |chart|}} +
    + {{#each chart.data as |datum index|}} +
  1. + + {{datum.value}} + + {{datum.label}} + +
  2. + {{/each}} +
+ {{/allocation-status-bar}}
+
-
-
- Allocations - {{search-box - searchTerm=(mut searchTerm) - placeholder="Search allocations..." - class="is-inline pull-right" - inputClass="is-compact"}} -
-
- {{#list-pagination - source=sortedAllocations - size=pageSize - page=currentPage - class="allocations" as |p|}} - {{#list-table - source=p.list - sortProperty=sortProperty - sortDescending=sortDescending - class="with-foot" as |t|}} - {{#t.head}} - - {{#t.sort-by prop="shortId"}}ID{{/t.sort-by}} - {{#t.sort-by prop="modifyIndex" title="Modify Index"}}Modified{{/t.sort-by}} - {{#t.sort-by prop="name"}}Name{{/t.sort-by}} - {{#t.sort-by prop="statusIndex"}}Status{{/t.sort-by}} - {{#t.sort-by prop="jobVersion"}}Version{{/t.sort-by}} - {{#t.sort-by prop="node.shortId"}}Client{{/t.sort-by}} - CPU - Memory - {{/t.head}} - {{#t.body as |row|}} - {{allocation-row data-test-allocation=row.model.id allocation=row.model context="job" onClick=(action "gotoAllocation" row.model)}} - {{/t.body}} - {{/list-table}} -
- +
+
+ Allocations + {{search-box + searchTerm=(mut searchTerm) + placeholder="Search allocations..." + class="is-inline pull-right" + inputClass="is-compact"}} +
+
+ {{#list-pagination + source=sortedAllocations + size=pageSize + page=currentPage + class="allocations" as |p|}} + {{#list-table + source=p.list + sortProperty=sortProperty + sortDescending=sortDescending + class="with-foot" as |t|}} + {{#t.head}} + + {{#t.sort-by prop="shortId"}}ID{{/t.sort-by}} + {{#t.sort-by prop="modifyIndex" title="Modify Index"}}Modified{{/t.sort-by}} + {{#t.sort-by prop="name"}}Name{{/t.sort-by}} + {{#t.sort-by prop="statusIndex"}}Status{{/t.sort-by}} + {{#t.sort-by prop="jobVersion"}}Version{{/t.sort-by}} + {{#t.sort-by prop="node.shortId"}}Client{{/t.sort-by}} + CPU + Memory + {{/t.head}} + {{#t.body as |row|}} + {{allocation-row data-test-allocation=row.model.id allocation=row.model context="job" onClick=(action "gotoAllocation" row.model)}} + {{/t.body}} + {{/list-table}} +
+ +
+ {{else}} + {{#if allocations.length}} +
+
+

No Matches

+

No allocations match the term {{searchTerm}}

+
{{else}} - {{#if allocations.length}} -
-
-

No Matches

-

No allocations match the term {{searchTerm}}

-
+
+
+

No Allocations

+

No allocations have been placed.

- {{else}} -
-
-

No Allocations

-

No allocations have been placed.

-
-
- {{/if}} - {{/list-pagination}} -
+
+ {{/if}} + {{/list-pagination}}
-
-{{/gutter-menu}} +
+
diff --git a/ui/app/templates/jobs/job/versions.hbs b/ui/app/templates/jobs/job/versions.hbs index 7e659a237..9f2d59b10 100644 --- a/ui/app/templates/jobs/job/versions.hbs +++ b/ui/app/templates/jobs/job/versions.hbs @@ -1,6 +1,4 @@ -{{#gutter-menu class="page-body"}} - {{partial "jobs/job/subnav"}} -
- {{job-versions-stream versions=model.versions verbose=true}} -
-{{/gutter-menu}} +{{partial "jobs/job/subnav"}} +
+ {{job-versions-stream versions=model.versions verbose=true}} +
diff --git a/ui/app/templates/jobs/loading.hbs b/ui/app/templates/jobs/loading.hbs index 39002f28a..ae06c3078 100644 --- a/ui/app/templates/jobs/loading.hbs +++ b/ui/app/templates/jobs/loading.hbs @@ -1,6 +1 @@ -{{#global-header class="page-header"}} - {{app-breadcrumbs}} -{{/global-header}} -{{#gutter-menu class="page-body"}} -
{{partial "partials/loading-spinner"}}
-{{/gutter-menu}} +
{{partial "partials/loading-spinner"}}
diff --git a/ui/app/templates/loading.hbs b/ui/app/templates/loading.hbs index 206f1ebac..169d53ffb 100644 --- a/ui/app/templates/loading.hbs +++ b/ui/app/templates/loading.hbs @@ -1,8 +1,3 @@ -
- {{#global-header class="page-header"}} - {{app-breadcrumbs}} - {{/global-header}} - {{#gutter-menu class="page-body"}} -
{{partial "partials/loading-spinner"}}
- {{/gutter-menu}} -
+{{#page-layout}} +
{{partial "partials/loading-spinner"}}
+{{/page-layout}} diff --git a/ui/tests/integration/job-page/parts/body-test.js b/ui/tests/integration/job-page/parts/body-test.js index 3454113ac..6189dce66 100644 --- a/ui/tests/integration/job-page/parts/body-test.js +++ b/ui/tests/integration/job-page/parts/body-test.js @@ -97,10 +97,6 @@ test('body yields content to a section after the subnav', function(assert) { `); return wait().then(() => { - assert.ok( - find('[data-test-page-content] .section > .inner-content'), - 'Content is rendered in a section in a gutter menu' - ); assert.ok( find('[data-test-subnav="job"] + .section > .inner-content'), 'Content is rendered immediately after the subnav'