-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create sysbatch pages and components
- Loading branch information
Showing
14 changed files
with
131 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Component from '@ember/component'; | ||
import { computed } from '@ember/object'; | ||
import { inject as service } from '@ember/service'; | ||
import { classNames } from '@ember-decorators/component'; | ||
import classic from 'ember-classic-decorator'; | ||
|
||
@classic | ||
@classNames('boxed-section') | ||
export default class JobClientSummary extends Component { | ||
@service store; | ||
|
||
job = null; | ||
jobClientStatus = null; | ||
|
||
@computed | ||
get isExpanded() { | ||
const storageValue = window.localStorage.nomadExpandJobClientSummary; | ||
return storageValue != null ? JSON.parse(storageValue) : true; | ||
} | ||
|
||
persist(item, isOpen) { | ||
window.localStorage.nomadExpandJobClientSummary = isOpen; | ||
this.notifyPropertyChange('isExpanded'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import AbstractJobPage from './abstract'; | ||
import classic from 'ember-classic-decorator'; | ||
import { inject as service } from '@ember/service'; | ||
import jobClientStatus from 'nomad-ui/utils/properties/job-client-status'; | ||
|
||
@classic | ||
export default class Sysbatch extends AbstractJobPage { | ||
@service store; | ||
|
||
@jobClientStatus('nodes', 'job') jobClientStatus; | ||
|
||
get nodes() { | ||
return this.store.peekAll('node'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
import AbstractJobPage from './abstract'; | ||
import classic from 'ember-classic-decorator'; | ||
import { inject as service } from '@ember/service'; | ||
import jobClientStatus from 'nomad-ui/utils/properties/job-client-status'; | ||
|
||
@classic | ||
export default class System extends AbstractJobPage {} | ||
export default class System extends AbstractJobPage { | ||
@service store; | ||
|
||
@jobClientStatus('nodes', 'job') jobClientStatus; | ||
|
||
get nodes() { | ||
return this.store.peekAll('node'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import Route from '@ember/routing/route'; | ||
|
||
export default class ClientsRoute extends Route {} | ||
export default class ClientsRoute extends Route { | ||
// TODO: add watcher for nodes. | ||
} |
35 changes: 35 additions & 0 deletions
35
ui/app/templates/components/job-page/parts/job-client-summary.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<ListAccordion data-test-job-summary @source={{array this.job}} @key="id" @startExpanded={{this.isExpanded}} @onToggle={{action this.persist}} as |a|> | ||
<a.head @buttonLabel={{if a.isOpen "collapse" "expand"}}> | ||
<div class="columns"> | ||
<div class="column is-minimum nowrap"> | ||
Job Status in Client | ||
<span class="badge {{if a.isOpen "is-white" "is-light"}}"> | ||
{{this.jobClientStatus.totalNodes}} | ||
</span> | ||
</div> | ||
|
||
{{#unless a.isOpen}} | ||
<div class="column"> | ||
<div class="inline-chart bumper-left"> | ||
<ClientStatusBar @jobClientStatus={{this.jobClientStatus}} @isNarrow={{true}} /> | ||
</div> | ||
</div> | ||
{{/unless}} | ||
</div> | ||
</a.head> | ||
<a.body> | ||
<ClientStatusBar @jobClientStatus={{this.jobClientStatus}} class="split-view" as |chart|> | ||
<ol data-test-legend class="legend"> | ||
{{#each chart.data as |datum index|}} | ||
<li class="{{datum.className}} {{if (eq datum.label chart.activeDatum.label) "is-active"}} {{if (eq datum.value 0) "is-empty"}}"> | ||
<span class="color-swatch {{if datum.className datum.className (concat "swatch-" index)}}" /> | ||
<span class="value" data-test-legend-value="{{datum.className}}">{{datum.value}}</span> | ||
<span class="label"> | ||
{{datum.label}} | ||
</span> | ||
</li> | ||
{{/each}} | ||
</ol> | ||
</ClientStatusBar> | ||
</a.body> | ||
</ListAccordion> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<JobPage::Parts::Body @job={{this.job}}> | ||
<JobPage::Parts::Error @errorMessage={{this.errorMessage}} @onDismiss={{action "clearErrorMessage"}} /> | ||
|
||
<JobPage::Parts::Title @job={{this.job}} @handleError={{action "handleError"}} /> | ||
|
||
<div class="boxed-section job-stats"> | ||
<div class="boxed-section-body"> | ||
<span data-test-job-stat="type"><strong>Type:</strong> {{this.job.type}} | </span> | ||
<span data-test-job-stat="priority"><strong>Priority:</strong> {{this.job.priority}} </span> | ||
{{#if (and this.job.namespace this.system.shouldShowNamespaces)}} | ||
<span data-test-job-stat="namespace"> | <strong>Namespace:</strong> {{this.job.namespace.name}}</span> | ||
{{/if}} | ||
</div> | ||
</div> | ||
|
||
<JobPage::Parts::JobClientSummary @job={{this.job}} @jobClientStatus={{this.jobClientStatus}} /> | ||
|
||
<JobPage::Parts::Summary @job={{this.job}} @forceCollapsed=true /> | ||
|
||
<JobPage::Parts::PlacementFailures @job={{this.job}} /> | ||
|
||
<JobPage::Parts::TaskGroups | ||
@job={{this.job}} | ||
@sortProperty={{this.sortProperty}} | ||
@sortDescending={{this.sortDescending}} | ||
@gotoTaskGroup={{this.gotoTaskGroup}} /> | ||
|
||
<JobPage::Parts::RecentAllocations @job={{this.job}} /> | ||
</JobPage::Parts::Body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters