From 4923fd84c16c67da2711d75993165ac3a691e83c Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Tue, 16 Jul 2013 23:25:25 -0400 Subject: [PATCH] AC-216 Added 'back' navigation button to each corner of page. --- awx/ui/static/js/controllers/JobEvents.js | 10 +- awx/ui/static/js/forms/JobEvents.js | 19 ++-- awx/ui/static/js/forms/JobEvents.js.old | 100 -------------------- awx/ui/static/js/helpers/search.js | 3 +- awx/ui/static/lib/ansible/form-generator.js | 33 ++++--- 5 files changed, 38 insertions(+), 127 deletions(-) delete mode 100644 awx/ui/static/js/forms/JobEvents.js.old diff --git a/awx/ui/static/js/controllers/JobEvents.js b/awx/ui/static/js/controllers/JobEvents.js index 5ba5498fd3..74ef9c422f 100644 --- a/awx/ui/static/js/controllers/JobEvents.js +++ b/awx/ui/static/js/controllers/JobEvents.js @@ -227,13 +227,19 @@ function JobEventsEdit ($scope, $rootScope, $compile, $location, $log, $routePar break; case 'id': case 'task': + case 'play': scope[fld] = data[fld]; break; + case 'start': + case 'end': + if (data['event_data'] && data['event_data']['res'] && data['event_data']['res'][fld] !== undefined) { + var cDate = new Date(data['event_data']['res'][fld]); + scope[fld] = FormatDate(cDate); + } + break; case 'msg': case 'stdout': case 'stderr': - case 'start': - case 'end': case 'delta': case 'rc': if (data['event_data'] && data['event_data']['res'] && data['event_data']['res'][fld] !== undefined) { diff --git a/awx/ui/static/js/forms/JobEvents.js b/awx/ui/static/js/forms/JobEvents.js index f9695b1232..8c2c4701ce 100644 --- a/awx/ui/static/js/forms/JobEvents.js +++ b/awx/ui/static/js/forms/JobEvents.js @@ -41,6 +41,12 @@ angular.module('JobEventFormDefinition', []) readonly: true, section: 'Event' }, + play: { + label: 'Play', + type: 'text', + readonly: true, + section: 'Event' + }, task: { label: 'Task', type: 'text', @@ -119,22 +125,15 @@ angular.module('JobEventFormDefinition', []) navigation: { back_top: { label: 'Back', - position: 'top', - 'class': 'btn-small pull-right', - icon: 'icon-arrow-left', - ngClick: 'navigateBack()' - }, - back_bottom: { - label: 'Back', - position: 'bottom', - 'class': 'btn-small pull-right', + position: ['top-left','top-right', 'bottom-left', 'bottom-right'], + 'class': 'btn-small', icon: 'icon-arrow-left', ngClick: 'navigateBack()' }, raw_view: { label: 'View raw JSON results', icon: 'icon-zoom-in', - position: 'bottom', + position: ['bottom-left'], 'class': 'btn-small', ngClick: 'rawView()' } diff --git a/awx/ui/static/js/forms/JobEvents.js.old b/awx/ui/static/js/forms/JobEvents.js.old deleted file mode 100644 index eb96accc0c..0000000000 --- a/awx/ui/static/js/forms/JobEvents.js.old +++ /dev/null @@ -1,100 +0,0 @@ -/********************************************* - * Copyright (c) 2013 AnsibleWorks, Inc. - * - * JobEvents.js - * Form definition for Job Events model - * - * @dict - */ -angular.module('JobEventFormDefinition', []) - .value( - 'JobEventForm', { - - editTitle: '{{ name }} Events', //Legend in edit mode - name: 'job_events', - well: true, - fieldsAsHeader: true, - - fields: { - job: { - label: 'Job', - type: 'text', - class: 'span1', - readonly: true - }, - job_name: { - type: 'text', - sourceModel: 'job', - sourceField: 'name', - class: 'span5', - readonly: true - }, - job_description: { - type: 'text', - sourceModel: 'job', - sourceField: 'description', - class: 'span5', - readonly: true - } - }, - - buttons: { - - }, - - items: { - event: { - set: 'job_events', - iterator: 'job_event', - label: 'Event', - fields: { - id: { - label: 'Event ID', - type: 'text', - readonly: true, - class: 'span2', - key: true, - searchType: 'int' - }, - created: { - label: 'Event Timestamp', - type: 'text', - readonly: true, - class: 'span4' - }, - event: { - label: 'Event', - type: 'text', - readonly: true - }, - host: { - label: 'Host', - type: 'text', - readonly: true - }, - event_status: { - label: 'Event Status', - type: 'text', - class: 'job-\{\{ event_status \}\}', - readonly: true, - searchField: 'failed', - searchType: 'boolean', - searchOptions: [{ name: "success", value: 0 }, { name: "failed", value: 1 }], - }, - event_data: { - label: 'Event Data', - type: 'textarea', - class: 'span12', - rows: 10, - readonly: true - } - } - } - }, - - related: { //related colletions (and maybe items?) - - } - - }); //Form - diff --git a/awx/ui/static/js/helpers/search.js b/awx/ui/static/js/helpers/search.js index a5560b6892..3508fc7560 100644 --- a/awx/ui/static/js/helpers/search.js +++ b/awx/ui/static/js/helpers/search.js @@ -8,8 +8,7 @@ * * SearchInit({ * scope: , - * set: + * set: * url: * list: * }); diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index 174efa49ee..d93a405c25 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -181,18 +181,25 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) return html; }, - button: function(btn) { + button: function(btn, topOrBottom) { // pass in a button object and get back an html string containing // a