From 1e34ccd8a15c853902a154600efc60466d5736ca Mon Sep 17 00:00:00 2001 From: Rawlin Peters Date: Wed, 10 Jun 2020 16:38:59 -0600 Subject: [PATCH] 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 --- CHANGELOG.md | 1 + .../app/src/common/api/ServerService.js | 11 ----- .../TableServerConfigFilesController.js | 43 ------------------- .../table.serverConfigFiles.tpl.html | 4 +- 4 files changed, 2 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87e35f988b..943c220958 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### 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 ce689dd124..449338acee 100644 --- a/traffic_portal/app/src/common/api/ServerService.js +++ b/traffic_portal/app/src/common/api/ServerService.js @@ -128,17 +128,6 @@ var ServerService = function($http, locationUtils, messageModel, ENV) { ) }; - 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 e2910cd896..7cda576f31 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 @@ var TableServerConfigFilesController = function(server, serverConfigFiles, $scop $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 tag - var link = document.createElement("a"); - link.href = url; - - // keep it hidden - link.style = "visibility:hidden"; - link.download = name; - - // briefly append the 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 @@ var TableServerConfigFilesController = function(server, serverConfigFiles, $scop "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 2c9e1a9a5f..798312c7e6 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 @@ Name Location Scope - - + {{::c.fnameOnDisk}} {{::c.location}} {{::c.scope}} -