You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2017/04/06 20:41:53 UTC

[09/15] incubator-trafficcontrol git commit: adds profile deliveryservices table

adds profile deliveryservices table


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

Branch: refs/heads/master
Commit: 9ffa4f6ba0d29d5bcf3a506ed57bbdd89178f269
Parents: e8a5352
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Mon Mar 13 21:43:34 2017 -0600
Committer: Dewayne Richardson <de...@apache.org>
Committed: Thu Apr 6 14:41:34 2017 -0600

----------------------------------------------------------------------
 traffic_ops/experimental/ui/app/src/app.js      |  2 +
 .../form/profile/FormProfileController.js       |  4 ++
 .../modules/form/profile/form.profile.tpl.html  |  5 +-
 .../TableProfileDeliveryServicesController.js   | 46 ++++++++++++
 .../table/profileDeliveryServices/index.js      | 22 ++++++
 .../table.profileDeliveryServices.tpl.html      | 74 ++++++++++++++++++++
 .../admin/profiles/deliveryServices/index.js    | 42 +++++++++++
 7 files changed, 193 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ffa4f6b/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 2a73e6d..a3fa799 100644
--- a/traffic_ops/experimental/ui/app/src/app.js
+++ b/traffic_ops/experimental/ui/app/src/app.js
@@ -79,6 +79,7 @@ var trafficOps = angular.module('trafficOps', [
         require('./modules/private/admin/parameters/new').name,
         require('./modules/private/admin/parameters/profiles').name,
         require('./modules/private/admin/profiles').name,
+        require('./modules/private/admin/profiles/deliveryServices').name,
         require('./modules/private/admin/profiles/edit').name,
         require('./modules/private/admin/profiles/list').name,
         require('./modules/private/admin/profiles/new').name,
@@ -226,6 +227,7 @@ var trafficOps = angular.module('trafficOps', [
         require('./common/modules/table/physLocationServers').name,
         require('./common/modules/table/parameters').name,
         require('./common/modules/table/parameterProfiles').name,
+        require('./common/modules/table/profileDeliveryServices').name,
         require('./common/modules/table/profileParameters').name,
         require('./common/modules/table/profileServers').name,
         require('./common/modules/table/profiles').name,

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ffa4f6b/traffic_ops/experimental/ui/app/src/common/modules/form/profile/FormProfileController.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/form/profile/FormProfileController.js b/traffic_ops/experimental/ui/app/src/common/modules/form/profile/FormProfileController.js
index 67755fd..20797b7 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/form/profile/FormProfileController.js
+++ b/traffic_ops/experimental/ui/app/src/common/modules/form/profile/FormProfileController.js
@@ -53,6 +53,10 @@ var FormProfileController = function(profile, $scope, $location, formUtils, loca
         $location.path($location.path() + '/servers');
     };
 
+    $scope.viewDeliveryServices = function() {
+        $location.path($location.path() + '/delivery-services');
+    };
+
     $scope.cloneProfile = function() {
         alert('not hooked up yet: cloneProfile');
     };

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ffa4f6b/traffic_ops/experimental/ui/app/src/common/modules/form/profile/form.profile.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/form/profile/form.profile.tpl.html b/traffic_ops/experimental/ui/app/src/common/modules/form/profile/form.profile.tpl.html
index 820659e..f2d5450 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/form/profile/form.profile.tpl.html
+++ b/traffic_ops/experimental/ui/app/src/common/modules/form/profile/form.profile.tpl.html
@@ -25,14 +25,15 @@ under the License.
         </ol>
         <div class="pull-right" role="group" ng-show="!settings.isNew">
             <button class="btn btn-primary" title="View Parameters" ng-click="viewParams()"><i class="fa fa-clone"></i></button>
-            <button class="btn btn-primary" title="View Servers" ng-click="viewServers()"><i class="fa fa-server"></i></button>
-
             <div class="btn-group" role="group" uib-dropdown is-open="more.isopen">
                 <button type="button" class="btn btn-default dropdown-toggle" uib-dropdown-toggle aria-haspopup="true" aria-expanded="false">
                     More
                     <span class="caret"></span>
                 </button>
                 <ul class="dropdown-menu-right dropdown-menu" uib-dropdown-menu>
+                    <li role="menuitem"><a ng-click="viewDeliveryServices()" ng-show="profile.type == 'DS_PROFILE'">View Delivery Services</a></li>
+                    <li role="menuitem"><a ng-click="viewServers()" ng-show="profile.type != 'DS_PROFILE'">View Servers</a></li>
+                    <li class="divider"></li>
                     <li role="menuitem"><a ng-click="cloneProfile()">Clone Profile</a></li>
                     <li role="menuitem"><a ng-click="exportProfile()">Export Profile</a></li>
                 </ul>

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ffa4f6b/traffic_ops/experimental/ui/app/src/common/modules/table/profileDeliveryServices/TableProfileDeliveryServicesController.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/profileDeliveryServices/TableProfileDeliveryServicesController.js b/traffic_ops/experimental/ui/app/src/common/modules/table/profileDeliveryServices/TableProfileDeliveryServicesController.js
new file mode 100644
index 0000000..8655d52
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/profileDeliveryServices/TableProfileDeliveryServicesController.js
@@ -0,0 +1,46 @@
+/*
+ * 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 TableProfileDeliveryServicesController = function(profile, deliveryServices, $scope, $state, locationUtils) {
+
+	$scope.profile = profile;
+
+	$scope.deliveryServices = deliveryServices;
+
+	$scope.editDeliveryService = function(id) {
+		locationUtils.navigateToPath('/configure/delivery-services/' + id);
+	};
+
+	$scope.refresh = function() {
+		$state.reload(); // reloads all the resolves for the view
+	};
+
+	$scope.navigateToPath = locationUtils.navigateToPath;
+
+	angular.element(document).ready(function () {
+		$('#deliveryServicesTable').dataTable({
+			"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
+			"iDisplayLength": -1
+		});
+	});
+
+};
+
+TableProfileDeliveryServicesController.$inject = ['profile', 'deliveryServices', '$scope', '$state', 'locationUtils'];
+module.exports = TableProfileDeliveryServicesController;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ffa4f6b/traffic_ops/experimental/ui/app/src/common/modules/table/profileDeliveryServices/index.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/profileDeliveryServices/index.js b/traffic_ops/experimental/ui/app/src/common/modules/table/profileDeliveryServices/index.js
new file mode 100644
index 0000000..e8bdce3
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/profileDeliveryServices/index.js
@@ -0,0 +1,22 @@
+
+/*
+ * 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.profileDeliveryServices', [])
+	.controller('TableProfileDeliveryServicesController', require('./TableProfileDeliveryServicesController'));

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ffa4f6b/traffic_ops/experimental/ui/app/src/common/modules/table/profileDeliveryServices/table.profileDeliveryServices.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/profileDeliveryServices/table.profileDeliveryServices.tpl.html b/traffic_ops/experimental/ui/app/src/common/modules/table/profileDeliveryServices/table.profileDeliveryServices.tpl.html
new file mode 100644
index 0000000..119b545
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/profileDeliveryServices/table.profileDeliveryServices.tpl.html
@@ -0,0 +1,74 @@
+<!--
+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/profiles')">Profiles</a></li>
+            <li><a ng-click="navigateToPath('/admin/profiles/' + profile.id)">{{profile.name}}</a></li>
+            <li class="active">Delivery Services</li>
+        </ol>
+        <div class="pull-right">
+            <button class="btn btn-default" title="Refresh" ng-click="refresh()"><i class="fa fa-refresh"></i></button>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+    <div class="x_content">
+        <br>
+        <table id="deliveryServicesTable" class="table responsive-utilities jambo_table">
+            <thead>
+            <tr class="headings">
+                <th>xmlId</th>
+                <th>orgServerFqdn</th>
+                <th>cdn</th>
+                <th>profile</th>
+                <th>ccrDnsTtl</th>
+                <th>active</th>
+                <th>type</th>
+                <th>dscp</th>
+                <th>signed</th>
+                <th>qstringIgnore</th>
+                <th>geoLimit</th>
+                <th>protocol</th>
+                <th>ipv6RoutingEnabled</th>
+                <th>rangeRequestHandling</th>
+            </tr>
+            </thead>
+            <tbody>
+            <tr ng-click="editDeliveryService(deliveryService.id)" ng-repeat="deliveryService in deliveryServices">
+                <td>{{deliveryService.xmlId}}</td>
+                <td>{{deliveryService.orgServerFqdn}}</td>
+                <td>{{deliveryService.cdnName}}</td>
+                <td>{{deliveryService.profileName}}</td>
+                <td>{{deliveryService.ccrDnsTtl}}</td>
+                <td>{{deliveryService.active}}</td>
+                <td>{{deliveryService.type}}</td>
+                <td>{{deliveryService.dscp}}</td>
+                <td>{{deliveryService.signed}}</td>
+                <td>{{deliveryService.qstringIgnore}}</td>
+                <td>{{deliveryService.geoLimit}}</td>
+                <td>{{deliveryService.protocol}}</td>
+                <td>{{deliveryService.ipv6RoutingEnabled}}</td>
+                <td>{{deliveryService.rangeRequestHandling}}</td>
+            </tr>
+            </tbody>
+        </table>
+    </div>
+</div>
+

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ffa4f6b/traffic_ops/experimental/ui/app/src/modules/private/admin/profiles/deliveryServices/index.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/modules/private/admin/profiles/deliveryServices/index.js b/traffic_ops/experimental/ui/app/src/modules/private/admin/profiles/deliveryServices/index.js
new file mode 100644
index 0000000..1a6c4a0
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/modules/private/admin/profiles/deliveryServices/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.profiles.deliveryServices', [])
+	.config(function($stateProvider, $urlRouterProvider) {
+		$stateProvider
+			.state('trafficOps.private.admin.profiles.deliveryServices', {
+				url: '/{profileId}/delivery-services',
+				views: {
+					profilesContent: {
+						templateUrl: 'common/modules/table/profileDeliveryServices/table.profileDeliveryServices.tpl.html',
+						controller: 'TableProfileDeliveryServicesController',
+						resolve: {
+							profile: function($stateParams, profileService) {
+								return profileService.getProfile($stateParams.profileId);
+							},
+							deliveryServices: function($stateParams, deliveryServiceService) {
+								return deliveryServiceService.getDeliveryServices({ profileId: $stateParams.profileId });
+							}
+						}
+					}
+				}
+			})
+		;
+		$urlRouterProvider.otherwise('/');
+	});