Skip to content

Commit

Permalink
Removes the ability to view server config files in TP as they are no …
Browse files Browse the repository at this point in the history
…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 327b10d)

Co-authored-by: Jeremy Mitchell <[email protected]>
  • Loading branch information
rawlinp and mitchell852 authored Jun 10, 2020
1 parent 9cabef3 commit 1e34ccd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 57 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions traffic_portal/app/src/common/api/ServerService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,56 +27,13 @@ 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 <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 () {
$('#configFilesTable').dataTable({
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
"iDisplayLength": 25,
"aaSorting": [],
"columnDefs": [
{ 'orderable': false, 'targets': 3 },
{ "width": "5%", "targets": 3 }
]
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 1e34ccd

Please sign in to comment.