mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 11:50:42 -03:30
More route work and directive
This commit is contained in:
parent
66b96ced38
commit
632f3ca567
@ -437,12 +437,14 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
|
||||
|
||||
.factory('HostsEdit', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm',
|
||||
'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,
|
||||
GetBasePath, HostsReload, ParseTypeChange, Wait, Find, SetStatus, ApplyEllipsis, ToJSON,
|
||||
ParseVariableString, CreateDialog, TextareaResize) {
|
||||
ParseVariableString, CreateDialog, TextareaResize, ScopePass) {
|
||||
return function(params) {
|
||||
|
||||
ScopePass.set(params);
|
||||
var passing = ScopePass.get();
|
||||
console.info(passing);
|
||||
var parent_scope = params.host_scope,
|
||||
group_scope = params.group_scope,
|
||||
host_id = params.host_id,
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<div class="tab-pane" id="inventory_edit">
|
||||
<ui-view/>
|
||||
<div ui-view class="manage">In the ui view
|
||||
<manage-hosts></manage-hosts>
|
||||
<div ui-view="manage" class="manage">
|
||||
|
||||
</div>
|
||||
<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';
|
||||
|
||||
export default
|
||||
angular.module('inventoryManage', [])
|
||||
angular.module('inventoryManage', [])
|
||||
.directive('manageHosts', manageHostsDirective)
|
||||
.run(['$stateExtender', function($stateExtender) {
|
||||
$stateExtender.addState(route);
|
||||
$stateExtender.addState(manageHostsRoute);
|
||||
}]);
|
||||
.run(['$stateExtender', function($stateExtender) {
|
||||
$stateExtender.addState(route);
|
||||
$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,
|
||||
$stateParams, $compile, Rest, ProcessErrors,
|
||||
$stateParams, $compile, ScopePass, Rest, ProcessErrors,
|
||||
CreateDialog, GetBasePath, Wait, GenerateList, GroupList, SearchInit,
|
||||
PaginateInit, GetRootGroups) {
|
||||
|
||||
var vm = this;
|
||||
var vm = this;
|
||||
console.info(ScopePass);
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
export default ['$q', '$rootScope', '$scope', '$state', '$stateParams',
|
||||
'ScopePass', '$compile', 'Rest', 'ProcessErrors', 'CreateDialog',
|
||||
'ScopePass', '$compile', 'ScopePass', 'Rest', 'ProcessErrors', 'CreateDialog',
|
||||
'GetBasePath', 'Wait', 'generateList', 'GroupList', 'SearchInit',
|
||||
'PaginateInit', 'GetRootGroups', manageHostDirectiveController
|
||||
'PaginateInit', 'GetRootGroups',
|
||||
manageHostDirectiveController
|
||||
];
|
||||
|
||||
@ -17,9 +17,9 @@ export default ['templateUrl',
|
||||
link: function(scope, element, attrs) {
|
||||
|
||||
},
|
||||
// controller: manageHostsController,
|
||||
// controllerAs: 'vm',
|
||||
// bindToController: true
|
||||
controller: manageHostsController,
|
||||
controllerAs: 'vm',
|
||||
bindToController: true
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
@ -4,23 +4,31 @@
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
import {
|
||||
templateUrl
|
||||
} from '../../../shared/template-url/template-url.factory';
|
||||
// import {
|
||||
// templateUrl
|
||||
// } from '../../../shared/template-url/template-url.factory';
|
||||
|
||||
import manageHostDirectiveController from './manage-hosts.controller'
|
||||
|
||||
export default {
|
||||
name: 'inventoryManage.manageHosts',
|
||||
route: '/managehosts',
|
||||
template: 'SOMETHING',
|
||||
//template: '<div>SOMETHING</div>',
|
||||
views: {
|
||||
"manage@inventoryManage" : {
|
||||
template: '<div>the template from route</div>'
|
||||
}
|
||||
},
|
||||
|
||||
// data: {
|
||||
// activityStream: true,
|
||||
// activityStreamTarget: 'inventory',
|
||||
// activityStreamId: 'inventory_id'
|
||||
// },
|
||||
// ncyBreadcrumb: {
|
||||
// label: "INVENTORY MANAGE"
|
||||
// },
|
||||
ncyBreadcrumb: {
|
||||
label: "INVENTORY MANAGE"
|
||||
},
|
||||
controller: manageHostDirectiveController,
|
||||
// resolve: {
|
||||
// features: ['FeaturesService', function(FeaturesService) {
|
||||
// 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
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user