mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 20:00:43 -03:30
AC-175 Job event details -show date in local timezone and with a cleaner format
This commit is contained in:
parent
5ead7b7ec4
commit
e17d984758
@ -145,7 +145,7 @@ JobEventsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routePa
|
||||
];
|
||||
|
||||
function JobEventsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, JobEventForm, GenerateForm,
|
||||
Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath)
|
||||
Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath, FormatDate)
|
||||
{
|
||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||
//scope.
|
||||
@ -172,8 +172,14 @@ function JobEventsEdit ($scope, $rootScope, $compile, $location, $log, $routePar
|
||||
scope['event_data'] = JSON.stringify(data['event_data'], undefined, '\t');
|
||||
}
|
||||
else {
|
||||
if (data[fld]) {
|
||||
scope[fld] = data[fld];
|
||||
if (fld == 'created') {
|
||||
var cDate = new Date(data['created']);
|
||||
scope['created'] = FormatDate(cDate);
|
||||
}
|
||||
else {
|
||||
if (data[fld]) {
|
||||
scope[fld] = data[fld];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -186,4 +192,6 @@ function JobEventsEdit ($scope, $rootScope, $compile, $location, $log, $routePar
|
||||
}
|
||||
|
||||
JobEventsEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'JobEventForm',
|
||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath'];
|
||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath',
|
||||
'FormatDate'
|
||||
];
|
||||
|
||||
@ -8,8 +8,9 @@
|
||||
*/
|
||||
angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventFormDefinition'])
|
||||
.factory('EventView', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobEventForm', 'GenerateForm',
|
||||
'Prompt', 'ProcessErrors', 'GetBasePath',
|
||||
function($rootScope, $location, $log, $routeParams, Rest, Alert, JobEventForm, GenerateForm, Prompt, ProcessErrors, GetBasePath) {
|
||||
'Prompt', 'ProcessErrors', 'GetBasePath', 'FormatDate',
|
||||
function($rootScope, $location, $log, $routeParams, Rest, Alert, JobEventForm, GenerateForm, Prompt, ProcessErrors, GetBasePath,
|
||||
FormatDate) {
|
||||
return function(params) {
|
||||
var event_id = params.event_id;
|
||||
var generator = GenerateForm;
|
||||
@ -49,8 +50,14 @@ angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventFormDefini
|
||||
scope['event_display'] = data.event_display.replace(/^\u00a0*/g,'')
|
||||
}
|
||||
else {
|
||||
if (data[fld]) {
|
||||
scope[fld] = data[fld];
|
||||
if (fld == 'created') {
|
||||
var cDate = new Date(data['created']);
|
||||
scope['created'] = FormatDate(cDate);
|
||||
}
|
||||
else {
|
||||
if (data[fld]) {
|
||||
scope[fld] = data[fld];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user