mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Merge remote-tracking branch 'origin/master' into celery-refactor
* origin/master: (28 commits) AC-995 fixed typo and added extra error handling in case we actually cannot parse inventory variables. If that does happen, we now alert the user and keep the application stable and running. Use supervisorctl when restarting celeryd on Ubuntu Revert custom supervisor initscript fix for the small viewport issue (https://www.dropbox.com/s/dmf4aixfv7k67cm/Screenshot%202014-01-29%2015.19.52.png) where group name div gets pushed to a new line. Fixed AS widget breadcrumb links 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. During AMI boot, use custom initscript name Update tower-setup filename used in AMI build AC-578 - Add custom supervisor initscript on ubuntu Remove 'awx-' prefix when reporting version Explicitly include the egg-info in rpm packaging Fixing store references to point to http://www.ansible.com/ansible-pricing Update make develop command, version check after package rename. AC-992 Fix inventory import tests. AC-967 Fixed job name in the host status fly-out. Text now wraps rather than extending beyond boundaries of pop-over. Removed status label- just show red/green dot. Clicking on ID or red/green dot shows the status dialog. When dialog closes the window.resize() watcher is restored. AC-976 now using custom javascript to apply ellipsis to long group and host names. Fixed indes.html title. Fix ansible-tower deb build Rename package awx to ansible-tower AC-976 add job template name to activity stream AC-979 using activity stream object arrays correctly. AC-980 fixed Action label on detail dialog. ... Conflicts: awx/ui/static/js/controllers/Inventories.js awx/ui/static/js/lists/InventoryHosts.js awx/ui/static/js/widgets/Stream.js
This commit is contained in:
commit
82b692be9c
@ -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 });
|
||||
}
|
||||
|
||||
@ -137,12 +137,24 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi
|
||||
if (fld == 'inventory_variables') {
|
||||
// Parse variables, converting to YAML.
|
||||
if ($.isEmptyObject(data.variables) || data.variables == "\{\}" ||
|
||||
data.variables == "null" || data.data_variables == "") {
|
||||
data.variables == "null" || data.variables == "") {
|
||||
scope.inventory_variables = "---";
|
||||
}
|
||||
else {
|
||||
var json_obj = JSON.parse(data.variables);
|
||||
scope.inventory_variables = jsyaml.safeDump(json_obj);
|
||||
try {
|
||||
var json_obj = JSON.parse(data.variables);
|
||||
scope.inventory_variables = jsyaml.safeDump(json_obj);
|
||||
}
|
||||
catch(err) {
|
||||
Alert('Variable Parse Error', 'Attempted to parse variables for inventory: ' + inventory_id +
|
||||
'. Parse returned: ' + err);
|
||||
if (console) {
|
||||
console.log(err);
|
||||
console.log('data:');
|
||||
console.log(data.variables);
|
||||
}
|
||||
scope.inventory_variables = '---';
|
||||
}
|
||||
}
|
||||
master.inventory_variables = scope.variables;
|
||||
}
|
||||
|
||||
@ -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;\">" +
|
||||
@ -112,4 +118,4 @@ angular.module('InventoryHostsDefinition', [])
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -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();
|
||||
@ -448,4 +459,4 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
||||
|
||||
}
|
||||
}]);
|
||||
|
||||
|
||||
|
||||
@ -1382,6 +1382,11 @@ tr td button i {
|
||||
border: 1px solid @grey;
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
|
||||
h5 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1437,35 +1442,15 @@ tr td button i {
|
||||
@media (min-width: 768px) and (max-width: 1199px) {
|
||||
|
||||
.list-actions button, .list-actions .checkbox-inline {
|
||||
margin-top: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/*.tree-form-container {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
|
||||
}
|
||||
|
||||
.tree-view-container .col-lg-4 {
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.tree-controls .btn-container {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
#tree-view {
|
||||
margin-left: 0;
|
||||
margin-top: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#tree-form {
|
||||
margin-top: 10px;
|
||||
}*/
|
||||
|
||||
.label-text {
|
||||
text-align: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.group-name {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1481,43 +1466,34 @@ tr td button i {
|
||||
.level-2,
|
||||
.level-3,
|
||||
.level-3-detail {
|
||||
padding-left: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
table {
|
||||
word-wrap: break-word;
|
||||
table-layout: fixed;
|
||||
word-wrap: break-word;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
th.actions-column,
|
||||
td.actions {
|
||||
white-space: normal;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
td.actions .btn {
|
||||
width: 75px;
|
||||
margin-bottom: 5px;
|
||||
width: 75px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.list-actions button, .list-actions .checkbox-inline {
|
||||
margin-top: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.tree-form-container {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.tree-view-container .col-lg-4 {
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.tree-controls .btn-container {
|
||||
padding-left: 15px;
|
||||
.group-name {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.label-text {
|
||||
text-align: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
||||
// before navigation
|
||||
html += "<div class=\"nav-path\">\n";
|
||||
html += "<ul class=\"breadcrumb\">\n";
|
||||
html += "<li ng-repeat=\"crumb in breadcrumbs\"><a href=\"\" ng-click=\"crumb.ngClick\">{{ crumb.title | capitalize }}</a></li>\n";
|
||||
html += "<li ng-repeat=\"crumb in breadcrumbs\"><a href=\"\" ng-click=\"\{\{ crumb.ngClick \}\}\">{{ crumb.title | capitalize }}</a></li>\n";
|
||||
html += "<li class=\"active\">";
|
||||
html += list.editTitle;
|
||||
html += "</li>\n</ul>\n</div>\n";
|
||||
@ -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…
x
Reference in New Issue
Block a user