dangogh closed pull request #2137: adds chart link and goto link (only for
rascal servers) to each serve…
URL: https://github.com/apache/incubator-trafficcontrol/pull/2137
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/traffic_portal/app/src/common/modules/form/server/FormServerController.js
b/traffic_portal/app/src/common/modules/form/server/FormServerController.js
index 5887f1abc..53e774534 100644
--- a/traffic_portal/app/src/common/modules/form/server/FormServerController.js
+++ b/traffic_portal/app/src/common/modules/form/server/FormServerController.js
@@ -17,7 +17,7 @@
* under the License.
*/
-var FormServerController = function(server, $scope, $location, $state,
$uibModal, $window, formUtils, locationUtils, serverUtils, serverService,
cacheGroupService, cdnService, physLocationService, profileService,
typeService, messageModel, propertiesModel) {
+var FormServerController = function(server, $scope, $location, $state,
$uibModal, formUtils, locationUtils, serverUtils, serverService,
cacheGroupService, cdnService, physLocationService, profileService,
typeService, messageModel, propertiesModel) {
var getPhysLocations = function() {
physLocationService.getPhysLocations()
@@ -89,14 +89,9 @@ var FormServerController = function(server, $scope,
$location, $state, $uibModal
$scope.isEdge = serverUtils.isEdge;
- $scope.showChartsButton = propertiesModel.properties.servers.charts.show;
+ $scope.openCharts = serverUtils.openCharts;
- $scope.openCharts = function(server) {
- $window.open(
- propertiesModel.properties.servers.charts.baseUrl +
server.hostName,
- '_blank'
- );
- };
+ $scope.showChartsButton = propertiesModel.properties.servers.charts.show;
$scope.onCDNChange = function() {
$scope.server.profileId = null; // the cdn of the server changed, so
we need to blank out the selected server profile (if any)
@@ -167,5 +162,5 @@ var FormServerController = function(server, $scope,
$location, $state, $uibModal
};
-FormServerController.$inject = ['server', '$scope', '$location', '$state',
'$uibModal', '$window', 'formUtils', 'locationUtils', 'serverUtils',
'serverService', 'cacheGroupService', 'cdnService', 'physLocationService',
'profileService', 'typeService', 'messageModel', 'propertiesModel'];
+FormServerController.$inject = ['server', '$scope', '$location', '$state',
'$uibModal', 'formUtils', 'locationUtils', 'serverUtils', 'serverService',
'cacheGroupService', 'cdnService', 'physLocationService', 'profileService',
'typeService', 'messageModel', 'propertiesModel'];
module.exports = FormServerController;
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 2b497385b..88e65be1b 100644
---
a/traffic_portal/app/src/common/modules/table/cacheGroupServers/TableCacheGroupServersController.js
+++
b/traffic_portal/app/src/common/modules/table/cacheGroupServers/TableCacheGroupServersController.js
@@ -17,7 +17,7 @@
* under the License.
*/
-var TableCacheGroupsServersController = function(cacheGroup, servers, $scope,
$state, $uibModal, cacheGroupService, locationUtils, serverUtils) {
+var TableCacheGroupsServersController = function(cacheGroup, servers, $scope,
$state, $uibModal, cacheGroupService, locationUtils, serverUtils,
propertiesModel) {
$scope.cacheGroup = cacheGroup;
@@ -99,10 +99,16 @@ var TableCacheGroupsServersController =
function(cacheGroup, servers, $scope, $s
});
};
+ $scope.showChartsButton =
propertiesModel.properties.servers.charts.show;
+
$scope.navigateToPath = locationUtils.navigateToPath;
$scope.ssh = serverUtils.ssh;
+ $scope.gotoMonitor = serverUtils.gotoMonitor;
+
+ $scope.openCharts = serverUtils.openCharts;
+
$scope.isOffline = serverUtils.isOffline;
$scope.offlineReason = serverUtils.offlineReason;
@@ -111,11 +117,14 @@ var TableCacheGroupsServersController =
function(cacheGroup, servers, $scope, $s
$('#serversTable').dataTable({
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100,
"All"]],
"iDisplayLength": 25,
+ "columnDefs": [
+ { 'orderable': false, 'targets': 11 }
+ ],
"aaSorting": []
});
});
};
-TableCacheGroupsServersController.$inject = ['cacheGroup', 'servers',
'$scope', '$state', '$uibModal', 'cacheGroupService', 'locationUtils',
'serverUtils'];
+TableCacheGroupsServersController.$inject = ['cacheGroup', 'servers',
'$scope', '$state', '$uibModal', 'cacheGroupService', 'locationUtils',
'serverUtils', 'propertiesModel'];
module.exports = TableCacheGroupsServersController;
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 0f6dd861b..7c36b33ef 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
@@ -55,6 +55,7 @@
<th>CDN</th>
<th>Cache Group</th>
<th>ILO</th>
+ <th style="text-align: right;">Actions</th>
</tr>
</thead>
<tbody>
@@ -76,6 +77,10 @@
<td data-search="^{{::s.cdnName}}$">{{::s.cdnName}}</td>
<td data-search="^{{::s.cachegroup}}$">{{::s.cachegroup}}</td>
<td data-search="^{{::s.iloIpAddress}}$"><a
ng-click="ssh(s.iloIpAddress, $event)">{{::s.iloIpAddress}}</a></td>
+ <td style="text-align: right;">
+ <span ng-if="s.type == 'RASCAL'"><a class="link
action-link" title="Go to" ng-click="gotoMonitor(s, $event)"><i class="fa fa-sm
fa-external-link"></i> </a></span>
+ <span ng-if="showChartsButton"><a class="link action-link"
title="View Charts" ng-click="openCharts(s, $event)"><i class="fa fa-sm
fa-bar-chart"></i></a></span>
+ </td>
</tr>
</tbody>
</table>
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 53a0eea07..d50ae91c0 100644
---
a/traffic_portal/app/src/common/modules/table/cdnServers/TableCDNServersController.js
+++
b/traffic_portal/app/src/common/modules/table/cdnServers/TableCDNServersController.js
@@ -17,7 +17,7 @@
* under the License.
*/
-var TableCDNServersController = function(cdn, servers, $scope, $state,
$uibModal, locationUtils, serverUtils, cdnService) {
+var TableCDNServersController = function(cdn, servers, $scope, $state,
$uibModal, locationUtils, serverUtils, cdnService, propertiesModel) {
var queueServerUpdates = function(cdn) {
cdnService.queueServerUpdates(cdn.id)
@@ -93,8 +93,14 @@ var TableCDNServersController = function(cdn, servers,
$scope, $state, $uibModal
$state.reload(); // reloads all the resolves for the view
};
+ $scope.showChartsButton =
propertiesModel.properties.servers.charts.show;
+
$scope.ssh = serverUtils.ssh;
+ $scope.gotoMonitor = serverUtils.gotoMonitor;
+
+ $scope.openCharts = serverUtils.openCharts;
+
$scope.isOffline = serverUtils.isOffline;
$scope.offlineReason = serverUtils.offlineReason;
@@ -105,11 +111,14 @@ var TableCDNServersController = function(cdn, servers,
$scope, $state, $uibModal
$('#serversTable').dataTable({
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100,
"All"]],
"iDisplayLength": 25,
+ "columnDefs": [
+ { 'orderable': false, 'targets': 11 }
+ ],
"aaSorting": []
});
});
};
-TableCDNServersController.$inject = ['cdn', 'servers', '$scope', '$state',
'$uibModal', 'locationUtils', 'serverUtils', 'cdnService'];
+TableCDNServersController.$inject = ['cdn', 'servers', '$scope', '$state',
'$uibModal', 'locationUtils', 'serverUtils', 'cdnService', 'propertiesModel'];
module.exports = TableCDNServersController;
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 f5e937209..3f3ab327e 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
@@ -55,6 +55,7 @@
<th>CDN</th>
<th>Cache Group</th>
<th>ILO</th>
+ <th style="text-align: right;">Actions</th>
</tr>
</thead>
<tbody>
@@ -76,6 +77,10 @@
<td data-search="^{{::s.cdnName}}$">{{::s.cdnName}}</td>
<td data-search="^{{::s.cachegroup}}$">{{::s.cachegroup}}</td>
<td data-search="^{{::s.iloIpAddress}}$"><a
ng-click="ssh(s.iloIpAddress, $event)">{{::s.iloIpAddress}}</a></td>
+ <td style="text-align: right;">
+ <span ng-if="s.type == 'RASCAL'"><a class="link
action-link" title="Go to" ng-click="gotoMonitor(s, $event)"><i class="fa fa-sm
fa-external-link"></i> </a></span>
+ <span ng-if="showChartsButton"><a class="link action-link"
title="View Charts" ng-click="openCharts(s, $event)"><i class="fa fa-sm
fa-bar-chart"></i></a></span>
+ </td>
</tr>
</tbody>
</table>
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 89ef012e4..c0412c8ea 100644
---
a/traffic_portal/app/src/common/modules/table/deliveryServiceServers/TableDeliveryServiceServersController.js
+++
b/traffic_portal/app/src/common/modules/table/deliveryServiceServers/TableDeliveryServiceServersController.js
@@ -17,7 +17,7 @@
* under the License.
*/
-var TableDeliveryServiceServersController = function(deliveryService, servers,
$scope, $state, $uibModal, locationUtils, serverUtils, deliveryServiceService) {
+var TableDeliveryServiceServersController = function(deliveryService, servers,
$scope, $state, $uibModal, locationUtils, serverUtils, deliveryServiceService,
propertiesModel) {
var removeServer = function(serverId) {
deliveryServiceService.deleteDeliveryServiceServer($scope.deliveryService.id,
serverId)
@@ -32,6 +32,10 @@ var TableDeliveryServiceServersController =
function(deliveryService, servers, $
$scope.servers = servers;
+ $scope.editServer = function(id) {
+ locationUtils.navigateToPath('/servers/' + id);
+ };
+
$scope.refresh = function() {
$state.reload(); // reloads all the resolves for the view
};
@@ -65,7 +69,9 @@ var TableDeliveryServiceServersController =
function(deliveryService, servers, $
});
};
- $scope.confirmRemoveServer = function(server) {
+ $scope.confirmRemoveServer = function(server, $event) {
+ $event.stopPropagation(); // this kills the click event so it
doesn't trigger anything else
+
var params = {
title: 'Remove Server from Delivery Service?',
message: 'Are you sure you want to remove ' +
server.hostName + ' from this delivery service?'
@@ -87,8 +93,12 @@ var TableDeliveryServiceServersController =
function(deliveryService, servers, $
});
};
+ $scope.showChartsButton =
propertiesModel.properties.servers.charts.show;
+
$scope.ssh = serverUtils.ssh;
+ $scope.openCharts = serverUtils.openCharts;
+
$scope.isOffline = serverUtils.isOffline;
$scope.offlineReason = serverUtils.offlineReason;
@@ -100,7 +110,7 @@ var TableDeliveryServiceServersController =
function(deliveryService, servers, $
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100,
"All"]],
"iDisplayLength": 25,
"columnDefs": [
- { 'orderable': false, 'targets': 10 }
+ { 'orderable': false, 'targets': 11 }
],
"aaSorting": []
});
@@ -108,5 +118,5 @@ var TableDeliveryServiceServersController =
function(deliveryService, servers, $
};
-TableDeliveryServiceServersController.$inject = ['deliveryService', 'servers',
'$scope', '$state', '$uibModal', 'locationUtils', 'serverUtils',
'deliveryServiceService'];
+TableDeliveryServiceServersController.$inject = ['deliveryService', 'servers',
'$scope', '$state', '$uibModal', 'locationUtils', 'serverUtils',
'deliveryServiceService', 'propertiesModel'];
module.exports = TableDeliveryServiceServersController;
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 5442ac282..5a4a5c13b 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
@@ -46,11 +46,11 @@
<th>CDN</th>
<th>Cache Group</th>
<th>ILO</th>
- <th></th>
+ <th style="text-align: right;">Actions</th>
</tr>
</thead>
<tbody>
- <tr ng-repeat="s in ::servers" ng-class="::{'active':
s.updPending}">
+ <tr ng-click="editServer(s.id)" ng-repeat="s in ::servers"
ng-class="::{'active': s.updPending}">
<td data-search="{{(s.updPending) ? 'UPD' : ''}}"
data-order="{{::s.updPending}}">
<i title="Updates Pending" ng-show="s.updPending"
class="fa fa-clock-o fa-lg" aria-hidden="true"></i>
<i title="Updates Applied" ng-show="!s.updPending"
class="fa fa-check fa-lg" aria-hidden="true"></i>
@@ -68,7 +68,10 @@
<td data-search="^{{::s.cdnName}}$">{{::s.cdnName}}</td>
<td data-search="^{{::s.cachegroup}}$">{{::s.cachegroup}}</td>
<td data-search="^{{::s.iloIpAddress}}$"><a
ng-click="ssh(s.iloIpAddress, $event)">{{::s.iloIpAddress}}</a></td>
- <td><button type="button" class="btn btn-link" title="Unlink
Server from Delivery Service" ng-click="confirmRemoveServer(s)"><i class="fa
fa-chain-broken"></i></button></td>
+ <td style="text-align: right;">
+ <a class="link action-link" title="Unlink Server from
Delivery Service" ng-click="confirmRemoveServer(s, $event)"><i class="fa fa-sm
fa-chain-broken"></i></a>
+ <span ng-if="showChartsButton"><a class="link action-link"
title="View Charts" ng-click="openCharts(s, $event)"><i class="fa fa-sm
fa-bar-chart"></i></a></span>
+ </td>
</tr>
</tbody>
</table>
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 a0183642d..ad2cde392 100644
---
a/traffic_portal/app/src/common/modules/table/physLocationServers/TablePhysLocationServersController.js
+++
b/traffic_portal/app/src/common/modules/table/physLocationServers/TablePhysLocationServersController.js
@@ -17,7 +17,7 @@
* under the License.
*/
-var TablePhysLocationServersController = function(physLocation, servers,
$scope, $state, locationUtils, serverUtils) {
+var TablePhysLocationServersController = function(physLocation, servers,
$scope, $state, locationUtils, serverUtils, propertiesModel) {
$scope.physLocation = physLocation;
@@ -31,8 +31,14 @@ var TablePhysLocationServersController =
function(physLocation, servers, $scope,
$state.reload(); // reloads all the resolves for the view
};
+ $scope.showChartsButton =
propertiesModel.properties.servers.charts.show;
+
$scope.ssh = serverUtils.ssh;
+ $scope.gotoMonitor = serverUtils.gotoMonitor;
+
+ $scope.openCharts = serverUtils.openCharts;
+
$scope.isOffline = serverUtils.isOffline;
$scope.offlineReason = serverUtils.offlineReason;
@@ -43,11 +49,14 @@ var TablePhysLocationServersController =
function(physLocation, servers, $scope,
$('#serversTable').dataTable({
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100,
"All"]],
"iDisplayLength": 25,
+ "columnDefs": [
+ { 'orderable': false, 'targets': 11 }
+ ],
"aaSorting": []
});
});
};
-TablePhysLocationServersController.$inject = ['physLocation', 'servers',
'$scope', '$state', 'locationUtils', 'serverUtils'];
+TablePhysLocationServersController.$inject = ['physLocation', 'servers',
'$scope', '$state', 'locationUtils', 'serverUtils', 'propertiesModel'];
module.exports = TablePhysLocationServersController;
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 deb1b9217..d415fa065 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
@@ -45,6 +45,7 @@
<th>CDN</th>
<th>Cache Group</th>
<th>ILO</th>
+ <th style="text-align: right;">Actions</th>
</tr>
</thead>
<tbody>
@@ -66,6 +67,10 @@
<td data-search="^{{::s.cdnName}}$">{{::s.cdnName}}</td>
<td data-search="^{{::s.cachegroup}}$">{{::s.cachegroup}}</td>
<td data-search="^{{::s.iloIpAddress}}$"><a
ng-click="ssh(s.iloIpAddress, $event)">{{::s.iloIpAddress}}</a></td>
+ <td style="text-align: right;">
+ <span ng-if="s.type == 'RASCAL'"><a class="link
action-link" title="Go to" ng-click="gotoMonitor(s, $event)"><i class="fa fa-sm
fa-external-link"></i> </a></span>
+ <span ng-if="showChartsButton"><a class="link action-link"
title="View Charts" ng-click="openCharts(s, $event)"><i class="fa fa-sm
fa-bar-chart"></i></a></span>
+ </td>
</tr>
</tbody>
</table>
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 08eaa872e..94fe8845b 100644
---
a/traffic_portal/app/src/common/modules/table/profileServers/TableProfileServersController.js
+++
b/traffic_portal/app/src/common/modules/table/profileServers/TableProfileServersController.js
@@ -17,7 +17,7 @@
* under the License.
*/
-var TableProfileServersController = function(profile, servers, $scope, $state,
locationUtils, serverUtils) {
+var TableProfileServersController = function(profile, servers, $scope, $state,
locationUtils, serverUtils, propertiesModel) {
$scope.profile = profile;
@@ -31,8 +31,14 @@ var TableProfileServersController = function(profile,
servers, $scope, $state, l
$state.reload(); // reloads all the resolves for the view
};
+ $scope.showChartsButton =
propertiesModel.properties.servers.charts.show;
+
$scope.ssh = serverUtils.ssh;
+ $scope.gotoMonitor = serverUtils.gotoMonitor;
+
+ $scope.openCharts = serverUtils.openCharts;
+
$scope.isOffline = serverUtils.isOffline;
$scope.offlineReason = serverUtils.offlineReason;
@@ -43,11 +49,14 @@ var TableProfileServersController = function(profile,
servers, $scope, $state, l
$('#serversTable').dataTable({
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100,
"All"]],
"iDisplayLength": 25,
+ "columnDefs": [
+ { 'orderable': false, 'targets': 11 }
+ ],
"aaSorting": []
});
});
};
-TableProfileServersController.$inject = ['profile', 'servers', '$scope',
'$state', 'locationUtils', 'serverUtils'];
+TableProfileServersController.$inject = ['profile', 'servers', '$scope',
'$state', 'locationUtils', 'serverUtils', 'propertiesModel'];
module.exports = TableProfileServersController;
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 61deb1802..9722deea1 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
@@ -45,6 +45,7 @@
<th>CDN</th>
<th>Cache Group</th>
<th>ILO</th>
+ <th style="text-align: right;">Actions</th>
</tr>
</thead>
<tbody>
@@ -66,6 +67,10 @@
<td data-search="^{{::s.cdnName}}$">{{::s.cdnName}}</td>
<td data-search="^{{::s.cachegroup}}$">{{::s.cachegroup}}</td>
<td data-search="^{{::s.iloIpAddress}}$"><a
ng-click="ssh(s.iloIpAddress, $event)">{{::s.iloIpAddress}}</a></td>
+ <td style="text-align: right;">
+ <span ng-if="s.type == 'RASCAL'"><a class="link
action-link" title="Go to" ng-click="gotoMonitor(s, $event)"><i class="fa fa-sm
fa-external-link"></i> </a></span>
+ <span ng-if="showChartsButton"><a class="link action-link"
title="View Charts" ng-click="openCharts(s, $event)"><i class="fa fa-sm
fa-bar-chart"></i></a></span>
+ </td>
</tr>
</tbody>
</table>
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 d0b5da5d0..3e5bb01a4 100644
---
a/traffic_portal/app/src/common/modules/table/servers/TableServersController.js
+++
b/traffic_portal/app/src/common/modules/table/servers/TableServersController.js
@@ -17,7 +17,7 @@
* under the License.
*/
-var TableServersController = function(servers, $scope, $state, $uibModal,
locationUtils, serverUtils, cdnService) {
+var TableServersController = function(servers, $scope, $state, $uibModal,
locationUtils, serverUtils, cdnService, propertiesModel) {
$scope.servers = servers;
@@ -101,8 +101,14 @@ var TableServersController = function(servers, $scope,
$state, $uibModal, locati
$state.reload(); // reloads all the resolves for the view
};
+ $scope.showChartsButton = propertiesModel.properties.servers.charts.show;
+
$scope.ssh = serverUtils.ssh;
+ $scope.gotoMonitor = serverUtils.gotoMonitor;
+
+ $scope.openCharts = serverUtils.openCharts;
+
$scope.isOffline = serverUtils.isOffline;
$scope.offlineReason = serverUtils.offlineReason;
@@ -111,11 +117,14 @@ var TableServersController = function(servers, $scope,
$state, $uibModal, locati
$('#serversTable').dataTable({
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
"iDisplayLength": 25,
+ "columnDefs": [
+ { 'orderable': false, 'targets': 11 }
+ ],
"aaSorting": []
});
});
};
-TableServersController.$inject = ['servers', '$scope', '$state', '$uibModal',
'locationUtils', 'serverUtils', 'cdnService'];
+TableServersController.$inject = ['servers', '$scope', '$state', '$uibModal',
'locationUtils', 'serverUtils', 'cdnService', 'propertiesModel'];
module.exports = TableServersController;
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 e21e174ba..0e27f6ed7 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
@@ -54,6 +54,7 @@
<th>CDN</th>
<th>Cache Group</th>
<th>ILO</th>
+ <th style="text-align: right;">Actions</th>
</tr>
</thead>
<tbody>
@@ -75,6 +76,10 @@
<td data-search="^{{::s.cdnName}}$">{{::s.cdnName}}</td>
<td data-search="^{{::s.cachegroup}}$">{{::s.cachegroup}}</td>
<td data-search="^{{::s.iloIpAddress}}$"><a
ng-click="ssh(s.iloIpAddress, $event)">{{::s.iloIpAddress}}</a></td>
+ <td style="text-align: right;">
+ <span ng-if="s.type == 'RASCAL'"><a class="link
action-link" title="Go to" ng-click="gotoMonitor(s, $event)"><i class="fa fa-sm
fa-external-link"></i> </a></span>
+ <span ng-if="showChartsButton"><a class="link action-link"
title="View Charts" ng-click="openCharts(s, $event)"><i class="fa fa-sm
fa-bar-chart"></i></a></span>
+ </td>
</tr>
</tbody>
</table>
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 bdfa2afa5..dd2ba0603 100644
---
a/traffic_portal/app/src/common/modules/table/statusServers/TableStatusServersController.js
+++
b/traffic_portal/app/src/common/modules/table/statusServers/TableStatusServersController.js
@@ -17,7 +17,7 @@
* under the License.
*/
-var TableStatusServersController = function(status, servers, $scope, $state,
locationUtils, serverUtils) {
+var TableStatusServersController = function(status, servers, $scope, $state,
locationUtils, serverUtils, propertiesModel) {
$scope.status = status;
@@ -31,8 +31,14 @@ var TableStatusServersController = function(status, servers,
$scope, $state, loc
$state.reload(); // reloads all the resolves for the view
};
+ $scope.showChartsButton =
propertiesModel.properties.servers.charts.show;
+
$scope.ssh = serverUtils.ssh;
+ $scope.gotoMonitor = serverUtils.gotoMonitor;
+
+ $scope.openCharts = serverUtils.openCharts;
+
$scope.isOffline = serverUtils.isOffline;
$scope.offlineReason = serverUtils.offlineReason;
@@ -43,11 +49,14 @@ var TableStatusServersController = function(status,
servers, $scope, $state, loc
$('#serversTable').dataTable({
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100,
"All"]],
"iDisplayLength": 25,
+ "columnDefs": [
+ { 'orderable': false, 'targets': 11 }
+ ],
"aaSorting": []
});
});
};
-TableStatusServersController.$inject = ['status', 'servers', '$scope',
'$state', 'locationUtils', 'serverUtils'];
+TableStatusServersController.$inject = ['status', 'servers', '$scope',
'$state', 'locationUtils', 'serverUtils', 'propertiesModel'];
module.exports = TableStatusServersController;
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 cb344a4ce..01331d91e 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
@@ -45,6 +45,7 @@
<th>CDN</th>
<th>Cache Group</th>
<th>ILO</th>
+ <th style="text-align: right;">Actions</th>
</tr>
</thead>
<tbody>
@@ -66,6 +67,10 @@
<td data-search="^{{::s.cdnName}}$">{{::s.cdnName}}</td>
<td data-search="^{{::s.cachegroup}}$">{{::s.cachegroup}}</td>
<td data-search="^{{::s.iloIpAddress}}$"><a
ng-click="ssh(s.iloIpAddress, $event)">{{::s.iloIpAddress}}</a></td>
+ <td style="text-align: right;">
+ <span ng-if="s.type == 'RASCAL'"><a class="link
action-link" title="Go to" ng-click="gotoMonitor(s, $event)"><i class="fa fa-sm
fa-external-link"></i> </a></span>
+ <span ng-if="showChartsButton"><a class="link action-link"
title="View Charts" ng-click="openCharts(s, $event)"><i class="fa fa-sm
fa-bar-chart"></i></a></span>
+ </td>
</tr>
</tbody>
</table>
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 d512909cf..01231262b 100644
---
a/traffic_portal/app/src/common/modules/table/typeServers/TableTypeServersController.js
+++
b/traffic_portal/app/src/common/modules/table/typeServers/TableTypeServersController.js
@@ -17,7 +17,7 @@
* under the License.
*/
-var TableTypeServersController = function(type, servers, $scope, $state,
locationUtils, serverUtils) {
+var TableTypeServersController = function(type, servers, $scope, $state,
locationUtils, serverUtils, propertiesModel) {
$scope.type = type;
@@ -31,8 +31,14 @@ var TableTypeServersController = function(type, servers,
$scope, $state, locatio
$state.reload(); // reloads all the resolves for the view
};
+ $scope.showChartsButton =
propertiesModel.properties.servers.charts.show;
+
$scope.ssh = serverUtils.ssh;
+ $scope.gotoMonitor = serverUtils.gotoMonitor;
+
+ $scope.openCharts = serverUtils.openCharts;
+
$scope.isOffline = serverUtils.isOffline;
$scope.offlineReason = serverUtils.offlineReason;
@@ -43,11 +49,14 @@ var TableTypeServersController = function(type, servers,
$scope, $state, locatio
$('#serversTable').dataTable({
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100,
"All"]],
"iDisplayLength": 25,
+ "columnDefs": [
+ { 'orderable': false, 'targets': 11 }
+ ],
"aaSorting": []
});
});
};
-TableTypeServersController.$inject = ['type', 'servers', '$scope', '$state',
'locationUtils', 'serverUtils'];
+TableTypeServersController.$inject = ['type', 'servers', '$scope', '$state',
'locationUtils', 'serverUtils', 'propertiesModel'];
module.exports = TableTypeServersController;
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 cd9f1816d..870346886 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
@@ -45,6 +45,7 @@
<th>CDN</th>
<th>Cache Group</th>
<th>ILO</th>
+ <th style="text-align: right;">Actions</th>
</tr>
</thead>
<tbody>
@@ -66,6 +67,10 @@
<td data-search="^{{::s.cdnName}}$">{{::s.cdnName}}</td>
<td data-search="^{{::s.cachegroup}}$">{{::s.cachegroup}}</td>
<td data-search="^{{::s.iloIpAddress}}$"><a
ng-click="ssh(s.iloIpAddress, $event)">{{::s.iloIpAddress}}</a></td>
+ <td style="text-align: right;">
+ <span ng-if="s.type == 'RASCAL'"><a class="link
action-link" title="Go to" ng-click="gotoMonitor(s, $event)"><i class="fa fa-sm
fa-external-link"></i> </a></span>
+ <span ng-if="showChartsButton"><a class="link action-link"
title="View Charts" ng-click="openCharts(s, $event)"><i class="fa fa-sm
fa-bar-chart"></i></a></span>
+ </td>
</tr>
</tbody>
</table>
diff --git a/traffic_portal/app/src/common/service/utils/ServerUtils.js
b/traffic_portal/app/src/common/service/utils/ServerUtils.js
index b215d99b4..74d0f4c29 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($window, userModel) {
+var ServerUtils = function($window, propertiesModel, userModel) {
this.isCache = function(server) {
return server.type && (server.type.indexOf('EDGE') != -1 ||
server.type == 'MID');
@@ -42,7 +42,23 @@ var ServerUtils = function($window, userModel) {
$event.stopPropagation(); // this kills the click event so it
doesn't trigger anything else
};
+ this.openCharts = function(server, $event) {
+ $event.stopPropagation(); // this kills the click event so it
doesn't trigger anything else
+ $window.open(
+ propertiesModel.properties.servers.charts.baseUrl +
server.hostName,
+ '_blank'
+ );
+ };
+
+ this.gotoMonitor = function(server, $event) {
+ $event.stopPropagation(); // this kills the click event so it
doesn't trigger anything else
+ $window.open(
+ 'http://' + server.hostName + '.' + server.domainName,
+ '_blank'
+ );
+ };
+
};
-ServerUtils.$inject = ['$window', 'userModel'];
+ServerUtils.$inject = ['$window', 'propertiesModel', 'userModel'];
module.exports = ServerUtils;
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services