mirror of
https://github.com/ansible/awx.git
synced 2026-01-27 08:31:28 -03:30
UI-Router: inventories manage, with nested groups
containing their own routes
This commit is contained in:
parent
5e777bd992
commit
c06250fc57
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@ export function InventoriesList($scope, $rootScope, $location, $log,
|
||||
$routeParams, $compile, $filter, sanitizeFilter, Rest, Alert, InventoryList, generateList,
|
||||
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
||||
ClearScope, ProcessErrors, GetBasePath, Wait, Stream,
|
||||
EditInventoryProperties, Find, Empty, LogViewer) {
|
||||
EditInventoryProperties, Find, Empty, LogViewer, $state) {
|
||||
|
||||
var list = InventoryList,
|
||||
defaultUrl = GetBasePath('inventory'),
|
||||
@ -312,7 +312,8 @@ export function InventoriesList($scope, $rootScope, $location, $log,
|
||||
};
|
||||
|
||||
$scope.addInventory = function () {
|
||||
$location.path($location.path() + '/add');
|
||||
// $location.path($location.path() + '/add');
|
||||
$state.go('inventories.add');
|
||||
};
|
||||
|
||||
$scope.editInventory = function (id) {
|
||||
@ -369,7 +370,7 @@ export function InventoriesList($scope, $rootScope, $location, $log,
|
||||
|
||||
InventoriesList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', '$compile', '$filter', 'sanitizeFilter', 'Rest', 'Alert', 'InventoryList', 'generateList',
|
||||
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
|
||||
'GetBasePath', 'Wait', 'Stream', 'EditInventoryProperties', 'Find', 'Empty', 'LogViewer'
|
||||
'GetBasePath', 'Wait', 'Stream', 'EditInventoryProperties', 'Find', 'Empty', 'LogViewer', '$state'
|
||||
];
|
||||
|
||||
|
||||
@ -792,14 +793,14 @@ InventoriesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$lo
|
||||
|
||||
|
||||
export function InventoriesManage ($log, $scope, $rootScope, $location,
|
||||
$routeParams, $compile, generateList, ClearScope, Empty, Wait, Rest, Alert,
|
||||
$state, $compile, generateList, ClearScope, Empty, Wait, Rest, Alert,
|
||||
LoadBreadCrumbs, GetBasePath, ProcessErrors, Breadcrumbs, InventoryGroups,
|
||||
InjectHosts, Find, HostsReload, SearchInit, PaginateInit, GetSyncStatusMsg,
|
||||
GetHostsStatusMsg, GroupsEdit, InventoryUpdate, GroupsCancelUpdate,
|
||||
ViewUpdateStatus, GroupsDelete, Store, HostsEdit, HostsDelete,
|
||||
EditInventoryProperties, ToggleHostEnabled, Stream, ShowJobSummary,
|
||||
InventoryGroupsHelp, HelpDialog, ViewJob,
|
||||
GroupsCopy, HostsCopy, transitionTo) {
|
||||
GroupsCopy, HostsCopy, $stateParams) {
|
||||
|
||||
var PreviousSearchParams,
|
||||
url,
|
||||
@ -1040,7 +1041,7 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
|
||||
});
|
||||
|
||||
// Load Inventory
|
||||
url = GetBasePath('inventory') + $routeParams.inventory_id + '/';
|
||||
url = GetBasePath('inventory') + $stateParams.inventory_id + '/';
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function (data) {
|
||||
@ -1132,7 +1133,13 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
|
||||
};
|
||||
|
||||
$scope.groupSelect = function(id) {
|
||||
var group = Find({ list: $scope.groups, key: 'id', val: id });
|
||||
var groups = [], group = Find({ list: $scope.groups, key: 'id', val: id });
|
||||
if($state.params.groups){
|
||||
groups.push($state.params.groups);
|
||||
}
|
||||
groups.push(group.id);
|
||||
groups = groups.join();
|
||||
$state.transitionTo('inventoriesManage', {inventory_id: $state.params.inventory_id, groups: groups}, { notify: false });
|
||||
$scope.group_breadcrumbs.push(group);
|
||||
setActiveGroupBreadcrumb();
|
||||
loadGroups(group.related.children, group.id);
|
||||
@ -1401,7 +1408,7 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
|
||||
|
||||
|
||||
InventoriesManage.$inject = ['$log', '$scope', '$rootScope', '$location',
|
||||
'$routeParams', '$compile', 'generateList', 'ClearScope', 'Empty', 'Wait',
|
||||
'$state', '$compile', 'generateList', 'ClearScope', 'Empty', 'Wait',
|
||||
'Rest', 'Alert', 'LoadBreadCrumbs', 'GetBasePath', 'ProcessErrors',
|
||||
'Breadcrumbs', 'InventoryGroups', 'InjectHosts', 'Find', 'HostsReload',
|
||||
'SearchInit', 'PaginateInit', 'GetSyncStatusMsg', 'GetHostsStatusMsg',
|
||||
@ -1409,5 +1416,5 @@ InventoriesManage.$inject = ['$log', '$scope', '$rootScope', '$location',
|
||||
'GroupsDelete', 'Store', 'HostsEdit', 'HostsDelete',
|
||||
'EditInventoryProperties', 'ToggleHostEnabled', 'Stream', 'ShowJobSummary',
|
||||
'InventoryGroupsHelp', 'HelpDialog', 'ViewJob', 'GroupsCopy',
|
||||
'HostsCopy', 'transitionTo'
|
||||
'HostsCopy', '$stateParams'
|
||||
];
|
||||
|
||||
@ -22,9 +22,9 @@
|
||||
* @description
|
||||
*/
|
||||
export default
|
||||
['$rootScope', '$cookieStore', 'transitionTo', 'CreateDialog', 'Authorization',
|
||||
['$rootScope', '$cookieStore', 'CreateDialog', 'Authorization',
|
||||
'Store', '$interval', '$location', '$q',
|
||||
function ($rootScope, $cookieStore, transitionTo, CreateDialog, Authorization,
|
||||
function ($rootScope, $cookieStore, CreateDialog, Authorization,
|
||||
Store, $interval, $location, $q) {
|
||||
return {
|
||||
|
||||
|
||||
@ -16,4 +16,5 @@ export default {
|
||||
}
|
||||
$(".LoginModal-dialog").remove();
|
||||
}]
|
||||
|
||||
};
|
||||
|
||||
@ -13,7 +13,7 @@ import logoutRoute from './logout.route';
|
||||
export default
|
||||
angular.module('login', [authentication.name, loginModal.name])
|
||||
.config(['$routeProvider', function($routeProvider) {
|
||||
var url = loginRoute.route;
|
||||
var url = loginRoute.url;
|
||||
delete loginRoute.route;
|
||||
$routeProvider.when(url, loginRoute);
|
||||
url = logoutRoute.route;
|
||||
|
||||
@ -87,7 +87,7 @@
|
||||
</a>
|
||||
<a class="MainMenu-item MainMenu-item--notMobile MainMenu-item--left"
|
||||
id="main_menu_inventories_link"
|
||||
href="/#/inventories"
|
||||
ui-sref="inventories"
|
||||
ng-class="{'is-currentRoute' : isCurrentRoute('inventories'), 'is-loggedOut' : !$root.current_user.username}">
|
||||
<span class="MainMenu-itemText">
|
||||
INVENTORIES
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<div class="tab-pane" id="inventories">
|
||||
<div ui-view></div>
|
||||
<div ng-cloak id="htmlTemplate"></div>
|
||||
<div id="inventory-edit-modal-dialog"></div>
|
||||
<div id="scan-jobs-list" style="padding-top:40px"></div>
|
||||
|
||||
14
awx/ui/client/src/partials/inventory-add.html
Normal file
14
awx/ui/client/src/partials/inventory-add.html
Normal file
@ -0,0 +1,14 @@
|
||||
<div class="tab-pane" id="inventories-add">
|
||||
|
||||
<div ng-cloak id="htmlTemplate"></div>
|
||||
<div id="inventory-edit-modal-dialog"></div>
|
||||
<div id="scan-jobs-list" style="padding-top:40px"></div>
|
||||
<div ng-include="'/static/partials/logviewer.html'"></div>
|
||||
<div id="copy-job-modal" style="display:none">
|
||||
<form name="copy_form" id="copy_form">
|
||||
What would you like to name the copy of job template <b><span id=job_name></span></b>?<br>
|
||||
<input id="new_copy_name" name="new_copy_name" ng-model ="new_copy_name" ng-required="true" class="form-control ng-pristine ng-invalid-required ng-invalid" style="margin-top:10px;">
|
||||
<div class="error survey_error ng-hide" ng-show="copy_form.new_copy_name.$dirty && copy_form.new_copy_name.$error.required">Please enter a name for this job template copy.</div></input>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@ -46,7 +46,8 @@
|
||||
<div class="container-fluid" id="#content-container">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div ng-view id="main-view"></div>
|
||||
<!-- <div ng-view id="main-view"></div> -->
|
||||
<div ui-view id="main-view"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -171,7 +172,8 @@
|
||||
save one fact scan (snapshot) per time window (frequency).
|
||||
For example, facts older than 30 days are purged, while one
|
||||
weekly fact scan is kept.<br>
|
||||
Caution: Setting both numerical variables to "0" will delete all facts.<br></div>
|
||||
Caution: Setting both numerical variables to "0" will delete all facts.<br>
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label for="description">
|
||||
<span class="label-text">
|
||||
@ -211,7 +213,7 @@
|
||||
prompt_for_days_facts_form.granularity_keep_amount.$error.min ||
|
||||
prompt_for_days_facts_form.granularity_keep_amount.$error.max)">Please enter an integer<span ng-show="prompt_for_days_facts_form.granularity_keep_amount.$dirty && prompt_for_days_facts_form.granularity_keep_amount.$error.min"> that is not negative</span><span ng-show="prompt_for_days_facts_form.granularity_keep_amount.$dirty && prompt_for_days_facts_form.granularity_keep_amount.$error.max"> that is lower than 9999</span>.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -220,7 +222,7 @@
|
||||
<div class="overlay"></div>
|
||||
<div class="spinny"><i class="fa fa-cog fa-spin fa-2x"></i> <p>working...</p></div>
|
||||
|
||||
<div class="site-footer"></div>
|
||||
<!-- <div class="site-footer"></div> -->
|
||||
<tower-footer></tower-footer>
|
||||
<script>
|
||||
// HACK: Need this to support global-dependent
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user