Collapsed node module

The nodes module had no real reason to exist separately from the
existing root module. I've removed it, and transferred the relevant
states and controllers to the root application module.

Also, this patch cleans up the index.html file, which tried to load
to javascript files that it shouldn't have.

Change-Id: I034aadaa2339b348fb67a170c789e11cf77fe104
This commit is contained in:
Michael Krotscheck 2015-12-07 11:51:59 -08:00
parent c6ac80fbb9
commit ab199892db
4 changed files with 47 additions and 60 deletions

View File

@ -25,12 +25,6 @@
<script type="application/javascript" src="js/openstack.js"></script>
<!-- The Ironic-Webclient root application -->
<script type="application/javascript" src="js/ironic.js"></script>
<!-- Port handling for the Ironic UI -->
<script type="application/javascript" src="js/ports.js"></script>
<!-- Driver handling for the Ironic UI -->
<script type="application/javascript" src="js/drivers.js"></script>
<!-- Node handling for the Ironic UI -->
<script type="application/javascript" src="js/nodes.js"></script>
<!-- UI Utilities used by the ironic client -->
<script type="application/javascript" src="js/util.js"></script>
<!-- A module of resources that talk with the ironic API -->

View File

@ -0,0 +1,25 @@
/*
* Copyright (c) 2015 Hewlett Packard Enterprise Development Company, L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/**
* Node handling for the Ironic UI.
*/
angular.module('ironic').controller('NodeDetailController',
function($scope, node) {
'use strict';
var vm = this;
vm.node = node;
});

View File

@ -20,8 +20,7 @@
* This module defines dependencies and root routes, but no actual
* functionality.
*/
angular.module('ironic', ['ui.router', 'ui.bootstrap',
'ironic.nodes', 'ironic.util', 'ironic.api'])
angular.module('ironic', ['ui.router', 'ui.bootstrap', 'ironic.util', 'ironic.api'])
.config(function($urlRouterProvider, $httpProvider, $stateProvider, $$configurationProvider) {
'use strict';
@ -72,6 +71,26 @@ angular.module('ironic', ['ui.router', 'ui.bootstrap',
}
}
})
.state('root.ironic.nodes', {
'abstract': true,
'url': '/nodes'
})
.state('root.ironic.nodes.detail', {
'url': '/:uuid',
'resolve': {
'node': function(IronicNode, $stateParams) {
return IronicNode.read({
'uuid': $stateParams.uuid
}).$promise;
}
},
'views': {
'main@root': {
'templateUrl': 'view/nodes/detail.html',
'controller': 'NodeDetailController as ctrl'
}
}
})
.state('root.config', {
'url': '/config',
'views': {
@ -86,7 +105,7 @@ angular.module('ironic', ['ui.router', 'ui.bootstrap',
'use strict';
var listener = $rootScope.$on('$stateChangeError',
function (evt, toState, toParams, fromState, fromParams, reason) {
function(evt, toState, toParams, fromState, fromParams, reason) {
if (reason === 'no_config') {
$state.go('root.config');
} else {

View File

@ -1,51 +0,0 @@
/*
* Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/**
* Node handling for the Ironic UI.
*/
angular.module('ironic.nodes', ['ui.router', 'ui.bootstrap'])
.config(function($urlRouterProvider, $httpProvider, $stateProvider) {
'use strict';
$stateProvider
.state('root.ironic.nodes', {
'abstract': true,
'url': '/nodes'
})
.state('root.ironic.nodes.detail', {
'url': '/:uuid',
'resolve': {
'node': function(IronicNode, $stateParams) {
return IronicNode.read({
'uuid': $stateParams.uuid
}).$promise;
}
},
'views': {
'main@root': {
'templateUrl': 'view/nodes/detail.html',
'controller': 'NodeDetailController as ctrl'
}
}
});
})
.controller('NodeDetailController', function($scope, node) {
'use strict';
var vm = this;
vm.node = node;
});