mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
removing resize behavior from inventory manage page
This commit is contained in:
@@ -848,8 +848,7 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
|
|||||||
GetHostsStatusMsg, GroupsEdit, InventoryUpdate, GroupsCancelUpdate,
|
GetHostsStatusMsg, GroupsEdit, InventoryUpdate, GroupsCancelUpdate,
|
||||||
ViewUpdateStatus, GroupsDelete, Store, HostsEdit, HostsDelete,
|
ViewUpdateStatus, GroupsDelete, Store, HostsEdit, HostsDelete,
|
||||||
EditInventoryProperties, ToggleHostEnabled, Stream, ShowJobSummary,
|
EditInventoryProperties, ToggleHostEnabled, Stream, ShowJobSummary,
|
||||||
InventoryGroupsHelp, HelpDialog, ViewJob, WatchInventoryWindowResize,
|
InventoryGroupsHelp, HelpDialog, ViewJob,
|
||||||
GetHostContainerRows, GetGroupContainerRows, GetGroupContainerHeight,
|
|
||||||
GroupsCopy, HostsCopy, Socket) {
|
GroupsCopy, HostsCopy, Socket) {
|
||||||
|
|
||||||
var PreviousSearchParams,
|
var PreviousSearchParams,
|
||||||
@@ -1000,14 +999,7 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
|
|||||||
scope: $scope
|
scope: $scope
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($(window).width() > 1210) {
|
rows = 20;
|
||||||
$scope.initial_height = GetGroupContainerHeight();
|
|
||||||
$('#groups-container .list-table-container').height($scope.initial_height);
|
|
||||||
rows = GetGroupContainerRows();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
rows = 20;
|
|
||||||
}
|
|
||||||
hostScope.host_page_size = rows;
|
hostScope.host_page_size = rows;
|
||||||
$scope.group_page_size = rows;
|
$scope.group_page_size = rows;
|
||||||
|
|
||||||
@@ -1022,8 +1014,20 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Load data
|
// Load data
|
||||||
SearchInit({ scope: $scope, set: 'groups', list: InventoryGroups, url: $scope.inventory.related.root_groups });
|
SearchInit({
|
||||||
PaginateInit({ scope: $scope, list: InventoryGroups , url: $scope.inventory.related.root_groups, pageSize: rows });
|
scope: $scope,
|
||||||
|
set: 'groups',
|
||||||
|
list: InventoryGroups,
|
||||||
|
url: $scope.inventory.related.root_groups
|
||||||
|
});
|
||||||
|
|
||||||
|
PaginateInit({
|
||||||
|
scope: $scope,
|
||||||
|
list: InventoryGroups ,
|
||||||
|
url: $scope.inventory.related.root_groups,
|
||||||
|
pageSize: rows
|
||||||
|
});
|
||||||
|
|
||||||
$scope.search(InventoryGroups.iterator, null, true);
|
$scope.search(InventoryGroups.iterator, null, true);
|
||||||
|
|
||||||
$scope.$emit('WatchUpdateStatus'); // init socket io conneciton and start watching for status updates
|
$scope.$emit('WatchUpdateStatus'); // init socket io conneciton and start watching for status updates
|
||||||
@@ -1071,12 +1075,6 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
|
|||||||
else {
|
else {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
}
|
}
|
||||||
|
|
||||||
WatchInventoryWindowResize({
|
|
||||||
group_scope: $scope,
|
|
||||||
host_scope: hostScope
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1454,8 +1452,6 @@ InventoriesManage.$inject = ['$log', '$scope', '$rootScope', '$location',
|
|||||||
'GroupsEdit', 'InventoryUpdate', 'GroupsCancelUpdate', 'ViewUpdateStatus',
|
'GroupsEdit', 'InventoryUpdate', 'GroupsCancelUpdate', 'ViewUpdateStatus',
|
||||||
'GroupsDelete', 'Store', 'HostsEdit', 'HostsDelete',
|
'GroupsDelete', 'Store', 'HostsEdit', 'HostsDelete',
|
||||||
'EditInventoryProperties', 'ToggleHostEnabled', 'Stream', 'ShowJobSummary',
|
'EditInventoryProperties', 'ToggleHostEnabled', 'Stream', 'ShowJobSummary',
|
||||||
'InventoryGroupsHelp', 'HelpDialog', 'ViewJob',
|
'InventoryGroupsHelp', 'HelpDialog', 'ViewJob', 'GroupsCopy',
|
||||||
'WatchInventoryWindowResize', 'GetHostContainerRows',
|
|
||||||
'GetGroupContainerRows', 'GetGroupContainerHeight', 'GroupsCopy',
|
|
||||||
'HostsCopy', 'Socket'
|
'HostsCopy', 'Socket'
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -707,11 +707,11 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
|
|||||||
*/
|
*/
|
||||||
.factory('GroupsEdit', ['$rootScope', '$location', '$log', '$routeParams', '$compile', 'Rest', 'Alert', 'GroupForm', 'GenerateForm',
|
.factory('GroupsEdit', ['$rootScope', '$location', '$log', '$routeParams', '$compile', 'Rest', 'Alert', 'GroupForm', 'GenerateForm',
|
||||||
'Prompt', 'ProcessErrors', 'GetBasePath', 'SetNodeName', 'ParseTypeChange', 'GetSourceTypeOptions', 'InventoryUpdate',
|
'Prompt', 'ProcessErrors', 'GetBasePath', 'SetNodeName', 'ParseTypeChange', 'GetSourceTypeOptions', 'InventoryUpdate',
|
||||||
'LookUpInit', 'Empty', 'Wait', 'GetChoices', 'UpdateGroup', 'SourceChange', 'Find', 'WatchInventoryWindowResize',
|
'LookUpInit', 'Empty', 'Wait', 'GetChoices', 'UpdateGroup', 'SourceChange', 'Find',
|
||||||
'ParseVariableString', 'ToJSON', 'GroupsScheduleListInit', 'SourceForm', 'SetSchedulesInnerDialogSize', 'CreateSelect2',
|
'ParseVariableString', 'ToJSON', 'GroupsScheduleListInit', 'SourceForm', 'SetSchedulesInnerDialogSize', 'CreateSelect2',
|
||||||
function ($rootScope, $location, $log, $routeParams, $compile, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors,
|
function ($rootScope, $location, $log, $routeParams, $compile, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors,
|
||||||
GetBasePath, SetNodeName, ParseTypeChange, GetSourceTypeOptions, InventoryUpdate, LookUpInit, Empty, Wait,
|
GetBasePath, SetNodeName, ParseTypeChange, GetSourceTypeOptions, InventoryUpdate, LookUpInit, Empty, Wait,
|
||||||
GetChoices, UpdateGroup, SourceChange, Find, WatchInventoryWindowResize, ParseVariableString, ToJSON, GroupsScheduleListInit,
|
GetChoices, UpdateGroup, SourceChange, Find, ParseVariableString, ToJSON, GroupsScheduleListInit,
|
||||||
SourceForm, SetSchedulesInnerDialogSize, CreateSelect2) {
|
SourceForm, SetSchedulesInnerDialogSize, CreateSelect2) {
|
||||||
return function (params) {
|
return function (params) {
|
||||||
|
|
||||||
@@ -1230,7 +1230,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
|
|||||||
parent_scope.removeAddTreeRefreshed = parent_scope.$on('GroupTreeRefreshed', function() {
|
parent_scope.removeAddTreeRefreshed = parent_scope.$on('GroupTreeRefreshed', function() {
|
||||||
// Clean up
|
// Clean up
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
WatchInventoryWindowResize();
|
|
||||||
if (modal_scope.searchCleanUp) {
|
if (modal_scope.searchCleanUp) {
|
||||||
modal_scope.searchCleanup();
|
modal_scope.searchCleanup();
|
||||||
}
|
}
|
||||||
@@ -2124,7 +2124,6 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
|
|||||||
});
|
});
|
||||||
$('#status-modal-dialog').dialog('destroy');
|
$('#status-modal-dialog').dialog('destroy');
|
||||||
$('#inventory-modal-container').empty();
|
$('#inventory-modal-container').empty();
|
||||||
//WatchInventoryWindowResize();
|
|
||||||
},
|
},
|
||||||
open: function () {
|
open: function () {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
|
|||||||
@@ -173,9 +173,9 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
|
|||||||
}])
|
}])
|
||||||
|
|
||||||
.factory('HostsReload', [ '$routeParams', 'Empty', 'InventoryHosts', 'GetBasePath', 'SearchInit', 'PaginateInit', 'Wait',
|
.factory('HostsReload', [ '$routeParams', 'Empty', 'InventoryHosts', 'GetBasePath', 'SearchInit', 'PaginateInit', 'Wait',
|
||||||
'SetHostStatus', 'SetStatus', 'ApplyEllipsis', 'SetContainerHeights', 'GetHostContainerRows',
|
'SetHostStatus', 'SetStatus', 'ApplyEllipsis',
|
||||||
function($routeParams, Empty, InventoryHosts, GetBasePath, SearchInit, PaginateInit, Wait, SetHostStatus, SetStatus,
|
function($routeParams, Empty, InventoryHosts, GetBasePath, SearchInit, PaginateInit, Wait, SetHostStatus, SetStatus,
|
||||||
ApplyEllipsis, SetContainerHeights) {
|
ApplyEllipsis) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
|
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
@@ -208,9 +208,6 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Size containers based on viewport
|
|
||||||
SetContainerHeights({ scope: scope, reloadHosts: false });
|
|
||||||
|
|
||||||
SearchInit({ scope: scope, set: 'hosts', list: list, url: url });
|
SearchInit({ scope: scope, set: 'hosts', list: list, url: url });
|
||||||
PaginateInit({ scope: scope, list: list, url: url, pageSize: pageSize });
|
PaginateInit({ scope: scope, list: list, url: url, pageSize: pageSize });
|
||||||
|
|
||||||
@@ -408,7 +405,6 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
|
|||||||
inventory_id: parent_scope.inventory_id
|
inventory_id: parent_scope.inventory_id
|
||||||
});
|
});
|
||||||
|
|
||||||
//WatchInventoryWindowResize();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
@@ -446,7 +442,7 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
|
|||||||
};
|
};
|
||||||
|
|
||||||
scope.cancelModal = function() {
|
scope.cancelModal = function() {
|
||||||
// WatchInventoryWindowResize();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -181,8 +181,7 @@ export default
|
|||||||
])
|
])
|
||||||
|
|
||||||
.factory('ShowJobSummary', ['Rest', 'Wait', 'GetBasePath', 'FormatDate', 'ProcessErrors', 'GenerateForm', 'JobSummary',
|
.factory('ShowJobSummary', ['Rest', 'Wait', 'GetBasePath', 'FormatDate', 'ProcessErrors', 'GenerateForm', 'JobSummary',
|
||||||
'WatchInventoryWindowResize',
|
function (Rest, Wait, GetBasePath, FormatDate, ProcessErrors, GenerateForm, JobSummary) {
|
||||||
function (Rest, Wait, GetBasePath, FormatDate, ProcessErrors, GenerateForm, JobSummary, WatchInventoryWindowResize) {
|
|
||||||
return function (params) {
|
return function (params) {
|
||||||
// Display status info in a modal dialog- called from inventory edit page
|
// Display status info in a modal dialog- called from inventory edit page
|
||||||
|
|
||||||
@@ -261,7 +260,6 @@ export default
|
|||||||
});
|
});
|
||||||
$('#status-modal-dialog').dialog('destroy');
|
$('#status-modal-dialog').dialog('destroy');
|
||||||
$('#inventory-modal-container').empty();
|
$('#inventory-modal-container').empty();
|
||||||
WatchInventoryWindowResize();
|
|
||||||
},
|
},
|
||||||
open: function () {
|
open: function () {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
|
|||||||
@@ -17,109 +17,7 @@ export default
|
|||||||
angular.module('InventoryHelper', ['RestServices', 'Utilities', 'OrganizationListDefinition', listGenerator.name, 'AuthService',
|
angular.module('InventoryHelper', ['RestServices', 'Utilities', 'OrganizationListDefinition', listGenerator.name, 'AuthService',
|
||||||
'InventoryHelper', 'InventoryFormDefinition', 'ParseHelper', 'SearchHelper', 'VariablesHelper',
|
'InventoryHelper', 'InventoryFormDefinition', 'ParseHelper', 'SearchHelper', 'VariablesHelper',
|
||||||
])
|
])
|
||||||
|
|
||||||
.factory('GetGroupContainerHeight', [ function() {
|
|
||||||
return function() {
|
|
||||||
|
|
||||||
/*console.log('window height: ' + $(window).height());
|
|
||||||
console.log('main-menu: ' + $('.main-menu').outerHeight());
|
|
||||||
console.log('main_tabs: ' + $('#main_tabs').outerHeight());
|
|
||||||
console.log('breadcrumbs: ' + $('#breadcrumbs').outerHeight());
|
|
||||||
console.log('footer: ' + $('.site-footer').outerHeight());
|
|
||||||
console.log('group-breadcrumbs: ' + $('.group-breadcrumbs').outerHeight());
|
|
||||||
console.log('searchwidget: ' + $('#groups-container #search-widget-container').outerHeight());
|
|
||||||
console.log('group table head: ' + $('#groups_table thead').height());
|
|
||||||
console.log('subtotal: ' + ( $(window).height() - $('.main-menu').outerHeight() - $('#main_tabs').outerHeight() - $('#breadcrumbs').outerHeight() -
|
|
||||||
$('.site-footer').outerHeight() - $('.group-breadcrumbs').outerHeight() - $('#groups-container #search-widget-container').outerHeight() -
|
|
||||||
$('#groups_table thead').height() ));
|
|
||||||
*/
|
|
||||||
var height = $(window).height() - $('#main-menu-container .navbar').outerHeight() - $('#breadcrumbs').outerHeight() -
|
|
||||||
$('.site-footer').outerHeight() - $('.group-breadcrumbs').outerHeight() - $('#groups-container #search-widget-container').outerHeight() -
|
|
||||||
$('#groups_table thead').height() - 90;
|
|
||||||
height = (height < 600) ? 600 : height;
|
|
||||||
return height;
|
|
||||||
};
|
|
||||||
}])
|
|
||||||
|
|
||||||
.factory('GetHostContainerRows', [ function() {
|
|
||||||
return function() {
|
|
||||||
var height, rows;
|
|
||||||
height = $('#hosts-container .list-well').height() - $('#hosts-constainer .list-well .row').height() - $('#hosts_table thead').height();
|
|
||||||
rows = Math.floor(height / 44) - 2;
|
|
||||||
// rows = (rows < 20) ? 20 : rows;
|
|
||||||
return rows;
|
|
||||||
};
|
|
||||||
}])
|
|
||||||
|
|
||||||
.factory('GetGroupContainerRows', [ function() {
|
|
||||||
return function() {
|
|
||||||
var height, rows;
|
|
||||||
height = $('#groups-container .list-table-container').height();
|
|
||||||
rows = Math.floor(height / 44) - 2;
|
|
||||||
// rows = (rows < 20) ? 20 : rows;
|
|
||||||
return rows;
|
|
||||||
};
|
|
||||||
}])
|
|
||||||
|
|
||||||
.factory('SetContainerHeights', [ 'GetGroupContainerHeight', 'GetHostContainerRows', function(GetGroupContainerHeight, GetHostContainerRows) {
|
|
||||||
return function(params) {
|
|
||||||
var group_scope = params.group_scope,
|
|
||||||
host_scope = params.host_scope,
|
|
||||||
reloadHosts = (params.reloadHosts) ? true : false,
|
|
||||||
height, rows;
|
|
||||||
|
|
||||||
$('#groups-container .list-table-container').height('auto');
|
|
||||||
$('#hosts-container .list-well').height('auto');
|
|
||||||
$('#hosts-container .list-table-container').height('auto');
|
|
||||||
|
|
||||||
setTimeout(function() {
|
|
||||||
if ($(window).width() > 1210) {
|
|
||||||
height = GetGroupContainerHeight();
|
|
||||||
$('#groups-container .list-table-container').height(height);
|
|
||||||
$('#hosts-container .list-table-container').height(height);
|
|
||||||
setTimeout(function() { $('#hosts-container .list-well').height( $('#groups-container .list-well').outerHeight()); }, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reloadHosts) {
|
|
||||||
// we need ro recalc the the page size
|
|
||||||
if ($(window).width() > 1210) {
|
|
||||||
rows = GetHostContainerRows();
|
|
||||||
host_scope.host_page_size = rows;
|
|
||||||
group_scope.group_page_size = rows;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// on small screens we go back to the default
|
|
||||||
host_scope.host_page_size = 20;
|
|
||||||
group_scope.group_page_size = 20;
|
|
||||||
}
|
|
||||||
host_scope.changePageSize('hosts', 'host');
|
|
||||||
group_scope.changePageSize('groups', 'group');
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
|
|
||||||
};
|
|
||||||
}])
|
|
||||||
|
|
||||||
.factory('WatchInventoryWindowResize', ['ApplyEllipsis', 'SetContainerHeights',
|
|
||||||
function (ApplyEllipsis, SetContainerHeights) {
|
|
||||||
return function (params) {
|
|
||||||
// Call to set or restore window resize
|
|
||||||
var group_scope = params.group_scope,
|
|
||||||
host_scope = params.host_scope;
|
|
||||||
$(window).off("resize");
|
|
||||||
$(window).resize(_.debounce(function() {
|
|
||||||
ApplyEllipsis('#groups_table .group-name a');
|
|
||||||
ApplyEllipsis('#hosts_table .host-name a');
|
|
||||||
SetContainerHeights({
|
|
||||||
group_scope: group_scope,
|
|
||||||
host_scope: host_scope,
|
|
||||||
reloadHosts: true
|
|
||||||
});
|
|
||||||
}, 500));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
.factory('SaveInventory', ['InventoryForm', 'Rest', 'Alert', 'ProcessErrors', 'LookUpInit', 'OrganizationList',
|
.factory('SaveInventory', ['InventoryForm', 'Rest', 'Alert', 'ProcessErrors', 'LookUpInit', 'OrganizationList',
|
||||||
'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON',
|
'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON',
|
||||||
function (InventoryForm, Rest, Alert, ProcessErrors, LookUpInit, OrganizationList, GetBasePath, ParseTypeChange, Wait,
|
function (InventoryForm, Rest, Alert, ProcessErrors, LookUpInit, OrganizationList, GetBasePath, ParseTypeChange, Wait,
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default
|
|||||||
label: 'Hosts',
|
label: 'Hosts',
|
||||||
ngClick: "editHost(host.id)",
|
ngClick: "editHost(host.id)",
|
||||||
ngClass: "{ 'host-disabled-label': !host.enabled }",
|
ngClass: "{ 'host-disabled-label': !host.enabled }",
|
||||||
columnClass: 'col-lg-6 col-md-9 col-sm-9 col-xs-7',
|
columnClass: 'col-lg-6 col-md-8 col-sm-8 col-xs-7',
|
||||||
dataHostId: "{{ host.id }}",
|
dataHostId: "{{ host.id }}",
|
||||||
dataType: "host"
|
dataType: "host"
|
||||||
},
|
},
|
||||||
@@ -52,7 +52,7 @@ export default
|
|||||||
|
|
||||||
fieldActions: {
|
fieldActions: {
|
||||||
|
|
||||||
columnClass: 'col-lg-6 col-md-3 col-sm-3 col-xs-5 text-right',
|
columnClass: 'col-lg-6 col-md-4 col-sm-4 col-xs-5 text-right',
|
||||||
label: false,
|
label: false,
|
||||||
|
|
||||||
active_failures: {
|
active_failures: {
|
||||||
|
|||||||
Reference in New Issue
Block a user