This is an automated email from the ASF dual-hosted git repository. dangogh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push: new df0c4ac adds chart link and goto link (only for rascal servers) to each server table df0c4ac is described below commit df0c4ac343f8634297d50fedcca0945fe3a778e5 Author: Jeremy Mitchell <mitchell...@gmail.com> AuthorDate: Fri Apr 13 15:25:00 2018 -0600 adds chart link and goto link (only for rascal servers) to each server table --- .../modules/form/server/FormServerController.js | 13 ++++--------- .../TableCacheGroupServersController.js | 13 +++++++++++-- .../table.cacheGroupServers.tpl.html | 5 +++++ .../table/cdnServers/TableCDNServersController.js | 13 +++++++++++-- .../table/cdnServers/table.cdnServers.tpl.html | 5 +++++ .../TableDeliveryServiceServersController.js | 18 ++++++++++++++---- .../table.deliveryServiceServers.tpl.html | 9 ++++++--- .../TablePhysLocationServersController.js | 13 +++++++++++-- .../table.physLocationServers.tpl.html | 5 +++++ .../profileServers/TableProfileServersController.js | 13 +++++++++++-- .../profileServers/table.profileServers.tpl.html | 5 +++++ .../modules/table/servers/TableServersController.js | 13 +++++++++++-- .../modules/table/servers/table.servers.tpl.html | 5 +++++ .../statusServers/TableStatusServersController.js | 13 +++++++++++-- .../table/statusServers/table.statusServers.tpl.html | 5 +++++ .../table/typeServers/TableTypeServersController.js | 13 +++++++++++-- .../table/typeServers/table.typeServers.tpl.html | 5 +++++ .../app/src/common/service/utils/ServerUtils.js | 20 ++++++++++++++++++-- 18 files changed, 154 insertions(+), 32 deletions(-) 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 5887f1a..53e7745 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 2b49738..88e65be 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 0f6dd86..7c36b33 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 @@ under the License. <th>CDN</th> <th>Cache Group</th> <th>ILO</th> + <th style="text-align: right;">Actions</th> </tr> </thead> <tbody> @@ -76,6 +77,10 @@ under the License. <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 53a0eea..d50ae91 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 f5e9372..3f3ab32 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 @@ under the License. <th>CDN</th> <th>Cache Group</th> <th>ILO</th> + <th style="text-align: right;">Actions</th> </tr> </thead> <tbody> @@ -76,6 +77,10 @@ under the License. <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 89ef012..c0412c8 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 5442ac2..5a4a5c1 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 @@ under the License. <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 @@ under the License. <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 a018364..ad2cde3 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 deb1b92..d415fa0 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 @@ under the License. <th>CDN</th> <th>Cache Group</th> <th>ILO</th> + <th style="text-align: right;">Actions</th> </tr> </thead> <tbody> @@ -66,6 +67,10 @@ under the License. <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 08eaa87..94fe884 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 61deb18..9722dee 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 @@ under the License. <th>CDN</th> <th>Cache Group</th> <th>ILO</th> + <th style="text-align: right;">Actions</th> </tr> </thead> <tbody> @@ -66,6 +67,10 @@ under the License. <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 d0b5da5..3e5bb01 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 e21e174..0e27f6e 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 @@ under the License. <th>CDN</th> <th>Cache Group</th> <th>ILO</th> + <th style="text-align: right;">Actions</th> </tr> </thead> <tbody> @@ -75,6 +76,10 @@ under the License. <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 bdfa2af..dd2ba06 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 cb344a4..01331d9 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 @@ under the License. <th>CDN</th> <th>Cache Group</th> <th>ILO</th> + <th style="text-align: right;">Actions</th> </tr> </thead> <tbody> @@ -66,6 +67,10 @@ under the License. <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 d512909..0123126 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 cd9f181..8703468 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 @@ under the License. <th>CDN</th> <th>Cache Group</th> <th>ILO</th> + <th style="text-align: right;">Actions</th> </tr> </thead> <tbody> @@ -66,6 +67,10 @@ under the License. <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 b215d99..74d0f4c 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; -- To stop receiving notification emails like this one, please contact dang...@apache.org.