1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

AC-203 no longer sorting jobs by Status when user clicks failed jobs link from Inventories page. Rows are now sorted by desc ID (which would be the same order as desc date btw).

This commit is contained in:
chouseknecht 2013-07-10 14:35:02 -04:00
parent f243bc7a80
commit 33512a9692
2 changed files with 7 additions and 8 deletions

View File

@ -4,7 +4,7 @@
*
* awx-min.js
*
* master-d4c7b51, Wed Jul 10 13:46:43 2013 -0400
* master-17d2fa9, Wed Jul 10 14:20:11 2013 -0400
*
*/
var urlPrefix="/static/";
@ -62,10 +62,9 @@ function JobEventsEdit(h,m,k,g,c,p,f,e,l,a,d,b,z,w,B){z("htmlTemplate");var u=e.
b,c,e){d(u,a,b,f,{hdr:"Error!",msg:"Failed to retrieve event detail: "+p.event_id+". GET status: "+b})})}JobEventsEdit.$inject="$scope $rootScope $compile $location $log $routeParams JobEventForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ClearScope GetBasePath FormatDate".split(" ");function JobHostSummaryList(h,m,k,g,c,p,f,e,l,a,d,b,z,w,B,u,x){B("htmlTemplate");h=x("jobs")+c.id+"/job_host_summaries/";k.path().replace(/^\//,"").split("/");var t=l.inject(e,{mode:"edit"});t.selected=[];t.PostRefreshRemove&&t.PostRefreshRemove();t.PostRefershRemove=t.$on("PostRefresh",function(){for(var a=0;a<t.jobhosts.length;a++)t.jobhosts[a].host_name=t.jobhosts[a].summary_fields.host.name,t.jobhosts[a].status=t.jobhosts[a].failed?"error":"success"});b({scope:t,set:"jobhosts",list:e,url:h});
z({scope:t,list:e,url:h});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});k.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(){k.path("/jobs/"+c.id)};t.jobEvents=function(){k.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(h,m,k,g,c,p,f,e,l,a,d,b,z,w,B,u,x,t,s,n){B("htmlTemplate");var C=x("jobs");k.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;b<q[e.name].length;b++)a=new Date(q[e.name][b].created),q[e.name][b].created=n(a)});b({scope:q,set:"jobs",list:e,url:C});z({scope:q,
list:e,url:C});c.inventory__int&&(q[e.iterator+"SearchField"]="inventory",q[e.iterator+"SearchValue"]=c.inventory__int,q[e.iterator+"SearchFieldLabel"]="Inventory ID");q.search(e.iterator);c.order_by&&q.sort(c.order_by);a();q.refreshJob=function(){q.search(e.iterator)};q.editJob=function(b,d){a({path:"/jobs/"+b,title:d});k.path(k.path()+"/"+b)};q.viewEvents=function(b,d){a({path:"/jobs/"+b,title:d});k.path(k.path()+"/"+b+"/job_events")};q.viewSummary=function(b,d){a({path:"/jobs/"+b,title:d});k.path(k.path()+
"/"+b+"/job_host_summaries")};q.deleteJob=function(a,b){p.setUrl(C+a+"/");p.get().success(function(b,c,f,l){var n,k;"pending"==b.status||"running"==b.status?(n=b.related.cancel,k="cancel",b="Cancel Job"):(n=C+a+"/",k="delete",b="Delete Job");d({hdr:b,body:"Are you sure you want to "+k+" job "+a+"?",action:function(){p.setUrl(n);"cancel"==k?p.post().success(function(a,b,d,c){$("#prompt-modal").modal("hide");q.search(e.iterator)}).error(function(a,b,d,c){$("#prompt-modal").modal("hide");u(q,a,b,null,
{hdr:"Error!",msg:"Call to "+n+" failed. POST returned status: "+b})}):p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");q.search(e.iterator)}).error(function(a,b,d,c){$("#prompt-modal").modal("hide");u(q,a,b,null,{hdr:"Error!",msg:"Call to "+n+" failed. DELETE returned status: "+b})})}})}).error(function(a,b,d,c){u(q,a,b,null,{hdr:"Error!",msg:"Failed to get job details. GET returned status: "+b})})};q.submitJob=function(a,b){s({scope:q,id:a,template:b})}}
JobsListCtrl.$inject="$scope $rootScope $location $log $routeParams Rest Alert JobList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors GetBasePath LookUpInit SubmitJob FormatDate".split(" ");
list:e,url:C});c.inventory__int&&(q[e.iterator+"SearchField"]="inventory",q[e.iterator+"SearchValue"]=c.inventory__int,q[e.iterator+"SearchFieldLabel"]="Inventory ID");q.search(e.iterator);a();q.refreshJob=function(){q.search(e.iterator)};q.editJob=function(b,d){a({path:"/jobs/"+b,title:d});k.path(k.path()+"/"+b)};q.viewEvents=function(b,d){a({path:"/jobs/"+b,title:d});k.path(k.path()+"/"+b+"/job_events")};q.viewSummary=function(b,d){a({path:"/jobs/"+b,title:d});k.path(k.path()+"/"+b+"/job_host_summaries")};
q.deleteJob=function(a,b){p.setUrl(C+a+"/");p.get().success(function(b,c,f,l){var n,k;"pending"==b.status||"running"==b.status?(n=b.related.cancel,k="cancel",b="Cancel Job"):(n=C+a+"/",k="delete",b="Delete Job");d({hdr:b,body:"Are you sure you want to "+k+" job "+a+"?",action:function(){p.setUrl(n);"cancel"==k?p.post().success(function(a,b,d,c){$("#prompt-modal").modal("hide");q.search(e.iterator)}).error(function(a,b,d,c){$("#prompt-modal").modal("hide");u(q,a,b,null,{hdr:"Error!",msg:"Call to "+
n+" failed. POST returned status: "+b})}):p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");q.search(e.iterator)}).error(function(a,b,d,c){$("#prompt-modal").modal("hide");u(q,a,b,null,{hdr:"Error!",msg:"Call to "+n+" failed. DELETE returned status: "+b})})}})}).error(function(a,b,d,c){u(q,a,b,null,{hdr:"Error!",msg:"Failed to get job details. GET returned status: "+b})})};q.submitJob=function(a,b){s({scope:q,id:a,template:b})}}JobsListCtrl.$inject="$scope $rootScope $location $log $routeParams Rest Alert JobList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors GetBasePath LookUpInit SubmitJob FormatDate".split(" ");
function JobsEdit(h,m,k,g,c,p,f,e,l,a,d,b,z,w,B,u,x,t,s,n,C,q,v,A){function E(a){if(null!==a&&""!==a&&void 0!==a){var b=q("projects")+a+"/playbooks/";l.setUrl(b);l.get().success(function(a,b,d,c){r.playbook_options=[];for(b=0;b<a.length;b++)r.playbook_options.push(a[b])}).error(function(a,c,f,e){d(r,a,c,D,{hdr:"Error!",msg:"Failed to get playbook list for "+b+". GET returned status: "+c})})}}u("htmlTemplate");var F=q("jobs"),D=f,r=e.inject(D,{mode:"edit",related:!0});e.reset();var K=g.path().replace(/^\//,
"").split("/")[0],G={},J=p.id,H={};r.statusSearchSpin=!1;r.selectPlaybookUnregister&&r.selectPlaybookUnregister();r.selectPlaybookUnregister=r.$watch("project_name",function(a,b){a!==b&&(""!==b&&null!==b&&void 0!==b)&&(r.playbook=null,E(r.project))});r.jobLoadedRemove&&r.jobLoadedRemove();r.jobLoadedRemove=r.$on("jobLoaded",function(){r[D.name+"ReadOnly"]="new"==r.status?!1:!0;for(var a in H)r.search(H[a].iterator);E(r.project);$("#forks-slider").slider("option","value",r.forks);$("#forks-slider").slider("disable");
l.setUrl(r.template_url);l.get().success(function(a,b,d,c){b=a.host_config_key?"true":"false";r.host_config_key=a.host_config_key;v({scope:r,master:G,check_field:"allow_callbacks",default_val:b});$('input[type="checkbox"]').attr("disabled","disabled");$("#host_config_key-gen-btn").attr("disabled","disabled")}).error(function(a,b,c,f){d(r,a,b,D,{hdr:"Error!",msg:"Failed to retrieve job: "+p.id+". GET status: "+b})})});r.job_type_options=[{value:"run",label:"Run"},{value:"check",label:"Check"}];r.verbosity_options=

View File

@ -53,9 +53,9 @@ function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest,
scope.search(list.iterator);
// Called from Inventories page, failed jobs link. Now sort by status so faild jobs appear at top of list
if ($routeParams.order_by) {
scope.sort($routeParams.order_by);
}
//if ($routeParams.order_by) {
// scope.sort($routeParams.order_by);
//}
LoadBreadCrumbs();