Repository: incubator-trafficcontrol Updated Branches: refs/heads/master 72b577d7a -> 6b6d50ef5
enables ssh link on server ip addresses Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/6ff795da Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/6ff795da Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/6ff795da Branch: refs/heads/master Commit: 6ff795da70dcb2f96abcf7fc5ac16f6499c33ac8 Parents: 72b577d Author: Jeremy Mitchell <mitchell...@gmail.com> Authored: Mon Aug 21 13:38:41 2017 -0600 Committer: David Neuman <david.neuma...@gmail.com> Committed: Mon Aug 21 14:12:00 2017 -0600 ---------------------------------------------------------------------- .../cacheGroupServers/TableCacheGroupServersController.js | 2 ++ .../cacheGroupServers/table.cacheGroupServers.tpl.html | 2 +- .../modules/table/cdnServers/TableCDNServersController.js | 2 ++ .../modules/table/cdnServers/table.cdnServers.tpl.html | 2 +- .../TableDeliveryServiceServersController.js | 1 + .../table.deliveryServiceServers.tpl.html | 2 +- .../TablePhysLocationServersController.js | 2 ++ .../physLocationServers/table.physLocationServers.tpl.html | 2 +- .../table/profileServers/TableProfileServersController.js | 2 ++ .../table/profileServers/table.profileServers.tpl.html | 2 +- .../common/modules/table/servers/TableServersController.js | 7 ++----- .../src/common/modules/table/servers/table.servers.tpl.html | 4 +--- .../table/statusServers/TableStatusServersController.js | 2 ++ .../table/statusServers/table.statusServers.tpl.html | 2 +- .../modules/table/typeServers/TableTypeServersController.js | 2 ++ .../modules/table/typeServers/table.typeServers.tpl.html | 2 +- traffic_portal/app/src/common/service/utils/ServerUtils.js | 9 +++++++-- 17 files changed, 30 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/cacheGroupServers/TableCacheGroupServersController.js ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/cacheGroupServers/TableCacheGroupServersController.js b/traffic_portal/app/src/common/modules/table/cacheGroupServers/TableCacheGroupServersController.js index 26c0198..ee0b5a2 100644 --- a/traffic_portal/app/src/common/modules/table/cacheGroupServers/TableCacheGroupServersController.js +++ b/traffic_portal/app/src/common/modules/table/cacheGroupServers/TableCacheGroupServersController.js @@ -101,6 +101,8 @@ var TableCacheGroupsServersController = function(cacheGroup, servers, $scope, $s $scope.navigateToPath = locationUtils.navigateToPath; + $scope.ssh = serverUtils.ssh; + $scope.isOffline = serverUtils.isOffline; $scope.offlineReason = serverUtils.offlineReason; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/cacheGroupServers/table.cacheGroupServers.tpl.html ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/cacheGroupServers/table.cacheGroupServers.tpl.html b/traffic_portal/app/src/common/modules/table/cacheGroupServers/table.cacheGroupServers.tpl.html index ad3df4a..eb500c7 100644 --- a/traffic_portal/app/src/common/modules/table/cacheGroupServers/table.cacheGroupServers.tpl.html +++ b/traffic_portal/app/src/common/modules/table/cacheGroupServers/table.cacheGroupServers.tpl.html @@ -70,7 +70,7 @@ under the License. <td>{{::server.cachegroup}}</td> <td>{{::server.type}}</td> <td>{{::server.physLocation}}</td> - <td>{{::server.ipAddress}}</td> + <td><a ng-click="ssh(server.ipAddress, $event)">{{::server.ipAddress}}</a></td> <td>{{::server.ip6Address}}</td> <td> <span ng-if="!isOffline(server.status)">{{::server.status}}</span> http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/cdnServers/TableCDNServersController.js ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/cdnServers/TableCDNServersController.js b/traffic_portal/app/src/common/modules/table/cdnServers/TableCDNServersController.js index 8670fdc..a489457 100644 --- a/traffic_portal/app/src/common/modules/table/cdnServers/TableCDNServersController.js +++ b/traffic_portal/app/src/common/modules/table/cdnServers/TableCDNServersController.js @@ -49,6 +49,8 @@ var TableCDNServersController = function(cdn, servers, $scope, $state, locationU $state.reload(); // reloads all the resolves for the view }; + $scope.ssh = serverUtils.ssh; + $scope.isOffline = serverUtils.isOffline; $scope.offlineReason = serverUtils.offlineReason; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/cdnServers/table.cdnServers.tpl.html ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/cdnServers/table.cdnServers.tpl.html b/traffic_portal/app/src/common/modules/table/cdnServers/table.cdnServers.tpl.html index da6cf1e..0d927d1 100644 --- a/traffic_portal/app/src/common/modules/table/cdnServers/table.cdnServers.tpl.html +++ b/traffic_portal/app/src/common/modules/table/cdnServers/table.cdnServers.tpl.html @@ -64,7 +64,7 @@ under the License. </td> <td>{{::server.hostName}}</td> <td>{{::server.domainName}}</td> - <td>{{::server.ipAddress}}</td> + <td><a ng-click="ssh(server.ipAddress, $event)">{{::server.ipAddress}}</a></td> <td>{{::server.ip6Address}}</td> <td> <span ng-if="!isOffline(server.status)">{{::server.status}}</span> http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/deliveryServiceServers/TableDeliveryServiceServersController.js ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/deliveryServiceServers/TableDeliveryServiceServersController.js b/traffic_portal/app/src/common/modules/table/deliveryServiceServers/TableDeliveryServiceServersController.js index f27aaad..0a03669 100644 --- a/traffic_portal/app/src/common/modules/table/deliveryServiceServers/TableDeliveryServiceServersController.js +++ b/traffic_portal/app/src/common/modules/table/deliveryServiceServers/TableDeliveryServiceServersController.js @@ -65,6 +65,7 @@ var TableDeliveryServiceServersController = function(deliveryService, servers, $ }); }; + $scope.ssh = serverUtils.ssh; $scope.isOffline = serverUtils.isOffline; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/deliveryServiceServers/table.deliveryServiceServers.tpl.html ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/deliveryServiceServers/table.deliveryServiceServers.tpl.html b/traffic_portal/app/src/common/modules/table/deliveryServiceServers/table.deliveryServiceServers.tpl.html index b93bb32..dd6a040 100644 --- a/traffic_portal/app/src/common/modules/table/deliveryServiceServers/table.deliveryServiceServers.tpl.html +++ b/traffic_portal/app/src/common/modules/table/deliveryServiceServers/table.deliveryServiceServers.tpl.html @@ -56,7 +56,7 @@ under the License. </td> <td>{{::server.hostName}}</td> <td>{{::server.domainName}}</td> - <td>{{::server.ipAddress}}</td> + <td><a ng-click="ssh(server.ipAddress, $event)">{{::server.ipAddress}}</a></td> <td>{{::server.ip6Address}}</td> <td> <span ng-if="!isOffline(server.status)">{{::server.status}}</span> http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/physLocationServers/TablePhysLocationServersController.js ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/physLocationServers/TablePhysLocationServersController.js b/traffic_portal/app/src/common/modules/table/physLocationServers/TablePhysLocationServersController.js index c7f69fc..23ad947 100644 --- a/traffic_portal/app/src/common/modules/table/physLocationServers/TablePhysLocationServersController.js +++ b/traffic_portal/app/src/common/modules/table/physLocationServers/TablePhysLocationServersController.js @@ -31,6 +31,8 @@ var TablePhysLocationServersController = function(physLocation, servers, $scope, $state.reload(); // reloads all the resolves for the view }; + $scope.ssh = serverUtils.ssh; + $scope.isOffline = serverUtils.isOffline; $scope.offlineReason = serverUtils.offlineReason; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/physLocationServers/table.physLocationServers.tpl.html ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/physLocationServers/table.physLocationServers.tpl.html b/traffic_portal/app/src/common/modules/table/physLocationServers/table.physLocationServers.tpl.html index 51dc0f3..4271c0f 100644 --- a/traffic_portal/app/src/common/modules/table/physLocationServers/table.physLocationServers.tpl.html +++ b/traffic_portal/app/src/common/modules/table/physLocationServers/table.physLocationServers.tpl.html @@ -61,7 +61,7 @@ under the License. <td>{{::server.cachegroup}}</td> <td>{{::server.type}}</td> <td>{{::server.physLocation}}</td> - <td>{{::server.ipAddress}}</td> + <td><a ng-click="ssh(server.ipAddress, $event)">{{::server.ipAddress}}</a></td> <td>{{::server.ip6Address}}</td> <td> <span ng-if="!isOffline(server.status)">{{::server.status}}</span> http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/profileServers/TableProfileServersController.js ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/profileServers/TableProfileServersController.js b/traffic_portal/app/src/common/modules/table/profileServers/TableProfileServersController.js index 7d4f5d5..df75ebe 100644 --- a/traffic_portal/app/src/common/modules/table/profileServers/TableProfileServersController.js +++ b/traffic_portal/app/src/common/modules/table/profileServers/TableProfileServersController.js @@ -31,6 +31,8 @@ var TableProfileServersController = function(profile, servers, $scope, $state, l $state.reload(); // reloads all the resolves for the view }; + $scope.ssh = serverUtils.ssh; + $scope.isOffline = serverUtils.isOffline; $scope.offlineReason = serverUtils.offlineReason; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/profileServers/table.profileServers.tpl.html ---------------------------------------------------------------------- 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 index 68d5d68..c9cc8a9 100644 --- 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 @@ -61,7 +61,7 @@ under the License. <td>{{::server.cachegroup}}</td> <td>{{::server.type}}</td> <td>{{::server.physLocation}}</td> - <td>{{::server.ipAddress}}</td> + <td><a ng-click="ssh(server.ipAddress, $event)">{{::server.ipAddress}}</a></td> <td>{{::server.ip6Address}}</td> <td> <span ng-if="!isOffline(server.status)">{{::server.status}}</span> http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/servers/TableServersController.js ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/servers/TableServersController.js b/traffic_portal/app/src/common/modules/table/servers/TableServersController.js index 93b6503..34d156a 100644 --- a/traffic_portal/app/src/common/modules/table/servers/TableServersController.js +++ b/traffic_portal/app/src/common/modules/table/servers/TableServersController.js @@ -97,15 +97,12 @@ var TableServersController = function(servers, $scope, $state, $uibModal, locati }); }; - - $scope.uploadServerCSV = function() { - alert('not hooked up yet: uploadServerCSV'); - }; - $scope.refresh = function() { $state.reload(); // reloads all the resolves for the view }; + $scope.ssh = serverUtils.ssh; + $scope.isOffline = serverUtils.isOffline; $scope.offlineReason = serverUtils.offlineReason; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/servers/table.servers.tpl.html ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/servers/table.servers.tpl.html b/traffic_portal/app/src/common/modules/table/servers/table.servers.tpl.html index 8dabadb..b5e82cc 100644 --- a/traffic_portal/app/src/common/modules/table/servers/table.servers.tpl.html +++ b/traffic_portal/app/src/common/modules/table/servers/table.servers.tpl.html @@ -33,8 +33,6 @@ under the License. <ul class="dropdown-menu-right dropdown-menu" uib-dropdown-menu> <li role="menuitem"><a ng-click="confirmQueueServerUpdates()">Queue Server Updates</a></li> <li role="menuitem"><a ng-click="confirmClearServerUpdates()">Clear Server Updates</a></li> - <li class="divider"></li> - <li role="menuitem"><a ng-click="uploadServerCSV()">Upload Bulk CSV</a></li> </ul> </div> </div> @@ -65,7 +63,7 @@ under the License. </td> <td>{{::server.hostName}}</td> <td>{{::server.domainName}}</td> - <td>{{::server.ipAddress}}</td> + <td><a ng-click="ssh(server.ipAddress, $event)">{{::server.ipAddress}}</a></td> <td>{{::server.ip6Address}}</td> <td> <span ng-if="!isOffline(server.status)">{{::server.status}}</span> http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/statusServers/TableStatusServersController.js ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/statusServers/TableStatusServersController.js b/traffic_portal/app/src/common/modules/table/statusServers/TableStatusServersController.js index 4aafa0a..cfbbe36 100644 --- a/traffic_portal/app/src/common/modules/table/statusServers/TableStatusServersController.js +++ b/traffic_portal/app/src/common/modules/table/statusServers/TableStatusServersController.js @@ -31,6 +31,8 @@ var TableStatusServersController = function(status, servers, $scope, $state, loc $state.reload(); // reloads all the resolves for the view }; + $scope.ssh = serverUtils.ssh; + $scope.isOffline = serverUtils.isOffline; $scope.offlineReason = serverUtils.offlineReason; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/statusServers/table.statusServers.tpl.html ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/statusServers/table.statusServers.tpl.html b/traffic_portal/app/src/common/modules/table/statusServers/table.statusServers.tpl.html index bc7f718..66d7a52 100644 --- a/traffic_portal/app/src/common/modules/table/statusServers/table.statusServers.tpl.html +++ b/traffic_portal/app/src/common/modules/table/statusServers/table.statusServers.tpl.html @@ -54,7 +54,7 @@ under the License. </td> <td>{{::server.hostName}}</td> <td>{{::server.domainName}}</td> - <td>{{::server.ipAddress}}</td> + <td><a ng-click="ssh(server.ipAddress, $event)">{{::server.ipAddress}}</a></td> <td>{{::server.ip6Address}}</td> <td> <span ng-show="!isOffline(server.status)">{{::server.status}}</span> http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/typeServers/TableTypeServersController.js ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/typeServers/TableTypeServersController.js b/traffic_portal/app/src/common/modules/table/typeServers/TableTypeServersController.js index f0e30d4..90a0163 100644 --- a/traffic_portal/app/src/common/modules/table/typeServers/TableTypeServersController.js +++ b/traffic_portal/app/src/common/modules/table/typeServers/TableTypeServersController.js @@ -31,6 +31,8 @@ var TableTypeServersController = function(type, servers, $scope, $state, locatio $state.reload(); // reloads all the resolves for the view }; + $scope.ssh = serverUtils.ssh; + $scope.isOffline = serverUtils.isOffline; $scope.offlineReason = serverUtils.offlineReason; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/modules/table/typeServers/table.typeServers.tpl.html ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/modules/table/typeServers/table.typeServers.tpl.html b/traffic_portal/app/src/common/modules/table/typeServers/table.typeServers.tpl.html index e311c42..7860576 100644 --- a/traffic_portal/app/src/common/modules/table/typeServers/table.typeServers.tpl.html +++ b/traffic_portal/app/src/common/modules/table/typeServers/table.typeServers.tpl.html @@ -54,7 +54,7 @@ under the License. </td> <td>{{::server.hostName}}</td> <td>{{::server.domainName}}</td> - <td>{{::server.ipAddress}}</td> + <td><a ng-click="ssh(server.ipAddress, $event)">{{::server.ipAddress}}</a></td> <td>{{::server.ip6Address}}</td> <td> <span ng-if="!isOffline(server.status)">{{::server.status}}</span> http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6ff795da/traffic_portal/app/src/common/service/utils/ServerUtils.js ---------------------------------------------------------------------- diff --git a/traffic_portal/app/src/common/service/utils/ServerUtils.js b/traffic_portal/app/src/common/service/utils/ServerUtils.js index a4d2c4c..be58cc9 100644 --- a/traffic_portal/app/src/common/service/utils/ServerUtils.js +++ b/traffic_portal/app/src/common/service/utils/ServerUtils.js @@ -17,7 +17,7 @@ * under the License. */ -var ServerUtils = function() { +var ServerUtils = function($window, userModel) { this.isOffline = function(status) { return (status == 'OFFLINE' || status == 'ADMIN_DOWN'); @@ -27,7 +27,12 @@ var ServerUtils = function() { return (server.offlineReason) ? server.offlineReason : 'None'; }; + this.ssh = function(ip, $event) { + $window.location.href = 'ssh://' + userModel.user.username + '@' + ip; + $event.stopPropagation(); // this kills the click event so it doesn't trigger anything else + }; + }; -ServerUtils.$inject = []; +ServerUtils.$inject = ['$window', 'userModel']; module.exports = ServerUtils;