Fixed <pre> block wrapping in tooltips for Firefox. Fixed missing output/error/returncode on events page- required use of angular sanitizer.

This commit is contained in:
Chris Houseknecht 2014-04-07 15:03:28 -04:00
parent 3876e06a8d
commit 1a7a4bad49
4 changed files with 27 additions and 9 deletions

View File

@ -10,7 +10,7 @@
'use strict';
function JobEventsList($filter, $scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobEventList, GenerateList,
function JobEventsList($sce, $filter, $scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobEventList, GenerateList,
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, LookUpInit, ToggleChildren,
FormatDate, EventView, Refresh, Wait) {
@ -79,11 +79,11 @@ function JobEventsList($filter, $scope, $rootScope, $location, $log, $routeParam
rows = (n) ? n.length : 1;
rows = (rows > 10) ? 10 : rows;
html += "<textarea readonly class=\"form-control nowrap\" rows=\"" + rows + "\">" + eventData.res[fld] + "</textarea>\n";
//html += "<pre>" + eventData.res[fld] + "</pre>\n";
html += "</div>\n";
found = true;
}
if (fld === "results" && Array.isArray(eventData.res[fld]) && eventData.res[fld].length > 0) {
//html += "<textarea readonly class="
txt = '';
for (i = 0; i < eventData.res[fld].length; i++) {
txt += eventData.res[fld][i];
@ -95,14 +95,16 @@ function JobEventsList($filter, $scope, $rootScope, $location, $log, $routeParam
html += "<div class=\"form-group\">\n";
html += "<label>Results:</label>\n";
html += "<textarea readonly class=\"form-control nowrap mono-space\" rows=\"" + rows + "\">" + txt + "</textarea>\n";
//html += "<pre>" + txt + "</pre>\n";
html += "</div>\n";
found = true;
}
}
if (fld === "rc" && eventData.res[fld] !== '') {
html += "<div class=\"form-group\">\n";
html += "<label>Return Code:</label>\n";
html += "<input type=\"text\" class=\"form-control nowrap mono-space\" value=\"" + eventData.res[fld] + "\" readonly >\n";
html += "<label>Return Code:</label><div class=\"return-code\">" + eventData.res[fld] + "</div>\n";
//html += "<input type=\"text\" class=\"form-control nowrap mono-space\" value=\"" + eventData.res[fld] + "\" readonly >\n";
html += "</div>\n";
found = true;
}
@ -123,7 +125,9 @@ function JobEventsList($filter, $scope, $rootScope, $location, $log, $routeParam
}
$scope.removePostRefresh = $scope.$on('PostRefresh', function () {
// Initialize the parent levels
generator.inject(list, { mode: 'edit', scope: $scope });
var set = $scope[list.name], i;
for (i = 0; i < set.length; i++) {
set[i].event_display = set[i].event_display.replace(/^\u00a0*/g, '');
@ -133,7 +137,7 @@ function JobEventsList($filter, $scope, $rootScope, $location, $log, $routeParam
} else {
set[i].ngicon = 'fa fa-square-o node-no-toggle';
set[i]['class'] = 'childNode';
set[i].event_detail = formatJSON(set[i].event_data);
set[i].event_detail = $sce.trustAsHtml(formatJSON(set[i].event_data));
}
set[i].show = true;
set[i].spaces = set[i].event_level * 24;
@ -247,7 +251,7 @@ function JobEventsList($filter, $scope, $rootScope, $location, $log, $routeParam
};
}
JobEventsList.$inject = ['$filter', '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobEventList',
JobEventsList.$inject = ['$sce', '$filter', '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobEventList',
'GenerateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
'GetBasePath', 'LookUpInit', 'ToggleChildren', 'FormatDate', 'EventView', 'Refresh', 'Wait'
];

View File

@ -70,7 +70,7 @@ angular.module('JobEventsFormDefinition', [])
rows: 10
},
stdout: {
label: 'Std Out',
label: 'Standard Out',
type: 'textarea',
readonly: true,
section: 'Results',
@ -79,7 +79,7 @@ angular.module('JobEventsFormDefinition', [])
rows: 10
},
stderr: {
label: 'Std Err',
label: 'Standard Err',
type: 'textarea',
readonly: true,
section: 'Results',

View File

@ -236,6 +236,9 @@ textarea.allowresize {
min-width: 200px;
max-width: 325px;
}
.popover pre {
white-space: pre-wrap;
}
.popover-footer {
font-size: 12px;
margin-top: 10px;
@ -1064,6 +1067,17 @@ input[type="checkbox"].checkbox-no-label {
#completed_jobs_table i[class*="icon-job-"] {
font-size: 13px;
}
#jobevents_table {
div.return-code {
display: inline-block;
margin-left: 10px;
}
textarea {
white-space: pre-wrap;
resize: vertical;
}
}
/* Inventory job status badge */
.failures-true {

View File

@ -630,7 +630,7 @@ angular.module('GeneratorHelpers', [])
// Specific to Job Events page -showing event detail/results
html += (field.appendHTML) ? "<div ng-show=\"" + field.appendHTML + " !== null\" " +
"ng-bind-html-unsafe=\"" + field.appendHTML + "\" " +
"ng-bind-html=\"" + field.appendHTML + "\" " +
"class=\"level-{{ " + list.iterator + ".event_level }}-detail\" " +
"></div>\n" : "";