mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
feat: add sliceClick to job-page/summary
This commit is contained in:
@@ -1,14 +1,32 @@
|
||||
import Component from '@ember/component';
|
||||
import { computed } from '@ember/object';
|
||||
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';
|
||||
|
||||
@classic
|
||||
@classNames('boxed-section')
|
||||
export default class Summary extends Component {
|
||||
@service router;
|
||||
|
||||
job = null;
|
||||
forceCollapsed = false;
|
||||
|
||||
@action
|
||||
gotoAllocations(status) {
|
||||
this.router.transitionTo('jobs.job.allocations', this.job, {
|
||||
queryParams: {
|
||||
status: JSON.stringify(status),
|
||||
namespace: this.job.get('namespace.name'),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@action
|
||||
onSliceClick(ev, slice) {
|
||||
this.gotoAllocations([slice.label.camelize()]);
|
||||
}
|
||||
|
||||
@computed('forceCollapsed')
|
||||
get isExpanded() {
|
||||
if (this.forceCollapsed) return false;
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
(if a.item.hasChildren "children-status-bar" "allocation-status-bar")
|
||||
allocationContainer=a.item.summary
|
||||
job=a.item.summary
|
||||
onSliceClick=this.onSliceClick
|
||||
class="split-view" as |chart|
|
||||
}}
|
||||
<ol data-test-legend class="legend">
|
||||
|
||||
Reference in New Issue
Block a user