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:57 UTC
[13/15] incubator-trafficcontrol git commit: adds cdn profiles table
adds cdn profiles 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/90044210
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/90044210
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/90044210
Branch: refs/heads/master
Commit: 900442107b52a2c6d34e439bcbb1180311c7943c
Parents: f9e77e2
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Thu Mar 23 21:04:13 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 +
.../modules/form/cdn/FormCDNController.js | 4 ++
.../common/modules/form/cdn/form.cdn.tpl.html | 3 +-
.../cdnProfiles/TableCDNProfilesController.js | 46 ++++++++++++++++
.../common/modules/table/cdnProfiles/index.js | 21 ++++++++
.../cdnProfiles/table.cdnProfiles.tpl.html | 55 ++++++++++++++++++++
.../private/admin/cdns/profiles/index.js | 42 +++++++++++++++
7 files changed, 172 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/90044210/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 05dce5b..20461f3 100644
--- a/traffic_ops/experimental/ui/app/src/app.js
+++ b/traffic_ops/experimental/ui/app/src/app.js
@@ -62,6 +62,7 @@ var trafficOps = angular.module('trafficOps', [
require('./modules/private/admin/cdns/edit').name,
require('./modules/private/admin/cdns/list').name,
require('./modules/private/admin/cdns/new').name,
+ require('./modules/private/admin/cdns/profiles').name,
require('./modules/private/admin/cdns/servers').name,
require('./modules/private/admin/divisions').name,
require('./modules/private/admin/divisions/edit').name,
@@ -216,6 +217,7 @@ var trafficOps = angular.module('trafficOps', [
require('./common/modules/table/asns').name,
require('./common/modules/table/cdns').name,
require('./common/modules/table/cdnDeliveryServices').name,
+ require('./common/modules/table/cdnProfiles').name,
require('./common/modules/table/cdnServers').name,
require('./common/modules/table/deliveryServices').name,
require('./common/modules/table/deliveryServiceRegexes').name,
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/90044210/traffic_ops/experimental/ui/app/src/common/modules/form/cdn/FormCDNController.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/form/cdn/FormCDNController.js b/traffic_ops/experimental/ui/app/src/common/modules/form/cdn/FormCDNController.js
index 28fc0c4..d76772d 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/form/cdn/FormCDNController.js
+++ b/traffic_ops/experimental/ui/app/src/common/modules/form/cdn/FormCDNController.js
@@ -50,6 +50,10 @@ var FormCDNController = function(cdn, $scope, $location, formUtils, stringUtils,
alert('not hooked up yet: manageSnapshots for CDN');
};
+ $scope.viewProfiles = function() {
+ $location.path($location.path() + '/profiles');
+ };
+
$scope.viewServers = function() {
$location.path($location.path() + '/servers');
};
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/90044210/traffic_ops/experimental/ui/app/src/common/modules/form/cdn/form.cdn.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/form/cdn/form.cdn.tpl.html b/traffic_ops/experimental/ui/app/src/common/modules/form/cdn/form.cdn.tpl.html
index 0dae223..661c3a8 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/form/cdn/form.cdn.tpl.html
+++ b/traffic_ops/experimental/ui/app/src/common/modules/form/cdn/form.cdn.tpl.html
@@ -37,8 +37,9 @@ under the License.
<li role="menuitem"><a ng-click="manageSSL()">Manage SSL Keys</a></li>
<li class="divider"></li>
<li role="menuitem"><a ng-click="cachegroupHealth()">View Cachegroup Health</a></li>
- <li role="menuitem"><a ng-click="viewServers()">View Servers</a></li>
<li role="menuitem"><a ng-click="viewDeliveryServices()">View Delivery Services</a></li>
+ <li role="menuitem"><a ng-click="viewProfiles()">View Profiles</a></li>
+ <li role="menuitem"><a ng-click="viewServers()">View Servers</a></li>
</ul>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/90044210/traffic_ops/experimental/ui/app/src/common/modules/table/cdnProfiles/TableCDNProfilesController.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/cdnProfiles/TableCDNProfilesController.js b/traffic_ops/experimental/ui/app/src/common/modules/table/cdnProfiles/TableCDNProfilesController.js
new file mode 100644
index 0000000..9a093bb
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/cdnProfiles/TableCDNProfilesController.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 TableCDNProfilesController = function(cdn, profiles, $scope, $state, locationUtils) {
+
+ $scope.cdn = cdn;
+
+ $scope.profiles = profiles;
+
+ $scope.editProfile = function(id) {
+ locationUtils.navigateToPath('/admin/profiles/' + id);
+ };
+
+ $scope.refresh = function() {
+ $state.reload(); // reloads all the resolves for the view
+ };
+
+ $scope.navigateToPath = locationUtils.navigateToPath;
+
+ angular.element(document).ready(function () {
+ $('#profilesTable').dataTable({
+ "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
+ "iDisplayLength": 100
+ });
+ });
+
+};
+
+TableCDNProfilesController.$inject = ['cdn', 'profiles', '$scope', '$state', 'locationUtils'];
+module.exports = TableCDNProfilesController;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/90044210/traffic_ops/experimental/ui/app/src/common/modules/table/cdnProfiles/index.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/cdnProfiles/index.js b/traffic_ops/experimental/ui/app/src/common/modules/table/cdnProfiles/index.js
new file mode 100644
index 0000000..8939080
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/cdnProfiles/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.cdnProfiles', [])
+ .controller('TableCDNProfilesController', require('./TableCDNProfilesController'));
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/90044210/traffic_ops/experimental/ui/app/src/common/modules/table/cdnProfiles/table.cdnProfiles.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/cdnProfiles/table.cdnProfiles.tpl.html b/traffic_ops/experimental/ui/app/src/common/modules/table/cdnProfiles/table.cdnProfiles.tpl.html
new file mode 100644
index 0000000..f017e84
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/cdnProfiles/table.cdnProfiles.tpl.html
@@ -0,0 +1,55 @@
+<!--
+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/cdns')">CDNs</a></li>
+ <li><a ng-click="navigateToPath('/admin/cdns/' + cdn.id)">{{cdn.name}}</a></li>
+ <li class="active">Profiles</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="profilesTable" class="table responsive-utilities jambo_table">
+ <thead>
+ <tr class="headings">
+ <th>name</th>
+ <th>description</th>
+ <th>cdn</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-click="editProfile(profile.id)" ng-repeat="profile in profiles">
+ <td>{{profile.name}}</td>
+ <td>{{profile.description}}</td>
+ <td>{{profile.cdnName}}</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+</div>
+
+
+
+
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/90044210/traffic_ops/experimental/ui/app/src/modules/private/admin/cdns/profiles/index.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/modules/private/admin/cdns/profiles/index.js b/traffic_ops/experimental/ui/app/src/modules/private/admin/cdns/profiles/index.js
new file mode 100644
index 0000000..45f9064
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/modules/private/admin/cdns/profiles/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.cdns.profiles', [])
+ .config(function($stateProvider, $urlRouterProvider) {
+ $stateProvider
+ .state('trafficOps.private.admin.cdns.profiles', {
+ url: '/{cdnId}/profiles',
+ views: {
+ cdnsContent: {
+ templateUrl: 'common/modules/table/cdnProfiles/table.cdnProfiles.tpl.html',
+ controller: 'TableCDNProfilesController',
+ resolve: {
+ cdn: function($stateParams, cdnService) {
+ return cdnService.getCDN($stateParams.cdnId);
+ },
+ profiles: function($stateParams, profileService) {
+ return profileService.getProfiles({ cdn: $stateParams.cdnId });
+ }
+ }
+ }
+ }
+ })
+ ;
+ $urlRouterProvider.otherwise('/');
+ });