This is an automated email from the ASF dual-hosted git repository.
shamrick pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 46b7555b58 Traffic Portal: fix profiles servers table (#6891)
46b7555b58 is described below
commit 46b7555b58fb895981ed7e11be9df4e3396692b1
Author: ocket8888 <[email protected]>
AuthorDate: Mon Jun 13 10:37:15 2022 -0600
Traffic Portal: fix profiles servers table (#6891)
* Allow links to be disabled
* Disable 'View Servers' for DS profiles, add 'View Delivery Services'
* Fix improper "a" tag use, use query param filtering instead of dedicated
tables
* Remove imports and corresponding source files
---
traffic_portal/app/src/app.js | 4 -
.../modules/form/profile/FormProfileController.js | 35 ++----
.../modules/form/profile/form.profile.tpl.html | 22 ++--
.../app/src/common/modules/table/_table.scss | 1 +
.../modules/table/agGrid/CommonGridController.js | 8 +-
.../src/common/modules/table/agGrid/grid.tpl.html | 5 +-
.../TableProfileDeliveryServicesController.js | 29 -----
.../modules/table/profileDeliveryServices/index.js | 22 ----
.../table.profileDeliveryServices.tpl.html | 120 ---------------------
.../TableProfileServersController.js | 43 --------
.../common/modules/table/profileServers/index.js | 22 ----
.../profileServers/table.profileServers.tpl.html | 24 -----
.../table/profiles/TableProfilesController.js | 11 +-
.../private/profiles/deliveryServices/index.js | 51 ---------
.../src/modules/private/profiles/servers/index.js | 51 ---------
15 files changed, 34 insertions(+), 414 deletions(-)
diff --git a/traffic_portal/app/src/app.js b/traffic_portal/app/src/app.js
index 1e9b37bc66..deabf78960 100644
--- a/traffic_portal/app/src/app.js
+++ b/traffic_portal/app/src/app.js
@@ -165,12 +165,10 @@ var trafficPortal = angular.module('trafficPortal', [
require('./modules/private/profiles').name,
require('./modules/private/profiles/compare').name,
require('./modules/private/profiles/compare/diff').name,
- require('./modules/private/profiles/deliveryServices').name,
require('./modules/private/profiles/edit').name,
require('./modules/private/profiles/list').name,
require('./modules/private/profiles/new').name,
require('./modules/private/profiles/parameters').name,
- require('./modules/private/profiles/servers').name,
require('./modules/private/regions').name,
require('./modules/private/regions/edit').name,
require('./modules/private/regions/list').name,
@@ -401,10 +399,8 @@ var trafficPortal = angular.module('trafficPortal', [
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/profilesParamsCompare').name,
- require('./common/modules/table/profileServers').name,
require('./common/modules/table/profiles').name,
require('./common/modules/table/regions').name,
require('./common/modules/table/regionPhysLocations').name,
diff --git
a/traffic_portal/app/src/common/modules/form/profile/FormProfileController.js
b/traffic_portal/app/src/common/modules/form/profile/FormProfileController.js
index 50be8ff4f9..348436d16b 100644
---
a/traffic_portal/app/src/common/modules/form/profile/FormProfileController.js
+++
b/traffic_portal/app/src/common/modules/form/profile/FormProfileController.js
@@ -17,13 +17,11 @@
* under the License.
*/
-var FormProfileController = function(profile, $scope, $location, $uibModal,
fileUtils, formUtils, locationUtils, cdnService, profileService) {
+var FormProfileController = function(profile, $scope, $uibModal, fileUtils,
formUtils, cdnService, profileService) {
- var getCDNs = function() {
- cdnService.getCDNs(true)
- .then(function(result) {
- $scope.cdns = result;
- });
+ async function getCDNs() {
+ const result = await cdnService.getCDNs(true);
+ $scope.cdns = result;
};
$scope.profile = profile;
@@ -51,18 +49,6 @@ var FormProfileController = function(profile, $scope,
$location, $uibModal, file
{ value: false, label: 'false' }
];
- $scope.viewParams = function() {
- $location.path($location.path() + '/parameters');
- };
-
- $scope.viewServers = function() {
- $location.path($location.path() + '/servers');
- };
-
- $scope.viewDeliveryServices = function() {
- $location.path($location.path() + '/delivery-services');
- };
-
$scope.cloneProfile = function() {
var params = {
title: 'Clone Profile',
@@ -80,8 +66,6 @@ var FormProfileController = function(profile, $scope,
$location, $uibModal, file
});
modalInstance.result.then(function(clonedProfileName) {
profileService.cloneProfile(profile.name, clonedProfileName);
- }, function () {
- // do nothing
});
};
@@ -103,18 +87,11 @@ var FormProfileController = function(profile, $scope,
$location, $uibModal, file
profileService.clearServerUpdatesByProfile($scope.profile.cdn,
$scope.profile.name).then($scope.refresh);
};
- $scope.navigateToPath = locationUtils.navigateToPath;
-
$scope.hasError = formUtils.hasError;
-
$scope.hasPropertyError = formUtils.hasPropertyError;
- var init = function () {
- getCDNs();
- };
- init();
-
+ getCDNs();
};
-FormProfileController.$inject = ['profile', '$scope', '$location',
'$uibModal', 'fileUtils', 'formUtils', 'locationUtils', 'cdnService',
'profileService'];
+FormProfileController.$inject = ['profile', '$scope', '$uibModal',
'fileUtils', 'formUtils', 'cdnService', 'profileService'];
module.exports = FormProfileController;
diff --git
a/traffic_portal/app/src/common/modules/form/profile/form.profile.tpl.html
b/traffic_portal/app/src/common/modules/form/profile/form.profile.tpl.html
index e281f489ab..f5a115b8b9 100644
--- a/traffic_portal/app/src/common/modules/form/profile/form.profile.tpl.html
+++ b/traffic_portal/app/src/common/modules/form/profile/form.profile.tpl.html
@@ -20,26 +20,26 @@ under the License.
<div class="x_panel">
<div class="x_title">
<ol class="breadcrumb pull-left">
- <li><a ng-click="navigateToPath('/profiles')">Profiles</a></li>
+ <li><a href="#!/profiles">Profiles</a></li>
<li class="active">{{profileName}}</li>
</ol>
<div class="pull-right" role="group" ng-show="!settings.isNew">
- <button class="btn btn-primary" title="View Parameters"
ng-click="viewParams()">View Parameters</button>
+ <a class="btn btn-primary" title="View Parameters"
ng-href="#!/profiles/{{profile.id}}/parameters">View Parameters</a>
<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-if="profile.type == 'DS_PROFILE'">View Delivery Services</a></li>
- <li role="menuitem"><a ng-click="viewParams()">View
Parameters</a></li>
- <li role="menuitem"><a ng-click="viewServers()"
ng-if="profile.type != 'DS_PROFILE'">View Servers</a></li>
+ <li ng-if="profile.type === 'DS_PROFILE'"
role="menuitem"><a
ng-href="#!/delivery-services?profileName={{profile.name}}">View Delivery
Services</a></li>
+ <li role="menuitem"><a
ng-href="#!/profiles/{{profile.id}}/parameters">View Parameters</a></li>
+ <li ng-if="profile.type !== 'DS_PROFILE'"
role="menuitem"><a ng-href="#!/servers?profileName={{profile.name}}">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(profile)">Export Profile</a></li>
- <li class="divider"></li>
- <li role="menuitem"><a
ng-click="queueUpdatesByProfile()">Queue Updates By Profile</a></li>
- <li role="menuitem"><a
ng-click="clearUpdatesByProfile()">Clear Updates By Profile</a></li>
+ <li role="menuitem"><button type="button"
ng-click="cloneProfile()">Clone Profile</button></li>
+ <li role="menuitem"><button type="button"
ng-click="exportProfile(profile)">Export Profile</button></li>
+ <li ng-if="profile.type !== 'DS_PROFILE'"
class="divider"></li>
+ <li ng-if="profile.type !== 'DS_PROFILE'"
role="menuitem"><button type="button" ng-click="queueUpdatesByProfile()">Queue
Updates By Profile</button></li>
+ <li ng-if="profile.type !== 'DS_PROFILE'"
role="menuitem"><button type="button" ng-click="clearUpdatesByProfile()">Clear
Updates By Profile</button></li>
</ul>
</div>
</div>
@@ -65,7 +65,7 @@ under the License.
<option value="">Select...</option>
</select>
<small class="input-error"
ng-show="hasPropertyError(profileForm.cdn, 'required')">Required</small>
- <small ng-show="profile.cdn"><a
href="/#!/cdns/{{profile.cdn}}" target="_blank">View Details <i
class="fa fs-xs fa-external-link"></i></a></small>
+ <small ng-show="profile.cdn"><a
ng-href="/#!/cdns/{{profile.cdn}}" target="_blank">View Details <i
class="fa fs-xs fa-external-link"></i></a></small>
</div>
</div>
<div class="form-group" ng-class="{'has-error':
hasError(profileForm.type), 'has-feedback': hasError(profileForm.type)}">
diff --git a/traffic_portal/app/src/common/modules/table/_table.scss
b/traffic_portal/app/src/common/modules/table/_table.scss
index ec16980cb9..4f18c0b3f9 100644
--- a/traffic_portal/app/src/common/modules/table/_table.scss
+++ b/traffic_portal/app/src/common/modules/table/_table.scss
@@ -182,6 +182,7 @@ menu[type="contextmenu"] {
&[disabled] {
color: gray;
background-color: #f5f5f5;
+ cursor: not-allowed;
}
}
}
diff --git
a/traffic_portal/app/src/common/modules/table/agGrid/CommonGridController.js
b/traffic_portal/app/src/common/modules/table/agGrid/CommonGridController.js
index b3197e22d4..aaf1868f14 100644
--- a/traffic_portal/app/src/common/modules/table/agGrid/CommonGridController.js
+++ b/traffic_portal/app/src/common/modules/table/agGrid/CommonGridController.js
@@ -171,7 +171,7 @@ let CommonGridController = function ($scope, $document,
$state, userModel, dateU
function HTTPSCellRenderer() {}
HTTPSCellRenderer.prototype.init = function(params) {
- this.eGui = document.createElement("A");
+ this.eGui = document.createElement("a");
this.eGui.href = "https://" + params.value;
this.eGui.setAttribute("class", "link");
this.eGui.setAttribute("target", "_blank");
@@ -182,7 +182,7 @@ let CommonGridController = function ($scope, $document,
$state, userModel, dateU
// browserify can't handle classes...
function SSHCellRenderer() {}
SSHCellRenderer.prototype.init = function(params) {
- this.eGui = document.createElement("A");
+ this.eGui = document.createElement("a");
this.eGui.href = "ssh://" + userModel.user.username + "@" +
params.value;
this.eGui.setAttribute("class", "link");
this.eGui.textContent = params.value;
@@ -191,7 +191,7 @@ let CommonGridController = function ($scope, $document,
$state, userModel, dateU
function CheckCellRenderer() {}
CheckCellRenderer.prototype.init = function(params) {
- this.eGui = document.createElement("I");
+ this.eGui = document.createElement("i");
if (params.value === null || params.value === undefined) {
return;
}
@@ -209,7 +209,7 @@ let CommonGridController = function ($scope, $document,
$state, userModel, dateU
function UpdateCellRenderer() {}
UpdateCellRenderer.prototype.init = function(params) {
- this.eGui = document.createElement("I");
+ this.eGui = document.createElement("i");
this.eGui.setAttribute("aria-hidden", "true");
this.eGui.setAttribute("title", String(params.value));
diff --git a/traffic_portal/app/src/common/modules/table/agGrid/grid.tpl.html
b/traffic_portal/app/src/common/modules/table/agGrid/grid.tpl.html
index c9d1af7696..c172a584e8 100644
--- a/traffic_portal/app/src/common/modules/table/agGrid/grid.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/agGrid/grid.tpl.html
@@ -84,8 +84,9 @@ under the License.
<ul>
<li role="menuitem" ng-repeat="menu in $ctrl.contextMenuOptions"
ng-if="$ctrl.isShown(menu)">
<hr ng-if="menu.type == 0" class="divider"/>
- <button ng-if="menu.type == 1"
ng-disabled="$ctrl.contextIsDisabled(menu)" type="button"
ng-click="$ctrl.contextMenuClick(menu, $event)">{{ $ctrl.getText(menu)
}}</button>
- <a ng-if="menu.type == 2" href="{{ $ctrl.getHref(menu) }}"
target="{{ menu.newTab ? '_blank' : '' }}">{{ $ctrl.getText(menu) }}</a>
+ <button ng-if="menu.type == 1" type="button"
ng-disabled="$ctrl.contextIsDisabled(menu)" type="button"
ng-click="$ctrl.contextMenuClick(menu, $event)">{{ $ctrl.getText(menu)
}}</button>
+ <a ng-if="menu.type == 2 && !$ctrl.contextIsDisabled(menu)"
href="{{ $ctrl.getHref(menu) }}" target="{{ menu.newTab ? '_blank' : '' }}">{{
$ctrl.getText(menu) }}</a>
+ <button ng-if="menu.type == 2 && $ctrl.contextIsDisabled(menu)"
type="button" disabled>{{ $ctrl.getText(menu) }}</a>
</li>
</ul>
</menu>
diff --git
a/traffic_portal/app/src/common/modules/table/profileDeliveryServices/TableProfileDeliveryServicesController.js
b/traffic_portal/app/src/common/modules/table/profileDeliveryServices/TableProfileDeliveryServicesController.js
deleted file mode 100644
index 157b3b6b87..0000000000
---
a/traffic_portal/app/src/common/modules/table/profileDeliveryServices/TableProfileDeliveryServicesController.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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, filter, $controller, $scope) {
-
- // extends the TableDeliveryServicesController to inherit common methods
- angular.extend(this, $controller('TableDeliveryServicesController', {
tableName: 'profileDS', deliveryServices: deliveryServices, filter: filter,
$scope: $scope }));
-
- $scope.profile = profile;
-};
-
-TableProfileDeliveryServicesController.$inject = ['profile',
'deliveryServices', 'filter', '$controller', '$scope'];
-module.exports = TableProfileDeliveryServicesController;
diff --git
a/traffic_portal/app/src/common/modules/table/profileDeliveryServices/index.js
b/traffic_portal/app/src/common/modules/table/profileDeliveryServices/index.js
deleted file mode 100644
index 963a67eac5..0000000000
---
a/traffic_portal/app/src/common/modules/table/profileDeliveryServices/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-
-/*
- * 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('trafficPortal.table.profileDeliveryServices',
[])
- .controller('TableProfileDeliveryServicesController',
require('./TableProfileDeliveryServicesController'));
diff --git
a/traffic_portal/app/src/common/modules/table/profileDeliveryServices/table.profileDeliveryServices.tpl.html
b/traffic_portal/app/src/common/modules/table/profileDeliveryServices/table.profileDeliveryServices.tpl.html
deleted file mode 100644
index 92e7f16e27..0000000000
---
a/traffic_portal/app/src/common/modules/table/profileDeliveryServices/table.profileDeliveryServices.tpl.html
+++ /dev/null
@@ -1,120 +0,0 @@
-<!--
-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 href="#!/profiles">Profiles</a></li>
- <li><a
ng-href="#!/profiles/{{profile.id}}">{{::profile.name}}</a></li>
- <li class="active">Delivery Services</li>
- </ol>
- <div class="pull-right">
- <div class="form-inline" role="search">
- <input id="quickSearch" name="quickSearch" type="search"
class="form-control text-input" placeholder="Quick search..."
ng-model="quickSearch" ng-change="onQuickSearchChanged()" aria-label="Search"/>
- <div class="input-group text-input">
- <span class="input-group-addon">
- <label for="pageSize">Page size</label>
- </span>
- <input id="pageSize" name="pageSize" type="number" min="1"
class="form-control" placeholder="100" ng-model="pageSize"
ng-change="onPageSizeChanged()" aria-label="Page Size"/>
- </div>
- <div id="toggleColumns" class="btn-group" role="group"
title="Select Table Columns" uib-dropdown is-open="columnSettings.isopen">
- <button type="button" class="btn btn-default
dropdown-toggle" uib-dropdown-toggle aria-haspopup="true" aria-expanded="false">
- <i class="fa fa-columns"></i>
- <span class="caret"></span>
- </button>
- <menu ng-click="$event.stopPropagation()"
class="column-settings dropdown-menu-right dropdown-menu" uib-dropdown-menu>
- <li role="menuitem" ng-repeat="c in
gridOptions.columnApi.getAllColumns() | orderBy:'colDef.headerName'">
- <div class="checkbox">
- <label><input type="checkbox"
ng-checked="c.isVisible()"
ng-click="toggleVisibility(c.colId)">{{::c.colDef.headerName}}</label>
- </div>
- </li>
- </menu>
- </div>
- <div class="btn-group" role="group" uib-dropdown
is-open="more.isopen">
- <button name="moreBtn" 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"><button class="menu-item-button"
type="button" ng-click="clearTableFilters()">Clear Table Filters</button></li>
- <li role="menuitem"><button class="menu-item-button"
type="button" ng-click="exportCSV()">Export CSV</button></li>
- </ul>
- </div>
- </div>
- </div>
- <div class="clearfix"></div>
- </div>
- <div class="x_content">
- <div style="height: 740px;" ag-grid="gridOptions"
class="ag-theme-alpine"></div>
- </div>
-</div>
-
-<menu id="context-menu" class="dropdown-menu" ng-style="menuStyle"
type="contextmenu" ng-show="showMenu">
- <ul>
- <li role="menuitem">
- <a
ng-href="#!/delivery-services/{{deliveryService.id}}?type={{deliveryService.type}}"
target="_blank">Open {{ deliveryService.xmlId }} in New Tab</a>
- </li>
- <hr class="divider"/>
- <li role="menuitem">
- <a
ng-href="#!/delivery-services/{{deliveryService.id}}?type={{deliveryService.type}}">Edit</a>
- </li>
- <li role="menuitem">
- <button type="button" ng-click="clone(deliveryService,
$event)">Clone</button>
- </li>
- <li role="menuitem">
- <button type="button" ng-click="confirmDelete(deliveryService,
$event)">Delete</button>
- </li>
- <hr class="divider"/>
- <li role="menuitem">
- <button type="button" ng-click="viewCharts(deliveryService,
$event)">View Charts</button>
- </li>
- <hr class="divider"/>
- <li role="menuitem">
- <a
ng-href="#!/delivery-services/{{deliveryService.id}}/ssl-keys?type={{deliveryService.type}}">Manage
SSL Keys</a>
- </li>
- <li role="menuitem">
- <a
ng-href="#!/delivery-services/{{deliveryService.id}}/url-sig-keys?type={{deliveryService.type}}">Manage
URL Sig Keys</a>
- </li>
- <li role="menuitem">
- <a
ng-href="#!/delivery-services/{{deliveryService.id}}/uri-signing-keys?type={{deliveryService.type}}">Manage
URI Signing Keys</a>
- </li>
- <hr class="divider"/>
- <li role="menuitem">
- <a
ng-href="#!/delivery-services/{{deliveryService.id}}/jobs?type={{deliveryService.type}}">Manage
Invalidation Requests</a>
- </li>
- <li role="menuitem" ng-if="deliveryService.type.indexOf('STEERING') ==
-1">
- <a
ng-href="#!/delivery-services/{{deliveryService.id}}/origins?type={{deliveryService.type}}">Manage
Origins</a>
- </li>
- <li role="menuitem">
- <a
ng-href="#!/delivery-services/{{deliveryService.id}}/regexes?type={{deliveryService.type}}">Manage
Regexes</a>
- </li>
- <li role="menuitem" ng-if="deliveryService.type.indexOf('DNS') != -1
|| deliveryService.type.indexOf('HTTP') != -1">
- <a
ng-href="#!/delivery-services/{{deliveryService.id}}/required-server-capabilities?type={{deliveryService.type}}">Manage
Required Server Capabilities</a>
- </li>
- <li role="menuitem">
- <a
ng-href="#!/delivery-services/{{deliveryService.id}}/servers?type={{deliveryService.type}}">Manage
Servers</a>
- </li>
- <li role="menuitem" ng-if="deliveryService.type.indexOf('STEERING') !=
-1">
- <a
ng-href="#!/delivery-services/{{deliveryService.id}}/targets?type={{deliveryService.type}}">Manage
Targets</a>
- </li>
- <li role="menuitem">
- <a
ng-href="#!/delivery-services/{{deliveryService.id}}/static-dns-entries?type={{deliveryService.type}}">Manage
Static DNS Entries</a>
- </li>
- </ul>
-</menu>
diff --git
a/traffic_portal/app/src/common/modules/table/profileServers/TableProfileServersController.js
b/traffic_portal/app/src/common/modules/table/profileServers/TableProfileServersController.js
deleted file mode 100644
index f4e7c1cb58..0000000000
---
a/traffic_portal/app/src/common/modules/table/profileServers/TableProfileServersController.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.
- */
-/** @typedef { import('../agGrid/CommonGridController').CGC } CGC */
-
-var TableProfileServersController = function(profile, servers, filter,
$controller, $scope) {
-
- // extends the TableServersController to inherit common methods
- angular.extend(this, $controller('TableServersController', { tableName:
'profileServers', servers: servers, filter: filter, $scope: $scope }));
-
- /** @type CGC.TitleBreadCrumbs[] */
- $scope.breadCrumbs = [{
- text: "Profiles",
- href: "#!/profiles"
- },
- {
- getText: function() { return $scope.profile.name; },
- getHref: function() { return "#!/profiles/" +
$scope.profile.id;}
- },
- {
- text: "Servers"
- }];
-
- $scope.profile = profile;
-};
-
-TableProfileServersController.$inject = ['profile', 'servers', 'filter',
'$controller', '$scope'];
-module.exports = TableProfileServersController;
diff --git
a/traffic_portal/app/src/common/modules/table/profileServers/index.js
b/traffic_portal/app/src/common/modules/table/profileServers/index.js
deleted file mode 100644
index ba238c1e08..0000000000
--- a/traffic_portal/app/src/common/modules/table/profileServers/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-
-/*
- * 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('trafficPortal.table.profileServers', [])
- .controller('TableProfileServersController',
require('./TableProfileServersController'));
diff --git
a/traffic_portal/app/src/common/modules/table/profileServers/table.profileServers.tpl.html
b/traffic_portal/app/src/common/modules/table/profileServers/table.profileServers.tpl.html
deleted file mode 100644
index 2ad729f150..0000000000
---
a/traffic_portal/app/src/common/modules/table/profileServers/table.profileServers.tpl.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-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">
- <common-grid-controller table-name="profilesServer" options="gridOptions"
data="servers" columns="columns"
- drop-down-options="dropDownOptions"
context-menu-options="contextMenuOptions"
- default-data="defaultData"
bread-crumbs="breadCrumbs"></common-grid-controller>
-</div>
diff --git
a/traffic_portal/app/src/common/modules/table/profiles/TableProfilesController.js
b/traffic_portal/app/src/common/modules/table/profiles/TableProfilesController.js
index ecd7088798..2c7c70772e 100644
---
a/traffic_portal/app/src/common/modules/table/profiles/TableProfilesController.js
+++
b/traffic_portal/app/src/common/modules/table/profiles/TableProfilesController.js
@@ -296,8 +296,15 @@ var TableProfilesController = function(profiles, $scope,
$location, $uibModal, l
type: 2
},
{
- getHref: profile => `#!/profiles/${profile.id}/servers`,
- text: "Manage Servers",
+ getHref: profile =>
`#!/servers?profileName=${profile.name}`,
+ isDisabled: profile => profile.type === "DS_PROFILE",
+ text: "View Servers",
+ type: 2
+ },
+ {
+ getHref: profile =>
`#!/delivery-services?profileName=${profile.name}`,
+ isDisabled: profile => profile.type !== "DS_PROFILE",
+ text: "View Delivery Services",
type: 2
}
];
diff --git
a/traffic_portal/app/src/modules/private/profiles/deliveryServices/index.js
b/traffic_portal/app/src/modules/private/profiles/deliveryServices/index.js
deleted file mode 100644
index 04ad1d655c..0000000000
--- a/traffic_portal/app/src/modules/private/profiles/deliveryServices/index.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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('trafficPortal.private.profiles.deliveryServices', [])
- .config(function($stateProvider, $urlRouterProvider) {
- $stateProvider
-
.state('trafficPortal.private.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({ profile: $stateParams.profileId });
- },
- filter:
function(profile) {
- return {
-
profileName: {
-
filterType: "text",
-
type: "equals",
-
filter: profile.name
- }
- }
- }
- }
- }
- }
- })
- ;
- $urlRouterProvider.otherwise('/');
- });
diff --git a/traffic_portal/app/src/modules/private/profiles/servers/index.js
b/traffic_portal/app/src/modules/private/profiles/servers/index.js
deleted file mode 100644
index 2859c13c8c..0000000000
--- a/traffic_portal/app/src/modules/private/profiles/servers/index.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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('trafficPortal.private.profiles.servers', [])
- .config(function($stateProvider, $urlRouterProvider) {
- $stateProvider
- .state('trafficPortal.private.profiles.servers', {
- url: '/{profileId}/servers',
- views: {
- profilesContent: {
- templateUrl:
'common/modules/table/profileServers/table.profileServers.tpl.html',
- controller:
'TableProfileServersController',
- resolve: {
- profile:
function($stateParams, profileService) {
- return
profileService.getProfile($stateParams.profileId);
- },
- servers:
function(profile, $stateParams, serverService) {
- return
serverService.getServers({ profileId: profile.id, orderby: 'hostName' });
- },
- filter:
function(profile) {
- return {
-
profile: {
-
filterType: "text",
-
type: "equals",
-
filter: profile.name
- }
- }
- }
- }
- }
- }
- })
- ;
- $urlRouterProvider.otherwise('/');
- });