Removes the ability to view server config files in TP as they are no longer reliable (#4775) (#4782)
* removes the ability to view server config files in TP as they are no longer reliable via the TO api
* adds change log entry
* moved change log entry
(cherry picked from commit 327b10d397639b6f54e5922faf873ad381548885)
Co-authored-by: Jeremy Mitchell <mitchell852@users.noreply.github.com>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 87e35f9..943c220 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -70,6 +70,7 @@
### Deprecated/Removed
- The Traffic Ops `db/admin.pl` script has now been removed. Please use the `db/admin` binary instead.
+- Removed from Traffic Portal the ability to view cache server config files as the contents are no longer reliable through the TO API due to the introduction of atstccfg.
- Traffic Ops Python client no longer supports Python 2.
- Traffic Ops API Endpoints
- /api_capabilities/:id
diff --git a/traffic_portal/app/src/common/api/ServerService.js b/traffic_portal/app/src/common/api/ServerService.js
index ce689dd..449338a 100644
--- a/traffic_portal/app/src/common/api/ServerService.js
+++ b/traffic_portal/app/src/common/api/ServerService.js
@@ -128,17 +128,6 @@
)
};
- this.getServerConfigFile = function(url) {
- return $http.get(url).then(
- function(result) {
- return result.data;
- },
- function(err) {
- throw err;
- }
- );
- };
-
this.getDeliveryServiceServers = function(dsId) {
return $http.get(ENV.api['root'] + 'deliveryservices/' + dsId + '/servers').then(
function (result) {
diff --git a/traffic_portal/app/src/common/modules/table/serverConfigFiles/TableServerConfigFilesController.js b/traffic_portal/app/src/common/modules/table/serverConfigFiles/TableServerConfigFilesController.js
index e2910cd..7cda576 100644
--- a/traffic_portal/app/src/common/modules/table/serverConfigFiles/TableServerConfigFilesController.js
+++ b/traffic_portal/app/src/common/modules/table/serverConfigFiles/TableServerConfigFilesController.js
@@ -27,45 +27,6 @@
$state.reload(); // reloads all the resolves for the view
};
- $scope.view = function(name, url) {
- var params = {
- title: name
- };
- var modalInstance = $uibModal.open({
- templateUrl: 'common/modules/dialog/text/dialog.text.tpl.html',
- controller: 'DialogTextController',
- windowClass: 'dialog-90',
- resolve: {
- params: function () {
- return params;
- },
- text: function(serverService) {
- return serverService.getServerConfigFile(url);
- }
- }
- });
- modalInstance.result.then(function() {}, function() {}); // do nothing on modal close
-
- };
-
- $scope.download = function(name, url, $event) {
- $event.stopPropagation(); // this kills the click event so it doesn't trigger anything else
-
- // we're going to trick the browser into opening a download dialog
- // generate a temp <a> tag
- var link = document.createElement("a");
- link.href = url;
-
- // keep it hidden
- link.style = "visibility:hidden";
- link.download = name;
-
- // briefly append the <a> tag and remove it after auto click
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
- };
-
$scope.navigateToPath = locationUtils.navigateToPath;
angular.element(document).ready(function () {
@@ -73,10 +34,6 @@
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
"iDisplayLength": 25,
"aaSorting": [],
- "columnDefs": [
- { 'orderable': false, 'targets': 3 },
- { "width": "5%", "targets": 3 }
- ]
});
});
diff --git a/traffic_portal/app/src/common/modules/table/serverConfigFiles/table.serverConfigFiles.tpl.html b/traffic_portal/app/src/common/modules/table/serverConfigFiles/table.serverConfigFiles.tpl.html
index 2c9e1a9..798312c 100644
--- a/traffic_portal/app/src/common/modules/table/serverConfigFiles/table.serverConfigFiles.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/serverConfigFiles/table.serverConfigFiles.tpl.html
@@ -37,15 +37,13 @@
<th>Name</th>
<th>Location</th>
<th>Scope</th>
- <th></th>
</tr>
</thead>
<tbody>
- <tr ng-click="view(c.fnameOnDisk, c.apiUri)" ng-repeat="c in ::configFiles">
+ <tr ng-repeat="c in ::configFiles">
<td data-search="^{{::c.fnameOnDisk}}$">{{::c.fnameOnDisk}}</td>
<td data-search="^{{::c.location}}$">{{::c.location}}</td>
<td data-search="^{{::c.scope}}$">{{::c.scope}}</td>
- <td><a title="Download {{::c.fnameOnDisk}}" ng-click="download(c.fnameOnDisk, c.apiUri, $event)"><i class="fa fa-download" aria-hidden="true"></i></a></td>
</tr>
</tbody>
</table>