mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 19:05:42 +03:00
refact: move gotoClients logic down to component
This commit is contained in:
@@ -8,6 +8,7 @@ import jobClientStatus from 'nomad-ui/utils/properties/job-client-status';
|
||||
@classic
|
||||
@classNames('boxed-section')
|
||||
export default class JobClientStatusSummary extends Component {
|
||||
@service router;
|
||||
@service store;
|
||||
|
||||
@jobClientStatus('nodes', 'job') jobClientStatus;
|
||||
@@ -17,7 +18,16 @@ export default class JobClientStatusSummary extends Component {
|
||||
}
|
||||
|
||||
job = null;
|
||||
gotoClients() {}
|
||||
|
||||
@action
|
||||
gotoClients(statusFilter) {
|
||||
this.router.transitionTo('jobs.job.clients', this.job, {
|
||||
queryParams: {
|
||||
status: JSON.stringify(statusFilter),
|
||||
namespace: this.job.get('namespace.name'),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@computed
|
||||
get isExpanded() {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { inject as service } from '@ember/service';
|
||||
import { alias } from '@ember/object/computed';
|
||||
import Controller from '@ember/controller';
|
||||
import { alias } from '@ember/object/computed';
|
||||
import { inject as service } from '@ember/service';
|
||||
import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting';
|
||||
import { action } from '@ember/object';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
@@ -29,14 +28,4 @@ export default class IndexController extends Controller.extend(
|
||||
|
||||
sortProperty = 'name';
|
||||
sortDescending = false;
|
||||
|
||||
@action
|
||||
gotoClients(statusFilter) {
|
||||
this.transitionToRoute('jobs.job.clients', this.job, {
|
||||
queryParams: {
|
||||
status: JSON.stringify(statusFilter),
|
||||
namespace: this.job.get('namespace.name'),
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</span>
|
||||
</:before-namespace>
|
||||
</jobPage.ui.StatsBox>
|
||||
<jobPage.ui.JobClientStatusSummary @gotoClients={{this.gotoClients}} />
|
||||
<jobPage.ui.JobClientStatusSummary />
|
||||
<jobPage.ui.Summary @forceCollapsed={{@job.hasClientStatus}} />
|
||||
<jobPage.ui.PlacementFailures />
|
||||
<jobPage.ui.TaskGroups @sortProperty={{@sortProperty}} @sortDescending={{@sortDescending}} />
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</span>
|
||||
</:before-namespace>
|
||||
</jobPage.ui.StatsBox>
|
||||
<jobPage.ui.JobClientStatusSummary @gotoClients={{@gotoClients}} />
|
||||
<jobPage.ui.JobClientStatusSummary />
|
||||
<jobPage.ui.Summary @forceCollapsed={{@job.hasClientStatus}} />
|
||||
<jobPage.ui.PlacementFailures />
|
||||
<jobPage.ui.TaskGroups @sortProperty={{@sortProperty}} @sortDescending={{@sortDescending}} />
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<jobPage.ui.Error />
|
||||
<jobPage.ui.Title />
|
||||
<jobPage.ui.StatsBox />
|
||||
<jobPage.ui.JobClientStatusSummary @gotoClients={{@gotoClients}} />
|
||||
<jobPage.ui.JobClientStatusSummary />
|
||||
<jobPage.ui.Summary @forceCollapsed="true" />
|
||||
<jobPage.ui.PlacementFailures />
|
||||
<jobPage.ui.TaskGroups @sortProperty={{@sortProperty}} @sortDescending={{@sortDescending}} />
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<jobPage.ui.Title />
|
||||
<jobPage.ui.StatsBox />
|
||||
<jobPage.ui.DasRecommendations />
|
||||
<jobPage.ui.JobClientStatusSummary @gotoClients={{@gotoClients}} />
|
||||
<jobPage.ui.JobClientStatusSummary />
|
||||
<jobPage.ui.Summary @forceCollapsed="true" />
|
||||
<jobPage.ui.PlacementFailures />
|
||||
<jobPage.ui.TaskGroups @sortProperty={{@sortProperty}} @sortDescending={{@sortDescending}} />
|
||||
|
||||
@@ -5,5 +5,4 @@
|
||||
sortProperty=this.sortProperty
|
||||
sortDescending=this.sortDescending
|
||||
currentPage=this.currentPage
|
||||
gotoClients=(action "gotoClients")
|
||||
}}
|
||||
Reference in New Issue
Block a user