mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 02:19:58 -03:30
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:
parent
289835f01b
commit
e2abbafa1e
@ -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'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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(){
|
||||
|
||||
@ -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(){
|
||||
|
||||
@ -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'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -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)",
|
||||
|
||||
@ -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}" ` +
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user