'dlux.directives.general',
'dlux.directives.topology',
'dlux.container',
+ 'dlux.connection_manager',
'dlux.flow',
'dlux.node',
'dlux.networking',
--- /dev/null
+angular.module('dlux.connection_manager', [])
+
+.config(function ($stateProvider) {
+ $stateProvider.state('connection_manager', {
+ abstract: true,
+ url: '/connection_manager',
+ templateUrl: 'connection_manager/root.tpl.html'
+ });
+
+ $stateProvider.state('connection_manager.index', {
+ url: '/index',
+ templateUrl: 'connection_manager/index.tpl.html',
+ views: {
+ '': {
+ templateUrl: 'connection_manager/index.tpl.html',
+ controller: function ($scope, ConnectionManagerSvc) {
+ $scope.svc = ConnectionManagerSvc;
+
+ $scope.gridOptions = {
+ data: 'data["node"]',
+ selectedItems: [],
+ enableRowSelection: true,
+ showSelectionCheckbox: true,
+ selectWithCheckboxOnly: true,
+ columnDefs: [
+ {
+ field: 'id', displayName: 'ID',
+ },
+ {
+ field: 'type', displayName: 'Type',
+ }
+ ]
+ };
+
+ $scope.$watch(
+ function () {
+ return ConnectionManagerSvc.data;
+ },
+ function (data) {
+ $scope.data = data;
+ }
+ );
+ }
+ }
+ }
+ });
+
+ $stateProvider.state('connection_manager.discover', {
+ url: '/discover',
+ views: {
+ '': {
+ templateUrl: 'connection_manager/discover.tpl.html',
+ controller: function ($scope, SwitchSvc, ConnectionManagerSvc) {
+ $scope.nodePort = 6633;
+
+ $scope.doDiscover = function () {
+ ConnectionManagerSvc.discover($scope.nodeId, $scope.nodeAddress, $scope.nodePort).then(
+ function () {
+ $scope.$state.go('connection_manager.index');
+ },
+ function (error) {
+ $scope.error = error.data;
+ }
+ );
+ };
+ }
+ }
+ }
+ });
+});
<label for="nodeId" class="control-label">ID / Name</label>
<input type="text" class="form-control input-sm" id="nodeId" ng-model="nodeId" placeholder="Example: management-switch01" required>
</div>
+
<div class="form-group">
<label for="nodeAddress" class="control-label">Address</label>
<input type="text" class="form-control input-sm" id="nodeAddress" ng-model="nodeAddress" placeholder="Example: 10.0.0.1" required>
--- /dev/null
+<ctrl-reload service="svc"></ctrl-reload>
+<show-selected data="gridOptions.selectedItems"></show-selected>
+<div class="indexGrid" ng-grid="gridOptions"></div>
--- /dev/null
+<div class="menu">
+ <ul class="nav nav-pills">
+ <li ng-class="{ active: $state.includes('connection_manager.index') }"><a ui-sref="connection_manager.index()">Home</a></li>
+ <li ng-class="{ active: $state.includes('connection_manager.discover') }"><a ui-sref="connection_manager.discover()">Discover</a></li>
+ </ul>
+
+ <!-- For child state use-->
+ <div ui-view="submenu"></div>
+</div>
+
+<div ui-view></div>
if (stateToServices[stateBase] !== undefined) {
svcName = stateToServices[stateBase];
} else {
- svcName = _.str.capitalize(stateBase) + 'Svc';
+ svcName = _.string.capitalize(_.string.camelize(stateBase)) + 'Svc';
}
-
if (!$injector.has(svcName)) {
$scope.menu = null;
return;
}
});
- $stateProvider.state('node.discover', {
- url: '/discover',
- views: {
- '': {
- templateUrl: 'node/discover.tpl.html',
- controller: function ($scope, SwitchSvc, ConnectionManagerSvc) {
- $scope.nodePort = 6633;
-
- $scope.doDiscover = function () {
- ConnectionManagerSvc.discover($scope.nodeId, $scope.nodeAddress, $scope.nodePort).then(
- function () {
- $scope.$state.go('node.index');
- },
- function (error) {
- $scope.error = error.data;
- }
- );
- };
- }
- }
- }
- });
$stateProvider.state('node.detail', {
url: '/{nodeType}/{nodeId}/detail',
<div class="menu">
<ul class="nav nav-pills">
<li ng-class="{ active: $state.includes('node.index') }"><a ui-sref="node.index()">Home</a></li>
- <li ng-class="{ active: $state.includes('node.discover') }"><a ui-sref="node.discover()">Discover</a></li>
</ul>
<!-- For child state use-->
};
svc.getAll = function () {
- Restangular.one('connectionmanager').one('nodes').then(function (data) {
+ Restangular.one('connectionmanager').one('nodes').getList().then(function (data) {
svc.data = data;
});
};
These are available from the root scope and elsewhere.
*/
var endpoint_proto = 'http';
-var endpoint_host = 'localhost';
+var endpoint_host = 'odl.cloudistic.me';
var endpoint_port = '8080';
var endpoint_path = '/controller/nb/v2';
<li is-active state="node">
<brd-anchor label="Nodes" state="node.index"></brd-anchor>
</li>
+ <li is-active state="connection_manager">
+ <brd-anchor label="Connection Manager" state="connection_manager.index">
+ </brd-anchor>
<li is-active state="flow">
<brd-anchor label="Flows" state="flow.index"></brd-anchor>
<li>
border-radius: 5px 5px 0 0;
border: 1px solid #ccc;
height: 175px;
+ overflow-y: auto;
.title {
background-image: linear-gradient(to bottom, #eee, #ccc);
color: #222;