mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 09:51:09 +03:00
AC-977 Fixed raw html showing up in Action field on detail dialog. Added a subtitle on the AS widget. On inventory groups/host page the subtitle explains what activities are being displayed, and only activities realted to the selected group (on the inventory page) are displayed. If All Hosts selected, then all activities for all groups related to the current inventory are displayed. Also, brought back activity stream button for inventory hosts.
This commit is contained in:
parent
57235cad7a
commit
168c4235f5
@ -521,10 +521,26 @@ function InventoriesEdit ($scope, $location, $routeParams, $compile, GenerateLis
|
||||
}
|
||||
|
||||
$scope.showGroupActivity = function() {
|
||||
var url = GetBasePath('activity_stream') + '?group__inventory__id=' + $scope.inventory_id;
|
||||
Stream({ scope: $scope, inventory_name: $scope.inventory_name, url: url });
|
||||
var url, title, group;
|
||||
if ($scope.selected_group_id) {
|
||||
group = Find({ list: $scope.groups, key: 'id', val: $scope.selected_tree_id });
|
||||
url = GetBasePath('activity_stream') + '?group__id=' + $scope.selected_group_id;
|
||||
title = 'Showing all activities for group ' + group.name;
|
||||
}
|
||||
else {
|
||||
title = 'Showing all activities for all ' + $scope.inventory_name + ' groups';
|
||||
url = GetBasePath('activity_stream') + '?group__inventory__id=' + $scope.inventory_id;
|
||||
}
|
||||
Stream({ scope: $scope, inventory_name: $scope.inventory_name, url: url, title: title });
|
||||
}
|
||||
|
||||
$scope.showHostActivity = function() {
|
||||
var url, title;
|
||||
title = 'Showing all activities for all ' + $scope.inventory_name + ' hosts';
|
||||
url = GetBasePath('activity_stream') + '?host__inventory__id=' + $scope.inventory_id;
|
||||
Stream({ scope: $scope, inventory_name: $scope.inventory_name, url: url, title: title });
|
||||
}
|
||||
|
||||
$scope.showJobSummary = function(job_id) {
|
||||
ShowJobSummary({ job_id: job_id });
|
||||
}
|
||||
|
@ -100,7 +100,13 @@ angular.module('InventoryHostsDefinition', [])
|
||||
ngHide: 'selected_tree_id == 1', //disable when 'All Hosts' selected
|
||||
awToolTip: "Create a new host"
|
||||
},
|
||||
help: {
|
||||
stream: {
|
||||
ngClick: "showHostActivity()",
|
||||
awToolTip: "View Activity Stream",
|
||||
mode: 'all',
|
||||
ngShow: "user_is_superuser"
|
||||
},
|
||||
help: {
|
||||
mode: 'all',
|
||||
awToolTip:
|
||||
//"<div style=\"text-align:left;\"><img src=\"/static/img/cow.png\" style=\"width:50px; height:56px; float:left; padding-right:5px;\">" +
|
||||
|
@ -189,14 +189,17 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
||||
}
|
||||
else if (obj1) {
|
||||
name = '';
|
||||
var name_nolink = '';
|
||||
// find the name in changes, if needed
|
||||
if ( !(obj1_obj && obj1_obj.name) || obj1_obj && obj1_obj.name && /^_delete/.test(obj1_obj.name) ) {
|
||||
if (activity.changes && activity.changes.name) {
|
||||
if (typeof activity.changes.name == 'string') {
|
||||
name = ' ' + activity.changes.name;
|
||||
name_nolink = name;
|
||||
}
|
||||
else if (typeof activity.changes.name == 'object' && Array.isArray(activity.changes.name)) {
|
||||
name = ' ' + activity.changes.name[0]
|
||||
name = ' ' + activity.changes.name[0];
|
||||
name_nolink = name;
|
||||
}
|
||||
}
|
||||
else if (obj1 == 'job' && obj1_obj && activity.changes && activity.changes.job_template) {
|
||||
@ -204,9 +207,11 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
||||
if (activity.operation != 'delete') {
|
||||
obj1_obj['base'] = obj1;
|
||||
name = ' ' + '<a href=\"' + BuildUrl(obj1_obj) + '\">'+ obj1_obj.id + ' ' + activity.changes.job_template + '</a>';
|
||||
name_nolink = ' ' + obj1_obj.id + ' ' + activity.changes.job_template;
|
||||
}
|
||||
else {
|
||||
name = ' ' + obj1_obj.id + ' ' + activity.changes.job_template;
|
||||
name_nolink = name;
|
||||
}
|
||||
}
|
||||
else if (obj1 == 'job' && obj1_obj) {
|
||||
@ -214,17 +219,20 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
||||
if (activity.operation != 'delete') {
|
||||
obj1_obj['base'] = obj1;
|
||||
name = ' ' + '<a href=\"' + BuildUrl(obj1_obj) + '\">' + obj1_obj.id + '</a>';
|
||||
name_nolink = ' ' + obj1_obj.id;
|
||||
}
|
||||
else {
|
||||
name = ' ' + obj1_obj.id;
|
||||
name_nolink = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (obj1_obj && obj1_obj.name) {
|
||||
name = ' ' + stripDeleted(obj1_obj.name);
|
||||
name_nolink = name;
|
||||
}
|
||||
descr += obj1 + name;
|
||||
descr_nolink += obj1 + name;
|
||||
descr_nolink += obj1 + name_nolink;
|
||||
}
|
||||
activity['description'] = descr;
|
||||
activity['description_nolink'] = descr_nolink;
|
||||
@ -301,10 +309,10 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
||||
var PreviousSearchParams = Store('CurrentSearchParams');
|
||||
|
||||
// pass in an inventory name to fix breadcrumb display
|
||||
var inventory_name = (params) ? params.inventory_name : null;
|
||||
var inventory_name = (params && params.inventory_name) ? params.inventory_name : null;
|
||||
|
||||
// url will override the attempt to compute an activity_stream query
|
||||
var url = (params) ? params.url : null;
|
||||
var url = (params && params.url) ? params.url : null;
|
||||
|
||||
$rootScope.flashMessage = null;
|
||||
|
||||
@ -357,6 +365,9 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
||||
secondWidget: true,
|
||||
activityStream: true
|
||||
});
|
||||
|
||||
// descriptive title describing what AS is showing
|
||||
scope.streamTitle = (params && params.title) ? params.title : null;
|
||||
|
||||
scope.closeStream = function(inUrl) {
|
||||
HideStream();
|
||||
|
@ -1382,6 +1382,11 @@ tr td button i {
|
||||
border: 1px solid @grey;
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
|
||||
h5 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -147,6 +147,15 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
||||
html += "<div class=\"well\">\n";
|
||||
}
|
||||
|
||||
if (options.activityStream) {
|
||||
// Add a title row
|
||||
html += "<div class=\"row\">\n";
|
||||
html += "<div class=\"col-lg-12\">\n";
|
||||
html += "<h5>{{ streamTitle }}</h5>\n";
|
||||
html += "</div>\n";
|
||||
html += "</div>\n";
|
||||
}
|
||||
|
||||
html += "<div class=\"row\">\n";
|
||||
|
||||
if (list.name != 'groups') {
|
||||
|
Loading…
Reference in New Issue
Block a user