From 1d5cf7fd8c7c8b42627ac3747acc4f29c98609bb Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Mon, 15 Jul 2013 02:24:58 -0400 Subject: [PATCH] AC-213 Fixed confusing project path messages, labels and help text. --- awx/ui/static/css/ansible-ui.css | 4 + awx/ui/static/js/awx-min.js | 31 ++++---- awx/ui/static/js/forms/JobEvents.js | 87 ++++++++++++++++----- awx/ui/static/js/forms/Projects.js | 8 +- awx/ui/static/js/helpers/Events.js | 18 +++-- awx/ui/static/js/helpers/ProjectPath.js | 8 +- awx/ui/static/lib/ansible/form-generator.js | 3 +- 7 files changed, 111 insertions(+), 48 deletions(-) diff --git a/awx/ui/static/css/ansible-ui.css b/awx/ui/static/css/ansible-ui.css index a38a2ef3a6..1f78373bf4 100644 --- a/awx/ui/static/css/ansible-ui.css +++ b/awx/ui/static/css/ansible-ui.css @@ -389,6 +389,10 @@ color: #da4f49; } + .job-event-status { + padding-top: 5px; + } + .job-new, input[type="text"].job-new, .job-canceled, input[type="text"].job-canceled { color: #778899; diff --git a/awx/ui/static/js/awx-min.js b/awx/ui/static/js/awx-min.js index febe5a7584..29ccf4c39b 100644 --- a/awx/ui/static/js/awx-min.js +++ b/awx/ui/static/js/awx-min.js @@ -4,7 +4,7 @@ * * awx-min.js * - * master-bf73e20, Sat Jul 13 05:56:49 2013 -0400 + * master-e27ab4f, Sat Jul 13 06:23:40 2013 -0400 * */ var urlPrefix="/static/"; @@ -64,8 +64,8 @@ b,c,e){d(u,a,b,f,{hdr:"Error!",msg:"Failed to retrieve event detail: "+p.event_i y({scope:t,list:e,url:k});t.search(e.iterator);a();t.showEvents=function(b,d){p.setUrl(d);p.get().success(function(d,c,f,e){a({path:"/jobs/"+d.id,title:d.name});h.url("/jobs/"+d.id+"/job_events/?host="+escape(b))}).error(function(a,b,c,f){u(t,a,b,form,{hdr:"Error!",msg:"Failed to lookup last job: "+d+". GET status: "+b})})};t.refresh=function(){t.search(e.iterator)};t.jobDetails=function(){h.path("/jobs/"+c.id)};t.jobEvents=function(){h.path("/jobs/"+c.id+"/job_events")}} JobHostSummaryList.$inject="$scope $rootScope $location $log $routeParams Rest Alert JobHostList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors GetBasePath".split(" ");function JobsListCtrl(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r,n){A("htmlTemplate");var B=C("jobs");h.path().replace(/^\//,"").split("/");var q=l.inject(e,{mode:"edit"});m.flashMessage=null;q.selected=[];q.PostRefreshRemove&&q.PostRefreshRemove();q.PostRefreshRemove=q.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");q[a]=""});for(var a,b=0;bEnter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.

View JSON examples at www.json.org

View YAML examples at ansibleworks.com

