mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
refactor: compute jobClientStatus in summary backing class component
This commit is contained in:
@@ -1,13 +1,22 @@
|
||||
import Component from '@ember/component';
|
||||
import { action, computed } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { classNames } from '@ember-decorators/component';
|
||||
import classic from 'ember-classic-decorator';
|
||||
import jobClientStatus from 'nomad-ui/utils/properties/job-client-status';
|
||||
|
||||
@classic
|
||||
@classNames('boxed-section')
|
||||
export default class JobClientStatusSummary extends Component {
|
||||
@service store;
|
||||
|
||||
@jobClientStatus('nodes', 'job') jobClientStatus;
|
||||
|
||||
get nodes() {
|
||||
return this.store.peekAll('node');
|
||||
}
|
||||
|
||||
job = null;
|
||||
jobClientStatus = null;
|
||||
gotoClients() {}
|
||||
|
||||
@computed
|
||||
|
||||
@@ -18,10 +18,7 @@
|
||||
</span>
|
||||
</:before-namespace>
|
||||
</jobPage.ui.StatsBox>
|
||||
<jobPage.ui.JobClientStatusSummary
|
||||
@gotoClients={{this.gotoClients}}
|
||||
@jobClientStatus={{this.jobClientStatus}}
|
||||
/>
|
||||
<jobPage.ui.JobClientStatusSummary @gotoClients={{this.gotoClients}} />
|
||||
<jobPage.ui.Summary @forceCollapsed={{@job.hasClientStatus}} />
|
||||
<jobPage.ui.PlacementFailures />
|
||||
<jobPage.ui.TaskGroups
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{#if @job.hasClientStatus}}
|
||||
{{#if this.job.hasClientStatus}}
|
||||
<ListAccordion
|
||||
data-test-job-summary
|
||||
@source={{array this.job}}
|
||||
@@ -35,6 +35,7 @@
|
||||
</div>
|
||||
</a.head>
|
||||
<a.body>
|
||||
{{debugger}}
|
||||
<JobClientStatusBar
|
||||
@onSliceClick={{action this.onSliceClick}}
|
||||
@job={{this.job}}
|
||||
|
||||
Reference in New Issue
Block a user