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