',dataTitle:"Inventory Variables",dataPlacement:"bottom",column:2}},buttons:{save:{label:"Save",icon:"icon-ok","class":"btn-success",ngClick:"formSave()",ngDisabled:!0}, reset:{ngClick:"formReset()",label:"Reset",icon:"icon-remove",ngDisabled:!0}},related:{groups:{type:"tree",open:!0,actions:{}},hosts:{type:"treeview",title:"{{ groupTitle }}",iterator:"host",actions:{select:{ngClick:"selectHost()",icon:"icon-check",label:"Add Existing Host",awToolTip:"Select existing host",ngHide:"createButtonShow == false","class":"btn btn-pad"},create:{ngClick:"createHost()",icon:"icon-plus",label:"Create New Host",awToolTip:"Create a new host",ngHide:"createButtonShow == false", "class":"btn-success"}},fields:{name:{key:!0,label:"Host Name",ngClick:"editHost({{ host.id }}, '{{ host.name }}')"},has_active_failures:{label:"Failed jobs?",showValue:!1,ngClick:"showEvents('{{ host.name }}', '{{ host.related.last_job }}')",ngShow:"{{ host.has_active_failures }}",icon:"icon-exclamation-sign","class":"active-failures-{{ host.has_active_failures }}",text:"View failures",searchField:"has_active_failures",searchType:"boolean",searchOptions:[{name:"No",value:0},{name:"Yes",value:1}]}}, -fieldActions:{edit:{ngClick:"editHost({{ host.id }}, '{{ host.name }}')",icon:"icon-edit",label:"Edit","class":"btn-success",awToolTip:"Edit host"},"delete":{ngClick:"deleteHost({{ host.id }}, '{{ host.name }}')",icon:"icon-remove",label:"Delete","class":"btn-danger",awToolTip:"Remove host"}}}}});angular.module("JobEventFormDefinition",[]).value("JobEventForm",{editTitle:"{{ id }} - {{ event }}",name:"job_events","class":"horizontal-narrow",well:!1,fields:{event_display:{label:"Event",type:"text",readonly:!0},created:{label:"Created",type:"text",readonly:!0,"class":"span3"},status:{label:"Status",type:"text","class":"job-{{ event_status }}",readonly:!0},host:{label:"Host",type:"text",readonly:!0},status:{label:"Status",type:"text","class":"job-{{ event_status }}",readonly:!0},event_data:{label:"Event Data", -type:"textarea","class":"modal-input-xlarge",rows:10,readonly:!0}},buttons:{},related:{}});angular.module("JobFormDefinition",[]).value("JobForm",{addTitle:"Create Job",editTitle:"{{ name }}",name:"jobs",well:!0,twoColumns:!0,fields:{name:{label:"Name",type:"text",addRequired:!0,editRequired:!0,column:1},description:{label:"Description",type:"text",addRequired:!1,editRequired:!1,column:1},job_type:{label:"Job Type",type:"select",ngOptions:"type.label for type in job_type_options","default":"run",addRequired:!0,editRequired:!0,awPopOver:"

When this template is submitted as a job, setting the type to run will execute the playbook, running tasks on the selected hosts.

Setting the type to check will not execute the playbook. Instead, ansible will check playbook syntax, test environment setup and report problems.

", +fieldActions:{edit:{ngClick:"editHost({{ host.id }}, '{{ host.name }}')",icon:"icon-edit",label:"Edit","class":"btn-success",awToolTip:"Edit host"},"delete":{ngClick:"deleteHost({{ host.id }}, '{{ host.name }}')",icon:"icon-remove",label:"Delete","class":"btn-danger",awToolTip:"Remove host"}}}}});angular.module("JobEventFormDefinition",[]).value("JobEventForm",{editTitle:"{{ id }} - {{ event }}",name:"job_events","class":"horizontal-narrow",well:!1,fields:{created:{label:"Created",type:"text",readonly:!0,"class":"span3",section:"Event Info"},status:{labelClass:"job-{{ status }}",icon:"icon-circle",type:"custom",control:'
{{ status }}
',section:"Event"},host:{label:"Host",type:"text",readonly:!0,section:"Event"},task:{label:"Task",type:"text", +readonly:!0,section:"Event"},conditional:{label:"Conditional?",type:"checkbox",readonly:!0},msg:{label:"Message",type:"textarea",readonly:!0,section:"Results",rows:5},stdout:{label:"Standard Out",type:"textarea",readonly:!0,section:"Results",rows:5},stderr:{label:"Standard Error",type:"textarea",readonly:!0,section:"Results",rows:5},start:{label:"Start",type:"text",readonly:!0,section:"Timing"},end:{label:"End",type:"text",readonly:!0,section:"Timing"},delta:{label:"Elapsed",type:"text",readonly:!0, +section:"Timing"},module_name:{label:"Name",type:"text",readonly:!0,section:"Module"},module_args:{label:"Arguments",type:"text",readonly:!0,section:"Module"}},buttons:{},related:{}});angular.module("JobFormDefinition",[]).value("JobForm",{addTitle:"Create Job",editTitle:"{{ name }}",name:"jobs",well:!0,twoColumns:!0,fields:{name:{label:"Name",type:"text",addRequired:!0,editRequired:!0,column:1},description:{label:"Description",type:"text",addRequired:!1,editRequired:!1,column:1},job_type:{label:"Job Type",type:"select",ngOptions:"type.label for type in job_type_options","default":"run",addRequired:!0,editRequired:!0,awPopOver:"

