mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 04:10:44 -03:30
Applied prior job_template.extra_vars changes to the jobs detail page.
This commit is contained in:
parent
8e0974c688
commit
3f58947c05
153
awx/ui/static/js/awx-min.js
vendored
153
awx/ui/static/js/awx-min.js
vendored
@ -4,7 +4,7 @@
|
||||
*
|
||||
* awx-min.js
|
||||
*
|
||||
* master-f6eea06, Mon Jul 15 12:08:33 2013 -0400
|
||||
* master-a2c4d8c, Mon Jul 15 13:48:02 2013 -0400
|
||||
*
|
||||
*/
|
||||
var urlPrefix="/static/";
|
||||
@ -25,120 +25,121 @@ c.replace(/\_/g," ");$('.nav-tabs a[href="#'+c+'"]').tab("show");k.viewCurrentUs
|
||||
data:a,status:b});u.$emit("callFinished")}).error(function(a,b,d,c){u.queue.push({result:"error",data:a,status:b,headers:d});u.$emit("callFinished")})}else v(1)};u.toggle_admin=function(a){"success"==u[e.iterator+"_"+a+"_class"]?(u[e.iterator+"_"+a+"_class"]="",document.getElementById("check_"+a).checked=!1,-1<u.selected.indexOf(a)&&u.selected.splice(u.selected.indexOf(a),1)):(u[e.iterator+"_"+a+"_class"]="success",document.getElementById("check_"+a).checked=!0,-1==u.selected.indexOf(a)&&u.selected.push(a))}}
|
||||
AdminsList.$inject="$scope $rootScope $location $log $routeParams Rest Alert AdminList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller GetBasePath".split(" ");function Authenticate(k,m,h,g,c,p){"/logout"==h.path()&&g.logout();m.userLoggedIn=!1;k.sessionExpired=g.didSessionExpire();k.sessionTimeout=($AnsibleConfig.session_timeout/60).toFixed(2);$("#login-password").bind("keypress",function(c){13==(c.keyCode?c.keyCode:c.which)&&$("#login-button").click()});$("#login-modal").modal({show:!0,keyboard:!1,backdrop:!1});k.reset=function(){$("#login-form input").each(function(c){$(this).val("")})};k.systemLogin=function(c,e){$(".api-error").empty();g.retrieveToken(c,
|
||||
e).success(function(c,a,d,b){g.setToken(c.token);k.reset();g.getUser().success(function(a,b,d,c){$("#login-modal").modal("hide");g.setUserInfo(a);g.getLicense().success(function(a,b,d,c){g.setLicense(a.license_info);h.path("/organizations")}).error(function(a,b,d,c){p("Error","Failed to access user information. GET returned status: "+b)})}).error(function(a,b,d,c){p("Error","Failed to access license information. GET returned status: "+b)})}).error(function(c,a,d,b){if(c.non_field_errors&&0==c.non_field_errors.length)for(var f in c)k[f+
|
||||
"Error"]=c[f][0];else c.non_field_errors&&0<c.non_field_errors.length?(d="Error",c=c.non_field_errors[0]):(d="Error",c="The login attempt failed with a status of: "+a),k.reset(),p(d,c)})}}Authenticate.$inject="$scope $rootScope $location Authorization ToggleClass Alert".split(" ");function CredentialsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){A("htmlTemplate");var t=C("credentials"),r=h.path().replace(/^\//,"").split("/")[0],n=l.inject(e,{mode:"credentials"==r?"edit":"select"});n.selected=[];n.PostRefreshRemove&&n.PostRefreshRemove();n.PostRefreshRemove=n.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");n[a]=""})});b({scope:n,set:"credentials",list:e,url:t});y({scope:n,list:e,url:t});n.search(e.iterator);a();n.addCredential=function(){h.path(h.path()+
|
||||
"/add")};n.editCredential=function(a){h.path(h.path()+"/"+a)};n.deleteCredential=function(a,b){d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:function(){var b=t+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");n.search(e.iterator)}).error(function(a,d,c,f){$("#prompt-modal").modal("hide");u(n,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+d})})}})};n.finishSelection=function(){var a=C(r),a=a+("users"==r?c.user_id+
|
||||
"Error"]=c[f][0];else c.non_field_errors&&0<c.non_field_errors.length?(d="Error",c=c.non_field_errors[0]):(d="Error",c="The login attempt failed with a status of: "+a),k.reset(),p(d,c)})}}Authenticate.$inject="$scope $rootScope $location Authorization ToggleClass Alert".split(" ");function CredentialsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){A("htmlTemplate");var t=C("credentials"),s=h.path().replace(/^\//,"").split("/")[0],n=l.inject(e,{mode:"credentials"==s?"edit":"select"});n.selected=[];n.PostRefreshRemove&&n.PostRefreshRemove();n.PostRefreshRemove=n.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");n[a]=""})});b({scope:n,set:"credentials",list:e,url:t});y({scope:n,list:e,url:t});n.search(e.iterator);a();n.addCredential=function(){h.path(h.path()+
|
||||
"/add")};n.editCredential=function(a){h.path(h.path()+"/"+a)};n.deleteCredential=function(a,b){d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:function(){var b=t+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");n.search(e.iterator)}).error(function(a,d,c,f){$("#prompt-modal").modal("hide");u(n,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+d})})}})};n.finishSelection=function(){var a=C(s),a=a+("users"==s?c.user_id+
|
||||
"/credentials/":c.team_id+"/credentials/");p.setUrl(a);n.queue=[];n.$on("callFinished",function(){if(n.queue.length==n.selected.length){$('input[type="checkbox"]').prop("checked",!1);n.selected=[];for(var a=0,b=0;b<n.queue.length;b++)"error"==n.queue[b].result&&a++;0<a?f("Error","There was an error while adding one or more of the selected Credentials."):v(1)}});if(0<n.selected.length)for(var a=null,b=0;b<n.selected.length;b++){for(var d=0;d<n.credentials.length;d++)n.credentials[d].id==n.selected[b]&&
|
||||
(a=n.credentials[d]);null!==a&&p.post(a).success(function(a,b,d,c){n.queue.push({result:"success",data:a,status:b});n.$emit("callFinished")}).error(function(a,b,d,c){n.queue.push({result:"error",data:a,status:b,headers:d});n.$emit("callFinished")})}else v()};n.toggle_credential=function(a){"success"==n[e.iterator+"_"+a+"_class"]?(n[e.iterator+"_"+a+"_class"]="",document.getElementById("check_"+a).checked=!1,-1<n.selected.indexOf(a)&&n.selected.splice(n.selected.indexOf(a),1)):(n[e.iterator+"_"+a+
|
||||
"_class"]="success",document.getElementById("check_"+a).checked=!0,-1==n.selected.indexOf(a)&&n.selected.push(a))}}CredentialsList.$inject="$scope $rootScope $location $log $routeParams Rest Alert CredentialList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors GetBasePath".split(" ");
|
||||
function CredentialsAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r,n,B){v("htmlTemplate");var q=B("credentials"),w=e.inject(f,{mode:"add",related:!1}),z=g.path().replace(/^\//,"").split("/")[0],q=B(z),q=q+("teams"==z?p.team_id+"/credentials/":p.user_id+"/credentials/");e.reset();b();w.formSave=function(){l.setUrl(q);var a={},b;for(b in f.fields)a[b]=w[b];"teams"==z?a.team=p.team_id:a.user=p.user_id;l.post(a).success(function(a,b,d,c){y(1)}).error(function(a,b,c,n){d(w,a,b,f,{hdr:"Error!",msg:"Failed to add new Credential. Post returned status: "+
|
||||
function CredentialsAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s,n,B){v("htmlTemplate");var q=B("credentials"),w=e.inject(f,{mode:"add",related:!1}),z=g.path().replace(/^\//,"").split("/")[0],q=B(z),q=q+("teams"==z?p.team_id+"/credentials/":p.user_id+"/credentials/");e.reset();b();w.formSave=function(){l.setUrl(q);var a={},b;for(b in f.fields)a[b]=w[b];"teams"==z?a.team=p.team_id:a.user=p.user_id;l.post(a).success(function(a,b,d,c){y(1)}).error(function(a,b,c,n){d(w,a,b,f,{hdr:"Error!",msg:"Failed to add new Credential. Post returned status: "+
|
||||
b})})};w.formReset=function(){e.reset()};w.clearPWConfirm=function(a){w[a]="";w[f.name+"_form"][a].$setValidity("awpassmatch",!1)};w.ask=function(a,b){w[a]=w[a+"_ask"]?"ASK":"";w[b]="";w[f.name+"_form"][b].$setValidity("awpassmatch",!0)};w.clear=function(a,b){w[a]="";w[b]="";w[f.name+"_form"][b].$setValidity("awpassmatch",!0)}}CredentialsAdd.$inject="$scope $rootScope $compile $location $log $routeParams CredentialForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ReturnToCaller ClearScope GenerateList SearchInit PaginateInit LookUpInit UserList TeamList GetBasePath".split(" ");
|
||||
function CredentialsEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t){function r(){for(var a in B.fields)"password"==B.fields[a].type&&B.fields[a].ask&&"ASK"==q[a]?($("#"+a+"-clear-btn").attr("disabled","disabled"),q[a+"_ask"]=!0):(q[a+"_ask"]=!1,$("#"+a+"-clear-btn").removeAttr("disabled"))}u("htmlTemplate");var n=t("credentials"),B=f,q=e.inject(B,{mode:"edit",related:!0});e.reset();var w=g.path().replace(/^\//,"").split("/")[0],n=t("credentials"),z={},E=p.credential_id,F={};q.credentialLoadedRemove&&q.credentialLoadedRemove();
|
||||
q.credentialLoadedRemove=q.$on("credentialLoaded",function(){for(var a in F)q.search(F[a].iterator)});l.setUrl(n+":id/");l.get({params:{id:E}}).success(function(a,d,c,f){b({path:"/credentials/"+E,title:a.name});for(var n in B.fields)a[n]&&(q[n]=a[n],z[n]=q[n]);q.team=a.team;q.user=a.user;r();a=a.related;for(var e in B.related)a[e]&&(F[e]={url:a[e],iterator:B.related[e].iterator});y({scope:q,form:B,relatedSets:F});v({scope:q,relatedSets:F});q.$emit("credentialLoaded")}).error(function(a,b,c,f){d(q,
|
||||
a,b,B,{hdr:"Error!",msg:"Failed to retrieve Credential: "+p.id+". GET status: "+b})});q.formSave=function(){l.setUrl(n+E+"/");var a={},b;for(b in B.fields)a[b]=q[b];a.team=q.team;a.user=q.user;l.put(a).success(function(a,b,d,c){"credentials"==g.path().replace(/^\//,"").split("/")[0]?A():A(1)}).error(function(a,b,c,f){d(q,a,b,B,{hdr:"Error!",msg:"Failed to update Credential: "+p.id+". PUT status: "+b})})};q.formReset=function(){e.reset();for(var a in z)q[a]=z[a];r()};q.add=function(a){m.flashMessage=
|
||||
function CredentialsEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t){function s(){for(var a in B.fields)"password"==B.fields[a].type&&B.fields[a].ask&&"ASK"==q[a]?($("#"+a+"-clear-btn").attr("disabled","disabled"),q[a+"_ask"]=!0):(q[a+"_ask"]=!1,$("#"+a+"-clear-btn").removeAttr("disabled"))}u("htmlTemplate");var n=t("credentials"),B=f,q=e.inject(B,{mode:"edit",related:!0});e.reset();var w=g.path().replace(/^\//,"").split("/")[0],n=t("credentials"),z={},E=p.credential_id,F={};q.credentialLoadedRemove&&q.credentialLoadedRemove();
|
||||
q.credentialLoadedRemove=q.$on("credentialLoaded",function(){for(var a in F)q.search(F[a].iterator)});l.setUrl(n+":id/");l.get({params:{id:E}}).success(function(a,d,c,f){b({path:"/credentials/"+E,title:a.name});for(var n in B.fields)a[n]&&(q[n]=a[n],z[n]=q[n]);q.team=a.team;q.user=a.user;s();a=a.related;for(var e in B.related)a[e]&&(F[e]={url:a[e],iterator:B.related[e].iterator});y({scope:q,form:B,relatedSets:F});v({scope:q,relatedSets:F});q.$emit("credentialLoaded")}).error(function(a,b,c,f){d(q,
|
||||
a,b,B,{hdr:"Error!",msg:"Failed to retrieve Credential: "+p.id+". GET status: "+b})});q.formSave=function(){l.setUrl(n+E+"/");var a={},b;for(b in B.fields)a[b]=q[b];a.team=q.team;a.user=q.user;l.put(a).success(function(a,b,d,c){"credentials"==g.path().replace(/^\//,"").split("/")[0]?A():A(1)}).error(function(a,b,c,f){d(q,a,b,B,{hdr:"Error!",msg:"Failed to update Credential: "+p.id+". PUT status: "+b})})};q.formReset=function(){e.reset();for(var a in z)q[a]=z[a];s()};q.add=function(a){m.flashMessage=
|
||||
null;g.path("/"+w+"/"+p.id+"/"+a+"/add")};q.edit=function(a,b,d){m.flashMessage=null;g.path("/"+w+"/"+p.id+"/"+a+"/"+b)};q["delete"]=function(a,b,c,f){m.flashMessage=null;C({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+q.name+" "+f+"?",action:function(){var c=n+E+"/"+a+"/";l.setUrl(c);l.post({id:b,disassociate:1}).success(function(b,d,c,f){$("#prompt-modal").modal("hide");q.search(B.related[a].iterator)}).error(function(a,b,f,n){$("#prompt-modal").modal("hide");d(q,a,b,null,{hdr:"Error!",
|
||||
msg:"Call to "+c+" failed. POST returned status: "+b})})}})};q.clearPWConfirm=function(a){q[a]="";q[B.name+"_form"][a].$setValidity("awpassmatch",!1)};q.ask=function(a,b){q[a+"_ask"]?($("#"+a+"-clear-btn").attr("disabled","disabled"),q[a]="ASK"):($("#"+a+"-clear-btn").removeAttr("disabled"),q[a]="");q[b]="";q[B.name+"_form"][b].$setValidity("awpassmatch",!0)};q.clear=function(a,b){q[a]="";q[b]="";q[B.name+"_form"][b].$setValidity("awpassmatch",!0)}}CredentialsEdit.$inject="$scope $rootScope $compile $location $log $routeParams CredentialForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit ReturnToCaller ClearScope Prompt GetBasePath".split(" ");function InventoriesList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){A("htmlTemplate");var t=C("inventory");k="inventories"==h.path().replace(/^\//,"").split("/")[0]?"edit":"select";var r=l.inject(e,{mode:k});r.selected=[];m.flashMessage=null;r.PostRefreshRemove&&r.PostRefreshRemove();r.PostRefreshRemove=r.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");r[a]=""})});b({scope:r,set:"inventories",list:e,url:t});y({scope:r,list:e,url:t});r.search(e.iterator);a();r.addInventory=
|
||||
function(){h.path(h.path()+"/add")};r.editInventory=function(a){h.path(h.path()+"/"+a)};r.deleteInventory=function(a,b){d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:function(){var b=t+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");r.search(e.iterator)}).error(function(a,d,c,f){$("#prompt-modal").modal("hide");u(r,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+d})})}})};r.lookupOrganization=function(a){p.setUrl(C("organizations")+
|
||||
a+"/");p.get().success(function(a,b,d,c){return a.name})};r.finishSelection=function(){p.setUrl("/api/v1"+h.path()+"/");r.queue=[];r.$on("callFinished",function(){if(r.queue.length==r.selected.length){$('input[type="checkbox"]').prop("checked",!1);r.selected=[];for(var a=0,b=0;b<r.queue.length;b++)"error"==r.queue[b].result&&a++;0<a?f("Error","There was an error while adding one or more of the selected inventories."):v(1)}});if(0<r.selected.length)for(var a=null,b=0;b<r.selected.length;b++){for(var d=
|
||||
0;d<r.inventories.length;d++)r.inventories[d].id==r.selected[b]&&(a=r.inventories[d]);null!==a&&p.post(a).success(function(a,b,d,c){r.queue.push({result:"success",data:a,status:b});r.$emit("callFinished")}).error(function(a,b,d,c){r.queue.push({result:"error",data:a,status:b,headers:d});r.$emit("callFinished")})}else v()};r.toggle_inventory=function(a){"success"==r[e.iterator+"_"+a+"_class"]?(r[e.iterator+"_"+a+"_class"]="",document.getElementById("check_"+a).checked=!1,-1<r.selected.indexOf(a)&&
|
||||
r.selected.splice(r.selected.indexOf(a),1)):(r[e.iterator+"_"+a+"_class"]="success",document.getElementById("check_"+a).checked=!0,-1==r.selected.indexOf(a)&&r.selected.push(a))};r.viewJobs=function(a){h.url("/jobs/?inventory__int="+a+"&order_by=status")}}InventoriesList.$inject="$scope $rootScope $location $log $routeParams Rest Alert InventoryList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors GetBasePath".split(" ");
|
||||
function InventoriesAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r,n,B){v("htmlTemplate");var q=n("inventory"),w=e.inject(f,{mode:"add",related:!1});w.inventoryParseType="yaml";e.reset();b();B(w,"inventory_variables","inventoryParseType");r({scope:w,form:f,current_item:p.organization_id?p.organization_id:null,list:u,field:"organization"});w.formSave=function(){try{var b="json"==w.inventoryParseType?JSON.parse(w.inventory_variables):jsyaml.load(w.inventory_variables);if("object"!==typeof b)throw"failed to return an object!";
|
||||
msg:"Call to "+c+" failed. POST returned status: "+b})})}})};q.clearPWConfirm=function(a){q[a]="";q[B.name+"_form"][a].$setValidity("awpassmatch",!1)};q.ask=function(a,b){q[a+"_ask"]?($("#"+a+"-clear-btn").attr("disabled","disabled"),q[a]="ASK"):($("#"+a+"-clear-btn").removeAttr("disabled"),q[a]="");q[b]="";q[B.name+"_form"][b].$setValidity("awpassmatch",!0)};q.clear=function(a,b){q[a]="";q[b]="";q[B.name+"_form"][b].$setValidity("awpassmatch",!0)}}CredentialsEdit.$inject="$scope $rootScope $compile $location $log $routeParams CredentialForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit ReturnToCaller ClearScope Prompt GetBasePath".split(" ");function InventoriesList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){A("htmlTemplate");var t=C("inventory");k="inventories"==h.path().replace(/^\//,"").split("/")[0]?"edit":"select";var s=l.inject(e,{mode:k});s.selected=[];m.flashMessage=null;s.PostRefreshRemove&&s.PostRefreshRemove();s.PostRefreshRemove=s.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");s[a]=""})});b({scope:s,set:"inventories",list:e,url:t});y({scope:s,list:e,url:t});s.search(e.iterator);a();s.addInventory=
|
||||
function(){h.path(h.path()+"/add")};s.editInventory=function(a){h.path(h.path()+"/"+a)};s.deleteInventory=function(a,b){d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:function(){var b=t+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");s.search(e.iterator)}).error(function(a,d,c,f){$("#prompt-modal").modal("hide");u(s,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+d})})}})};s.lookupOrganization=function(a){p.setUrl(C("organizations")+
|
||||
a+"/");p.get().success(function(a,b,d,c){return a.name})};s.finishSelection=function(){p.setUrl("/api/v1"+h.path()+"/");s.queue=[];s.$on("callFinished",function(){if(s.queue.length==s.selected.length){$('input[type="checkbox"]').prop("checked",!1);s.selected=[];for(var a=0,b=0;b<s.queue.length;b++)"error"==s.queue[b].result&&a++;0<a?f("Error","There was an error while adding one or more of the selected inventories."):v(1)}});if(0<s.selected.length)for(var a=null,b=0;b<s.selected.length;b++){for(var d=
|
||||
0;d<s.inventories.length;d++)s.inventories[d].id==s.selected[b]&&(a=s.inventories[d]);null!==a&&p.post(a).success(function(a,b,d,c){s.queue.push({result:"success",data:a,status:b});s.$emit("callFinished")}).error(function(a,b,d,c){s.queue.push({result:"error",data:a,status:b,headers:d});s.$emit("callFinished")})}else v()};s.toggle_inventory=function(a){"success"==s[e.iterator+"_"+a+"_class"]?(s[e.iterator+"_"+a+"_class"]="",document.getElementById("check_"+a).checked=!1,-1<s.selected.indexOf(a)&&
|
||||
s.selected.splice(s.selected.indexOf(a),1)):(s[e.iterator+"_"+a+"_class"]="success",document.getElementById("check_"+a).checked=!0,-1==s.selected.indexOf(a)&&s.selected.push(a))};s.viewJobs=function(a){h.url("/jobs/?inventory__int="+a+"&order_by=status")}}InventoriesList.$inject="$scope $rootScope $location $log $routeParams Rest Alert InventoryList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors GetBasePath".split(" ");
|
||||
function InventoriesAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s,n,B){v("htmlTemplate");var q=n("inventory"),w=e.inject(f,{mode:"add",related:!1});w.inventoryParseType="yaml";e.reset();b();B(w,"inventory_variables","inventoryParseType");s({scope:w,form:f,current_item:p.organization_id?p.organization_id:null,list:u,field:"organization"});w.formSave=function(){try{var b="json"==w.inventoryParseType?JSON.parse(w.inventory_variables):jsyaml.load(w.inventory_variables);if("object"!==typeof b)throw"failed to return an object!";
|
||||
var c={},e;for(e in f.fields)"inventory_variables"!=e&&(f.fields[e].realName?c[f.fields[e].realName]=w[e]:c[e]=w[e]);l.setUrl(q);l.post(c).success(function(a,c,e,n){var k=a.id;w.inventory_variables?(l.setUrl(a.related.variable_data),l.put(b).success(function(a,b,d,c){g.path("/inventories/"+k)}).error(function(a,b,c,e){d(w,a,b,f,{hdr:"Error!",msg:"Failed to add inventory varaibles. PUT returned status: "+b})})):g.path("/inventories/"+k)}).error(function(a,b,c,e){d(w,a,b,f,{hdr:"Error!",msg:"Failed to add new inventory. Post returned status: "+
|
||||
b})})}catch(n){a("Error","Error parsing inventory variables. Parser returned: "+n)}};w.formReset=function(){e.reset()}}InventoriesAdd.$inject="$scope $rootScope $compile $location $log $routeParams InventoryForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ReturnToCaller ClearScope GenerateList OrganizationList SearchInit PaginateInit LookUpInit GetBasePath ParseTypeChange".split(" ");
|
||||
function InventoriesEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r,n,B,q,w,z,E,F,D,s,K,G,J){u("htmlTemplate");var H=B("inventory"),x=e.inject(f,{mode:"edit",related:!0});e.reset();var L=g.path().replace(/^\//,"").split("/")[0],I=p.id;J(x,"inventory_variables","inventoryParseType");x.inventoryParseType="yaml";x.inventory_id=I;x.inventoryLoadedRemove&&x.inventoryLoadedRemove();x.inventoryLoadedRemove=x.$on("inventoryLoaded",function(){x.groupTitle="All Hosts";x.createButtonShow=!1;x.search(x.relatedSets.hosts.iterator);
|
||||
n(x.TreeParams);C({scope:x,form:f,current_item:x.organization?x.organization:null,list:r,field:"organization"});x.variable_url?(l.setUrl(x.variable_url),l.get().success(function(a,b,d,c){$.isEmptyObject(a)?x.inventory_variables="---":x.inventory_variables=jsyaml.safeDump(a)}).error(function(a,b,c,e){x.inventory_variables=null;d(x,a,b,f,{hdr:"Error!",msg:"Failed to retrieve inventory variables. GET returned status: "+b})})):x.inventory_variables="---"});z({scope:x});x.filterInventory=function(){G({scope:x})};
|
||||
function InventoriesEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s,n,B,q,w,z,E,F,D,r,K,G,J){u("htmlTemplate");var H=B("inventory"),x=e.inject(f,{mode:"edit",related:!0});e.reset();var L=g.path().replace(/^\//,"").split("/")[0],I=p.id;J(x,"inventory_variables","inventoryParseType");x.inventoryParseType="yaml";x.inventory_id=I;x.inventoryLoadedRemove&&x.inventoryLoadedRemove();x.inventoryLoadedRemove=x.$on("inventoryLoaded",function(){x.groupTitle="All Hosts";x.createButtonShow=!1;x.search(x.relatedSets.hosts.iterator);
|
||||
n(x.TreeParams);C({scope:x,form:f,current_item:x.organization?x.organization:null,list:s,field:"organization"});x.variable_url?(l.setUrl(x.variable_url),l.get().success(function(a,b,d,c){$.isEmptyObject(a)?x.inventory_variables="---":x.inventory_variables=jsyaml.safeDump(a)}).error(function(a,b,c,e){x.inventory_variables=null;d(x,a,b,f,{hdr:"Error!",msg:"Failed to retrieve inventory variables. GET returned status: "+b})})):x.inventory_variables="---"});z({scope:x});x.filterInventory=function(){G({scope:x})};
|
||||
x.formSave=function(){try{var b="json"==x.inventoryParseType?JSON.parse(x.inventory_variables):jsyaml.load(x.inventory_variables);if("object"!==typeof b)throw"failed to return an object!";var c={},e;for(e in f.fields)"inventory_variables"!=e&&(f.fields[e].realName?c[f.fields[e].realName]=x[e]:c[e]=x[e]);l.setUrl(H+I+"/");l.put(c).success(function(a,c,e,n){x.inventory_variables?(l.setUrl(a.related.variable_data),l.put(b).success(function(a,b,d,c){g.path("/inventories")}).error(function(a,b,c,e){d(x,
|
||||
a,b,f,{hdr:"Error!",msg:"Failed to update inventory varaibles. PUT returned status: "+b})})):g.path("/inventories")}).error(function(a,b,c,e){d(x,a,b,f,{hdr:"Error!",msg:"Failed to update new inventory. Post returned status: "+b})})}catch(n){a("Error","Error parsing inventory variables. Parser returned: "+n)}};x.formReset=function(){e.reset();for(var a in x.master)x[a]=x.master[a]};x.add=function(a){m.flashMessage=null;g.path("/"+L+"/"+p.id+"/groups/"+x.group_id+"/"+a+"/add")};x.edit=function(a,b,
|
||||
d){m.flashMessage=null;g.path("/"+L+"/"+p.id+"/"+a+"/"+b)};x["delete"]=function(a,b,c,e){m.flashMessage=null;t({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+x.name+" "+e+"?",action:function(){var c=H+I+"/"+a+"/";l.setUrl(c);l.post({id:b,disassociate:1}).success(function(b,d,c,e){$("#prompt-modal").modal("hide");x.search(f.related[a].iterator)}).error(function(a,b,f,e){$("#prompt-modal").modal("hide");d(x,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. POST returned status: "+
|
||||
b})})}})};x.treeController=function(a){return"inventory"==$(a).attr("type")?{addGroup:{label:"Add Group",action:function(a){q({inventory_id:I,group_id:null})}}}:{addGroup:{label:"Add Group",action:function(a){q({inventory_id:I,group_id:$(a).attr("group_id")})}},edit:{label:"Edit Group",action:function(a){w({inventory_id:I,group_id:$(a).attr("group_id")})},separator_before:!0},"delete":{label:"Delete Group",action:function(a){E({scope:x,inventory_id:I,group_id:$(a).attr("group_id")})}}}};x.$on("NodeSelect",
|
||||
function(a,b){var d=$('li[id="'+b.attr.id+'"]'),c=d.attr("type"),e;x.selectedNode=d;$("#tree-view").jstree("open_node",d);"group"==c?(e=d.attr("all"),x.groupAddHide=!1,x.groupEditHide=!1,x.groupDeleteHide=!1,x.createButtonShow=!0,x.group_id=d.attr("group_id"),x.groupName=b.data,x.groupTitle=b.data,x.groupTitle+=d.attr("description")?" -"+d.attr("description"):""):"inventory"==c&&(e=d.attr("hosts"),x.groupAddHide=!1,x.groupEditHide=!0,x.groupDeleteHide=!0,x.createButtonShow=!1,x.groupName="All Hosts",
|
||||
x.groupTitle="All Hosts",x.group_id=null);x.relatedSets.hosts={url:e,iterator:"host"};y({scope:x,form:f,relatedSets:x.relatedSets});v({scope:x,relatedSets:x.relatedSets});x.search("host");x.$$phase||x.$digest()});x.addGroup=function(){q({inventory_id:I,group_id:x.group_id})};x.editGroup=function(){w({inventory_id:I,group_id:x.group_id})};x.deleteGroup=function(){E({scope:x,inventory_id:I,group_id:x.group_id})};x.selectHost=function(){F({scope:x,inventory_id:I,group_id:x.group_id})};x.createHost=function(){D({scope:x,
|
||||
inventory_id:I,group_id:x.group_id})};x.editHost=function(a,b){s({scope:x,inventory_id:I,group_id:x.group_id,host_id:a,host_name:b})};x.deleteHost=function(a,b){K({scope:x,inventory_id:I,group_id:x.group_id,host_id:a,host_name:b})};x.showEvents=function(a,c){l.setUrl(c);l.get().success(function(d,c,f,e){b({path:"/jobs/"+d.id,title:d.name});g.url("/jobs/"+d.id+"/job_events/?host="+escape(a))}).error(function(a,b,e,n){d(x,a,b,f,{hdr:"Error!",msg:"Failed to lookup last job: "+c+". GET status: "+b})})}}
|
||||
InventoriesEdit.$inject="$scope $rootScope $compile $location $log $routeParams InventoryForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit ReturnToCaller ClearScope LookUpInit Prompt OrganizationList TreeInit GetBasePath GroupsList GroupsEdit LoadInventory GroupsDelete HostsList HostsAdd HostsEdit HostsDelete RefreshTree ParseTypeChange".split(" ");function JobEventsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r,n,B){A("htmlTemplate");e.base=h.path();k=C("jobs")+c.id+"/job_events/";h.path().replace(/^\//,"").split("/");var q=l.inject(e,{mode:"edit"});m.flashMessage=null;q.selected=[];q.expand=!0;q.parentNode="parent-event";q.childNode="child-event";q.RemovePostRefresh&&q.RemovePostRefresh();q.RemovePostRefresh=q.$on("PostRefresh",function(){for(var a=q[e.name],b,d=0;d<a.length;d++){a[d].event_display=a[d].event_display.replace(/^\u00a0*/g,"");if(3>
|
||||
inventory_id:I,group_id:x.group_id})};x.editHost=function(a,b){r({scope:x,inventory_id:I,group_id:x.group_id,host_id:a,host_name:b})};x.deleteHost=function(a,b){K({scope:x,inventory_id:I,group_id:x.group_id,host_id:a,host_name:b})};x.showEvents=function(a,c){l.setUrl(c);l.get().success(function(d,c,f,e){b({path:"/jobs/"+d.id,title:d.name});g.url("/jobs/"+d.id+"/job_events/?host="+escape(a))}).error(function(a,b,e,n){d(x,a,b,f,{hdr:"Error!",msg:"Failed to lookup last job: "+c+". GET status: "+b})})}}
|
||||
InventoriesEdit.$inject="$scope $rootScope $compile $location $log $routeParams InventoryForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit ReturnToCaller ClearScope LookUpInit Prompt OrganizationList TreeInit GetBasePath GroupsList GroupsEdit LoadInventory GroupsDelete HostsList HostsAdd HostsEdit HostsDelete RefreshTree ParseTypeChange".split(" ");function JobEventsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s,n,B){A("htmlTemplate");e.base=h.path();k=C("jobs")+c.id+"/job_events/";h.path().replace(/^\//,"").split("/");var q=l.inject(e,{mode:"edit"});m.flashMessage=null;q.selected=[];q.expand=!0;q.parentNode="parent-event";q.childNode="child-event";q.RemovePostRefresh&&q.RemovePostRefresh();q.RemovePostRefresh=q.$on("PostRefresh",function(){for(var a=q[e.name],b,d=0;d<a.length;d++){a[d].event_display=a[d].event_display.replace(/^\u00a0*/g,"");if(3>
|
||||
a[d].event_level)a[d].ngclick="toggleChildren("+a[d].id+', "'+a[d].related.children+'")',a[d].ngicon="icon-collapse-alt",a[d]["class"]="parentNode";else{a[d]["class"]="childNode";b=a[d];var c=a[d].event_data,f="";if(c.res){var n=void 0,n=void 0,l=!1;if("string"==typeof c.res)n=(n=c.res.match(/\n/g))?n.length:1,l=!0,f+="<label>Traceback:</label>\n",f+='<textarea readonly class="input-xxlarge" rows="'+n+'">'+c.res+"</textarea>\n";else{var g=void 0;for(g in c.res){if(("msg"==g||"stdout"==g||"stderr"==
|
||||
g)&&null!==c.res[g]&&""!==c.res[g]){f+="<label>";switch(g){case "msg":case "stdout":f+="Output:";break;case "stderr":f+="Error:"}f+="</label>\n";n=(n=c.res[g].match(/\n/g))?n.length:1;f+='<textarea readonly class="input-xxlarge" rows="'+n+'">'+c.res[g]+"</textarea>\n";l=!0}if("results"==g&&Array.isArray(c.res[g])&&0<c.res[g].length){f+="<label>Results:</label>\n";l="";for(n=0;n<c.res[g].length;n++)l+=c.res[g][n];n=(n=l.match(/\n/g))?n.length:1;f+='<textarea readonly class="input-xxlarge" rows="'+
|
||||
n+'">'+l+"</textarea>\n";l=!0}"rc"==g&&0!=c.res[g]&&(f+="<label>Return Code:</label>\n",f+='<input type="text" class="input-mini" value="'+c.res[g]+'" readonly >\n',l=!0)}}f=l?'<form class="event-form">\n'+f+"</form>\n":""}f=c.host?'<span class="event-detail-host visible-phone visible-tablet">'+c.host+"</span>\n"+f:""==f?null:f;b.event_detail=f}a[d].show=!0;a[d].spaces=24*a[d].event_level;q.jobevents[d].status=q.jobevents[d].failed?"error":q.jobevents[d].changed?"changed":"success";b=new Date(a[d].created);
|
||||
a[d].created=B(b)}});b({scope:q,set:"jobevents",list:e,url:k});y({scope:q,list:e,url:k});c.host&&(q[e.iterator+"SearchField"]="host",q[e.iterator+"SearchValue"]=c.host,q[e.iterator+"SearchFieldLabel"]=e.fields.host.label);q.search(e.iterator);q.toggleChildren=function(a,b){r({scope:q,list:e,id:a,children:b})};a();q.viewJobEvent=function(a){n({event_id:a})};q.refresh=function(){q.expand=!0;q.search(e.iterator)};q.jobDetails=function(){h.path("/jobs/"+c.id)};q.jobSummary=function(){h.path("/jobs/"+
|
||||
a[d].created=B(b)}});b({scope:q,set:"jobevents",list:e,url:k});y({scope:q,list:e,url:k});c.host&&(q[e.iterator+"SearchField"]="host",q[e.iterator+"SearchValue"]=c.host,q[e.iterator+"SearchFieldLabel"]=e.fields.host.label);q.search(e.iterator);q.toggleChildren=function(a,b){s({scope:q,list:e,id:a,children:b})};a();q.viewJobEvent=function(a){n({event_id:a})};q.refresh=function(){q.expand=!0;q.search(e.iterator)};q.jobDetails=function(){h.path("/jobs/"+c.id)};q.jobSummary=function(){h.path("/jobs/"+
|
||||
c.id+"/job_host_summaries")}}JobEventsList.$inject="$scope $rootScope $location $log $routeParams Rest Alert JobEventList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors GetBasePath LookUpInit ToggleChildren EventView FormatDate".split(" ");
|
||||
function JobEventsEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A){y("htmlTemplate");var u=e.inject(f,{mode:"edit",related:!0});e.reset();k=v("base")+"job_events/"+p.event_id+"/";g.path().replace(/^\//,"").split("/");l.setUrl(k);l.get().success(function(a,d,c,e){b({path:"/job_events/"+p.event_id,title:a.event});for(var l in f.fields)"status"==l?u.status=a.failed?"error":"success":"event_data"==l?u.event_data=JSON.stringify(a.event_data,void 0,"\t"):"created"==l?u.created=A(new Date(a.created)):a[l]&&(u[l]=a[l])}).error(function(a,
|
||||
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(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){A("htmlTemplate");k=C("jobs")+c.id+"/job_host_summaries/";h.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:k});
|
||||
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;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:B});y({scope:q,
|
||||
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,s,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;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:B});y({scope:q,
|
||||
list:e,url:B});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});h.path(h.path()+"/"+b)};q.viewEvents=function(b,d){a({path:"/jobs/"+b,title:d});h.path(h.path()+"/"+b+"/job_events")};q.viewSummary=function(b,d){a({path:"/jobs/"+b,title:d});h.path(h.path()+"/"+b+"/job_host_summaries")};
|
||||
q.deleteJob=function(a,b){p.setUrl(B+a+"/");p.get().success(function(b,c,f,l){var n,g;"pending"==b.status||"running"==b.status?(n=b.related.cancel,g="cancel",b="Cancel Job"):(n=B+a+"/",g="delete",b="Delete Job");d({hdr:b,body:"Are you sure you want to "+g+" job "+a+"?",action:function(){p.setUrl(n);"cancel"==g?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){r({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(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r,n,B,q,w,z){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){s.playbook_options=[];for(b=0;b<a.length;b++)s.playbook_options.push(a[b])}).error(function(a,c,f,e){d(s,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,s=e.inject(D,{mode:"edit",related:!0});e.reset();var K=g.path().replace(/^\//,
|
||||
"").split("/")[0],G={},J=p.id,H={};s.statusSearchSpin=!1;s.selectPlaybookUnregister&&s.selectPlaybookUnregister();s.selectPlaybookUnregister=s.$watch("project_name",function(a,b){a!==b&&(""!==b&&null!==b&&void 0!==b)&&(s.playbook=null,E(s.project))});s.jobLoadedRemove&&s.jobLoadedRemove();s.jobLoadedRemove=s.$on("jobLoaded",function(){s[D.name+"ReadOnly"]="new"==s.status?!1:!0;for(var a in H)s.search(H[a].iterator);E(s.project);$("#forks-slider").slider("option","value",s.forks);$("#forks-slider").slider("disable");
|
||||
l.setUrl(s.template_url);l.get().success(function(a,b,d,c){b=a.host_config_key?"true":"false";s.host_config_key=a.host_config_key;w({scope:s,master:G,check_field:"allow_callbacks",default_val:b});s.callback_url=a.related.callback;$('input[type="checkbox"]').attr("disabled","disabled");$("#host_config_key-gen-btn").attr("disabled","disabled")}).error(function(a,b,c,f){d(s,a,b,D,{hdr:"Error!",msg:"Failed to retrieve job: "+p.id+". GET status: "+b})})});s.job_type_options=[{value:"run",label:"Run"},
|
||||
{value:"check",label:"Check"}];s.verbosity_options=[{value:"0",label:"Default"},{value:"1",label:"Verbose"},{value:"3",label:"Debug"}];s.playbook_options=null;s.playbook=null;l.setUrl(F+":id/");l.get({params:{id:J}}).success(function(a,d,c,f){b({path:"/job_templates/"+J,title:a.name});for(var e in D.fields){if(null!==a[e]&&void 0!==a[e]){if("select"==D.fields[e].type)if(s[e+"_options"]&&0<s[e+"_options"].length)for(d=0;d<s[e+"_options"].length;d++)a[e]==s[e+"_options"][d].value&&(s[e]=s[e+"_options"][d]);
|
||||
else s[e]=a[e];else s[e]=a[e];G[e]=s[e]}"lookup"==D.fields[e].type&&a.summary_fields[D.fields[e].sourceModel]&&(s[D.fields[e].sourceModel+"_"+D.fields[e].sourceField]=a.summary_fields[D.fields[e].sourceModel][D.fields[e].sourceField],G[D.fields[e].sourceModel+"_"+D.fields[e].sourceField]=s[D.fields[e].sourceModel+"_"+D.fields[e].sourceField])}for(e in D.statusFields)null!==a[e]&&void 0!==a[e]&&("created"==e?s.created=z(new Date(a.created)):s[e]=a[e]);$('form[name="jobs_form"] input[type="text"], form[name="jobs_form"] jobs_form textarea').attr("readonly",
|
||||
"readonly");$('form[name="jobs_form"] select').prop("disabled","disabled");$('form[name="jobs_form"] .lookup-btn').prop("disabled","disabled");$('form[name="jobs_form"] .buttons, form[name="jobs_form"] hr').hide();s.url=a.url;e=a.related;for(var l in D.related)e[l]&&(H[l]={url:e[l],iterator:D.related[l].iterator});n({scope:s,form:D,current_item:a.inventory,list:C,field:"inventory"});n({scope:s,form:D,current_item:a.credential,list:t,field:"credential"});n({scope:s,form:D,current_item:a.project,list:r,
|
||||
field:"project"});y({scope:s,form:D,relatedSets:H});v({scope:s,relatedSets:H});s.template_url=a.related.job_template;s.$emit("jobLoaded")}).error(function(a,b,c,f){d(s,a,b,D,{hdr:"Error!",msg:"Failed to retrieve job: "+p.id+". GET status: "+b})});s.formSave=function(){l.setUrl(F+p.id+"/");var a={},b;for(b in D.fields)a[b]="select"==D.fields[b].type&&"playbook"!=b?s[b].value:s[b];l.put(a).success(function(a,b,d,c){"job_templates"==g.path().replace(/^\//,"").split("/")[0]?A():A(1)}).error(function(a,
|
||||
b,c,f){d(s,a,b,D,{hdr:"Error!",msg:"Failed to update job "+p.id+". PUT returned status: "+b})})};s.formReset=function(){e.reset();for(var a in G)s[a]=G[a];$("#forks-slider").slider("option","value",s.forks)};s.add=function(a){m.flashMessage=null;g.path("/"+K+"/"+p.id+"/"+a)};s.edit=function(a,b,d){m.flashMessage=null;g.path("/"+K+"/"+p.id+"/"+a+"/"+b)};s["delete"]=function(a,b,c,f){m.flashMessage=null;Prompt({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+s.name+" "+f+"?",action:function(){var c=
|
||||
F+J+"/"+a+"/";l.setUrl(c);l.post({id:b,disassociate:1}).success(function(b,d,c,f){$("#prompt-modal").modal("hide");s.search(D.related[a].iterator)}).error(function(a,b,f,e){$("#prompt-modal").modal("hide");d(s,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. POST returned status: "+b})})}})};s.refresh=function(){s.statusSearchSpin=!0;l.setUrl(F+J+"/");l.get().success(function(a,b,d,c){s.status=a.status;s.result_stdout=a.result_stdout;s.result_traceback=a.result_traceback;s.statusSearchSpin=!1}).error(function(a,
|
||||
b,c,f){d(s,a,b,null,{hdr:"Error!",msg:"Attempt to load job failed. GET returned status: "+b})})};s.jobSummary=function(){g.path("/jobs/"+J+"/job_host_summaries")};s.jobEvents=function(){g.path("/jobs/"+J+"/job_events")}}JobsEdit.$inject="$scope $rootScope $compile $location $log $routeParams JobForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit ReturnToCaller ClearScope InventoryList CredentialList ProjectList LookUpInit PromptPasswords GetBasePath md5Setup FormatDate".split(" ");function JobTemplatesList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r,n,B,q){A("htmlTemplate");var w=C("job_templates");k="job_templates"==h.path().replace(/^\//,"").split("/")[0]?"edit":"select";var z=l.inject(e,{mode:k});m.flashMessage=null;z.selected=[];z.PostRefreshRemove&&z.PostRefreshRemove();z.PostRefreshRemove=z.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");z[a]=""})});b({scope:z,set:"job_templates",list:e,url:w});y({scope:z,list:e,url:w});z.search(e.iterator);
|
||||
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(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s,n,B,q,w,z){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.parseType="yaml";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;w({scope:r,master:G,check_field:"allow_callbacks",default_val:b});r.callback_url=a.related.callback;$('input[type="checkbox"]').attr("disabled","disabled");$('input[type="radio"]').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=[{value:"0",label:"Default"},{value:"1",label:"Verbose"},{value:"3",label:"Debug"}];r.playbook_options=null;r.playbook=null;l.setUrl(F+":id/");l.get({params:{id:J}}).success(function(a,d,c,f){b({path:"/job_templates/"+J,title:a.name});for(var e in D.fields){if("variables"!=e&&null!==a[e]&&void 0!==a[e]){if("select"==D.fields[e].type)if(r[e+"_options"]&&0<r[e+"_options"].length)for(d=
|
||||
0;d<r[e+"_options"].length;d++)a[e]==r[e+"_options"][d].value&&(r[e]=r[e+"_options"][d]);else r[e]=a[e];else r[e]=a[e];G[e]=r[e]}"variables"==e&&($.isEmptyObject(a.extra_vars)||"{}"==a.extra_vars||"null"==a.extra_vars?r.variables="---":(d=JSON.parse(a.extra_vars),r.variables=jsyaml.safeDump(d)),G.variables=r.variables);"lookup"==D.fields[e].type&&a.summary_fields[D.fields[e].sourceModel]&&(r[D.fields[e].sourceModel+"_"+D.fields[e].sourceField]=a.summary_fields[D.fields[e].sourceModel][D.fields[e].sourceField],
|
||||
G[D.fields[e].sourceModel+"_"+D.fields[e].sourceField]=r[D.fields[e].sourceModel+"_"+D.fields[e].sourceField])}for(e in D.statusFields)null!==a[e]&&void 0!==a[e]&&("created"==e?r.created=z(new Date(a.created)):r[e]=a[e]);$('form[name="jobs_form"] input[type="text"], form[name="jobs_form"] jobs_form textarea').attr("readonly","readonly");$('form[name="jobs_form"] select').prop("disabled","disabled");$('form[name="jobs_form"] .lookup-btn').prop("disabled","disabled");$('form[name="jobs_form"] .buttons, form[name="jobs_form"] hr').hide();
|
||||
r.url=a.url;e=a.related;for(var l in D.related)e[l]&&(H[l]={url:e[l],iterator:D.related[l].iterator});n({scope:r,form:D,current_item:a.inventory,list:C,field:"inventory"});n({scope:r,form:D,current_item:a.credential,list:t,field:"credential"});n({scope:r,form:D,current_item:a.project,list:s,field:"project"});y({scope:r,form:D,relatedSets:H});v({scope:r,relatedSets:H});r.template_url=a.related.job_template;r.$emit("jobLoaded")}).error(function(a,b,c,f){d(r,a,b,D,{hdr:"Error!",msg:"Failed to retrieve job: "+
|
||||
p.id+". GET status: "+b})});r.formSave=function(){l.setUrl(F+p.id+"/");var a={},b;for(b in D.fields)a[b]="select"==D.fields[b].type&&"playbook"!=b?r[b].value:r[b];l.put(a).success(function(a,b,d,c){"job_templates"==g.path().replace(/^\//,"").split("/")[0]?A():A(1)}).error(function(a,b,c,f){d(r,a,b,D,{hdr:"Error!",msg:"Failed to update job "+p.id+". PUT returned status: "+b})})};r.formReset=function(){e.reset();for(var a in G)r[a]=G[a];$("#forks-slider").slider("option","value",r.forks)};r.add=function(a){m.flashMessage=
|
||||
null;g.path("/"+K+"/"+p.id+"/"+a)};r.edit=function(a,b,d){m.flashMessage=null;g.path("/"+K+"/"+p.id+"/"+a+"/"+b)};r["delete"]=function(a,b,c,f){m.flashMessage=null;Prompt({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+r.name+" "+f+"?",action:function(){var c=F+J+"/"+a+"/";l.setUrl(c);l.post({id:b,disassociate:1}).success(function(b,d,c,f){$("#prompt-modal").modal("hide");r.search(D.related[a].iterator)}).error(function(a,b,f,e){$("#prompt-modal").modal("hide");d(r,a,b,null,{hdr:"Error!",
|
||||
msg:"Call to "+c+" failed. POST returned status: "+b})})}})};r.refresh=function(){r.statusSearchSpin=!0;l.setUrl(F+J+"/");l.get().success(function(a,b,d,c){r.status=a.status;r.result_stdout=a.result_stdout;r.result_traceback=a.result_traceback;r.statusSearchSpin=!1}).error(function(a,b,c,f){d(r,a,b,null,{hdr:"Error!",msg:"Attempt to load job failed. GET returned status: "+b})})};r.jobSummary=function(){g.path("/jobs/"+J+"/job_host_summaries")};r.jobEvents=function(){g.path("/jobs/"+J+"/job_events")}}
|
||||
JobsEdit.$inject="$scope $rootScope $compile $location $log $routeParams JobForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit ReturnToCaller ClearScope InventoryList CredentialList ProjectList LookUpInit PromptPasswords GetBasePath md5Setup FormatDate".split(" ");function JobTemplatesList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s,n,B,q){A("htmlTemplate");var w=C("job_templates");k="job_templates"==h.path().replace(/^\//,"").split("/")[0]?"edit":"select";var z=l.inject(e,{mode:k});m.flashMessage=null;z.selected=[];z.PostRefreshRemove&&z.PostRefreshRemove();z.PostRefreshRemove=z.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");z[a]=""})});b({scope:z,set:"job_templates",list:e,url:w});y({scope:z,list:e,url:w});z.search(e.iterator);
|
||||
a();z.addJobTemplate=function(){h.path(h.path()+"/add")};z.editJobTemplate=function(a){h.path(h.path()+"/"+a)};z.deleteJobTemplate=function(a,b){d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:function(){var b=w+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");z.search(e.iterator)}).error(function(a,d,c,f){$("#prompt-modal").modal("hide");u(z,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+d})})}})};z.finishSelection=
|
||||
function(){p.setUrl(w);z.queue=[];z.callFinishedRemove&&z.callFinishedRemove();z.callFinishedRemove=z.$on("callFinished",function(){if(z.queue.length==z.selected.length){$('input[type="checkbox"]').prop("checked",!1);z.selected=[];for(var a=0,b=0;b<z.queue.length;b++)"error"==z.queue[b].result&&a++;0<a?f("Error","There was an error while adding one or more of the selected templates."):v(1)}});if(0<z.selected.length)for(var a=null,b=0;b<z.selected.length;b++){for(var d=0;d<z.job_templates.length;d++)z.job_templates[d].id==
|
||||
z.selected[b]&&(a=z.job_templates[d]);null!==a&&p.post(a).success(function(a,b,d,c){z.queue.push({result:"success",data:a,status:b});z.$emit("callFinished")}).error(function(a,b,d,c){z.queue.push({result:"error",data:a,status:b,headers:d});z.$emit("callFinished")})}else v(1)};z.toggle_job_template=function(a){"success"==z[e.iterator+"_"+a+"_class"]?(z[e.iterator+"_"+a+"_class"]="",document.getElementById("check_"+a).checked=!1,-1<z.selected.indexOf(a)&&z.selected.splice(z.selected.indexOf(a),1)):
|
||||
(z[e.iterator+"_"+a+"_class"]="success",document.getElementById("check_"+a).checked=!0,-1==z.selected.indexOf(a)&&z.selected.push(a))};z.submitJob=function(a){q({scope:z,id:a})}}JobTemplatesList.$inject="$scope $rootScope $location $log $routeParams Rest Alert JobTemplateList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors GetBasePath PromptPasswords JobTemplateForm CredentialList LookUpInit SubmitJob".split(" ");
|
||||
function JobTemplatesAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r,n,B){v("htmlTemplate");var q=A("job_templates"),w=e.inject(f,{mode:"add",related:!1}),z={};w.parseType="yaml";B(w);w.job_type_options=[{value:"run",label:"Run"},{value:"check",label:"Check"}];w.verbosity_options=[{value:"0",label:"Default"},{value:"1",label:"Verbose"},{value:"3",label:"Debug"}];w.playbook_options=[];w.allow_callbacks="false";e.reset();b();n({scope:w,master:z,check_field:"allow_callbacks",default_val:!1});r({scope:w,form:f,
|
||||
current_item:null,list:u,field:"inventory"});r({scope:w,form:f,current_item:null,list:C,field:"credential"});w.selectPlaybookUnregister&&w.selectPlaybookUnregister();w.selectPlaybookUnregister=w.$watch("project_name",function(a,b){if(a!=b&&w.project){var c=A("projects")+w.project+"/playbooks/";l.setUrl(c);l.get().success(function(a,b,d,c){b=[];for(d=0;d<a.length;d++)b.push(a[d]);w.playbook_options=b}).error(function(a,b,e,l){d(w,a,b,f,{hdr:"Error!",msg:"Failed to get playbook list for "+c+". GET returned status: "+
|
||||
b})})}});r({scope:w,form:f,current_item:null,list:t,field:"project"});w.formSave=function(){var b={};try{var c="json"==w.parseType?JSON.parse(w.variables):jsyaml.load(w.variables);if("object"!==typeof c)throw"failed to return an object!";for(var e in f.fields)"select"==f.fields[e].type&&"playbook"!=e?b[e]=w[e].value:"variables"!=e&&(b[e]=w[e]);b.extra_vars=JSON.stringify(c,void 0,"\t");l.setUrl(q);l.post(b).success(function(a,b,d,c){"job_templates"==g.path().replace(/^\//,"").split("/")[0]?y():y(1)}).error(function(a,
|
||||
function JobTemplatesAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s,n,B){v("htmlTemplate");var q=A("job_templates"),w=e.inject(f,{mode:"add",related:!1}),z={};w.parseType="yaml";B(w);w.job_type_options=[{value:"run",label:"Run"},{value:"check",label:"Check"}];w.verbosity_options=[{value:"0",label:"Default"},{value:"1",label:"Verbose"},{value:"3",label:"Debug"}];w.playbook_options=[];w.allow_callbacks="false";e.reset();b();n({scope:w,master:z,check_field:"allow_callbacks",default_val:!1});s({scope:w,form:f,
|
||||
current_item:null,list:u,field:"inventory"});s({scope:w,form:f,current_item:null,list:C,field:"credential"});w.selectPlaybookUnregister&&w.selectPlaybookUnregister();w.selectPlaybookUnregister=w.$watch("project_name",function(a,b){if(a!=b&&w.project){var c=A("projects")+w.project+"/playbooks/";l.setUrl(c);l.get().success(function(a,b,d,c){b=[];for(d=0;d<a.length;d++)b.push(a[d]);w.playbook_options=b}).error(function(a,b,e,l){d(w,a,b,f,{hdr:"Error!",msg:"Failed to get playbook list for "+c+". GET returned status: "+
|
||||
b})})}});s({scope:w,form:f,current_item:null,list:t,field:"project"});w.formSave=function(){var b={};try{var c="json"==w.parseType?JSON.parse(w.variables):jsyaml.load(w.variables);if("object"!==typeof c)throw"failed to return an object!";for(var e in f.fields)"select"==f.fields[e].type&&"playbook"!=e?b[e]=w[e].value:"variables"!=e&&(b[e]=w[e]);b.extra_vars=JSON.stringify(c,void 0,"\t");l.setUrl(q);l.post(b).success(function(a,b,d,c){"job_templates"==g.path().replace(/^\//,"").split("/")[0]?y():y(1)}).error(function(a,
|
||||
b,c,e){d(w,a,b,f,{hdr:"Error!",msg:"Failed to add new job template. POST returned status: "+b})})}catch(n){a("Error","Error parsing extra variables. Parser returned: "+n)}};w.formReset=function(){e.reset();$("#forks-slider").slider("option","value",w.forks);for(var a in z)w[a]=z[a]}}JobTemplatesAdd.$inject="$scope $rootScope $compile $location $log $routeParams JobTemplateForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ReturnToCaller ClearScope GetBasePath InventoryList CredentialList ProjectList LookUpInit md5Setup ParseTypeChange".split(" ");
|
||||
function JobTemplatesEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r,n,B,q,w,z){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){s.playbook_options=[];for(b=0;b<a.length;b++)s.playbook_options.push(a[b])}).error(function(a,c,f,e){d(s,a,c,D,{hdr:"Error!",msg:"Failed to get playbook list for "+b+". GET returned status: "+c})})}}u("htmlTemplate");var F=q("job_templates"),D=f,s=e.inject(D,{mode:"edit",related:!0});s.parseType=
|
||||
"yaml";z(s);s.job_type_options=[{value:"run",label:"Run"},{value:"check",label:"Check"}];s.verbosity_options=[{value:"0",label:"Default"},{value:"1",label:"Verbose"},{value:"3",label:"Debug"}];s.playbook_options=null;s.playbook=null;e.reset();var K=g.path().replace(/^\//,"").split("/")[0],G={},J=p.id,H={};s.selectPlaybookUnregister&&s.selectPlaybookUnregister();s.selectPlaybookUnregister=s.$watch("project_name",function(a,b){a!==b&&(""!==b&&null!==b&&void 0!==b)&&(s.playbook=null,E(s.project))});
|
||||
s.jobTemplateLoadedRemove&&s.jobTemplateLoadedRemove();s.jobTemplateLoadedRemove=s.$on("jobTemplateLoaded",function(){for(var a in H)s.search(H[a].iterator);E(s.project);$("#forks-slider").slider("value",s.forks);w({scope:s,master:G,check_field:"allow_callbacks",default_val:""===s.host_config_key||null===s.host_config_key?"false":"true"})});l.setUrl(F+":id/");l.get({params:{id:J}}).success(function(a,d,c,f){b({path:"/job_templates/"+J,title:a.name});for(var e in D.fields){if("variables"!=e&&null!==
|
||||
a[e]&&void 0!==a[e]){if("select"==D.fields[e].type)if(s[e+"_options"]&&0<s[e+"_options"].length)for(d=0;d<s[e+"_options"].length;d++)a[e]==s[e+"_options"][d].value&&(s[e]=s[e+"_options"][d]);else s[e]=a[e];else s[e]=a[e];G[e]=s[e]}"variables"==e&&($.isEmptyObject(a.extra_vars)||"{}"==a.extra_vars||"null"==a.extra_vars?s.variables="---":(d=JSON.parse(a.extra_vars),s.variables=jsyaml.safeDump(d)),G.variables=s.variables);"lookup"==D.fields[e].type&&a.summary_fields[D.fields[e].sourceModel]&&(s[D.fields[e].sourceModel+
|
||||
"_"+D.fields[e].sourceField]=a.summary_fields[D.fields[e].sourceModel][D.fields[e].sourceField],G[D.fields[e].sourceModel+"_"+D.fields[e].sourceField]=s[D.fields[e].sourceModel+"_"+D.fields[e].sourceField])}s.url=a.url;e=a.related;for(var l in D.related)e[l]&&(H[l]={url:e[l],iterator:D.related[l].iterator});s.callback_url=a.related.callback;G.callback_url=s.callback_url;n({scope:s,form:D,current_item:a.inventory,list:C,field:"inventory"});n({scope:s,form:D,current_item:a.credential,list:t,field:"credential"});
|
||||
n({scope:s,form:D,current_item:a.project,list:r,field:"project"});y({scope:s,form:D,relatedSets:H});v({scope:s,relatedSets:H});s.$emit("jobTemplateLoaded")}).error(function(a,b,c,e){d(s,a,b,D,{hdr:"Error!",msg:"Failed to retrieve job template: "+p.id+". GET status: "+b})});s.formSave=function(){var b={};try{var c="json"==s.parseType?JSON.parse(s.variables):jsyaml.load(s.variables);if("object"!==typeof c)throw"failed to return an object!";for(var e in D.fields)"select"==D.fields[e].type&&"playbook"!=
|
||||
e?b[e]=s[e].value:"variables"!=e&&"callback_url"!=e&&(b[e]=s[e]);b.extra_vars=JSON.stringify(c,void 0,"\t");l.setUrl(F+J+"/");l.put(b).success(function(a,b,d,c){"job_templates"==g.path().replace(/^\//,"").split("/")[0]?A():A(1)}).error(function(a,b,c,e){d(s,a,b,D,{hdr:"Error!",msg:"Failed to update job template. PUT returned status: "+b})})}catch(f){a("Error","Error parsing extra variables. Parser returned: "+f)}};s.formReset=function(){e.reset();for(var a in G)s[a]=G[a];s.parseType="yaml";$("#forks-slider").slider("option",
|
||||
"value",s.forks)};s.add=function(a){m.flashMessage=null;g.path("/"+K+"/"+p.id+"/"+a)};s.edit=function(a,b,d){m.flashMessage=null;g.path("/"+a+"/"+b)};s["delete"]=function(a,b,c,e){m.flashMessage=null;Prompt({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+s.name+" "+e+"?",action:function(){var c=F+J+"/"+a+"/";l.setUrl(c);l.post({id:b,disassociate:1}).success(function(b,d,c,e){$("#prompt-modal").modal("hide");s.search(D.related[a].iterator)}).error(function(a,b,e,f){$("#prompt-modal").modal("hide");
|
||||
d(s,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. POST returned status: "+b})})}})}}JobTemplatesEdit.$inject="$scope $rootScope $compile $location $log $routeParams JobTemplateForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit ReturnToCaller ClearScope InventoryList CredentialList ProjectList LookUpInit PromptPasswords GetBasePath md5Setup ParseTypeChange".split(" ");function OrganizationsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A){y("htmlTemplate");k="organizations"==h.path().replace(/^\//,"").split("/")[0]?"edit":"select";var u=l.inject(a,{mode:k}),C=A("organizations");m.flashMessage=null;f();u.PostRefreshRemove&&u.PostRefreshRemove();u.PostRefreshRemove=u.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");u[a]=""})});d({scope:u,set:a.name,list:a,url:C});b({scope:u,list:a,url:C});u.search(a.iterator);u.addOrganization=function(){h.path(h.path()+
|
||||
function JobTemplatesEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s,n,B,q,w,z){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("job_templates"),D=f,r=e.inject(D,{mode:"edit",related:!0});r.parseType=
|
||||
"yaml";z(r);r.job_type_options=[{value:"run",label:"Run"},{value:"check",label:"Check"}];r.verbosity_options=[{value:"0",label:"Default"},{value:"1",label:"Verbose"},{value:"3",label:"Debug"}];r.playbook_options=null;r.playbook=null;e.reset();var K=g.path().replace(/^\//,"").split("/")[0],G={},J=p.id,H={};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.jobTemplateLoadedRemove&&r.jobTemplateLoadedRemove();r.jobTemplateLoadedRemove=r.$on("jobTemplateLoaded",function(){for(var a in H)r.search(H[a].iterator);E(r.project);$("#forks-slider").slider("value",r.forks);w({scope:r,master:G,check_field:"allow_callbacks",default_val:""===r.host_config_key||null===r.host_config_key?"false":"true"})});l.setUrl(F+":id/");l.get({params:{id:J}}).success(function(a,d,c,f){b({path:"/job_templates/"+J,title:a.name});for(var e in D.fields){if("variables"!=e&&null!==
|
||||
a[e]&&void 0!==a[e]){if("select"==D.fields[e].type)if(r[e+"_options"]&&0<r[e+"_options"].length)for(d=0;d<r[e+"_options"].length;d++)a[e]==r[e+"_options"][d].value&&(r[e]=r[e+"_options"][d]);else r[e]=a[e];else r[e]=a[e];G[e]=r[e]}"variables"==e&&($.isEmptyObject(a.extra_vars)||"{}"==a.extra_vars||"null"==a.extra_vars?r.variables="---":(d=JSON.parse(a.extra_vars),r.variables=jsyaml.safeDump(d)),G.variables=r.variables);"lookup"==D.fields[e].type&&a.summary_fields[D.fields[e].sourceModel]&&(r[D.fields[e].sourceModel+
|
||||
"_"+D.fields[e].sourceField]=a.summary_fields[D.fields[e].sourceModel][D.fields[e].sourceField],G[D.fields[e].sourceModel+"_"+D.fields[e].sourceField]=r[D.fields[e].sourceModel+"_"+D.fields[e].sourceField])}r.url=a.url;e=a.related;for(var l in D.related)e[l]&&(H[l]={url:e[l],iterator:D.related[l].iterator});r.callback_url=a.related.callback;G.callback_url=r.callback_url;n({scope:r,form:D,current_item:a.inventory,list:C,field:"inventory"});n({scope:r,form:D,current_item:a.credential,list:t,field:"credential"});
|
||||
n({scope:r,form:D,current_item:a.project,list:s,field:"project"});y({scope:r,form:D,relatedSets:H});v({scope:r,relatedSets:H});r.$emit("jobTemplateLoaded")}).error(function(a,b,c,e){d(r,a,b,D,{hdr:"Error!",msg:"Failed to retrieve job template: "+p.id+". GET status: "+b})});r.formSave=function(){var b={};try{var c="json"==r.parseType?JSON.parse(r.variables):jsyaml.load(r.variables);if("object"!==typeof c)throw"failed to return an object!";for(var e in D.fields)"select"==D.fields[e].type&&"playbook"!=
|
||||
e?b[e]=r[e].value:"variables"!=e&&"callback_url"!=e&&(b[e]=r[e]);b.extra_vars=JSON.stringify(c,void 0,"\t");l.setUrl(F+J+"/");l.put(b).success(function(a,b,d,c){"job_templates"==g.path().replace(/^\//,"").split("/")[0]?A():A(1)}).error(function(a,b,c,e){d(r,a,b,D,{hdr:"Error!",msg:"Failed to update job template. PUT returned status: "+b})})}catch(f){a("Error","Error parsing extra variables. Parser returned: "+f)}};r.formReset=function(){e.reset();for(var a in G)r[a]=G[a];r.parseType="yaml";$("#forks-slider").slider("option",
|
||||
"value",r.forks)};r.add=function(a){m.flashMessage=null;g.path("/"+K+"/"+p.id+"/"+a)};r.edit=function(a,b,d){m.flashMessage=null;g.path("/"+a+"/"+b)};r["delete"]=function(a,b,c,e){m.flashMessage=null;Prompt({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+r.name+" "+e+"?",action:function(){var c=F+J+"/"+a+"/";l.setUrl(c);l.post({id:b,disassociate:1}).success(function(b,d,c,e){$("#prompt-modal").modal("hide");r.search(D.related[a].iterator)}).error(function(a,b,e,f){$("#prompt-modal").modal("hide");
|
||||
d(r,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. POST returned status: "+b})})}})}}JobTemplatesEdit.$inject="$scope $rootScope $compile $location $log $routeParams JobTemplateForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit ReturnToCaller ClearScope InventoryList CredentialList ProjectList LookUpInit PromptPasswords GetBasePath md5Setup ParseTypeChange".split(" ");function OrganizationsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A){y("htmlTemplate");k="organizations"==h.path().replace(/^\//,"").split("/")[0]?"edit":"select";var u=l.inject(a,{mode:k}),C=A("organizations");m.flashMessage=null;f();u.PostRefreshRemove&&u.PostRefreshRemove();u.PostRefreshRemove=u.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");u[a]=""})});d({scope:u,set:a.name,list:a,url:C});b({scope:u,list:a,url:C});u.search(a.iterator);u.addOrganization=function(){h.path(h.path()+
|
||||
"/add")};u.editOrganization=function(a){h.path(h.path()+"/"+a)};u.deleteOrganization=function(b,d){e({hdr:"Delete",body:"Are you sure you want to delete "+d+"?",action:function(){var d=C+b+"/";c.setUrl(d);c.destroy().success(function(b,d,c,e){$("#prompt-modal").modal("hide");u.search(a.iterator)}).error(function(a,b,c,e){$("#prompt-modal").modal("hide");v(u,a,b,null,{hdr:"Error!",msg:"Call to "+d+" failed. DELETE returned status: "+b})})}})};u.toggle_organization=function(b){"success"==u[a.iterator+
|
||||
"_"+b+"_class"]?(u[a.iterator+"_"+b+"_class"]="",document.getElementById("check_"+b).checked=!1,-1<u.selected.indexOf(b)&&u.selected.splice(u.selected.indexOf(b),1)):(u[a.iterator+"_"+b+"_class"]="success",document.getElementById("check_"+b).checked=!0,-1==u.selected.indexOf(b)&&u.selected.push(b))}}OrganizationsList.$inject="$scope $rootScope $location $log Rest Alert LoadBreadCrumbs Prompt GenerateList OrganizationList SearchInit PaginateInit ClearScope ProcessErrors GetBasePath".split(" ");
|
||||
function OrganizationsAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A){y("htmlTemplate");var u=e.inject(f,{mode:"add",related:!1}),C=v("organizations");e.reset();b();u.formSave=function(){l.setUrl(C);l.post({name:k.name,description:k.description}).success(function(a,b,d,c){m.flashMessage="New organization successfully created!";g.path("/organizations/"+a.id)}).error(function(a,b,c,e){d(u,a,b,f,{hdr:"Error!",msg:"Failed to add new organization. Post returned status: "+b})})};u.formReset=function(){m.flashMessage=
|
||||
null;e.reset()}}OrganizationsAdd.$inject="$scope $rootScope $compile $location $log $routeParams OrganizationForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ClearScope GetBasePath ReturnToCaller".split(" ");
|
||||
function OrganizationsEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){u("htmlTemplate");var t=e.inject(f,{mode:"edit",related:!0});e.reset();var r=C("organizations"),n=g.path().replace(/^\//,"").split("/")[0],B={},q=p.organization_id,w={};t.organizationLoadedRemove&&t.organizationLoadedRemove();t.organizationLoadedRemove=t.$on("organizationLoaded",function(){for(var a in w)t.search(w[a].iterator)});l.setUrl(r+q+"/");l.get().success(function(a,d,c,e){b({path:"/organizations/"+q,title:a.name});for(var l in f.fields)a[l]&&
|
||||
(t[l]=a[l],B[l]=a[l]);a=a.related;for(var n in f.related)a[n]&&(w[n]={url:a[n],iterator:f.related[n].iterator});y({scope:t,form:f,relatedSets:w});v({scope:t,relatedSets:w});t.$emit("organizationLoaded")}).error(function(a,b,c,e){d(t,a,b,f,{hdr:"Error!",msg:"Failed to retrieve organization: "+p.id+". GET status: "+b})});t.formSave=function(){var a={},b;for(b in f.fields)a[b]=t[b];l.setUrl(r+q+"/");l.put(a).success(function(b,d,c,e){B=a;m.flashMessage="Your changes were successfully saved!"}).error(function(a,
|
||||
b,c,e){d(t,a,b,f,{hdr:"Error!",msg:"Failed to update organization: "+q+". PUT status: "+b})})};t.formReset=function(){m.flashMessage=null;f.reset();for(var a in B)t[a]=B[a]};t.add=function(a){m.flashMessage=null;g.path("/"+n+"/"+p.organization_id+"/"+a)};t.edit=function(a,b,d){m.flashMessage=null;g.path("/"+a+"/"+b)};t["delete"]=function(a,b,c,e){m.flashMessage=null;A({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+t.name+" "+e+"?",action:function(){var c=r+p.organization_id+"/"+
|
||||
a+"/";l.setUrl(c);l.post({id:b,disassociate:1}).success(function(b,d,c,e){$("#prompt-modal").modal("hide");t.search(f.related[a].iterator)}).error(function(a,b,e,f){$("#prompt-modal").modal("hide");d(t,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. POST returned status: "+b})})}})}}OrganizationsEdit.$inject="$scope $rootScope $compile $location $log $routeParams OrganizationForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit Prompt ClearScope GetBasePath".split(" ");function PermissionsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t){A("htmlTemplate");k=h.path().replace(/^\//,"").split("/")[0];k=C(k);k+=void 0!==c.user_id?c.user_id:c.team_id;k+="/permissions/";var r=l.inject(e,{mode:"edit"});r.selected=[];b({scope:r,set:"permissions",list:e,url:k});y({scope:r,list:e,url:k});r.search(e.iterator);a();r.addPermission=function(){t()&&h.path(h.path()+"/add")};r.editPermission=function(a){t()&&h.path(h.path()+"/"+a)};r.deletePermission=function(a,b){var c=function(){var b=
|
||||
C("base")+"permissions/"+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");r.search(e.iterator)}).error(function(a,d,c,e){$("#prompt-modal").modal("hide");u(r,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+d})})};checkAccess()&&d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:c})}}PermissionsList.$inject="$scope $rootScope $location $log $routeParams Rest Alert PermissionList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors GetBasePath CheckAccess".split(" ");
|
||||
function PermissionsAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t){y("htmlTemplate");var r=void 0!==p.user_id?p.user_id:p.team_id,n=g.path().replace(/^\//,"").split("/")[0];v(n);var B=e.inject(f,{mode:"add",related:!1}),q={};e.reset();b();B.inventoryrequired=!0;B.projectrequired=!1;B.category="Inventory";q.category="Inventory";q.inventoryrequired=!0;q.projectrequired=!1;t({scope:B,form:f,current_item:null,list:u,field:"inventory"});t({scope:B,form:f,current_item:null,list:C,field:"project"});B.formSave=
|
||||
function(){var a={},b;for(b in f.fields)a[b]=B[b];b="teams"==n?v("teams")+r+"/permissions/":v("users")+r+"/permissions/";l.setUrl(b);l.post(a).success(function(a,b,d,c){A(1)}).error(function(a,b,c,e){d(B,a,b,f,{hdr:"Error!",msg:"Failed to create new permission. Post returned status: "+b})})};B.formReset=function(){m.flashMessage=null;e.reset();for(var a in q)B[a]=q[a]};B.selectCategory=function(){B.projectrequired="Inventory"==B.category?!1:!0;B.permission_type=null}}PermissionsAdd.$inject="$scope $rootScope $compile $location $log $routeParams PermissionsForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ClearScope GetBasePath ReturnToCaller InventoryList ProjectList LookUpInit".split(" ");
|
||||
function PermissionsEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r){v("htmlTemplate");var n=e.inject(f,{mode:"edit",related:!0}),B=void 0!==p.user_id?p.user_id:p.team_id;g.path().replace(/^\//,"").split("/");var q=p.permission_id,w=u("base")+"permissions/"+q+"/";e.reset();var z={};l.setUrl(w);l.get().success(function(a,d,c,e){b({path:"/users/"+B+"/permissions/"+q,title:a.name});for(var l in f.fields)a[l]&&(f.fields[l].sourceModel&&(d=f.fields[l].sourceModel,c=f.fields[l].sourceField,n[d+"_"+c]=a.summary_fields[d][c],
|
||||
z[d+"_"+c]=a.summary_fields[d][c]),n[l]=a[l],z[l]=n[l]);n.category="Deploy";"run"!=a.permission_type&&"check"!=a.permission_type?(n.category="Inventory",n.projectrequired=!1):n.projectrequired=!0;z.category=n.category;r({scope:n,form:f,current_item:a.inventory,list:C,field:"inventory"});r({scope:n,form:f,current_item:a.project,list:t,field:"project"})}).error(function(a,b,c,e){d(n,a,b,f,{hdr:"Error!",msg:"Failed to retrieve Permission: "+q+". GET status: "+b})});n.formSave=function(){var a={},b;for(b in f.fields)a[b]=
|
||||
n[b];l.setUrl(w);l.put(a).success(function(a,b,d,c){y(1)}).error(function(a,b,c,e){d(n,a,b,f,{hdr:"Error!",msg:"Failed to update Permission: "+p.id+". PUT status: "+b})})};n.formReset=function(){e.reset();for(var a in z)n[a]=z[a]};n.selectCategory=function(){n.projectrequired="Inventory"==n.category?!1:!0;n.permission_type=null}}PermissionsEdit.$inject="$scope $rootScope $compile $location $log $routeParams PermissionsForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ReturnToCaller ClearScope Prompt GetBasePath InventoryList ProjectList LookUpInit".split(" ");function ProjectsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){A("htmlTemplate");var t=C("projects"),r=h.path().replace(/^\//,"").split("/")[0],n=l.inject(e,{mode:"projects"==r?"edit":"select"});n.selected=[];m.flashMessage=null;n.PostRefreshRemove&&n.PostRefreshRemove();n.PostRefreshRemove=n.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");n[a]=""})});b({scope:n,set:"projects",list:e,url:t});y({scope:n,list:e,url:t});n.search(e.iterator);a();n.addProject=function(){h.path(h.path()+
|
||||
"/add")};n.editProject=function(a){h.path(h.path()+"/"+a)};n.deleteProject=function(a,b){d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:function(){var b=t+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");n.search(e.iterator)}).error(function(a,d,c,e){$("#prompt-modal").modal("hide");u(n,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+d})})}})};n.finishSelection=function(){var a="teams"==r?C("teams")+c.team_id+
|
||||
function OrganizationsEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){u("htmlTemplate");var t=e.inject(f,{mode:"edit",related:!0});e.reset();var s=C("organizations"),n=g.path().replace(/^\//,"").split("/")[0],B={},q=p.organization_id,w={};t.organizationLoadedRemove&&t.organizationLoadedRemove();t.organizationLoadedRemove=t.$on("organizationLoaded",function(){for(var a in w)t.search(w[a].iterator)});l.setUrl(s+q+"/");l.get().success(function(a,d,c,e){b({path:"/organizations/"+q,title:a.name});for(var l in f.fields)a[l]&&
|
||||
(t[l]=a[l],B[l]=a[l]);a=a.related;for(var n in f.related)a[n]&&(w[n]={url:a[n],iterator:f.related[n].iterator});y({scope:t,form:f,relatedSets:w});v({scope:t,relatedSets:w});t.$emit("organizationLoaded")}).error(function(a,b,c,e){d(t,a,b,f,{hdr:"Error!",msg:"Failed to retrieve organization: "+p.id+". GET status: "+b})});t.formSave=function(){var a={},b;for(b in f.fields)a[b]=t[b];l.setUrl(s+q+"/");l.put(a).success(function(b,d,c,e){B=a;m.flashMessage="Your changes were successfully saved!"}).error(function(a,
|
||||
b,c,e){d(t,a,b,f,{hdr:"Error!",msg:"Failed to update organization: "+q+". PUT status: "+b})})};t.formReset=function(){m.flashMessage=null;f.reset();for(var a in B)t[a]=B[a]};t.add=function(a){m.flashMessage=null;g.path("/"+n+"/"+p.organization_id+"/"+a)};t.edit=function(a,b,d){m.flashMessage=null;g.path("/"+a+"/"+b)};t["delete"]=function(a,b,c,e){m.flashMessage=null;A({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+t.name+" "+e+"?",action:function(){var c=s+p.organization_id+"/"+
|
||||
a+"/";l.setUrl(c);l.post({id:b,disassociate:1}).success(function(b,d,c,e){$("#prompt-modal").modal("hide");t.search(f.related[a].iterator)}).error(function(a,b,e,f){$("#prompt-modal").modal("hide");d(t,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. POST returned status: "+b})})}})}}OrganizationsEdit.$inject="$scope $rootScope $compile $location $log $routeParams OrganizationForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit Prompt ClearScope GetBasePath".split(" ");function PermissionsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t){A("htmlTemplate");k=h.path().replace(/^\//,"").split("/")[0];k=C(k);k+=void 0!==c.user_id?c.user_id:c.team_id;k+="/permissions/";var s=l.inject(e,{mode:"edit"});s.selected=[];b({scope:s,set:"permissions",list:e,url:k});y({scope:s,list:e,url:k});s.search(e.iterator);a();s.addPermission=function(){t()&&h.path(h.path()+"/add")};s.editPermission=function(a){t()&&h.path(h.path()+"/"+a)};s.deletePermission=function(a,b){var c=function(){var b=
|
||||
C("base")+"permissions/"+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");s.search(e.iterator)}).error(function(a,d,c,e){$("#prompt-modal").modal("hide");u(s,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+d})})};checkAccess()&&d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:c})}}PermissionsList.$inject="$scope $rootScope $location $log $routeParams Rest Alert PermissionList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors GetBasePath CheckAccess".split(" ");
|
||||
function PermissionsAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t){y("htmlTemplate");var s=void 0!==p.user_id?p.user_id:p.team_id,n=g.path().replace(/^\//,"").split("/")[0];v(n);var B=e.inject(f,{mode:"add",related:!1}),q={};e.reset();b();B.inventoryrequired=!0;B.projectrequired=!1;B.category="Inventory";q.category="Inventory";q.inventoryrequired=!0;q.projectrequired=!1;t({scope:B,form:f,current_item:null,list:u,field:"inventory"});t({scope:B,form:f,current_item:null,list:C,field:"project"});B.formSave=
|
||||
function(){var a={},b;for(b in f.fields)a[b]=B[b];b="teams"==n?v("teams")+s+"/permissions/":v("users")+s+"/permissions/";l.setUrl(b);l.post(a).success(function(a,b,d,c){A(1)}).error(function(a,b,c,e){d(B,a,b,f,{hdr:"Error!",msg:"Failed to create new permission. Post returned status: "+b})})};B.formReset=function(){m.flashMessage=null;e.reset();for(var a in q)B[a]=q[a]};B.selectCategory=function(){B.projectrequired="Inventory"==B.category?!1:!0;B.permission_type=null}}PermissionsAdd.$inject="$scope $rootScope $compile $location $log $routeParams PermissionsForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ClearScope GetBasePath ReturnToCaller InventoryList ProjectList LookUpInit".split(" ");
|
||||
function PermissionsEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s){v("htmlTemplate");var n=e.inject(f,{mode:"edit",related:!0}),B=void 0!==p.user_id?p.user_id:p.team_id;g.path().replace(/^\//,"").split("/");var q=p.permission_id,w=u("base")+"permissions/"+q+"/";e.reset();var z={};l.setUrl(w);l.get().success(function(a,d,c,e){b({path:"/users/"+B+"/permissions/"+q,title:a.name});for(var l in f.fields)a[l]&&(f.fields[l].sourceModel&&(d=f.fields[l].sourceModel,c=f.fields[l].sourceField,n[d+"_"+c]=a.summary_fields[d][c],
|
||||
z[d+"_"+c]=a.summary_fields[d][c]),n[l]=a[l],z[l]=n[l]);n.category="Deploy";"run"!=a.permission_type&&"check"!=a.permission_type?(n.category="Inventory",n.projectrequired=!1):n.projectrequired=!0;z.category=n.category;s({scope:n,form:f,current_item:a.inventory,list:C,field:"inventory"});s({scope:n,form:f,current_item:a.project,list:t,field:"project"})}).error(function(a,b,c,e){d(n,a,b,f,{hdr:"Error!",msg:"Failed to retrieve Permission: "+q+". GET status: "+b})});n.formSave=function(){var a={},b;for(b in f.fields)a[b]=
|
||||
n[b];l.setUrl(w);l.put(a).success(function(a,b,d,c){y(1)}).error(function(a,b,c,e){d(n,a,b,f,{hdr:"Error!",msg:"Failed to update Permission: "+p.id+". PUT status: "+b})})};n.formReset=function(){e.reset();for(var a in z)n[a]=z[a]};n.selectCategory=function(){n.projectrequired="Inventory"==n.category?!1:!0;n.permission_type=null}}PermissionsEdit.$inject="$scope $rootScope $compile $location $log $routeParams PermissionsForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ReturnToCaller ClearScope Prompt GetBasePath InventoryList ProjectList LookUpInit".split(" ");function ProjectsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){A("htmlTemplate");var t=C("projects"),s=h.path().replace(/^\//,"").split("/")[0],n=l.inject(e,{mode:"projects"==s?"edit":"select"});n.selected=[];m.flashMessage=null;n.PostRefreshRemove&&n.PostRefreshRemove();n.PostRefreshRemove=n.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");n[a]=""})});b({scope:n,set:"projects",list:e,url:t});y({scope:n,list:e,url:t});n.search(e.iterator);a();n.addProject=function(){h.path(h.path()+
|
||||
"/add")};n.editProject=function(a){h.path(h.path()+"/"+a)};n.deleteProject=function(a,b){d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:function(){var b=t+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");n.search(e.iterator)}).error(function(a,d,c,e){$("#prompt-modal").modal("hide");u(n,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+d})})}})};n.finishSelection=function(){var a="teams"==s?C("teams")+c.team_id+
|
||||
"/projects/":t;p.setUrl(a);n.queue=[];n.callFinishedRemove&&n.callFinishedRemove();n.callFinishedRemoved=n.$on("callFinished",function(){if(n.queue.length==n.selected.length){$('input[type="checkbox"]').prop("checked",!1);n.selected=[];for(var a=0,b=0;b<n.queue.length;b++)"error"==n.queue[b].result&&a++;0<a?f("Error","There was an error while adding one or more of the selected Pojects."):v(1)}});if(0<n.selected.length)for(var a=null,b=0;b<n.selected.length;b++){for(var d=0;d<n.projects.length;d++)n.projects[d].id==
|
||||
n.selected[b]&&(a=n.projects[d]);null!==a&&p.post(a).success(function(a,b,d,c){n.queue.push({result:"success",data:a,status:b});n.$emit("callFinished")}).error(function(a,b,d,c){n.queue.push({result:"error",data:a,status:b,headers:d});n.$emit("callFinished")})}else v(1)};n.toggle_project=function(a){"success"==n[e.iterator+"_"+a+"_class"]?(n[e.iterator+"_"+a+"_class"]="",document.getElementById("check_"+a).checked=!1,-1<n.selected.indexOf(a)&&n.selected.splice(n.selected.indexOf(a),1)):(n[e.iterator+
|
||||
"_"+a+"_class"]="success",document.getElementById("check_"+a).checked=!0,-1==n.selected.indexOf(a)&&n.selected.push(a))}}ProjectsList.$inject="$scope $rootScope $location $log $routeParams Rest Alert ProjectList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors GetBasePath".split(" ");
|
||||
function ProjectsAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u){y("htmlTemplate");var C=g.path().replace(/^\//,"").split("/")[0],t=v("projects"),r=e.inject(f,{mode:"add",related:!1}),n={};e.reset();b();u({scope:r,master:n});r.formSave=function(){var a={},b;for(b in f.fields)a[b]=r[b];b="teams"==C?v("teams")+p.team_id+"/projects/":t;l.setUrl(b);l.post(a).success(function(a,b,d,c){m.flashMessage="New project successfully created!";"projects"==C?A():A(1)}).error(function(a,b,c,e){d(r,a,b,f,{hdr:"Error!",msg:"Failed to create new project. Post returned status: "+
|
||||
b})})};r.formReset=function(){m.flashMessage=null;e.reset();for(var a in n)r[a]=n[a]}}ProjectsAdd.$inject="$scope $rootScope $compile $location $log $routeParams ProjectsForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ClearScope GetBasePath ReturnToCaller GetProjectPath".split(" ");
|
||||
function ProjectsEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r){u("htmlTemplate");var n=e.inject(f,{mode:"edit",related:!0});e.reset();var B=C("projects")+p.id+"/",q=g.path().replace(/^\//,"").split("/")[0],w={},z=p.id,E={};n.project_local_paths=[];n.base_dir="";n.projectLoadedRemove&&n.projectLoadedRemove();n.projectLoadedRemove=n.$on("projectLoaded",function(){for(var a in E)n.search(E[a].iterator);r({scope:n,master:w})});l.setUrl(B);l.get({params:{id:z}}).success(function(a,d,c,e){b({path:"/projects/"+
|
||||
function ProjectsAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u){y("htmlTemplate");var C=g.path().replace(/^\//,"").split("/")[0],t=v("projects"),s=e.inject(f,{mode:"add",related:!1}),n={};e.reset();b();u({scope:s,master:n});s.formSave=function(){var a={},b;for(b in f.fields)a[b]=s[b];b="teams"==C?v("teams")+p.team_id+"/projects/":t;l.setUrl(b);l.post(a).success(function(a,b,d,c){m.flashMessage="New project successfully created!";"projects"==C?A():A(1)}).error(function(a,b,c,e){d(s,a,b,f,{hdr:"Error!",msg:"Failed to create new project. Post returned status: "+
|
||||
b})})};s.formReset=function(){m.flashMessage=null;e.reset();for(var a in n)s[a]=n[a]}}ProjectsAdd.$inject="$scope $rootScope $compile $location $log $routeParams ProjectsForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ClearScope GetBasePath ReturnToCaller GetProjectPath".split(" ");
|
||||
function ProjectsEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s){u("htmlTemplate");var n=e.inject(f,{mode:"edit",related:!0});e.reset();var B=C("projects")+p.id+"/",q=g.path().replace(/^\//,"").split("/")[0],w={},z=p.id,E={};n.project_local_paths=[];n.base_dir="";n.projectLoadedRemove&&n.projectLoadedRemove();n.projectLoadedRemove=n.$on("projectLoaded",function(){for(var a in E)n.search(E[a].iterator);s({scope:n,master:w})});l.setUrl(B);l.get({params:{id:z}}).success(function(a,d,c,e){b({path:"/projects/"+
|
||||
z,title:a.name});for(var l in f.fields)a[l]&&(n[l]=a[l],w[l]=a[l]);a=a.related;for(var g in f.related)a[g]&&(E[g]={url:a[g],iterator:f.related[g].iterator});y({scope:n,form:f,relatedSets:E});v({scope:n,relatedSets:E});n.$emit("projectLoaded")}).error(function(a,b,c,e){d(n,a,b,f,{hdr:"Error!",msg:"Failed to retrieve project: "+z+". GET status: "+b})});n.formSave=function(){m.flashMessage=null;var a={},b;for(b in f.fields)a[b]=n[b];l.setUrl(B);l.put(a).success(function(a,b,d,c){t()}).error(function(a,
|
||||
b,c,e){d(n,a,b,f,{hdr:"Error!",msg:"Failed to update project: "+z+". PUT status: "+b})})};n.formReset=function(){m.flashMessage=null;e.reset();for(var a in w)n[a]=w[a]};n.add=function(a){m.flashMessage=null;g.path("/"+q+"/"+p.id+"/"+a)};n.edit=function(a,b,d){m.flashMessage=null;g.path("/"+q+"/"+p.id+"/"+a+"/"+b)};n["delete"]=function(a,b,c,e){A({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+n.name+" "+e+"?",action:function(){var c=C("projects")+z+"/"+a+"/";m.flashMessage=null;l.setUrl(c);
|
||||
l.post({id:b,disassociate:1}).success(function(b,d,c,e){$("#prompt-modal").modal("hide");n.search(f.related[a].iterator)}).error(function(a,b,e,f){$("#prompt-modal").modal("hide");d(n,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. POST returned status: "+b})})}})}}ProjectsEdit.$inject="$scope $rootScope $compile $location $log $routeParams ProjectsForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit Prompt ClearScope GetBasePath ReturnToCaller GetProjectPath".split(" ");function TeamsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t){A("htmlTemplate");var r=t("teams");k="teams"==h.path().replace(/^\//,"").split("/")[0]?"edit":"select";var n=l.inject(e,{mode:k});n.selected=[];n.PostRefreshRemove&&n.PostRefreshRemove();n.PostRefershRemove=n.$on("PostRefresh",function(){for(var a=0;a<n.teams.length;a++)n.teams[a].organization_name=n.teams[a].summary_fields.organization.name;$("tr.success").each(function(a){a=$(this).attr("ng-class");n[a]=""})});b({scope:n,set:"teams",list:e,
|
||||
url:r});y({scope:n,list:e,url:r});n.search(e.iterator);a();n.addTeam=function(){h.path(h.path()+"/add")};n.editTeam=function(a){h.path(h.path()+"/"+a)};n.deleteTeam=function(a,b){d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:function(){var b=r+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");n.search(e.iterator)}).error(function(a,d,c,e){$("#prompt-modal").modal("hide");u(n,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+
|
||||
l.post({id:b,disassociate:1}).success(function(b,d,c,e){$("#prompt-modal").modal("hide");n.search(f.related[a].iterator)}).error(function(a,b,e,f){$("#prompt-modal").modal("hide");d(n,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. POST returned status: "+b})})}})}}ProjectsEdit.$inject="$scope $rootScope $compile $location $log $routeParams ProjectsForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit Prompt ClearScope GetBasePath ReturnToCaller GetProjectPath".split(" ");function TeamsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t){A("htmlTemplate");var s=t("teams");k="teams"==h.path().replace(/^\//,"").split("/")[0]?"edit":"select";var n=l.inject(e,{mode:k});n.selected=[];n.PostRefreshRemove&&n.PostRefreshRemove();n.PostRefershRemove=n.$on("PostRefresh",function(){for(var a=0;a<n.teams.length;a++)n.teams[a].organization_name=n.teams[a].summary_fields.organization.name;$("tr.success").each(function(a){a=$(this).attr("ng-class");n[a]=""})});b({scope:n,set:"teams",list:e,
|
||||
url:s});y({scope:n,list:e,url:s});n.search(e.iterator);a();n.addTeam=function(){h.path(h.path()+"/add")};n.editTeam=function(a){h.path(h.path()+"/"+a)};n.deleteTeam=function(a,b){d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:function(){var b=s+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");n.search(e.iterator)}).error(function(a,d,c,e){$("#prompt-modal").modal("hide");u(n,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+
|
||||
d})})}})};n.lookupOrganization=function(a){p.setUrl(t("organizations")+a+"/");p.get().success(function(a,b,d,c){return a.name})};n.finishSelection=function(){p.setUrl(t("base")+h.path()+"/");n.queue=[];n.$on("callFinished",function(){if(n.queue.length==n.selected.length){$('input[type="checkbox"]').prop("checked",!1);n.selected=[];for(var a=0,b=0;b<n.queue.length;b++)"error"==n.queue[b].result&&a++;0<a?f("Error","There was an error while adding one or more of the selected teams."):v(1)}});if(0<n.selected.length)for(var a=
|
||||
null,b=0;b<n.selected.length;b++){for(var d=0;d<n.teams.length;d++)n.teams[d].id==n.selected[b]&&(a=n.teams[d]);null!==a&&p.post(a).success(function(a,b,d,c){n.queue.push({result:"success",data:a,status:b});n.$emit("callFinished")}).error(function(a,b,d,c){n.queue.push({result:"error",data:a,status:b,headers:d});n.$emit("callFinished")})}else v()};n.toggle_team=function(a){"success"==n[e.iterator+"_"+a+"_class"]?(n[e.iterator+"_"+a+"_class"]="",document.getElementById("check_"+a).checked=!1,-1<n.selected.indexOf(a)&&
|
||||
n.selected.splice(n.selected.indexOf(a),1)):(n[e.iterator+"_"+a+"_class"]="success",document.getElementById("check_"+a).checked=!0,-1==n.selected.indexOf(a)&&n.selected.push(a))}}TeamsList.$inject="$scope $rootScope $location $log $routeParams Rest Alert TeamList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors SetTeamListeners GetBasePath".split(" ");
|
||||
function TeamsAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r,n){v("htmlTemplate");var B=n("teams"),q=e.inject(f,{mode:"add",related:!1});m.flashMessage=null;e.reset();b();r({scope:q});q.formSave=function(){l.setUrl(B);var a={},b;for(b in f.fields)a[b]=q[b];l.post(a).success(function(a,b,d,c){m.flashMessage="New team successfully created!";g.path("/teams/"+a.id)}).error(function(a,b,c,e){d(q,a,b,f,{hdr:"Error!",msg:"Failed to add new inventory. Post returned status: "+b})})};q.formReset=function(){e.reset()}}
|
||||
function TeamsAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s,n){v("htmlTemplate");var B=n("teams"),q=e.inject(f,{mode:"add",related:!1});m.flashMessage=null;e.reset();b();s({scope:q});q.formSave=function(){l.setUrl(B);var a={},b;for(b in f.fields)a[b]=q[b];l.post(a).success(function(a,b,d,c){m.flashMessage="New team successfully created!";g.path("/teams/"+a.id)}).error(function(a,b,c,e){d(q,a,b,f,{hdr:"Error!",msg:"Failed to add new inventory. Post returned status: "+b})})};q.formReset=function(){e.reset()}}
|
||||
TeamsAdd.$inject="$scope $rootScope $compile $location $log $routeParams TeamForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ReturnToCaller ClearScope GenerateList OrganizationList SearchInit PaginateInit TeamLookUpOrganizationInit GetBasePath".split(" ");
|
||||
function TeamsEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r,n){u("htmlTemplate");var B=r("teams"),q=e.inject(f,{mode:"edit",related:!0});e.reset();var w=g.path().replace(/^\//,"").split("/")[0],z={},E=p.team_id,F={};C({scope:q});q.teamLoadedRemove&&q.teamLoadedRemove();q.teamLoadedRemove=q.$on("teamLoaded",function(){l.setUrl(q.organization_url);l.get().success(function(a,b,d,c){q.organization_name=a.name;z.organization_name=a.name}).error(function(a,b,c,e){d(q,a,b,null,{hdr:"Error!",msg:"Failed to retrieve: "+
|
||||
function TeamsEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s,n){u("htmlTemplate");var B=s("teams"),q=e.inject(f,{mode:"edit",related:!0});e.reset();var w=g.path().replace(/^\//,"").split("/")[0],z={},E=p.team_id,F={};C({scope:q});q.teamLoadedRemove&&q.teamLoadedRemove();q.teamLoadedRemove=q.$on("teamLoaded",function(){l.setUrl(q.organization_url);l.get().success(function(a,b,d,c){q.organization_name=a.name;z.organization_name=a.name}).error(function(a,b,c,e){d(q,a,b,null,{hdr:"Error!",msg:"Failed to retrieve: "+
|
||||
q.orgnization_url+". GET status: "+b})});for(var a in F)q.search(F[a].iterator)});l.setUrl(B+":id/");l.get({params:{id:E}}).success(function(a,d,c,e){b({path:"/teams/"+E,title:a.name});for(var l in f.fields)a[l]&&(q[l]=a[l],z[l]=q[l]);d=a.related;for(var n in f.related)d[n]&&(F[n]={url:d[n],iterator:f.related[n].iterator});y({scope:q,form:f,relatedSets:F});v({scope:q,relatedSets:F});q.organization_url=a.related.organization;q.$emit("teamLoaded")}).error(function(a,b,c,e){d(q,a,b,f,{hdr:"Error!",msg:"Failed to retrieve team: "+
|
||||
p.id+". GET status: "+b})});q.formSave=function(){m.flashMessage=null;l.setUrl(B+p.id+"/");var a={},b;for(b in f.fields)a[b]=q[b];l.put(a).success(function(a,b,d,c){"teams"==g.path().replace(/^\//,"").split("/")[0]?A():A(1)}).error(function(a,b,c,e){d(q,a,b,f,{hdr:"Error!",msg:"Failed to update team: "+p.id+". PUT status: "+b})})};q.formReset=function(){m.flashMessage=null;e.reset();for(var a in z)q[a]=z[a]};q.add=function(a){m.flashMessage=null;"permissions"==a?n()&&g.path("/"+w+"/"+p.team_id+"/"+
|
||||
a+"/add"):g.path("/"+w+"/"+p.team_id+"/"+a)};q.edit=function(a,b,d){m.flashMessage=null;"permissions"==a?n()&&g.path("/"+w+"/"+p.team_id+"/"+a+"/"+b):g.path("/"+a+"/"+b)};q["delete"]=function(a,b,c,e){m.flashMessage=null;t({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+q.name+" "+e+"?",action:function(){var c;"permissions"==a?n()&&(c=r("base")+"permissions/"+b+"/",l.setUrl(c),l.destroy().success(function(b,d,c,e){$("#prompt-modal").modal("hide");q.search(f.related[a].iterator)}).error(function(a,
|
||||
b,e,f){$("#prompt-modal").modal("hide");d(q,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. DELETE returned status: "+b})})):(c=B+p.team_id+"/"+a+"/",l.setUrl(c),l.post({id:b,disassociate:1}).success(function(b,d,c,e){$("#prompt-modal").modal("hide");q.search(f.related[a].iterator)}).error(function(a,b,e,f){$("#prompt-modal").modal("hide");d(q,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. POST returned status: "+b})}))}})}}TeamsEdit.$inject="$scope $rootScope $compile $location $log $routeParams TeamForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit ReturnToCaller ClearScope TeamLookUpOrganizationInit Prompt GetBasePath CheckAccess".split(" ");function UsersList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){A("htmlTemplate");var t=C("users"),r=h.path().replace(/^\//,"").split("/")[0],n=l.inject(e,{mode:"users"==r?"edit":"select"});n.selected=[];m.flashMessage=null;b({scope:n,set:"users",list:e,url:t});y({scope:n,list:e,url:t});n.search(e.iterator);a();n.PostRefreshRemove&&n.PostRefreshRemove();n.PostRefreshRemove=n.$on("PostRefresh",function(){for(var a=0;a<n[e.name].length;a++)n[e.iterator+"_"+n[e.name][a].id+"_class"]=""});n.addUser=function(){h.path(h.path()+
|
||||
"/add")};n.editUser=function(a){h.path(h.path()+"/"+a)};n.deleteUser=function(a,b){d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:function(){var b=t+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");n.search(e.iterator)}).error(function(a,d,c,e){$("#prompt-modal").modal("hide");u(n,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+d})})}})};n.finishSelection=function(){var a;a="organizations"==r?C("organizations")+
|
||||
a+"/add"):g.path("/"+w+"/"+p.team_id+"/"+a)};q.edit=function(a,b,d){m.flashMessage=null;"permissions"==a?n()&&g.path("/"+w+"/"+p.team_id+"/"+a+"/"+b):g.path("/"+a+"/"+b)};q["delete"]=function(a,b,c,e){m.flashMessage=null;t({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+q.name+" "+e+"?",action:function(){var c;"permissions"==a?n()&&(c=s("base")+"permissions/"+b+"/",l.setUrl(c),l.destroy().success(function(b,d,c,e){$("#prompt-modal").modal("hide");q.search(f.related[a].iterator)}).error(function(a,
|
||||
b,e,f){$("#prompt-modal").modal("hide");d(q,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. DELETE returned status: "+b})})):(c=B+p.team_id+"/"+a+"/",l.setUrl(c),l.post({id:b,disassociate:1}).success(function(b,d,c,e){$("#prompt-modal").modal("hide");q.search(f.related[a].iterator)}).error(function(a,b,e,f){$("#prompt-modal").modal("hide");d(q,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. POST returned status: "+b})}))}})}}TeamsEdit.$inject="$scope $rootScope $compile $location $log $routeParams TeamForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit ReturnToCaller ClearScope TeamLookUpOrganizationInit Prompt GetBasePath CheckAccess".split(" ");function UsersList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){A("htmlTemplate");var t=C("users"),s=h.path().replace(/^\//,"").split("/")[0],n=l.inject(e,{mode:"users"==s?"edit":"select"});n.selected=[];m.flashMessage=null;b({scope:n,set:"users",list:e,url:t});y({scope:n,list:e,url:t});n.search(e.iterator);a();n.PostRefreshRemove&&n.PostRefreshRemove();n.PostRefreshRemove=n.$on("PostRefresh",function(){for(var a=0;a<n[e.name].length;a++)n[e.iterator+"_"+n[e.name][a].id+"_class"]=""});n.addUser=function(){h.path(h.path()+
|
||||
"/add")};n.editUser=function(a){h.path(h.path()+"/"+a)};n.deleteUser=function(a,b){d({hdr:"Delete",body:"Are you sure you want to delete "+b+"?",action:function(){var b=t+a+"/";p.setUrl(b);p.destroy().success(function(a,b,d,c){$("#prompt-modal").modal("hide");n.search(e.iterator)}).error(function(a,d,c,e){$("#prompt-modal").modal("hide");u(n,a,d,null,{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+d})})}})};n.finishSelection=function(){var a;a="organizations"==s?C("organizations")+
|
||||
c.organization_id+"/users/":C("teams")+c.team_id+"/users/";n.queue=[];n.$on("callFinished",function(){if(n.queue.length==n.selected.length){$('input[type="checkbox"]').prop("checked",!1);n.selected=[];for(var a=0,b=0;b<n.queue.length;b++)"error"==n.queue[b].result&&a++;0<a?f("Error","There was an error while adding one or more of the selected users."):v(1)}});if(0<n.selected.length)for(var b,d=0;d<n.selected.length;d++){b=null;for(var e=0;e<n.users.length;e++)n.users[e].id==n.selected[d]&&(b=n.users[e]);
|
||||
null!==b&&(p.setUrl(a),p.post(b).success(function(a,b,d,c){n.queue.push({result:"success",data:a,status:b});n.$emit("callFinished")}).error(function(a,b,d,c){n.queue.push({result:"error",data:a,status:b,headers:d});n.$emit("callFinished")}))}else v()};n.toggle_user=function(a){"success"==n[e.iterator+"_"+a+"_class"]?(n[e.iterator+"_"+a+"_class"]="",document.getElementById("check_"+a).checked=!1,-1<n.selected.indexOf(a)&&n.selected.splice(n.selected.indexOf(a),1)):(n[e.iterator+"_"+a+"_class"]="success",
|
||||
document.getElementById("check_"+a).checked=!0,-1==n.selected.indexOf(a)&&n.selected.push(a))}}UsersList.$inject="$scope $rootScope $location $log $routeParams Rest Alert UserList GenerateList LoadBreadCrumbs Prompt SearchInit PaginateInit ReturnToCaller ClearScope ProcessErrors GetBasePath".split(" ");
|
||||
function UsersAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){v("htmlTemplate");var t=A("organizations"),r=e.inject(f,{mode:"add",related:!1});e.reset();b();u({scope:r,form:f,current_item:void 0!==p.organization_id?p.organization_id:null,list:C,field:"organization"});p.organization_id&&(r.organization=p.organization_id,l.setUrl(A("organizations")+p.organization_id+"/"),l.get().success(function(a,b,d,c){r.organization_name=a.name}).error(function(a,b,c,e){d(r,a,b,f,{hdr:"Error!",msg:"Failed to lookup Organization: "+
|
||||
a.id+". GET returned status: "+b})}));r.formSave=function(){if(void 0!==r.organization&&null!==r.organization&&""!==r.organization){l.setUrl(t+r.organization+"/users/");var a={},b;for(b in f.fields)f.fields[b].realName?a[f.fields[b].realName]=r[b]:a[b]=r[b];l.post(a).success(function(a,b,d,c){"users"==g.path().replace(/^\//,"").split("/")[0]?(m.flashMessage="New user successfully created!",g.path("/users/"+a.id)):y(1)}).error(function(a,b,c,e){d(r,a,b,f,{hdr:"Error!",msg:"Failed to add new user. POST returned status: "+
|
||||
b})})}else r.organization_name_api_error="A value is required"};r.formReset=function(){e.reset()};r.clearPWConfirm=function(a){r[a]="";r[f.name+"_form"][a].$setValidity("awpassmatch",!1)}}UsersAdd.$inject="$scope $rootScope $compile $location $log $routeParams UserForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ReturnToCaller ClearScope GetBasePath LookUpInit OrganizationList".split(" ");
|
||||
function UsersEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,r){u("htmlTemplate");var n=C("users"),B=g.path().replace(/^\//,"").split("/")[0],q=e.inject(f,{mode:"edit",related:!0});e.reset();var w={},z=p.user_id,E={};q.$on("userLoaded",function(){for(var a in E)q.search(E[a].iterator)});l.setUrl(n+":id/");l.get({params:{id:z}}).success(function(a,d,c,e){b({path:"/users/"+z,title:a.username});for(var l in f.fields)a[l]&&(q[l]="is_superuser"==l?"true"==a[l]||!0==a[l]?"true":"false":a[l],w[l]=q[l]);a=a.related;
|
||||
function UsersAdd(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C){v("htmlTemplate");var t=A("organizations"),s=e.inject(f,{mode:"add",related:!1});e.reset();b();u({scope:s,form:f,current_item:void 0!==p.organization_id?p.organization_id:null,list:C,field:"organization"});p.organization_id&&(s.organization=p.organization_id,l.setUrl(A("organizations")+p.organization_id+"/"),l.get().success(function(a,b,d,c){s.organization_name=a.name}).error(function(a,b,c,e){d(s,a,b,f,{hdr:"Error!",msg:"Failed to lookup Organization: "+
|
||||
a.id+". GET returned status: "+b})}));s.formSave=function(){if(void 0!==s.organization&&null!==s.organization&&""!==s.organization){l.setUrl(t+s.organization+"/users/");var a={},b;for(b in f.fields)f.fields[b].realName?a[f.fields[b].realName]=s[b]:a[b]=s[b];l.post(a).success(function(a,b,d,c){"users"==g.path().replace(/^\//,"").split("/")[0]?(m.flashMessage="New user successfully created!",g.path("/users/"+a.id)):y(1)}).error(function(a,b,c,e){d(s,a,b,f,{hdr:"Error!",msg:"Failed to add new user. POST returned status: "+
|
||||
b})})}else s.organization_name_api_error="A value is required"};s.formReset=function(){e.reset()};s.clearPWConfirm=function(a){s[a]="";s[f.name+"_form"][a].$setValidity("awpassmatch",!1)}}UsersAdd.$inject="$scope $rootScope $compile $location $log $routeParams UserForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs ReturnToCaller ClearScope GetBasePath LookUpInit OrganizationList".split(" ");
|
||||
function UsersEdit(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A,u,C,t,s){u("htmlTemplate");var n=C("users"),B=g.path().replace(/^\//,"").split("/")[0],q=e.inject(f,{mode:"edit",related:!0});e.reset();var w={},z=p.user_id,E={};q.$on("userLoaded",function(){for(var a in E)q.search(E[a].iterator)});l.setUrl(n+":id/");l.get({params:{id:z}}).success(function(a,d,c,e){b({path:"/users/"+z,title:a.username});for(var l in f.fields)a[l]&&(q[l]="is_superuser"==l?"true"==a[l]||!0==a[l]?"true":"false":a[l],w[l]=q[l]);a=a.related;
|
||||
for(var n in f.related)a[n]&&(E[n]={url:a[n],iterator:f.related[n].iterator});y({scope:q,form:f,relatedSets:E});v({scope:q,relatedSets:E});q.$emit("userLoaded")}).error(function(a,b,c,e){d(q,a,b,f,{hdr:"Error!",msg:"Failed to retrieve user: "+p.id+". GET status: "+b})});q.formSave=function(){m.flashMessage=null;l.setUrl(n+z+"/");var a={},b;for(b in f.fields)a[b]=q[b];l.put(a).success(function(a,b,d,c){"users"==g.path().replace(/^\//,"").split("/")[0]?A():A(1)}).error(function(a,b,c,e){d(q,a,b,f,{hdr:"Error!",
|
||||
msg:"Failed to update users: "+p.id+". PUT status: "+b})})};q.formReset=function(){m.flashMessage=null;e.reset();for(var a in w)q[a]=w[a]};q.clearPWConfirm=function(a){q[a]="";q[f.name+"_form"][a].$setValidity("awpassmatch",!1);m.flashMessage=null};q.add=function(a){m.flashMessage=null;"permissions"==a?r()&&g.path("/"+B+"/"+p.user_id+"/"+a+"/add"):g.path("/"+B+"/"+p.user_id+"/"+a)};q.edit=function(a,b,d){m.flashMessage=null;"permissions"==a?r()&&g.path("/users/"+p.user_id+"/permissions/"+b):g.path("/"+
|
||||
a+"/"+b)};q["delete"]=function(a,b,c,e){m.flashMessage=null;t({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+q.username+" "+e+"?",action:function(){var c;"permissions"==a?r()&&(c=C("base")+"permissions/"+b+"/",l.setUrl(c),l.destroy().success(function(b,d,c,e){$("#prompt-modal").modal("hide");q.search(f.related[a].iterator)}).error(function(a,b,e,f){$("#prompt-modal").modal("hide");d(q,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. DELETE returned status: "+b})})):(c=n+p.user_id+
|
||||
msg:"Failed to update users: "+p.id+". PUT status: "+b})})};q.formReset=function(){m.flashMessage=null;e.reset();for(var a in w)q[a]=w[a]};q.clearPWConfirm=function(a){q[a]="";q[f.name+"_form"][a].$setValidity("awpassmatch",!1);m.flashMessage=null};q.add=function(a){m.flashMessage=null;"permissions"==a?s()&&g.path("/"+B+"/"+p.user_id+"/"+a+"/add"):g.path("/"+B+"/"+p.user_id+"/"+a)};q.edit=function(a,b,d){m.flashMessage=null;"permissions"==a?s()&&g.path("/users/"+p.user_id+"/permissions/"+b):g.path("/"+
|
||||
a+"/"+b)};q["delete"]=function(a,b,c,e){m.flashMessage=null;t({hdr:"Delete",body:"Are you sure you want to remove "+c+" from "+q.username+" "+e+"?",action:function(){var c;"permissions"==a?s()&&(c=C("base")+"permissions/"+b+"/",l.setUrl(c),l.destroy().success(function(b,d,c,e){$("#prompt-modal").modal("hide");q.search(f.related[a].iterator)}).error(function(a,b,e,f){$("#prompt-modal").modal("hide");d(q,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. DELETE returned status: "+b})})):(c=n+p.user_id+
|
||||
"/"+a+"/",l.setUrl(c),l.post({id:b,disassociate:1}).success(function(b,d,c,e){$("#prompt-modal").modal("hide");q.search(f.related[a].iterator)}).error(function(a,b,e,f){$("#prompt-modal").modal("hide");d(q,a,b,null,{hdr:"Error!",msg:"Call to "+c+" failed. POST returned status: "+b})}))}})}}UsersEdit.$inject="$scope $rootScope $compile $location $log $routeParams UserForm GenerateForm Rest Alert ProcessErrors LoadBreadCrumbs RelatedSearchInit RelatedPaginateInit ReturnToCaller ClearScope GetBasePath Prompt CheckAccess".split(" ");angular.module("CredentialFormDefinition",[]).value("CredentialForm",{addTitle:"Create Credential",editTitle:"{{ name }}",name:"credential",well:!0,fields:{name:{label:"Name",type:"text",addRequired:!0,editRequired:!0,autocomplete:!1},description:{label:"Description",type:"text",addRequired:!1,editRequired:!1},ssh_username:{label:"SSH Username",type:"text",addRequired:!1,editRequired:!1,autocomplete:!1},ssh_password:{label:"SSH Password",type:"password",addRequired:!1,editRequired:!1,ngChange:"clearPWConfirm('ssh_password_confirm')",
|
||||
ask:!0,clear:!0,associated:"ssh_password_confirm",autocomplete:!1},ssh_password_confirm:{label:"Confirm SSH Password",type:"password",addRequired:!1,editRequired:!1,awPassMatch:!0,associated:"ssh_password",autocomplete:!1},ssh_key_data:{label:"SSH Private Key",type:"textarea",addRequired:!1,editRequired:!1,rows:10,"class":"span10"},ssh_key_unlock:{label:"Key Password",type:"password",addRequired:!1,editRequired:!1,ngChange:"clearPWConfirm('ssh_key_unlock_confirm')",associated:"ssh_key_unlock_confirm",
|
||||
ask:!0,clear:!0},ssh_key_unlock_confirm:{label:"Confirm Key Password",type:"password",addRequired:!1,editRequired:!1,awPassMatch:!0,associated:"ssh_key_unlock"},sudo_username:{label:"Sudo Username",type:"text",addRequired:!1,editRequired:!1,autocomplete:!1},sudo_password:{label:"Sudo Password",type:"password",addRequired:!1,editRequired:!1,ngChange:"clearPWConfirm('sudo_password_confirm')",ask:!0,clear:!0,associated:"sudo_password_confirm",autocomplete:!1},sudo_password_confirm:{label:"Confirm Sudo Password",
|
||||
@ -156,7 +157,7 @@ section:"Timing"},module_name:{label:"Name",type:"text",readonly:!0,section:"Mod
|
||||
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:"<p>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.</p>",
|
||||
dataTitle:"Forks",dataPlacement:"left"},limit:{label:"Limit",type:"text",addRequired:!1,editRequired:!1,column:2,awPopOver:'<p>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 ,</p><p>For more information and examples see the <a href="http://ansible.cc/docs/patterns.html#selecting-targets" target="_blank">Selecting Targets section</a> under Inventory and Patterns in the Ansible documentation.</p>',
|
||||
dataTitle:"Limit",dataPlacement:"left"},verbosity:{label:"Verbosity",type:"select",ngOptions:"v.label for v in verbosity_options","default":0,addRequired:!0,editRequired:!0,column:2,awPopOver:"<p>Control the level of output ansible will produce as the playbook executes.</p>",dataTitle:"Verbosity",dataPlacement:"left"},extra_vars:{label:"Extra Variables",type:"textarea",rows:6,"class":"span12",addRequired:!1,editRequired:!1,awPopOver:'<p>Pass extra command line variables to the playbook. This is the -e or --extra-vars command line parameter for ansible-playbook. Provide key=value pairs or JSON. <p><a href="http://www.ansibleworks.com/docs/playbooks2.html#passing-variables-on-the-command-line" target="_blank">Click here to view documentation and examples.</a></p>',
|
||||
dataTitle:"Limit",dataPlacement:"left"},verbosity:{label:"Verbosity",type:"select",ngOptions:"v.label for v in verbosity_options","default":0,addRequired:!0,editRequired:!0,column:2,awPopOver:"<p>Control the level of output ansible will produce as the playbook executes.</p>",dataTitle:"Verbosity",dataPlacement:"left"},variables:{label:"Extra Variables",type:"textarea",rows:6,"class":"span12",addRequired:!1,editRequired:!1,awPopOver:'<p>Pass extra command line variables to the playbook. This is the -e or --extra-vars command line parameter for ansible-playbook. Provide key=value pairs or JSON. <p><a href="http://www.ansibleworks.com/docs/playbooks2.html#passing-variables-on-the-command-line" target="_blank">Click here to view documentation and examples.</a></p>',
|
||||
column:2},allow_callbacks:{label:"Allow Callbacks",type:"checkbox",addRequired:!1,editRequird:!1,trueValue:"true",falseValue:"false",ngChange:"toggleCallback('host_config_key')","class":"span12",column:2,awPopOver:'<p>Create a callback URL a host can use to contact the AWX server and request a configuration update using the job template. The URL will look like the following:</p>\n<p class="code-breakable">http://your.server.com:999/api/v1/job_templates/1/callback/</p><p>The request from the host must be a POST. Here is an example using curl:</p>\n<p class="code-breakable">curl --data "host_config_key=5a8ec154832b780b9bdef1061764ae5a" http://your.server.com:999/api/v1/job_templates/1/callback/</p>\n<p>Note the requesting host must be defined in your inventory. If ansible fails to locate the host either by name or IP address in one of your defined inventories, the request will be denied.</p><p>Successful requests will result in an entry on the Jobs tab, where the results and history can be viewed.</p>',
|
||||
detailPlacement:"left",dataContainer:"#jobs",dataTitle:"Callback URL"},callback_url:{label:"Callback URL",type:"text",addRequired:!1,editRequired:!1,readonly:!0,column:2,required:!1,"class":"span12",awPopOver:'<p>Using this URL a host can contact the AWX server and request a configuration update using the job template. The request from the host must be a POST. Here is an example using curl:</p>\n<p class="code-breakable">curl --data "host_config_key=5a8ec154832b780b9bdef1061764ae5a" http://your.server.com:999/api/v1/job_templates/1/callback/</p>\n<p>Note the requesting host must be defined in your inventory. If ansible fails to locate the host either by name or IP address in one of your defined inventories, the request will be denied.</p><p>Successful requests will result in an entry on the Jobs tab, where the results and history can be viewed.</p>',
|
||||
detailPlacement:"left",dataContainer:"#jobs",dataTitle:"Callback URL"},host_config_key:{label:"Host Config Key",type:"text",ngShow:"allow_callbacks",genMD5:!0,column:2,awPopOver:'<p>When contacting the AWX server using the callback URL, the calling host must authenticate by including this key in the POST data of the request. Here\'s an example using curl:</p>\n<p class="code-breakable">curl --data "host_config_key=5a8ec154832b780b9bdef1061764ae5a" http://your.server.com:999/api/v1/job_templates/1/callback/</p>\n',
|
||||
@ -206,11 +207,11 @@ d,c){h.queue.push({result:"success",data:a,status:b});h.$emit("callFinished")}).
|
||||
a).checked=!0,-1==h.selected.indexOf(a)&&h.selected.push(a))};h.createGroup=function(){$("#form-modal").modal("hide");v({inventory_id:l,group_id:k})}}}]).factory("GroupsAdd",["$rootScope","$location","$log","$routeParams","Rest","Alert","GroupForm","GenerateForm","Prompt","ProcessErrors","GetBasePath","RefreshTree","ParseTypeChange",function(k,m,h,g,c,p,f,e,l,a,d,b,y){return function(l){var g=l.inventory_id;l=void 0!==l.group_id?l.group_id:null;var h=null!==l?d("groups")+l+"/children/":d("inventory")+
|
||||
g+"/groups/",k=e.inject(f,{mode:"add",modal:!0,related:!1});k.formModalActionLabel="Save";k.formModalHeader="Create Group";k.formModalCancelShow=!0;k.parseType="yaml";y(k);$("#form-modal .btn-none").removeClass("btn-none").addClass("btn-success");e.reset();k.$$phase||k.$digest();k.formModalAction=function(){try{var d="json"==k.parseType?JSON.parse(k.variables):jsyaml.load(k.variables);if("object"!==typeof d)throw"failed to return an object!";var e={},l;for(l in f.fields)"variables"!=l&&(e[l]=k[l]);
|
||||
g&&(e.inventory=g);c.setUrl(h);c.post(e).success(function(e,l,n,g){k.variables?(c.setUrl(e.related.variable_data),c.put(d).success(function(a,d,c,e){$("#form-modal").modal("hide");b({scope:k})}).error(function(b,d,c,e){a(k,b,d,f,{hdr:"Error!",msg:"Failed to add group varaibles. PUT returned status: "+d})})):($("#form-modal").modal("hide"),b({scope:k}))}).error(function(b,d,c,e){a(k,b,d,f,{hdr:"Error!",msg:"Failed to add new group. POST returned status: "+d})})}catch(m){p("Error","Error parsing group variables. Parser returned: "+
|
||||
m)}};k.formReset=function(){e.reset()}}}]).factory("GroupsEdit",["$rootScope","$location","$log","$routeParams","Rest","Alert","GroupForm","GenerateForm","Prompt","ProcessErrors","GetBasePath","RefreshTree","ParseTypeChange",function(k,m,h,g,c,p,f,e,l,a,d,b,y){return function(l){var h=l.group_id,k=g.id,m=d("groups")+h+"/",t=e.inject(f,{mode:"edit",modal:!0,related:!1});e.reset();var r={},n={};t.formModalActionLabel="Save";t.formModalHeader="Edit Group";t.formModalCancelShow=!0;t.parseType="yaml";
|
||||
m)}};k.formReset=function(){e.reset()}}}]).factory("GroupsEdit",["$rootScope","$location","$log","$routeParams","Rest","Alert","GroupForm","GenerateForm","Prompt","ProcessErrors","GetBasePath","RefreshTree","ParseTypeChange",function(k,m,h,g,c,p,f,e,l,a,d,b,y){return function(l){var h=l.group_id,k=g.id,m=d("groups")+h+"/",t=e.inject(f,{mode:"edit",modal:!0,related:!1});e.reset();var s={},n={};t.formModalActionLabel="Save";t.formModalHeader="Edit Group";t.formModalCancelShow=!0;t.parseType="yaml";
|
||||
y(t);$("#form-modal .btn-none").removeClass("btn-none").addClass("btn-success");t.groupLoadedRemove&&t.groupLoadedRemove();t.groupLoadedRemove=t.$on("groupLoaded",function(){for(var b in n)t.search(n[b].iterator);t.variable_url?(c.setUrl(t.variable_url),c.get().success(function(a,b,d,c){$.isEmptyObject(a)?t.variables="---":t.variables=jsyaml.safeDump(a)}).error(function(b,d,c,e){t.variables=null;a(t,b,d,f,{hdr:"Error!",msg:"Failed to retrieve group variables. GET returned status: "+d})})):t.variables=
|
||||
"---";r.variables=t.variables});c.setUrl(m);c.get().success(function(a,b,d,c){for(var e in f.fields)a[e]&&(t[e]=a[e],r[e]=t[e]);b=a.related;for(var l in f.related)b[l]&&(n[l]={url:b[l],iterator:f.related[l].iterator});t.variable_url=a.related.variable_data;t.$emit("groupLoaded")}).error(function(b,d,c,e){a(t,b,d,f,{hdr:"Error!",msg:"Failed to retrieve group: "+id+". GET status: "+d})});t.$$phase||t.$digest();t.formModalAction=function(){try{var e="json"==t.parseType?JSON.parse(t.variables):jsyaml.load(t.variables);
|
||||
"---";s.variables=t.variables});c.setUrl(m);c.get().success(function(a,b,d,c){for(var e in f.fields)a[e]&&(t[e]=a[e],s[e]=t[e]);b=a.related;for(var l in f.related)b[l]&&(n[l]={url:b[l],iterator:f.related[l].iterator});t.variable_url=a.related.variable_data;t.$emit("groupLoaded")}).error(function(b,d,c,e){a(t,b,d,f,{hdr:"Error!",msg:"Failed to retrieve group: "+id+". GET status: "+d})});t.$$phase||t.$digest();t.formModalAction=function(){try{var e="json"==t.parseType?JSON.parse(t.variables):jsyaml.load(t.variables);
|
||||
if("object"!==typeof e)throw"failed to return an object!";var l={},n;for(n in f.fields)l[n]=t[n];l.inventory=k;c.setUrl(m);c.put(l).success(function(l,n,g,h){t.variables?(c.setUrl(d("groups")+l.id+"/variable_data/"),c.put(e).success(function(a,d,c,e){$("#form-modal").modal("hide");b({scope:t})}).error(function(b,d,c,e){a(t,b,d,f,{hdr:"Error!",msg:"Failed to update group varaibles. PUT returned status: "+d})})):($("#form-modal").modal("hide"),b({scope:t}))}).error(function(b,d,c,e){a(t,b,d,f,{hdr:"Error!",
|
||||
msg:"Failed to update group: "+h+". PUT status: "+d})})}catch(g){p("Error","Error parsing group variables. Parser returned: "+g)}};t.formReset=function(){e.reset();for(var a in r)t[a]=r[a];t.parseType="yaml"}}}]).factory("GroupsDelete",["$rootScope","$location","$log","$routeParams","Rest","Alert","GroupForm","GenerateForm","Prompt","ProcessErrors","GetBasePath",function(k,m,h,g,c,p,f,e,l,a,d){return function(b){var e=b.scope,f=b.group_id;b=b.inventory_id;var l=$('#tree-view li[group_id="'+f+'"]'),
|
||||
msg:"Failed to update group: "+h+". PUT status: "+d})})}catch(g){p("Error","Error parsing group variables. Parser returned: "+g)}};t.formReset=function(){e.reset();for(var a in s)t[a]=s[a];t.parseType="yaml"}}}]).factory("GroupsDelete",["$rootScope","$location","$log","$routeParams","Rest","Alert","GroupForm","GenerateForm","Prompt","ProcessErrors","GetBasePath",function(k,m,h,g,c,p,f,e,l,a,d){return function(b){var e=b.scope,f=b.group_id;b=b.inventory_id;var l=$('#tree-view li[group_id="'+f+'"]'),
|
||||
g="LI"==l.parent().last().prop("tagName")?l.parent().last():l.parent().parent().last(),h;h="group"==g.attr("type")?d("base")+"groups/"+g.attr("group_id")+"/children/":d("inventory")+b+"/groups/";$("#prompt-header").text("Delete Group");$("#prompt-body").text("Are you sure you want to remove group "+$(l).attr("name")+" from "+$(g).attr("name")+"?");$("#prompt-action-btn").addClass("btn-danger");e.promptAction=function(){c.setUrl(h);c.post({id:f,disassociate:1}).success(function(a,b,d,c){$("#prompt-modal").modal("hide");
|
||||
$("#tree-view").jstree("delete_node",l)}).error(function(b,d,c,f){$("#prompt-modal").modal("hide");RefreshTree({scope:e});a(e,b,d,null,{hdr:"Error!",msg:"Call to "+h+" failed. DELETE returned status: "+d})})};$("#prompt-modal").modal({backdrop:"static",keyboard:!0,show:!0})}}]);angular.module("HostsHelper","RestServices Utilities ListGenerator HostListDefinition SearchHelper PaginateHelper ListGenerator AuthService HostsHelper InventoryHelper RelatedSearchHelper RelatedPaginateHelper InventoryFormDefinition".split(" ")).factory("HostsList",["$rootScope","$location","$log","$routeParams","Rest","Alert","HostList","GenerateList","Prompt","SearchInit","PaginateInit","ProcessErrors","GetBasePath","HostsAdd","HostsReload",function(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A){return function(b){var l=
|
||||
b.inventory_id,g=b.group_id;f.iterator="subhost";f.name="subhosts";var h=y("inventory")+l+"/hosts/",n=e.inject(f,{id:"form-modal-body",mode:"select",breadCrumbs:!1,selectButton:!1});n.formModalActionLabel="Select";n.formModalHeader="Select Hosts";n.formModalCancelShow=!0;n.removeHostsReload&&n.removeHostsReload();n.removeHostsReload=n.$on("hostsReload",function(){A(b)});$(".popover").remove();$("#form-modal .btn-none").removeClass("btn-none").addClass("btn-success");$("#form-modal").modal({backdrop:"static",
|
||||
@ -220,11 +221,11 @@ data:a,status:b});n.$emit("callFinished")}).error(function(a,b,d,c){n.queue.push
|
||||
a).checked=!0,-1==n.selected.indexOf(a)&&n.selected.push(a))};n.createHost=function(){$("#form-modal").modal("hide");v({scope:b.scope,inventory_id:l,group_id:g})}}}]).factory("HostsAdd",["$rootScope","$location","$log","$routeParams","Rest","Alert","HostForm","GenerateForm","Prompt","ProcessErrors","GetBasePath","HostsReload","ParseTypeChange",function(k,m,h,g,c,p,f,e,l,a,d,b,y){return function(l){var g=l.inventory_id,h=void 0!==l.group_id?l.group_id:null,k=d("groups")+h+"/hosts/",m=e.inject(f,{mode:"add",
|
||||
modal:!0,related:!1});m.formModalActionLabel="Save";m.formModalHeader="Create Host";m.formModalCancelShow=!0;m.parseType="yaml";y(m);m.removeHostsReload&&m.removeHostsReload();m.removeHostsReload=m.$on("hostsReload",function(){b(l)});$("#form-modal .btn-none").removeClass("btn-none").addClass("btn-success");e.reset();m.$$phase||m.$digest();m.formModalAction=function(){try{var b="json"==m.parseType?JSON.parse(m.variables):jsyaml.load(m.variables);if("object"!==typeof b)throw"failed to return an object!";
|
||||
var d={},e;for(e in f.fields)"variables"!=e&&(d[e]=m[e]);d.inventory=g;c.setUrl(k);c.post(d).success(function(d,e,l,g){m.variables?(c.setUrl(d.related.variable_data),c.put(b).success(function(a,b,d,c){$("#form-modal").modal("hide")}).error(function(b,d,c,e){a(m,b,d,f,{hdr:"Error!",msg:"Failed to add host varaibles. PUT returned status: "+d})})):($("#form-modal").modal("hide"),m.$emit("hostsReload"))}).error(function(b,d,c,e){a(m,b,d,f,{hdr:"Error!",msg:"Failed to add new host. POST returned status: "+
|
||||
d})})}catch(l){p("Error","Error parsing host variables. Parser returned: "+l)}};m.formReset=function(){e.reset()}}}]).factory("HostsEdit",["$rootScope","$location","$log","$routeParams","Rest","Alert","HostForm","GenerateForm","Prompt","ProcessErrors","GetBasePath","HostsReload","ParseTypeChange",function(k,m,h,g,c,p,f,e,l,a,d,b,y){return function(l){var g=l.host_id,h=l.inventory_id,k=d("hosts")+g+"/",m=e.inject(f,{mode:"edit",modal:!0,related:!1});e.reset();var r={};m.formModalActionLabel="Save";
|
||||
d})})}catch(l){p("Error","Error parsing host variables. Parser returned: "+l)}};m.formReset=function(){e.reset()}}}]).factory("HostsEdit",["$rootScope","$location","$log","$routeParams","Rest","Alert","HostForm","GenerateForm","Prompt","ProcessErrors","GetBasePath","HostsReload","ParseTypeChange",function(k,m,h,g,c,p,f,e,l,a,d,b,y){return function(l){var g=l.host_id,h=l.inventory_id,k=d("hosts")+g+"/",m=e.inject(f,{mode:"edit",modal:!0,related:!1});e.reset();var s={};m.formModalActionLabel="Save";
|
||||
m.formModalHeader="Edit Host";m.formModalCancelShow=!0;m.parseType="yaml";y(m);m.removeHostsReload&&m.removeHostsReload();m.removeHostsReload=m.$on("hostsReload",function(){b(l)});$("#form-modal .btn-none").removeClass("btn-none").addClass("btn-success");m.hostLoadedRemove&&m.hostLoadedRemove();m.hostLoadedRemove=m.$on("hostLoaded",function(){m.variable_url?(c.setUrl(m.variable_url),c.get().success(function(a,b,d,c){$.isEmptyObject(a)?m.variables="---":m.variables=jsyaml.safeDump(a)}).error(function(b,
|
||||
d,c,e){m.variables=null;a(m,b,d,f,{hdr:"Error!",msg:"Failed to retrieve host variables. GET returned status: "+d})})):m.variables="---";r.variables=m.variables});c.setUrl(k);c.get().success(function(a,b,d,c){for(var e in f.fields)a[e]&&(m[e]=a[e],r[e]=m[e]);for(var l in f.related);m.variable_url=a.related.variable_data;m.$emit("hostLoaded")}).error(function(b,d,c,e){a(m,b,d,f,{hdr:"Error!",msg:"Failed to retrieve host: "+id+". GET returned status: "+d})});m.$$phase||m.$digest();m.formModalAction=
|
||||
d,c,e){m.variables=null;a(m,b,d,f,{hdr:"Error!",msg:"Failed to retrieve host variables. GET returned status: "+d})})):m.variables="---";s.variables=m.variables});c.setUrl(k);c.get().success(function(a,b,d,c){for(var e in f.fields)a[e]&&(m[e]=a[e],s[e]=m[e]);for(var l in f.related);m.variable_url=a.related.variable_data;m.$emit("hostLoaded")}).error(function(b,d,c,e){a(m,b,d,f,{hdr:"Error!",msg:"Failed to retrieve host: "+id+". GET returned status: "+d})});m.$$phase||m.$digest();m.formModalAction=
|
||||
function(){try{var b="json"==m.parseType?JSON.parse(m.variables):jsyaml.load(m.variables);if("object"!==typeof b)throw"failed to return an object!";var e={},l;for(l in f.fields)e[l]=m[l];e.inventory=h;c.setUrl(k);c.put(e).success(function(e,l,g,h){m.variables?(c.setUrl(d("hosts")+e.id+"/variable_data/"),c.put(b).success(function(a,b,d,c){$("#form-modal").modal("hide");m.$emit("hostsReload")}).error(function(b,d,c,e){a(m,b,d,f,{hdr:"Error!",msg:"Failed to update host varaibles. PUT returned status: "+
|
||||
d})})):($("#form-modal").modal("hide"),m.$emit("hostsReload"))}).error(function(b,d,c,e){a(m,b,d,f,{hdr:"Error!",msg:"Failed to update host: "+g+". PUT returned status: "+d})})}catch(y){p("Error","Error parsing host variables. Parser returned: "+y)}};m.formReset=function(){e.reset();for(var a in r)m[a]=r[a];m.parseType="yaml"}}}]).factory("HostsDelete",["$rootScope","$location","$log","$routeParams","Rest","Alert","Prompt","ProcessErrors","GetBasePath","HostsReload",function(k,m,h,g,c,p,f,e,l,a){return function(d){var b=
|
||||
d})})):($("#form-modal").modal("hide"),m.$emit("hostsReload"))}).error(function(b,d,c,e){a(m,b,d,f,{hdr:"Error!",msg:"Failed to update host: "+g+". PUT returned status: "+d})})}catch(y){p("Error","Error parsing host variables. Parser returned: "+y)}};m.formReset=function(){e.reset();for(var a in s)m[a]=s[a];m.parseType="yaml"}}}]).factory("HostsDelete",["$rootScope","$location","$log","$routeParams","Rest","Alert","Prompt","ProcessErrors","GetBasePath","HostsReload",function(k,m,h,g,c,p,f,e,l,a){return function(d){var b=
|
||||
d.scope,f=d.inventory_id,g=d.host_id,h=d.host_name,k=null!==b.group_id?l("groups")+b.group_id+"/hosts/":l("inventory")+f+"/hosts/";null!==b.group_id?($("#prompt-header").text("Remove Host from Group"),$("#prompt-body").text("Are you sure you want to remove host "+h+" from the group?")):($("#prompt-header").text("Delete Host"),$("#prompt-body").text("Are you sure you want to permenantly remove host "+h+"?"));$("#prompt-action-btn").addClass("btn-danger");b.promptAction=function(){b.removeHostsReload&&
|
||||
b.removeHostsReload();b.removeHostsReload=b.$on("hostsReload",function(){a(d)});c.setUrl(k);c.post({id:g,disassociate:1}).success(function(a,d,c,e){$("#prompt-modal").modal("hide");b.$emit("hostsReload")}).error(function(a,d,c,l){$("#prompt-modal").modal("hide");b.$emit("hostsReload");e(b,a,d,null,{hdr:"Error!",msg:"Call to "+k+" failed. DELETE returned status: "+d})})};$("#prompt-modal").modal({backdrop:"static",keyboard:!0,show:!0})}}]).factory("HostsReload",["RelatedSearchInit","RelatedPaginateInit",
|
||||
"InventoryForm","GetBasePath",function(k,m,h,g){return function(c){scope=c.scope;var p={hosts:{url:null!==scope.group_id?g("groups")+scope.group_id+"/hosts/":g("inventory")+c.inventory_id+"/hosts/",iterator:"host"}};k({scope:c.scope,form:h,relatedSets:p});m({scope:c.scope,relatedSets:p});c.scope.search("host");c.scope.$$phase||c.scope.$digest()}}]);angular.module("InventoryHelper","RestServices Utilities OrganizationListDefinition SearchHelper PaginateHelper ListGenerator AuthService InventoryHelper RelatedSearchHelper RelatedPaginateHelper InventoryFormDefinition".split(" ")).factory("LoadTreeData",["Alert","Rest","Authorization","$http",function(k,m,h,g){return function(c){var g=c.scope,f=c.inventory,e=f.related.root_groups,l=f.related.hosts,a=f.name,d=f.url,b=f.id,h=f.description,v=0,A=[];g.HostLoadedRemove&&g.HostLoadedRemove();g.HostLoadedRemove=
|
||||
|
||||
@ -165,6 +165,7 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
||||
var id = $routeParams.id;
|
||||
var relatedSets = {};
|
||||
|
||||
scope.parseType = 'yaml';
|
||||
scope.statusSearchSpin = false;
|
||||
|
||||
function getPlaybooks(project) {
|
||||
@ -228,6 +229,7 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
||||
});
|
||||
scope['callback_url'] = data.related['callback'];
|
||||
$('input[type="checkbox"]').attr('disabled','disabled');
|
||||
$('input[type="radio"]').attr('disabled','disabled');
|
||||
$('#host_config_key-gen-btn').attr('disabled','disabled');
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
@ -254,7 +256,7 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
||||
LoadBreadCrumbs({ path: '/job_templates/' + id, title: data.name });
|
||||
|
||||
for (var fld in form.fields) {
|
||||
if (data[fld] !== null && data[fld] !== undefined) {
|
||||
if (fld != 'variables' && data[fld] !== null && data[fld] !== undefined) {
|
||||
if (form.fields[fld].type == 'select') {
|
||||
if (scope[fld + '_options'] && scope[fld + '_options'].length > 0) {
|
||||
for (var i=0; i < scope[fld + '_options'].length; i++) {
|
||||
@ -272,6 +274,17 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
||||
}
|
||||
master[fld] = scope[fld];
|
||||
}
|
||||
if (fld == 'variables') {
|
||||
// Parse extra_vars, converting to YAML.
|
||||
if ($.isEmptyObject(data.extra_vars) || data.extra_vars == "\{\}" || data.extra_vars == "null") {
|
||||
scope.variables = "---";
|
||||
}
|
||||
else {
|
||||
var json_obj = JSON.parse(data.extra_vars);
|
||||
scope.variables = jsyaml.safeDump(json_obj);
|
||||
}
|
||||
master.variables = scope.variables;
|
||||
}
|
||||
if (form.fields[fld].type == 'lookup' && data.summary_fields[form.fields[fld].sourceModel]) {
|
||||
scope[form.fields[fld].sourceModel + '_' + form.fields[fld].sourceField] =
|
||||
data.summary_fields[form.fields[fld].sourceModel][form.fields[fld].sourceField];
|
||||
|
||||
@ -127,7 +127,7 @@ angular.module('JobFormDefinition', [])
|
||||
dataTitle: 'Verbosity',
|
||||
dataPlacement: 'left'
|
||||
},
|
||||
extra_vars: {
|
||||
variables: {
|
||||
label: 'Extra Variables',
|
||||
type: 'textarea',
|
||||
rows: 6,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user