mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
Merge pull request #2078 from marshmalien/fix/869-instance-groups-jobs-link
Add "running jobs" and "total jobs" links to instances and instance groups
This commit is contained in:
commit
85aeb799dc
@ -16,8 +16,7 @@ export default {
|
||||
job_search: {
|
||||
value: {
|
||||
page_size: '10',
|
||||
order_by: '-id',
|
||||
status: 'running'
|
||||
order_by: '-finished'
|
||||
},
|
||||
dynamic: true
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ export default {
|
||||
name: 'instanceGroups.instanceJobs',
|
||||
url: '/:instance_group_id/instances/:instance_id/jobs',
|
||||
ncyBreadcrumb: {
|
||||
parent: 'instanceGroups.edit',
|
||||
parent: 'instanceGroups.instances',
|
||||
label: N_('JOBS')
|
||||
},
|
||||
views: {
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
{{ labelValue }}
|
||||
</div>
|
||||
<div class="at-RowItem-label" ng-if="labelValue && labelState">
|
||||
<a ui-sref="{{ labelState }}" ui-sref-opts="{reload: true, notify: true}">{{ labelValue }}</a>
|
||||
<a ui-sref="{{ labelState }}" ui-sref-opts="{reload: true, notify: true, inherit: false}">{{ labelValue }}</a>
|
||||
</div>
|
||||
<div class="at-RowItem-value" ng-if="value && valueLink">
|
||||
<a ng-href="{{ valueLink }}">{{ value }}</a>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
function CapacityAdjuster (templateUrl, ProcessErrors, Wait) {
|
||||
function CapacityAdjuster (templateUrl, ProcessErrors, Wait, strings) {
|
||||
return {
|
||||
scope: {
|
||||
state: '=',
|
||||
@ -9,10 +9,10 @@ function CapacityAdjuster (templateUrl, ProcessErrors, Wait) {
|
||||
replace: true,
|
||||
link: function(scope) {
|
||||
const adjustment_values = [{
|
||||
label: 'CPU',
|
||||
label: strings.get('capacityAdjuster.CPU'),
|
||||
value: scope.state.cpu_capacity,
|
||||
},{
|
||||
label: 'RAM',
|
||||
label: strings.get('capacityAdjuster.RAM'),
|
||||
value: scope.state.mem_capacity
|
||||
}];
|
||||
|
||||
@ -51,7 +51,8 @@ function CapacityAdjuster (templateUrl, ProcessErrors, Wait) {
|
||||
CapacityAdjuster.$inject = [
|
||||
'templateUrl',
|
||||
'ProcessErrors',
|
||||
'Wait'
|
||||
'Wait',
|
||||
'InstanceGroupsStrings'
|
||||
];
|
||||
|
||||
export default CapacityAdjuster;
|
||||
@ -3,12 +3,10 @@
|
||||
<div ui-view="add"></div>
|
||||
<div ui-view="edit"></div>
|
||||
|
||||
<div ui-view="instanceJobs"></div>
|
||||
<div ui-view="instanceJobsContainer"></div>
|
||||
|
||||
<div ui-view="instances"></div>
|
||||
|
||||
<div ui-view="instanceJobsContainer"></div>
|
||||
|
||||
<div ui-view="instanceGroupsJobsContainer"></div>
|
||||
|
||||
<div ui-view="list"></div>
|
||||
|
||||
@ -10,7 +10,11 @@ function InstanceGroupsStrings (BaseString) {
|
||||
};
|
||||
|
||||
ns.list = {
|
||||
PANEL_TITLE: t.s('INSTANCE GROUPS')
|
||||
PANEL_TITLE: t.s('INSTANCE GROUPS'),
|
||||
ROW_ITEM_LABEL_INSTANCES: t.s('Instances'),
|
||||
ROW_ITEM_LABEL_RUNNING_JOBS: t.s('Running Jobs'),
|
||||
ROW_ITEM_LABEL_TOTAL_JOBS: t.s('Total Jobs'),
|
||||
ROW_ITEM_LABEL_USED_CAPACITY: t.s('Used Capacity')
|
||||
};
|
||||
|
||||
ns.tab = {
|
||||
@ -33,6 +37,11 @@ function InstanceGroupsStrings (BaseString) {
|
||||
IS_OFFLINE_LABEL: t.s('Unavailable')
|
||||
};
|
||||
|
||||
ns.capacityAdjuster = {
|
||||
CPU: t.s('CPU'),
|
||||
RAM: t.s('RAM')
|
||||
};
|
||||
|
||||
ns.jobs = {
|
||||
PANEL_TITLE: t.s('Jobs')
|
||||
};
|
||||
|
||||
@ -61,17 +61,24 @@
|
||||
<div class="at-Row-items">
|
||||
<at-row-item header-value="{{ instance.hostname }}"></at-row-item>
|
||||
<at-row-item
|
||||
label-value="Running Jobs"
|
||||
label-state="instanceGroups.instanceJobs({instance_group_id: {{vm.instance_group_id}}, instance_id: {{instance.id}}})"
|
||||
label-value="{{:: vm.strings.get('list.ROW_ITEM_LABEL_RUNNING_JOBS') }}"
|
||||
label-state="instanceGroups.instanceJobs({instance_group_id: {{vm.instance_group_id}}, instance_id: {{instance.id}}, job_search: {status__in: ['running,waiting']}})"
|
||||
value="{{ instance.jobs_running }}"
|
||||
inline="true"
|
||||
badge="true">
|
||||
</at-row-item>
|
||||
<at-row-item
|
||||
label-value="{{:: vm.strings.get('list.ROW_ITEM_LABEL_TOTAL_JOBS') }}"
|
||||
label-state="instanceGroups.instanceJobs({instance_group_id: {{vm.instance_group_id}}, instance_id: {{instance.id}}})"
|
||||
value="{{ instance.jobs_total }}"
|
||||
inline="true"
|
||||
badge="true">
|
||||
</at-row-item>
|
||||
</div>
|
||||
|
||||
<div class="at-Row-actions">
|
||||
<capacity-adjuster state="instance" disabled="{{vm.rowAction.capacity_adjustment._disabled}}"></capacity-adjuster>
|
||||
<capacity-bar label-value="Used Capacity" capacity="instance.consumed_capacity" total-capacity="instance.capacity"></capacity-bar>
|
||||
<capacity-bar label-value="{{:: vm.strings.get('list.ROW_ITEM_LABEL_USED_CAPACITY') }}" capacity="instance.consumed_capacity" total-capacity="instance.capacity"></capacity-bar>
|
||||
</div>
|
||||
</at-row>
|
||||
</at-list>
|
||||
|
||||
@ -45,25 +45,31 @@
|
||||
|
||||
<div class="at-Row--inline">
|
||||
<at-row-item
|
||||
label-value="Instances"
|
||||
label-value="{{:: vm.strings.get('list.ROW_ITEM_LABEL_INSTANCES') }}"
|
||||
label-link="/#/instance_groups/{{ instance_group.id }}/instances"
|
||||
value="{{ instance_group.instances }}"
|
||||
inline="true"
|
||||
badge="true">
|
||||
</at-row-item>
|
||||
|
||||
<at-row-item
|
||||
label-value="Running Jobs"
|
||||
label-link="/#/instance_groups/{{ instance_group.id }}/jobs"
|
||||
label-value="{{:: vm.strings.get('list.ROW_ITEM_LABEL_RUNNING_JOBS') }}"
|
||||
label-state="instanceGroups.jobs({instance_group_id: {{ instance_group.id }}, job_search: {status__in: ['running,waiting']}})"
|
||||
value="{{ instance_group.jobs_running }}"
|
||||
inline="true"
|
||||
badge="true">
|
||||
</at-row-item>
|
||||
<at-row-item
|
||||
label-value="{{:: vm.strings.get('list.ROW_ITEM_LABEL_TOTAL_JOBS') }}"
|
||||
label-state="instanceGroups.jobs({instance_group_id: {{ instance_group.id }}})"
|
||||
value="{{ instance_group.jobs_total }}"
|
||||
inline="true"
|
||||
badge="true">
|
||||
</at-row-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="at-Row-actions">
|
||||
<capacity-bar label-value="Used Capacity" capacity="instance_group.consumed_capacity" total-capacity="instance_group.capacity"></capacity-bar>
|
||||
<capacity-bar label-value="{{:: vm.strings.get('list.ROW_ITEM_LABEL_USED_CAPACITY') }}" capacity="instance_group.consumed_capacity" total-capacity="instance_group.capacity"></capacity-bar>
|
||||
<at-row-action icon="fa-trash" ng-click="vm.deleteInstanceGroup(instance_group)" ng-if="vm.rowAction.trash(instance_group)">
|
||||
</at-row-action>
|
||||
</div>
|
||||
|
||||
@ -10,9 +10,10 @@ export default [function() {
|
||||
const maxPanels = parseInt(scope.maxPanels);
|
||||
|
||||
scope.$watch(
|
||||
() => angular.element('#' + scope.panelContainer).find('.Panel').length,
|
||||
() => angular.element('#' + scope.panelContainer).find('.Panel, .at-Panel').length,
|
||||
() => {
|
||||
const panels = angular.element('#' + scope.panelContainer).find('.Panel');
|
||||
const panels = angular.element('#' + scope.panelContainer).find('.Panel, .at-Panel');
|
||||
|
||||
if(panels.length > maxPanels) {
|
||||
// hide the excess panels
|
||||
$(panels).each(function( index ) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user