mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
More route work and directive
This commit is contained in:
@@ -437,12 +437,14 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
|
|||||||
|
|
||||||
.factory('HostsEdit', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm',
|
.factory('HostsEdit', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm',
|
||||||
'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait', 'Find', 'SetStatus', 'ApplyEllipsis',
|
'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait', 'Find', 'SetStatus', 'ApplyEllipsis',
|
||||||
'ToJSON', 'ParseVariableString', 'CreateDialog', 'TextareaResize',
|
'ToJSON', 'ParseVariableString', 'CreateDialog', 'TextareaResize', 'ScopePass',
|
||||||
function($rootScope, $location, $log, $stateParams, Rest, Alert, HostForm, GenerateForm, Prompt, ProcessErrors,
|
function($rootScope, $location, $log, $stateParams, Rest, Alert, HostForm, GenerateForm, Prompt, ProcessErrors,
|
||||||
GetBasePath, HostsReload, ParseTypeChange, Wait, Find, SetStatus, ApplyEllipsis, ToJSON,
|
GetBasePath, HostsReload, ParseTypeChange, Wait, Find, SetStatus, ApplyEllipsis, ToJSON,
|
||||||
ParseVariableString, CreateDialog, TextareaResize) {
|
ParseVariableString, CreateDialog, TextareaResize, ScopePass) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
|
ScopePass.set(params);
|
||||||
|
var passing = ScopePass.get();
|
||||||
|
console.info(passing);
|
||||||
var parent_scope = params.host_scope,
|
var parent_scope = params.host_scope,
|
||||||
group_scope = params.group_scope,
|
group_scope = params.group_scope,
|
||||||
host_id = params.host_id,
|
host_id = params.host_id,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<div class="tab-pane" id="inventory_edit">
|
<div class="tab-pane" id="inventory_edit">
|
||||||
<ui-view/>
|
<div ui-view="manage" class="manage">
|
||||||
<div ui-view class="manage">In the ui view
|
|
||||||
<manage-hosts></manage-hosts>
|
|
||||||
</div>
|
</div>
|
||||||
<div ng-cloak id="htmlTemplate">
|
<div ng-cloak id="htmlTemplate">
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ import manageHostsDirective from './manage-hosts/manage-hosts.directive';
|
|||||||
import manageHostsRoute from './manage-hosts/manage-hosts.route';
|
import manageHostsRoute from './manage-hosts/manage-hosts.route';
|
||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('inventoryManage', [])
|
angular.module('inventoryManage', [])
|
||||||
.directive('manageHosts', manageHostsDirective)
|
.directive('manageHosts', manageHostsDirective)
|
||||||
.run(['$stateExtender', function($stateExtender) {
|
.run(['$stateExtender', function($stateExtender) {
|
||||||
$stateExtender.addState(route);
|
$stateExtender.addState(route);
|
||||||
$stateExtender.addState(manageHostsRoute);
|
$stateExtender.addState(manageHostsRoute);
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
13
awx/ui/client/src/inventories/manage/manage-hosts/main.js
Normal file
13
awx/ui/client/src/inventories/manage/manage-hosts/main.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Copyright (c) 2015 Ansible, Inc.
|
||||||
|
*
|
||||||
|
* All Rights Reserved
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
import route from './manage-hosts.route';
|
||||||
|
|
||||||
|
export default
|
||||||
|
angular.module('manageHosts', [])
|
||||||
|
.run(['$stateExtender', function($stateExtender) {
|
||||||
|
$stateExtender.addState(route);
|
||||||
|
}]);
|
||||||
@@ -5,16 +5,18 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
function manageHostDirectiveController($q, $rootScope, $scope, $state,
|
function manageHostDirectiveController($q, $rootScope, $scope, $state,
|
||||||
$stateParams, $compile, Rest, ProcessErrors,
|
$stateParams, $compile, ScopePass, Rest, ProcessErrors,
|
||||||
CreateDialog, GetBasePath, Wait, GenerateList, GroupList, SearchInit,
|
CreateDialog, GetBasePath, Wait, GenerateList, GroupList, SearchInit,
|
||||||
PaginateInit, GetRootGroups) {
|
PaginateInit, GetRootGroups) {
|
||||||
|
|
||||||
var vm = this;
|
var vm = this;
|
||||||
|
console.info(ScopePass);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ['$q', '$rootScope', '$scope', '$state', '$stateParams',
|
export default ['$q', '$rootScope', '$scope', '$state', '$stateParams',
|
||||||
'ScopePass', '$compile', 'Rest', 'ProcessErrors', 'CreateDialog',
|
'ScopePass', '$compile', 'ScopePass', 'Rest', 'ProcessErrors', 'CreateDialog',
|
||||||
'GetBasePath', 'Wait', 'generateList', 'GroupList', 'SearchInit',
|
'GetBasePath', 'Wait', 'generateList', 'GroupList', 'SearchInit',
|
||||||
'PaginateInit', 'GetRootGroups', manageHostDirectiveController
|
'PaginateInit', 'GetRootGroups',
|
||||||
|
manageHostDirectiveController
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ export default ['templateUrl',
|
|||||||
link: function(scope, element, attrs) {
|
link: function(scope, element, attrs) {
|
||||||
|
|
||||||
},
|
},
|
||||||
// controller: manageHostsController,
|
controller: manageHostsController,
|
||||||
// controllerAs: 'vm',
|
controllerAs: 'vm',
|
||||||
// bindToController: true
|
bindToController: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -4,23 +4,31 @@
|
|||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
import {
|
// import {
|
||||||
templateUrl
|
// templateUrl
|
||||||
} from '../../../shared/template-url/template-url.factory';
|
// } from '../../../shared/template-url/template-url.factory';
|
||||||
|
|
||||||
|
import manageHostDirectiveController from './manage-hosts.controller'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'inventoryManage.manageHosts',
|
name: 'inventoryManage.manageHosts',
|
||||||
route: '/managehosts',
|
route: '/managehosts',
|
||||||
template: 'SOMETHING',
|
//template: '<div>SOMETHING</div>',
|
||||||
|
views: {
|
||||||
|
"manage@inventoryManage" : {
|
||||||
|
template: '<div>the template from route</div>'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// data: {
|
// data: {
|
||||||
// activityStream: true,
|
// activityStream: true,
|
||||||
// activityStreamTarget: 'inventory',
|
// activityStreamTarget: 'inventory',
|
||||||
// activityStreamId: 'inventory_id'
|
// activityStreamId: 'inventory_id'
|
||||||
// },
|
// },
|
||||||
// ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
// label: "INVENTORY MANAGE"
|
label: "INVENTORY MANAGE"
|
||||||
// },
|
},
|
||||||
|
controller: manageHostDirectiveController,
|
||||||
// resolve: {
|
// resolve: {
|
||||||
// features: ['FeaturesService', function(FeaturesService) {
|
// features: ['FeaturesService', function(FeaturesService) {
|
||||||
// return FeaturesService.get();
|
// return FeaturesService.get();
|
||||||
|
|||||||
@@ -871,4 +871,20 @@ angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter'])
|
|||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
]);
|
])
|
||||||
|
.factory('ScopePass', function() {
|
||||||
|
var savedData = {}
|
||||||
|
|
||||||
|
function set(data) {
|
||||||
|
savedData = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
return savedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
set: set,
|
||||||
|
get: get
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user