Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [unreleased]
### Added
- [#7314](https://github.com/apache/trafficcontrol/pull/7314) *Traffic Portal* Added capability feature to Delivery Service Form (HTTP, DNS)
- [#7295](https://github.com/apache/trafficcontrol/pull/7295) *Traffic Portal* Added description and priority order for Layered Profile on server form.
- [#6234](https://github.com/apache/trafficcontrol/issues/6234) *Traffic Ops, Traffic Portal* Added description field to Server Capabilities
- [#6033](https://github.com/apache/trafficcontrol/issues/6033) *Traffic Ops, Traffic Portal* Added ability to assign multiple servers per capability.
Expand Down
2 changes: 0 additions & 2 deletions traffic_portal/app/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ var trafficPortal = angular.module('trafficPortal', [
require('./modules/private/deliveryServiceRequests/edit').name,
require('./modules/private/deliveryServiceRequests/list').name,
require('./modules/private/deliveryServices').name,
require('./modules/private/deliveryServices/capabilities').name,
require('./modules/private/deliveryServices/clone').name,
require('./modules/private/deliveryServices/charts').name,
require('./modules/private/deliveryServices/charts/view').name,
Expand Down Expand Up @@ -373,7 +372,6 @@ var trafficPortal = angular.module('trafficPortal', [
require('./common/modules/table/cdniConfigRequests').name,
require('./common/modules/table/coordinates').name,
require('./common/modules/table/deliveryServices').name,
require('./common/modules/table/deliveryServiceCapabilities').name,
require('./common/modules/table/deliveryServiceJobs').name,
require('./common/modules/table/deliveryServiceOrigins').name,
require('./common/modules/table/deliveryServiceRegexes').name,
Expand Down
14 changes: 14 additions & 0 deletions traffic_portal/app/src/common/modules/form/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,17 @@ input:checked + .slider::before {
text-shadow: none;
}
}

.checkbox-scroll-container {
max-height: 3.5em;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-content: space-between;

div {
min-width: 5em;
width: fit-content;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
* @param {import("../../../api/TenantService")} tenantService
* @param {import("../../../models/PropertiesModel")} propertiesModel
* @param {import("../../../models/UserModel")} userModel
* @param {import("../../../api/ServerCapabilityService")} serverCapabilityService
* @param {import("../../../api/ServiceCategoryService")} serviceCategoryService
*/
var FormDeliveryServiceController = function(deliveryService, dsCurrent, origin, topologies, type, types, $scope, formUtils, tenantUtils, deliveryServiceUtils, deliveryServiceService, cdnService, profileService, tenantService, propertiesModel, userModel, serviceCategoryService) {
var FormDeliveryServiceController = function(deliveryService, dsCurrent, origin, topologies, type, types, $scope, formUtils, tenantUtils, deliveryServiceUtils, deliveryServiceService, cdnService, profileService, tenantService, propertiesModel, userModel, serverCapabilityService, serviceCategoryService) {

/**
* This is used to cache TLS version settings when the checkbox is toggled.
Expand Down Expand Up @@ -197,6 +198,16 @@ var FormDeliveryServiceController = function(deliveryService, dsCurrent, origin,
tenantUtils.addLevels($scope.tenants);
}

$scope.selectedCapabilities = {};
/**
* Updates the server Capabilities on the $scope.
* @returns {Promise<void>}
*/
async function getRequiredCapabilities() {
$scope.requiredCapabilities = await serverCapabilityService.getServerCapabilities();
$scope.selectedCapabilities = Object.fromEntries($scope.requiredCapabilities.map(dsc => [dsc.name, $scope.deliveryService.requiredCapabilities.includes(dsc.name)]))
}

/**
* Updates the Service Categories on the $scope.
* @returns {Promise<void>}
Expand Down Expand Up @@ -469,6 +480,7 @@ var FormDeliveryServiceController = function(deliveryService, dsCurrent, origin,
getCDNs();
getProfiles();
getTenants();
getRequiredCapabilities();
getServiceCategories();
getSteeringTargets();
if (!deliveryService.consistentHashQueryParams || deliveryService.consistentHashQueryParams.length < 1) {
Expand All @@ -488,5 +500,5 @@ var FormDeliveryServiceController = function(deliveryService, dsCurrent, origin,
}
};

FormDeliveryServiceController.$inject = ["deliveryService", "dsCurrent", "origin", "topologies", "type", "types", "$scope", "formUtils", "tenantUtils", "deliveryServiceUtils", "deliveryServiceService", "cdnService", "profileService", "tenantService", "propertiesModel", "userModel", "serviceCategoryService"];
FormDeliveryServiceController.$inject = ["deliveryService", "dsCurrent", "origin", "topologies", "type", "types", "$scope", "formUtils", "tenantUtils", "deliveryServiceUtils", "deliveryServiceService", "cdnService", "profileService", "tenantService", "propertiesModel", "userModel", "serverCapabilityService", "serviceCategoryService"];
module.exports = FormDeliveryServiceController;
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ var FormEditDeliveryServiceController = function(deliveryService, origin, topolo
* @returns
*/
$scope.save = async function(deliveryService) {
deliveryService.requiredCapabilities = Object.entries($scope.selectedCapabilities).filter(sc => (sc[1])).map(sc => sc[0])

if (
deliveryService.sslKeyVersion !== null &&
deliveryService.sslKeyVersion !== 0 &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
<li role="menuitem"><a ng-href="/#!/delivery-services/{{deliveryService.id}}/jobs">Manage Invalidation Requests</a></li>
<li role="menuitem"><a ng-href="/#!/delivery-services/{{deliveryService.id}}/origins">Manage Origins</a></li>
<li role="menuitem"><a ng-href="/#!/delivery-services/{{deliveryService.id}}/regexes">Manage Regexes</a></li>
<li role="menuitem"><a ng-href="/#!/delivery-services/{{deliveryService.id}}/required-server-capabilities">Manage Required Server Capabilities</a></li>
<li role="menuitem"><a ng-href="/#!/delivery-services/{{deliveryService.id}}/servers">Manage Servers</a></li>
<li role="menuitem"><a ng-href="/#!/delivery-services/{{deliveryService.id}}/static-dns-entries">Manage Static DNS Entries</a></li>
</ul>
Expand Down Expand Up @@ -343,6 +342,33 @@ <h3 ng-if="!open()">Previous Value</h3>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error': hasError(generalConfig.requiredCapabilities), 'has-feedback': hasError(generalConfig.requiredCapabilities)}">
<label class="has-tooltip control-label col-md-2 col-sm-2 col-xs-12" for="capability">Required Capability
Comment thread
rimashah25 marked this conversation as resolved.
Outdated
<div class="helptooltip">
<div class="helptext">Required capability(ies) associated with a delivery service</div>
Comment thread
rimashah25 marked this conversation as resolved.
Outdated
</div>
</label>
<div class="col-md-10 col-sm-10 col-xs-12">
<div class="checkbox-scroll-container">
<div ng-repeat="capability in requiredCapabilities track by $index">
<input
aria-label="{{capability.name}}"
type="checkbox"
id="capability-{{$index}}"
name="capability-{{$index}}"
ng-model="selectedCapabilities[capability.name]"
ng-checked="selectedCapabilities[capability.name]"
Comment thread
rimashah25 marked this conversation as resolved.
Outdated
/>
<a ng-href="/#!/server-capabilities/edit?name={{capability.name}}" target="_blank"> {{capability.name}}</a>
</div>
</div>
<aside class="current-value" ng-if="settings.isRequest" ng-show="deliveryService.requiredCapabilities !== dsCurrent.requiredCapabilities">
<h3 ng-if="open()">Current Value</h3>
<h3 ng-if="!open()">Previous Value</h3>
<pre>{{::dsCurrent.requiredCapabilities}}</pre>
</aside>
</div>
</div>
<div class="form-group" ng-class="{'has-error': hasError(generalConfig.serviceCategory), 'has-feedback': hasError(generalConfig.serviceCategory)}">
<label class="has-tooltip control-label col-md-2 col-sm-2 col-xs-12" for="serviceCategory">Service Category<div class="helptooltip">
<div class="helptext">The type of content being delivered. Some examples are linear and vod.</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
<li role="menuitem"><a ng-href="/#!/delivery-services/{{deliveryService.id}}/jobs">Manage Invalidation Requests</a></li>
<li role="menuitem"><a ng-href="/#!/delivery-services/{{deliveryService.id}}/origins">Manage Origins</a></li>
<li role="menuitem"><a ng-href="/#!/delivery-services/{{deliveryService.id}}/regexes">Manage Regexes</a></li>
<li role="menuitem"><a ng-href="/#!/delivery-services/{{deliveryService.id}}/required-server-capabilities">Manage Required Server Capabilities</a></li>
<li role="menuitem"><a ng-href="/#!/delivery-services/{{deliveryService.id}}/servers">Manage Servers</a></li>
<li role="menuitem"><a ng-href="/#!/delivery-services/{{deliveryService.id}}/static-dns-entries">Manage Static DNS Entries</a></li>
</ul>
Expand Down Expand Up @@ -343,6 +342,33 @@ <h3 ng-if="!open()">Previous Value</h3>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error': hasError(generalConfig.requiredCapabilities), 'has-feedback': hasError(generalConfig.requiredCapabilities)}">
<label class="has-tooltip control-label col-md-2 col-sm-2 col-xs-12" for="capability">Required Capability
<div class="helptooltip">
<div class="helptext">Required capability(ies) associated with this Delivery Service</div>
</div>
</label>
<div class="col-md-10 col-sm-10 col-xs-12">
<div class="checkbox-scroll-container">
<div ng-repeat="capability in requiredCapabilities track by $index">
<input
aria-label="{{capability.name}}"
type="checkbox"
id="capability-{{$index}}"
name="capability-{{$index}}"
ng-model="selectedCapabilities[capability.name]"
ng-checked="selectedCapabilities[capability.name]"
/>
<a ng-href="/#!/server-capabilities/edit?name={{capability.name}}" target="_blank">{{capability.name}}</a>
</div>
</div>
<aside class="current-value" ng-if="settings.isRequest" ng-show="deliveryService.requiredCapabilities !== dsCurrent.requiredCapabilities">
<h3 ng-if="open()">Current Value</h3>
<h3 ng-if="!open()">Previous Value</h3>
<pre>{{::dsCurrent.requiredCapabilities}}</pre>
</aside>
</div>
</div>
<div class="form-group" ng-class="{'has-error': hasError(generalConfig.serviceCategory), 'has-feedback': hasError(generalConfig.serviceCategory)}">
<label class="has-tooltip control-label col-md-2 col-sm-2 col-xs-12" for="serviceCategory">Service Category<div class="helptooltip">
<div class="helptext">The type of content being delivered. Some examples are linear and vod.</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ var FormNewDeliveryServiceController = function(deliveryService, origin, topolog
* @returns {Promise<void>}
*/
$scope.save = async function(deliveryService) {
deliveryService.requiredCapabilities = Object.entries($scope.selectedCapabilities).filter(sc => (sc[1])).map(sc => sc[0])

if (!$scope.restrictTLS) {
deliveryService.tlsVersions = null;
}
Expand Down

This file was deleted.

This file was deleted.

Loading