When this template is submitted as a job, setting the type to run will execute the playbook, running tasks on the selected hosts.

Setting the type to check will not execute the playbook. Instead, ansible will check playbook syntax, test environment setup and report problems.

", dataTitle:"Job Type",dataPlacement:"right",column:1},inventory:{label:"Inventory",type:"lookup",sourceModel:"inventory",sourceField:"name",addRequired:!0,editRequired:!0,ngClick:"lookUpInventory()",column:1},project:{label:"Project",type:"lookup",sourceModel:"project",sourceField:"name",addRequired:!0,editRequired:!0,ngClick:"lookUpProject()",column:1},playbook:{label:"Playbook",type:"select",ngOptions:"book for book in playbook_options",id:"playbook-select",addRequired:!0,editRequired:!0,column:1}, credential:{label:"Credential",type:"lookup",sourceModel:"credential",sourceField:"name",ngClick:"lookUpCredential()",addRequired:!1,editRequired:!1,column:2},forks:{label:"Forks",id:"forks-number",type:"number",integer:!0,min:0,max:100,slider:!0,"class":"input-mini","default":"0",addRequired:!1,editRequired:!1,column:2,awPopOver:"

The number of parallel or simultaneous processes to use while executing the playbook. Provide a value between 0 and 100. A value of zero will use the ansible default setting of 5 parallel processes.

", dataTitle:"Forks",dataPlacement:"left"},limit:{label:"Limit",type:"text",addRequired:!1,editRequired:!1,column:2,awPopOver:'

Provide a host pattern to further constrain the list of hosts that will be managed or affected by the playbook. Multiple patterns can be separated by ; : or ,

For more information and examples see the Selecting Targets section under Inventory and Patterns in the Ansible documentation.

', @@ -175,8 +176,8 @@ title:"Users",iterator:"user",open:!1,actions:{add:{ngClick:"add('users')",label "class":"btn-danger",awToolTip:"Remove user"}}},admins:{type:"collection",title:"Administrators",iterator:"admin",open:!1,base:"/users",actions:{add:{ngClick:"add('admins')",icon:"icon-plus",label:"Add",awToolTip:"Add new administrator"}},fields:{username:{key:!0,label:"Username"},first_name:{label:"First Name"},last_name:{label:"Last Name"}},fieldActions:{edit:{label:"Edit",ngClick:"edit('users', {{ admin.id }}, '{{ admin.username }}')",icon:"icon-edit","class":"btn-success",awToolTip:"Edit administrator"}, "delete":{label:"Delete",ngClick:"delete('admins', {{ admin.id }}, '{{ admin.username }}', 'administrators')",icon:"icon-remove","class":"btn-danger",awToolTip:"Remove administrator"}}}}});angular.module("PermissionFormDefinition",[]).value("PermissionsForm",{addTitle:"Add Permission",editTitle:"{{ name }}",name:"permission",well:!0,fields:{category:{label:"Permission Type",type:"radio",options:[{label:"Inventory",value:"Inventory"},{label:"Deployment",value:"Deploy"}],ngChange:"selectCategory()"},name:{label:"Name",type:"text",addRequired:!0,editRequired:!0,capitalize:!0},description:{label:"Description",type:"text",addRequired:!1,editRequired:!1},user:{label:"User",type:"hidden"}, team:{label:"Team",type:"hidden"},project:{label:"Project",type:"lookup",sourceModel:"project",sourceField:"name",ngShow:"category == 'Deploy'",ngClick:"lookUpProject()",awRequiredWhen:{variable:"projectrequired",init:"false"}},inventory:{label:"Inventory",type:"lookup",sourceModel:"inventory",sourceField:"name",ngClick:"lookUpInventory()",awRequiredWhen:{variable:"inventoryrequired",init:"true"}},permission_type:{label:"Permission",type:"radio",options:[{label:"Admin",value:"admin",ngShow:"category == 'Inventory'"}, -{label:"Read",value:"read",ngShow:"category == 'Inventory'"},{label:"Write",value:"write",ngShow:"category == 'Inventory'"},{label:"Run",value:"run",ngShow:"category == 'Deploy'"},{label:"Check",value:"check",ngShow:"category == 'Deploy'"}],addRequired:!0,editRequired:!0}},buttons:{save:{label:"Save",icon:"icon-ok","class":"btn-success",ngClick:"formSave()",ngDisabled:!0},reset:{ngClick:"formReset()",label:"Reset",icon:"icon-remove",ngDisabled:!0}},related:{}});angular.module("ProjectFormDefinition",[]).value("ProjectsForm",{addTitle:"Create Project",editTitle:"{{ name }}",name:"project",well:!0,fields:{name:{label:"Name",type:"text",addRequired:!0,editRequired:!0,capitalize:!0},description:{label:"Description",type:"text",addRequired:!1,editRequired:!1},base_dir:{label:"Project Base Path",type:"textarea","class":"span6",showonly:!0,awPopOver:"

