You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2017/01/05 21:59:46 UTC

[05/11] incubator-trafficcontrol git commit: adds table for phys location servers

adds table for phys location servers


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/86c5a54e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/86c5a54e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/86c5a54e

Branch: refs/heads/master
Commit: 86c5a54e59d9cbfb9991a54c484399eb28db526d
Parents: 1bd400d
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Tue Dec 13 15:04:47 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Thu Jan 5 14:57:46 2017 -0700

----------------------------------------------------------------------
 traffic_ops/experimental/ui/app/src/app.js      |  2 +
 .../form/location/FormLocationController.js     |  8 ++-
 .../form/location/form.location.tpl.html        |  5 +-
 .../modules/navigation/navigation.tpl.html      |  2 +-
 .../TableLocationServersController.js           | 38 +++++++++++
 .../modules/table/locationServers/index.js      | 21 ++++++
 .../table.locationServers.tpl.html              | 70 ++++++++++++++++++++
 .../table/locations/table.locations.tpl.html    |  2 +-
 .../private/admin/locations/servers/index.js    | 42 ++++++++++++
 9 files changed, 185 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/86c5a54e/traffic_ops/experimental/ui/app/src/app.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/app.js b/traffic_ops/experimental/ui/app/src/app.js
index 9bbc457..8e9362a 100644
--- a/traffic_ops/experimental/ui/app/src/app.js
+++ b/traffic_ops/experimental/ui/app/src/app.js
@@ -70,6 +70,7 @@ var trafficOps = angular.module('trafficOps', [
         require('./modules/private/admin/locations/edit').name,
         require('./modules/private/admin/locations/list').name,
         require('./modules/private/admin/locations/new').name,
+        require('./modules/private/admin/locations/servers').name,
         require('./modules/private/admin/parameters').name,
         require('./modules/private/admin/parameters/edit').name,
         require('./modules/private/admin/parameters/list').name,
@@ -193,6 +194,7 @@ var trafficOps = angular.module('trafficOps', [
         require('./common/modules/table/divisions').name,
         require('./common/modules/table/divisionRegions').name,
         require('./common/modules/table/locations').name,
+        require('./common/modules/table/locationServers').name,
         require('./common/modules/table/parameters').name,
         require('./common/modules/table/profileParameters').name,
         require('./common/modules/table/profiles').name,

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/86c5a54e/traffic_ops/experimental/ui/app/src/common/modules/form/location/FormLocationController.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/form/location/FormLocationController.js b/traffic_ops/experimental/ui/app/src/common/modules/form/location/FormLocationController.js
index 4a92e43..2280bc2 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/form/location/FormLocationController.js
+++ b/traffic_ops/experimental/ui/app/src/common/modules/form/location/FormLocationController.js
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-var FormLocationController = function(location, $scope, formUtils, stringUtils, locationUtils, regionService) {
+var FormLocationController = function(location, $scope, $location, formUtils, stringUtils, locationUtils, regionService) {
 
     var getRegions = function() {
         regionService.getRegions()
@@ -42,6 +42,10 @@ var FormLocationController = function(location, $scope, formUtils, stringUtils,
 
     $scope.labelize = stringUtils.labelize;
 
+    $scope.viewServers = function() {
+        $location.path($location.path() + '/servers');
+    };
+
     $scope.navigateToPath = locationUtils.navigateToPath;
 
     $scope.hasError = formUtils.hasError;
@@ -55,5 +59,5 @@ var FormLocationController = function(location, $scope, formUtils, stringUtils,
 
 };
 
-FormLocationController.$inject = ['location', '$scope', 'formUtils', 'stringUtils', 'locationUtils', 'regionService'];
+FormLocationController.$inject = ['location', '$scope', '$location', 'formUtils', 'stringUtils', 'locationUtils', 'regionService'];
 module.exports = FormLocationController;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/86c5a54e/traffic_ops/experimental/ui/app/src/common/modules/form/location/form.location.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/form/location/form.location.tpl.html b/traffic_ops/experimental/ui/app/src/common/modules/form/location/form.location.tpl.html
index a844e04..45c44f8 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/form/location/form.location.tpl.html
+++ b/traffic_ops/experimental/ui/app/src/common/modules/form/location/form.location.tpl.html
@@ -20,9 +20,12 @@ under the License.
 <div class="x_panel">
     <div class="x_title">
         <ol class="breadcrumb">
-            <li><a ng-click="navigateToPath('/admin/locations')">Locations</a></li>
+            <li><a ng-click="navigateToPath('/admin/locations')">Physical Locations</a></li>
             <li class="active">{{locationName}}</li>
         </ol>
+        <div class="btn-group pull-right" role="group" ng-show="!settings.isNew">
+            <button class="btn btn-default" ng-click="viewServers()">Servers</button>
+        </div>
         <div class="clearfix"></div>
     </div>
     <div class="x_content">

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/86c5a54e/traffic_ops/experimental/ui/app/src/common/modules/navigation/navigation.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/navigation/navigation.tpl.html b/traffic_ops/experimental/ui/app/src/common/modules/navigation/navigation.tpl.html
index b3e39f6..83885e2 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/navigation/navigation.tpl.html
+++ b/traffic_ops/experimental/ui/app/src/common/modules/navigation/navigation.tpl.html
@@ -44,7 +44,7 @@ under the License.
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficOps.private.admin.asns')}"><a ng-click="navigateToPath('/admin/asns')">ASNs</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficOps.private.admin.cdns')}"><a ng-click="navigateToPath('/admin/cdns')">CDNs</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficOps.private.admin.divisions')}"><a ng-click="navigateToPath('/admin/divisions')">Divisions</a></li>
-                        <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficOps.private.admin.locations')}"><a ng-click="navigateToPath('/admin/locations')">Locations</a></li>
+                        <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficOps.private.admin.locations')}"><a ng-click="navigateToPath('/admin/locations')">Phys Locations</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficOps.private.admin.parameters')}"><a ng-click="navigateToPath('/admin/parameters')">Parameters</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficOps.private.admin.profiles')}"><a ng-click="navigateToPath('/admin/profiles')">Profiles</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficOps.private.admin.regions')}"><a ng-click="navigateToPath('/admin/regions')">Regions</a></li>

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/86c5a54e/traffic_ops/experimental/ui/app/src/common/modules/table/locationServers/TableLocationServersController.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/locationServers/TableLocationServersController.js b/traffic_ops/experimental/ui/app/src/common/modules/table/locationServers/TableLocationServersController.js
new file mode 100644
index 0000000..ab6ad9a
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/locationServers/TableLocationServersController.js
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+var TableLocationServersController = function(location, servers, $scope, locationUtils) {
+
+	$scope.location = location;
+
+	$scope.servers = servers;
+
+	$scope.navigateToPath = locationUtils.navigateToPath;
+
+	angular.element(document).ready(function () {
+		$('#serversTable').dataTable({
+			"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
+			"iDisplayLength": 100
+		});
+	});
+
+};
+
+TableLocationServersController.$inject = ['location', 'servers', '$scope', 'locationUtils'];
+module.exports = TableLocationServersController;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/86c5a54e/traffic_ops/experimental/ui/app/src/common/modules/table/locationServers/index.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/locationServers/index.js b/traffic_ops/experimental/ui/app/src/common/modules/table/locationServers/index.js
new file mode 100644
index 0000000..35ada00
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/locationServers/index.js
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+module.exports = angular.module('trafficOps.table.locationServers', [])
+	.controller('TableLocationServersController', require('./TableLocationServersController'));

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/86c5a54e/traffic_ops/experimental/ui/app/src/common/modules/table/locationServers/table.locationServers.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/locationServers/table.locationServers.tpl.html b/traffic_ops/experimental/ui/app/src/common/modules/table/locationServers/table.locationServers.tpl.html
new file mode 100644
index 0000000..3245aae
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/locationServers/table.locationServers.tpl.html
@@ -0,0 +1,70 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+-->
+
+<div class="x_panel">
+    <div class="x_title">
+        <ol class="breadcrumb pull-left">
+            <li><a ng-click="navigateToPath('/admin/locations')">Physical Locations</a></li>
+            <li><a ng-click="navigateToPath('/admin/locations/' + location.id)">{{location.name}}</a></li>
+            <li class="active">Servers</li>
+        </ol>
+        <div class="clearfix"></div>
+    </div>
+    <div class="x_content">
+        <br>
+        <table id="serversTable" class="table responsive-utilities jambo_table">
+            <thead>
+            <tr class="headings">
+                <th>hostName</th>
+                <th>domainName</th>
+                <th>cdn</th>
+                <th>cachegroup</th>
+                <th>type</th>
+                <th>location</th>
+                <th>ipAddress</th>
+                <th>ip6Address</th>
+                <th>status</th>
+                <th>profile</th>
+                <th>iloIpAddress</th>
+                <th>iloIpGateway</th>
+            </tr>
+            </thead>
+            <tbody>
+            <tr ng-repeat="server in servers">
+                <td>{{server.hostName}}</td>
+                <td>{{server.domainName}}</td>
+                <td>{{server.cdnName}}</td>
+                <td>{{server.cachegroup}}</td>
+                <td>{{server.type}}</td>
+                <td>{{server.physLocation}}</td>
+                <td>{{server.ipAddress}}</td>
+                <td>{{server.ip6Address}}</td>
+                <td>{{server.status}}</td>
+                <td>{{server.profile}}</td>
+                <td>{{server.iloIpAddress}}</td>
+                <td>{{server.iloIpGateway}}</td>
+            </tr>
+            </tbody>
+        </table>
+    </div>
+</div>
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/86c5a54e/traffic_ops/experimental/ui/app/src/common/modules/table/locations/table.locations.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/locations/table.locations.tpl.html b/traffic_ops/experimental/ui/app/src/common/modules/table/locations/table.locations.tpl.html
index c6061e9..efaf7e7 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/table/locations/table.locations.tpl.html
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/locations/table.locations.tpl.html
@@ -20,7 +20,7 @@ under the License.
 <div class="x_panel">
     <div class="x_title">
         <ol class="breadcrumb pull-left">
-            <li class="active">Locations</li>
+            <li class="active">Physical Locations</li>
         </ol>
         <button class="btn btn-primary pull-right" ng-click="createLocation()">New</button>
         <div class="clearfix"></div>

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/86c5a54e/traffic_ops/experimental/ui/app/src/modules/private/admin/locations/servers/index.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/modules/private/admin/locations/servers/index.js b/traffic_ops/experimental/ui/app/src/modules/private/admin/locations/servers/index.js
new file mode 100644
index 0000000..d5198a4
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/modules/private/admin/locations/servers/index.js
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+module.exports = angular.module('trafficOps.private.admin.locations.servers', [])
+	.config(function($stateProvider, $urlRouterProvider) {
+		$stateProvider
+			.state('trafficOps.private.admin.locations.servers', {
+				url: '/{locationId}/servers',
+				views: {
+					locationsContent: {
+						templateUrl: 'common/modules/table/locationServers/table.locationServers.tpl.html',
+						controller: 'TableLocationServersController',
+						resolve: {
+							location: function($stateParams, locationService) {
+								return locationService.getLocation($stateParams.locationId);
+							},
+							servers: function(serverService) {
+								return serverService.getServers();
+							}
+						}
+					}
+				}
+			})
+		;
+		$urlRouterProvider.otherwise('/');
+	});