adding insights row icon per host

as well as hide the insights tab if a host is not an insights
host.
This commit is contained in:
Jared Tabor 2017-05-31 14:32:09 -07:00
parent 289835f01b
commit e2abbafa1e
8 changed files with 24 additions and 2 deletions

View File

@ -125,7 +125,8 @@ function(i18n) {
awToolTip: i18n._('Please save before viewing Insights'),
dataPlacement: 'top',
title: i18n._('Insights'),
skipGenerator: true
skipGenerator: true,
ngIf: 'host.insights_system_id!==null'
}
}
};

View File

@ -74,6 +74,9 @@
</td>
<td class="List-actionsContainer">
<div class="List-actionButtonCell List-tableCell">
<button id="insights-action" class="List-actionButton " data-placement="top" ng-click="goToInsights(host.id)" aw-tool-tip="View Insights Data" ng-show="host.insights_system_id">
<i class="fa fa-info"></i>
</button>
<button id="edit-action" class="List-actionButton " ng-class="{'List-editButton--selected' : $stateParams['host_id'] == host.id}" data-placement="top" ng-click="editHost(host.id)" aw-tool-tip="Edit host" ng-show="host.summary_fields.user_capabilities.edit">
<i class="fa fa-pencil"></i>
</button>

View File

@ -65,6 +65,9 @@ function HostsList($scope, HostsList, $rootScope, GetBasePath,
$scope.editHost = function(id){
$state.go('hosts.edit', {host_id: id});
};
$scope.goToInsights = function(id){
$state.go('hosts.edit.insights', {host_id:id});
};
$scope.deleteHost = function(id, name){
var body = '<div class=\"Prompt-bodyQuery\">Are you sure you want to permanently delete the host below from the inventory?</div><div class=\"Prompt-bodyTarget\">' + $filter('sanitize')(name) + '</div>';
var action = function(){

View File

@ -86,6 +86,9 @@ export default ['$scope', 'ListDefinition', '$rootScope', 'GetBasePath',
$scope.editHost = function(id){
$state.go('inventories.edit.hosts.edit', {host_id: id});
};
$scope.goToInsights = function(id){
$state.go('inventories.edit.hosts.edit.insights', {host_id:id});
};
$scope.deleteHost = function(id, name){
var body = '<div class=\"Prompt-bodyQuery\">Are you sure you want to permanently delete the host below from the inventory?</div><div class=\"Prompt-bodyTarget\">' + $filter('sanitize')(name) + '</div>';
var action = function(){

View File

@ -125,7 +125,8 @@ function(i18n) {
awToolTip: i18n._('Please save before viewing Insights'),
dataPlacement: 'top',
title: i18n._('Insights'),
skipGenerator: true
skipGenerator: true,
ngIf: 'host.insights_system_id!==null'
}
}
};

View File

@ -50,6 +50,13 @@ export default {
fieldActions: {
columnClass: 'col-lg-6 col-md-4 col-sm-4 col-xs-5 text-right',
insights: {
ngClick: "goToInsights(host.id)",
icon: 'fa-info',
awToolTip: 'View Insights Data',
dataPlacement: 'top',
ngShow: 'host.insights_system_id'
},
copy: {
mode: 'all',
ngClick: "copyMoveHost(host.id)",

View File

@ -1507,6 +1507,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
collection = this.form.related[itm];
html += `<div id="${itm}_tab" `+
`class="Form-tab" `;
html += (this.form.related[itm].ngIf) ? ` ng-if="${this.form.related[itm].ngIf}" ` : "";
html += (this.form.related[itm].ngClick) ? `ng-click="` + this.form.related[itm].ngClick + `" ` : `ng-click="$state.go('${this.form.stateTree}.edit.${itm}')" `;
if (collection.awToolTip && collection.awToolTipTabEnabledInEditMode === true) {
html += `aw-tool-tip="${collection.awToolTip}" ` +

View File

@ -191,6 +191,9 @@ angular.module('GeneratorHelpers', [systemStatus.name])
case 'copy':
icon = "fa-copy";
break;
case 'insights':
icon = "fa-info";
break;
case 'cancel':
icon = "fa-minus-circle";
break;