Base path used for locating playbooks. Directories found inside this path will be listed in the Project Path drop-down. Together the base path and selected project path provide the full path used to locate playbooks for this project.

Use PROJECTS_ROOT in your environment settings file to determine the base path value.

", -dataTitle:"Project Base Path",dataPlacement:"right"},local_path:{label:"Project Path",type:"select",id:"local-path-select",ngOptions:"path for path in project_local_paths",addRequired:!0,editRequired:!0,awPopOver:"

Select from the list of directories found in the base path.Together the base path and selected project path provide the full path used to locate playbooks for this project.

Use PROJECTS_ROOT in your environment settings file to determine the base path value.

",dataTitle:"Project Path", +{label:"Read",value:"read",ngShow:"category == 'Inventory'"},{label:"Write",value:"write",ngShow:"category == 'Inventory'"},{label:"Run",value:"run",ngShow:"category == 'Deploy'"},{label:"Check",value:"check",ngShow:"category == 'Deploy'"}],addRequired:!0,editRequired:!0}},buttons:{save:{label:"Save",icon:"icon-ok","class":"btn-success",ngClick:"formSave()",ngDisabled:!0},reset:{ngClick:"formReset()",label:"Reset",icon:"icon-remove",ngDisabled:!0}},related:{}});angular.module("ProjectFormDefinition",[]).value("ProjectsForm",{addTitle:"Create Project",editTitle:"{{ name }}",name:"project",well:!0,fields:{name:{label:"Name",type:"text",addRequired:!0,editRequired:!0,capitalize:!0},description:{label:"Description",type:"text",addRequired:!1,editRequired:!1},base_dir:{label:"Project Base Path",type:"textarea","class":"span6",showonly:!0,awPopOver:"

Base path used for locating playbooks. Directories found inside this path will be listed in the playbook directory drop-down. Together the base path and selected playbook directory provide the full path used to locate playbooks.

Use PROJECTS_ROOT in your environment settings file to determine the base path value.

", +dataTitle:"Project Base Path",dataPlacement:"right"},local_path:{label:"Playbook Directory",type:"select",id:"local-path-select",ngOptions:"path for path in project_local_paths",addRequired:!0,editRequired:!0,awPopOver:"

Select from the list of directories found in the base path.Together the base path and the playbook directory provide the full path used to locate playbooks.

Use PROJECTS_ROOT in your environment settings file to determine the base path value.

