diff --git a/awx/ui/static/js/controllers/Projects.js b/awx/ui/static/js/controllers/Projects.js index d2cf9c9f18..42fdff1a70 100644 --- a/awx/ui/static/js/controllers/Projects.js +++ b/awx/ui/static/js/controllers/Projects.js @@ -208,7 +208,8 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Wait('start'); LogViewer({ scope: $scope, - url: project.related.last_update + url: project.related.last_update, + status_icon: 'icon-job-' + project.statusIcon }); /* ProjectStatus({ diff --git a/awx/ui/static/js/forms/LogViewerOptions.js b/awx/ui/static/js/forms/LogViewerOptions.js index d23b365977..a3d94b06ef 100644 --- a/awx/ui/static/js/forms/LogViewerOptions.js +++ b/awx/ui/static/js/forms/LogViewerOptions.js @@ -13,16 +13,6 @@ angular.module('LogViewerOptionsDefinition', []) well: false, fields: { - "job_args": { - label: "Arguments", - type: "text", - readonly: true - }, - "job_cwd": { - label: "CWD", - type: "text", - readonly: true - }, "job_type": { label: "Job Type", type: "text", diff --git a/awx/ui/static/js/forms/LogViewerStatus.js b/awx/ui/static/js/forms/LogViewerStatus.js index 7b634998fc..511b71fee3 100644 --- a/awx/ui/static/js/forms/LogViewerStatus.js +++ b/awx/ui/static/js/forms/LogViewerStatus.js @@ -18,18 +18,18 @@ angular.module('LogViewerStatusDefinition', []) type: "text", readonly: true, }, - "created": { - label: "Created", + "started": { + label: "Started", type: "text", readonly: true }, - "modified": { - label: "Modified", + "finished": { + label: "Finished", type: "text", readonly: true }, - "unified_job_template": { - label: "Job Template", + "elapsed": { + label: "Elapsed", type: "text", readonly: true }, @@ -47,21 +47,6 @@ angular.module('LogViewerStatusDefinition', []) label: "License Error", type: "text", readonly: true - }, - "started": { - label: "Started", - type: "text", - readonly: true - }, - "finished": { - label: "Finished", - type: "text", - readonly: true - }, - "elapsed": { - label: "Elapsed", - type: "text", - readonly: true } } diff --git a/awx/ui/static/js/helpers/LogViewer.js b/awx/ui/static/js/helpers/LogViewer.js index 817234c485..44e5d8d7a8 100644 --- a/awx/ui/static/js/helpers/LogViewer.js +++ b/awx/ui/static/js/helpers/LogViewer.js @@ -16,6 +16,7 @@ angular.module('LogViewerHelper', ['ModalDialog', 'Utilities', 'FormGenerator']) return function(params) { var parent_scope = params.scope, url = params.url, + status_icon = params.status_icon, scope = parent_scope.$new(); if (scope.removeModalReady) { @@ -36,8 +37,8 @@ angular.module('LogViewerHelper', ['ModalDialog', 'Utilities', 'FormGenerator']) scope[key] = data[key]; } - AddTable({ scope: scope, form: LogViewerStatusForm, id: 'status-form-container' }); - AddTable({ scope: scope, form: LogViewerOptionsForm, id: 'options-form-container' }); + AddTable({ scope: scope, form: LogViewerStatusForm, id: 'status-form-container', status_icon: status_icon }); + AddTable({ scope: scope, form: LogViewerOptionsForm, id: 'options-form-container', status_icon: status_icon }); if (data.result_stdout) { AddTextarea({ @@ -61,12 +62,12 @@ angular.module('LogViewerHelper', ['ModalDialog', 'Utilities', 'FormGenerator']) $('#logview-tabs li:eq(2)').hide(); } - if (data.job_env) { + /*if (data.job_env) { EnvTable({ id: 'env-form-container', vars: data.job_env }); - } + }*/ if (!Empty(scope.credential)) { LookUpName({ @@ -124,7 +125,7 @@ angular.module('LogViewerHelper', ['ModalDialog', 'Utilities', 'FormGenerator']) CreateDialog({ scope: scope, width: 600, - height: 675, + height: 550, minWidth: 450, callback: 'ModalReady', id: 'logviewer-modal-dialog', @@ -172,7 +173,11 @@ angular.module('LogViewerHelper', ['ModalDialog', 'Utilities', 'FormGenerator']) Rest.get() .success(function(data) { if (!Empty(data.name)) { - scope[scope_var] = data.name; + scope[scope_var + '_name'] = data.name; + } + if (!Empty(data.group)) { + // Used for inventory_source + scope.group = data.group; } }) .error(function(data, status) { @@ -182,20 +187,37 @@ angular.module('LogViewerHelper', ['ModalDialog', 'Utilities', 'FormGenerator']) }; }]) - .factory('AddTable', ['Empty', function(Empty) { + .factory('AddTable', ['Empty', 'Find', function(Empty, Find) { return function(params) { var form = params.form, id = params.id, scope = params.scope, - fld, html; + status_icon = params.status_icon, + fld, html, url, + urls = [ + { "variable": "credential", "url": "/#/credentials/" }, + { "variable": "project", "url": "/#/projects/" }, + { "variable": "inventory", "url": "/#/inventories/" }, + { "variable": "cloud_credential", "url": "/#/credentials/" }, + { "variable": "inventory_source", "url": "/#/home/groups/?id=" } + ]; + html = "\n"; for (fld in form.fields) { if (!Empty(scope[fld])) { html += "" + "
" + form.fields[fld].label + ""; - if (fld === "credential" || fld === "project" || fld === "inventory" || fld === "cloud_credential" || - fld === "inventory_source") { - html += "{{ " + fld + " }}"; + url = Find({ list: urls, key: "variable", val: fld }); + if (url) { + html += "{{ " + fld + '_name' + " }}"; + } + else if (fld === 'elapsed') { + html += scope[fld] + " seconds"; + } + else if (status_icon && fld === 'status') { + html += " " + scope[fld]; } else { html += scope[fld]; diff --git a/awx/ui/static/js/lists/HomeGroups.js b/awx/ui/static/js/lists/HomeGroups.js index eaa5bfac22..8229c9840d 100644 --- a/awx/ui/static/js/lists/HomeGroups.js +++ b/awx/ui/static/js/lists/HomeGroups.js @@ -32,7 +32,7 @@ angular.module('HomeGroupListDefinition', []) sourceModel: 'inventory', sourceField: 'name', columnClass: 'col-lg-3 col-md2 col-sm-2 hidden-xs elllipsis', - linkTo: "{{ /#/inventories/' + group.inventory + '/' }}" + linkTo: "{{ '/#/inventories/' + group.inventory + '/' }}" }, source: { label: 'Source', diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 4dc36584c9..e959dc7dfa 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -59,6 +59,7 @@ body.modal-open { .pad-left-sm { padding-left: 10px; } .pad-left-lg { padding-left: 50px; } .normal-weight { font-weight: normal; } +.small-text { font-size: 12px; } .no-bullets { list-style: none; } .nowrap { white-space: nowrap; } .capitalize { text-transform: capitalize; } diff --git a/awx/ui/static/partials/logviewer.html b/awx/ui/static/partials/logviewer.html index 1620074395..6469c6d752 100644 --- a/awx/ui/static/partials/logviewer.html +++ b/awx/ui/static/partials/logviewer.html @@ -2,10 +2,9 @@