mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 19:37:38 -02:30
Removed old failed hosts logic. Added logic to hide panels where more than two are present
This commit is contained in:
committed by
Jared Tabor
parent
0b6a5b14a3
commit
db8b36a057
@@ -93,6 +93,10 @@ body {
|
|||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.Panel-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.btn{
|
.btn{
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ export default {
|
|||||||
iconOnly: true,
|
iconOnly: true,
|
||||||
awToolTip: "{{ group.hosts_status_tip }}",
|
awToolTip: "{{ group.hosts_status_tip }}",
|
||||||
dataPlacement: "top",
|
dataPlacement: "top",
|
||||||
ngClick: "showFailedHosts(group)",
|
|
||||||
icon: "{{ 'fa icon-job-' + group.hosts_status_class }}",
|
icon: "{{ 'fa icon-job-' + group.hosts_status_class }}",
|
||||||
columnClass: 'status-column List-staticColumn--smallStatus'
|
columnClass: 'status-column List-staticColumn--smallStatus'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -183,15 +183,13 @@
|
|||||||
$scope.cancelUpdate = function (id) {
|
$scope.cancelUpdate = function (id) {
|
||||||
GroupsCancelUpdate({ scope: $scope, id: id });
|
GroupsCancelUpdate({ scope: $scope, id: id });
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.viewUpdateStatus = function (id) {
|
$scope.viewUpdateStatus = function (id) {
|
||||||
ViewUpdateStatus({
|
ViewUpdateStatus({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
group_id: id
|
group_id: id
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
$scope.showFailedHosts = function() {
|
|
||||||
// TODO: implement
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.copyMoveGroup = function(id){
|
$scope.copyMoveGroup = function(id){
|
||||||
$state.go('inventories.edit.groups.copyMoveGroup', {group_id: id, groups: $stateParams.groups});
|
$state.go('inventories.edit.groups.copyMoveGroup', {group_id: id, groups: $stateParams.groups});
|
||||||
|
|||||||
@@ -167,15 +167,14 @@
|
|||||||
$scope.cancelUpdate = function (id) {
|
$scope.cancelUpdate = function (id) {
|
||||||
GroupsCancelUpdate({ scope: $scope, id: id });
|
GroupsCancelUpdate({ scope: $scope, id: id });
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.viewUpdateStatus = function (id) {
|
$scope.viewUpdateStatus = function (id) {
|
||||||
ViewUpdateStatus({
|
ViewUpdateStatus({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
group_id: id
|
group_id: id
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
$scope.showFailedHosts = function() {
|
|
||||||
// TODO: implement
|
|
||||||
};
|
|
||||||
// $scope.$parent governed by InventoryManageController, for unified multiSelect options
|
// $scope.$parent governed by InventoryManageController, for unified multiSelect options
|
||||||
$scope.$on('multiSelectList.selectionChanged', (event, selection) => {
|
$scope.$on('multiSelectList.selectionChanged', (event, selection) => {
|
||||||
$scope.$parent.groupsSelected = selection.length > 0 ? true : false;
|
$scope.$parent.groupsSelected = selection.length > 0 ? true : false;
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ export default {
|
|||||||
iconOnly: true,
|
iconOnly: true,
|
||||||
awToolTip: "{{ nested_group.hosts_status_tip }}",
|
awToolTip: "{{ nested_group.hosts_status_tip }}",
|
||||||
dataPlacement: "top",
|
dataPlacement: "top",
|
||||||
ngClick: "showFailedHosts(nested_group)",
|
|
||||||
icon: "{{ 'fa icon-job-' + nested_group.hosts_status_class }}",
|
icon: "{{ 'fa icon-job-' + nested_group.hosts_status_class }}",
|
||||||
columnClass: 'status-column List-staticColumn--smallStatus'
|
columnClass: 'status-column List-staticColumn--smallStatus'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<div class="tab-pane" id="inventories-panel">
|
<div class="tab-pane" id="inventories-panel">
|
||||||
|
<aw-limit-panels max-panels="2" panel-container="inventories-panel"></aw-limit-panels>
|
||||||
<div ui-view="copyMove"></div>
|
<div ui-view="copyMove"></div>
|
||||||
<div ui-view="adhocForm"></div>
|
<div ui-view="adhocForm"></div>
|
||||||
<div ui-view="hostForm"></div>
|
<div ui-view="hostForm"></div>
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
export default ['$rootScope', function($rootScope) {
|
||||||
|
return {
|
||||||
|
restrict: 'E',
|
||||||
|
scope: {
|
||||||
|
maxPanels: '@',
|
||||||
|
panelContainer: '@'
|
||||||
|
},
|
||||||
|
link: function(scope) {
|
||||||
|
|
||||||
|
scope.maxPanels = parseInt(scope.maxPanels);
|
||||||
|
|
||||||
|
$rootScope.$on('$stateChangeSuccess', function() {
|
||||||
|
let panels = angular.element('#' + scope.panelContainer).find('.Panel');
|
||||||
|
|
||||||
|
if(panels.length > scope.maxPanels) {
|
||||||
|
// hide the excess panels
|
||||||
|
$(panels).each(function( index ) {
|
||||||
|
if(index+1 > scope.maxPanels) {
|
||||||
|
$(this).addClass('Panel-hidden');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// show all the panels
|
||||||
|
$(panels).removeClass('Panel-hidden');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}];
|
||||||
5
awx/ui/client/src/shared/limit-panels/main.js
Normal file
5
awx/ui/client/src/shared/limit-panels/main.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import directive from './limit-panels.directive';
|
||||||
|
|
||||||
|
export default
|
||||||
|
angular.module('LimitPanelsModule', [])
|
||||||
|
.directive('awLimitPanels', directive);
|
||||||
@@ -30,6 +30,7 @@ import PromptDialog from './prompt-dialog';
|
|||||||
import directives from './directives';
|
import directives from './directives';
|
||||||
import features from './features/main';
|
import features from './features/main';
|
||||||
import orgAdminLookup from './org-admin-lookup/main';
|
import orgAdminLookup from './org-admin-lookup/main';
|
||||||
|
import limitPanels from './limit-panels/main';
|
||||||
import 'angular-duration-format';
|
import 'angular-duration-format';
|
||||||
|
|
||||||
export default
|
export default
|
||||||
@@ -57,6 +58,7 @@ angular.module('shared', [listGenerator.name,
|
|||||||
filters.name,
|
filters.name,
|
||||||
features.name,
|
features.name,
|
||||||
orgAdminLookup.name,
|
orgAdminLookup.name,
|
||||||
|
limitPanels.name,
|
||||||
require('angular-cookies'),
|
require('angular-cookies'),
|
||||||
'angular-duration-format'
|
'angular-duration-format'
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user