",dataTitle:"Project Path", dataPlacement:"right"}},buttons:{save:{label:"Save",icon:"icon-ok","class":"btn-success",ngClick:"formSave()",ngDisabled:!0},reset:{ngClick:"formReset()",label:"Reset",icon:"icon-remove",ngDisabled:!0}},related:{}});angular.module("TeamFormDefinition",[]).value("TeamForm",{addTitle:"Create Team",editTitle:"{{ name }}",name:"team",well:!0,collapse:!0,collapseTitle:"Team Settings",collapseMode:"edit",collapseOpen:!0,fields:{name:{label:"Name",type:"text",addRequired:!0,editRequired:!0,capitalize:!0},description:{label:"Description",type:"text",addRequired:!1,editRequired:!1},organization:{label:"Organization",type:"lookup",sourceModel:"organization",sourceField:"name",addRequired:!0,editRequired:!0,ngClick:"lookUpOrganization()"}}, buttons:{save:{label:"Save",icon:"icon-ok","class":"btn-success",ngClick:"formSave()",ngDisabled:!0},reset:{ngClick:"formReset()",label:"Reset",icon:"icon-remove",ngDisabled:!0}},related:{credentials:{type:"collection",title:"Credentials",iterator:"credential",open:!1,actions:{add:{ngClick:"add('credentials')",icon:"icon-plus",label:"Add",add:"Add a new credential"}},fields:{name:{key:!0,label:"Name"},description:{label:"Description"}},fieldActions:{edit:{label:"Edit",ngClick:"edit('credentials', {{ credential.id }}, '{{ credential.name }}')", icon:"icon-edit","class":"btn-success",awToolTip:"Modify the credential"},"delete":{label:"Delete",ngClick:"delete('credentials', {{ credential.id }}, '{{ credential.name }}', 'credentials')",icon:"icon-remove","class":"btn-danger",awToolTip:"Remove the credential"}}},permissions:{type:"collection",title:"Permissions",iterator:"permission",open:!1,actions:{add:{ngClick:"add('permissions')",icon:"icon-plus",label:"Add",awToolTip:"Add a permission for this user"}},fields:{name:{key:!0,label:"Name", @@ -196,8 +197,8 @@ a})}));e||m("Access Denied","You do not have access to this function. Please con 0>=parseInt(g.free_instances)&&h("License Warning",'Your AnsibleWorks AWX License has reached capacity for the number of managed hosts allowed. You will not be able to add any additional hosts. To extend your license, please visit ansibleworks.com/ansibleworks-awx., or contact info@ansibleworks.com for more information.',"alert-info",null,!0))}}]);angular.module("APIDefaults",["RestServices","Utilities"]).factory("GetAPIDefaults",["Alert","Rest","$rootScope",function(k,m,h){return function(g){function c(c){var a={};for(id in h.apiDefaults)if(id==c||id.iterator==c){a[id]=defaults[id];break}return a}function k(){if(f=={}&&5>e)e++,setTimeout(1E3,k());else if("success"==f.status)return c(g)}var f={},e=0;return null==h.apiDefaults||void 0==h.apiDefaults?(f={},m.setUrl("/api/v1"),m.get().success(function(c,a,d,b){defaults=c;for(var e in defaults)switch(e){case "organizations":dafaults[e].iterator= "organization";break;case "jobs":defaults[e].iterator="job";break;case "users":defaults[e].iterator="user";break;case "teams":defaults[e].iterator="team";break;case "hosts":defaults[e].iterator="host";break;case "groups":defaults[e].iterator="group";break;case "projects":defaults[e].iterator="project"}h.apiDefaults=defaults;f={status:"success"}}).error(function(c,a,d,b){f={status:"error",msg:"Call to /api/v1 failed. GET returned status: "+a}}),k()):c(g)}}]);angular.module("ChildrenHelper",["RestServices","Utilities"]).factory("ToggleChildren",["Alert","Rest","GetBasePath","ProcessErrors","FormatDate",function(k,m,h,g,c){return function(c){function f(b){a[b].ngicon="icon-collapse-alt";for(var d=b+1;dThere are no unassigned playbook directories in the base project path ("+ +p.base_dir+"). Either the project directory is empty, or all of the contents are already assigned to other AWX projects.

To fix this, log into the AWX server and check out another playbook project from your SCM repository into "+p.base_dir+".

","alert-info")}).error(function(c,l,a,d){g(p,c,l,null,{hdr:"Error!",msg:"Failed to access API config. GET status: "+l})})}}]);angular.module("RefreshRelatedHelper",["RestServices","Utilities"]).factory("RefreshRelated",["Alert","Rest",function(k,m){return function(h){var g=h.scope,c=h.set,p=h.iterator;m.setUrl(h.url);m.get().success(function(f,e,l,a){g[c]=f.results;g[p+"NextUrl"]=f.next;g[p+"PrevUrl"]=f.previous;g[p+"Count"]=f.count;g[p+"PageCount"]=Math.ceil(f.count/g[p+"PageSize"]);g[p+"SearchSpin"]=!1;g[p+"Loading"]=!1}).error(function(f,e,l,a){g[p+"SearchSpin"]=!0;k("Error!","Failed to retrieve related set: "+c+". GET returned status: "+ e)})}}]);angular.module("RefreshHelper",["RestServices","Utilities"]).factory("Refresh",["Alert","Rest",function(k,m){return function(h){var g=h.scope,c=h.set,p=h.iterator;m.setUrl(h.url);m.get().success(function(f,e,l,a){g[p+"NextUrl"]=f.next;g[p+"PrevUrl"]=f.previous;g[p+"Count"]=f.count;g[p+"PageCount"]=Math.ceil(f.count/g[p+"PageSize"]);g[p+"SearchSpin"]=!1;g[p+"Loading"]=!1;g[c]=f.results;g.$emit("PostRefresh")}).error(function(f,e,l,a){g[p+"SearchSpin"]=!1;k("Error!","Failed to retrieve "+c+". GET returned status: "+ e)})}}]);angular.module("RelatedPaginateHelper",["RefreshRelatedHelper","ngCookies"]).factory("RelatedPaginateInit",["RefreshRelated","$cookieStore",function(k,m){return function(h){var g=h.scope,c=h.relatedSets,p;for(p in c)(cookieSize=m.get(c[p].iterator+"PageSize"))?g[c[p].iterator+"PageSize"]=cookieSize:(g[c[p].iterator+"Page"]=0,g[c[p].iterator+"PageSize"]=10);g.nextSet=function(c,e){g[e+"Page"]++;k({scope:g,set:c,iterator:e,url:g[e+"NextUrl"]})};g.prevSet=function(c,e){g[e+"Page"]--;k({scope:g,set:c, iterator:e,url:g[e+"PrevUrl"]})};g.changePageSize=function(f,e){var l;g[e+"Page"]=0;for(var a in c)if(a==f){l=c[a].url;break}m.put(e+"PageSize",g[e+"PageSize"]);l=l.replace(/\/\?.*$/,"/");l+=g[e+"SearchParams"]?g[e+"SearchParams"]+"&page_size="+g[e+"PageSize"]:"?page_size="+g[e+"PageSize"];k({scope:g,set:f,iterator:e,url:l})}}}]);angular.module("RelatedSearchHelper",["RestServices","Utilities","RefreshRelatedHelper"]).factory("RelatedSearchInit",["Alert","Rest","RefreshRelated",function(k,m,h){return function(g){var c=g.scope,k=g.relatedSets,f=g.form,e,l;for(l in f.related)if("tree"!=f.related[l].type){g=f.related[l].iterator;for(var a in f.related[l].fields)if(f.related[l].fields[a].key){c[g+"SearchField"]=a;c[g+"SearchFieldLabel"]=f.related[l].fields[a].label;break}c[g+"SortOrder"]=null;c[g+"SearchType"]="contains";c[g+ @@ -327,9 +328,9 @@ if("radio"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode)){for(var b=b+'

\n';b+="
\n";b+="\n"}if("hidden"==a.type&&("edit"==d.mode&&a.includeOnEdit||"add"==d.mode&&a.includeOnAdd))b+='';if("lookup"==a.type&&(void 0==a.excludeMode||a.excludeMode!=d.mode)){b+='
\n";b+='\n";b+='
\n';b+='
\n'; b+='\n';b+='A value is required!\n';b+='Value not found\n';b+='\n';b+="
\n";b+="
\n"}if("custom"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode))b+='
\n",b+='\n",b+='
\n',b+=a.control,b+="
\n",b+="
\n";return b},build:function(c){var a="";this.modal||(a+='\n");if(!this.modal&&this.form.statusFields){a+='
\n'; -if(this.form.statusActions){var a=a+'
\n',d;for(action in this.form.statusActions)d=this.form.statusActions[action],a+="
\n";a+='
\n'}var a= +"_"+a.sourceField+'.$error.awlookup">Value not found\n';b+='\n';b+="
\n";b+="
\n"}if("custom"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode))b+='
\n",b+='\n",b+='
\n',b+=a.control,b+="
\n",b+="
\n";return b},build:function(c){var a="";this.modal||(a+='\n");if(!this.modal&&this.form.statusFields){a+= +'
\n';if(this.form.statusActions){var a=a+'
\n',d;for(action in this.form.statusActions)d=this.form.statusActions[action],a+="
\n";a+='
\n'}var a= a+'
\n',b;for(b in this.form.statusFields)d=this.form.statusFields[b],a+=this.buildField(b,d,c);a+="
\x3c!-- status fields --\x3e\n";a+="
\x3c!-- well --\x3e\n"}if(this.form.fieldsAsHeader){a+='
\n';a+='
\n';for(b in this.form.fields)d=this.form.fields[b],a+=this.headerField(b,d,c);a+="
\n";a+="
\n"}else{this.form.collapse&&this.form.collapseMode== c.mode&&(a+='
\n",a+="
\n");this.has("well")&&(a+='
\n');a+='
\n';a+='
{{ flashMessage }}
\n'; if(this.form.twoColumns){a+='
\n';a+='
\n';for(b in this.form.fields)d=this.form.fields[b],1==d.column&&(a+=this.buildField(b,d,c));a+="
\x3c!-- column 1 --\x3e\n";a+='
\n';for(b in this.form.fields)d=this.form.fields[b],2==d.column&&(a+=this.buildField(b,d,c));a+="
\x3c!-- column 2 --\x3e\n";a+="
\x3c!-- inner row --\x3e\n"}else for(b in this.form.fields)d=this.form.fields[b],a+=this.buildField(b,d,c);if(!this.modal){this.has("buttons")&& diff --git a/awx/ui/static/js/forms/JobEvents.js b/awx/ui/static/js/forms/JobEvents.js index 90fd412e8b..f6c8159187 100644 --- a/awx/ui/static/js/forms/JobEvents.js +++ b/awx/ui/static/js/forms/JobEvents.js @@ -16,40 +16,87 @@ angular.module('JobEventFormDefinition', []) well: false, fields: { - event_display: { - label: 'Event', - type: 'text', - readonly: true - }, created: { label: 'Created', type: 'text', readonly: true, - "class": 'span3' + "class": 'span3', + section: 'Event Info' }, - status: { - label: 'Status', - type: 'text', - "class": 'job-\{\{ event_status \}\}', - readonly: true + status: { + labelClass: 'job-\{\{ status \}\}', + icon: 'icon-circle', + type: 'custom', + control: '
\{\{ status \}\}
', + section: 'Event' }, host: { label: 'Host', type: 'text', - readonly: true + readonly: true, + section: 'Event' }, - status: { - label: 'Status', + task: { + label: 'Task', type: 'text', - "class": 'job-\{\{ event_status \}\}', + readonly: true, + section: 'Event' + }, + conditional: { + label: 'Conditional?', + type: 'checkbox', readonly: true }, - event_data: { - label: 'Event Data', + msg: { + label: 'Message', type: 'textarea', - "class": "modal-input-xlarge", - rows: 10, - readonly: true + readonly: true, + section: 'Results', + rows: 5 + }, + stdout: { + label: 'Standard Out', + type: 'textarea', + readonly: true, + section: 'Results', + rows: 5 + }, + stderr: { + label: 'Standard Error', + type: 'textarea', + readonly: true, + section: 'Results', + rows: 5 + }, + start: { + label: 'Start', + type: 'text', + readonly: true, + section: 'Timing' + }, + end: { + label: 'End', + type: 'text', + readonly: true, + section: 'Timing' + }, + delta: { + label: 'Elapsed', + type: 'text', + readonly: true, + section: 'Timing' + }, + module_name: { + label: 'Name', + type: 'text', + readonly: true, + section: 'Module' + }, + module_args: { + label: 'Arguments', + type: 'text', + readonly: true, + section: 'Module' } }, diff --git a/awx/ui/static/js/forms/Projects.js b/awx/ui/static/js/forms/Projects.js index 6e8487299e..3dba322409 100644 --- a/awx/ui/static/js/forms/Projects.js +++ b/awx/ui/static/js/forms/Projects.js @@ -35,21 +35,21 @@ angular.module('ProjectFormDefinition', []) type: 'textarea', "class": 'span6', showonly: true, - awPopOver: '

Base path used for locating playbooks. Directories found inside this path will be listed in the Project Path drop-down. ' + - 'Together the base path and selected project path provide the full path used to locate playbooks for this project.

' + + awPopOver: '

Base path used for locating playbooks. Directories found inside this path will be listed in the playbook directory drop-down. ' + + 'Together the base path and selected playbook directory provide the full path used to locate playbooks.

' + '

Use PROJECTS_ROOT in your environment settings file to determine the base path value.

', dataTitle: 'Project Base Path', dataPlacement: 'right' }, local_path: { - label: 'Project Path', + label: 'Playbook Directory', type: 'select', id: 'local-path-select', ngOptions: 'path for path in project_local_paths', addRequired: true, editRequired: true, awPopOver: '

Select from the list of directories found in the base path.' + - 'Together the base path and selected project path provide the full path used to locate playbooks for this project.

' + + 'Together the base path and the playbook directory provide the full path used to locate playbooks.

' + '

Use PROJECTS_ROOT in your environment settings file to determine the base path value.

', dataTitle: 'Project Path', dataPlacement: 'right' diff --git a/awx/ui/static/js/helpers/Events.js b/awx/ui/static/js/helpers/Events.js index 31f11cd594..389de5a968 100644 --- a/awx/ui/static/js/helpers/Events.js +++ b/awx/ui/static/js/helpers/Events.js @@ -25,7 +25,7 @@ angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventFormDefini } scope.formModalActionLabel = 'OK'; - scope.formModalHeader = 'View Event'; + //scope.formModalHeader = 'View Event'; scope.formModalCancelShow = false; $('#form-modal .btn-success').removeClass('btn-success').addClass('btn-none'); @@ -36,7 +36,15 @@ angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventFormDefini .success( function(data, status, headers, config) { for (var fld in form.fields) { if (fld == 'status') { - scope['status'] = (data.failed) ? 'error' : 'success'; + if (data['failed']) { + scope['status'] = 'error'; + } + else if (data['changed']) { + scope['status'] = 'changed'; + } + else { + scope['status'] = 'success'; + } } else if (fld == 'event_data') { scope['event_data'] = JSON.stringify(data['event_data'], undefined, '\t'); @@ -46,9 +54,6 @@ angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventFormDefini scope['host'] = data['summary_fields']['host']['name']; } } - else if (fld == 'event_display') { - scope['event_display'] = data.event_display.replace(/^\u00a0*/g,'') - } else { if (fld == 'created') { var cDate = new Date(data['created']); @@ -61,6 +66,9 @@ angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventFormDefini } } } + + scope['formModalHeader'] = data.event_display.replace(/^\u00a0*/g,''); + }) .error( function(data, status, headers, config) { ProcessErrors(scope, data, status, form, diff --git a/awx/ui/static/js/helpers/ProjectPath.js b/awx/ui/static/js/helpers/ProjectPath.js index 00f6f4a475..ace80ec41f 100644 --- a/awx/ui/static/js/helpers/ProjectPath.js +++ b/awx/ui/static/js/helpers/ProjectPath.js @@ -32,9 +32,11 @@ angular.module('ProjectPathHelper', ['RestServices', 'Utilities']) master.base_dir = scope.base_dir; // Keep in master object so that it doesn't get // wiped out on form reset. if (opts.length == 0) { - Alert('Missing project path', 'All of the project paths have been assigned to existing projects, or ' + - 'there are no directories found in the base path. You will need to add a project path before creating ' + - 'a new project.', 'alert-info'); + Alert('Missing Playbooks', + '

There are no unassigned playbook directories in the base project path (' + scope.base_dir + '). ' + + 'Either the project directory is empty, or all of the contents are already assigned to other AWX projects.

' + + '

To fix this, log into the AWX server and check out another playbook project from your SCM repository into ' + + scope.base_dir + '.

', 'alert-info'); } }) .error( function(data, status, headers, config) { diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index 9233ea1772..9831337567 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -505,7 +505,8 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) html += "\" for=\"" + fld + '">'; html += (field.awPopOver) ? this.attr(field, 'awPopOver') : ""; html += (field.icon) ? this.icon(field.icon) : ""; - html += field.label + '' + "\n"; + html += (field.label) ? field.label : ''; + html += '' + "\n"; html += "
\n"; html += field.control; html += "
\n";