1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Help icon is now the same everywhere. In some places it was an 'i' and in others a '?'. Same with the color. We had two different flavors of blue. Also streamlined the code. Now all help html is genereated from one place.

This commit is contained in:
chouseknecht 2013-07-13 05:56:49 -04:00
parent 7d6507ec0d
commit 44f7ce42cc
6 changed files with 240 additions and 276 deletions

View File

@ -126,6 +126,10 @@
text-decoration: none;
}
.help-link {
color: #49afcd;
}
.site-footer {
width: 100%;
margin-top: 60px;

View File

@ -4,11 +4,11 @@
*
* awx-min.js
*
* master-987e4d1, Fri Jul 12 13:46:38 2013 -0400
* master-6495420, Fri Jul 12 17:08:30 2013 -0400
*
*/
var urlPrefix="/static/";
angular.module("ansible","RestServices AuthService Utilities OrganizationFormDefinition UserFormDefinition FormGenerator OrganizationListDefinition UserListDefinition ListGenerator PromptDialog ApiLoader RelatedSearchHelper RelatedPaginateHelper SearchHelper PaginateHelper RefreshHelper AdminListDefinition AWDirectives InventoriesListDefinition InventoryFormDefinition InventoryHelper AWFilters HostFormDefinition HostListDefinition GroupFormDefinition GroupListDefinition TeamsListDefinition TeamFormDefinition TeamHelper CredentialsListDefinition CredentialFormDefinition LookUpHelper JobTemplatesListDefinition JobTemplateFormDefinition JobTemplateHelper ProjectsListDefinition ProjectFormDefinition PermissionFormDefinition PermissionListDefinition JobsListDefinition JobFormDefinition JobEventsListDefinition JobEventFormDefinition JobHostDefinition GroupsHelper HostsHelper ParseHelper ChildrenHelper EventsHelper ProjectPathHelper md5Helper AccessHelper".split(" ")).config(["$routeProvider",function(l){l.when("/jobs",
angular.module("ansible","RestServices AuthService Utilities OrganizationFormDefinition UserFormDefinition FormGenerator OrganizationListDefinition UserListDefinition ListGenerator PromptDialog ApiLoader RelatedSearchHelper RelatedPaginateHelper SearchHelper PaginateHelper RefreshHelper AdminListDefinition AWDirectives InventoriesListDefinition InventoryFormDefinition InventoryHelper AWFilters HostFormDefinition HostListDefinition GroupFormDefinition GroupListDefinition TeamsListDefinition TeamFormDefinition TeamHelper CredentialsListDefinition CredentialFormDefinition LookUpHelper JobTemplatesListDefinition JobTemplateFormDefinition JobTemplateHelper ProjectsListDefinition ProjectFormDefinition PermissionFormDefinition PermissionListDefinition JobsListDefinition JobFormDefinition JobEventsListDefinition JobEventFormDefinition JobHostDefinition GroupsHelper HostsHelper ParseHelper ChildrenHelper EventsHelper ProjectPathHelper md5Helper AccessHelper".split(" ")).config(["$routeProvider",function(k){k.when("/jobs",
{templateUrl:urlPrefix+"partials/jobs.html",controller:JobsListCtrl}).when("/jobs/:id",{templateUrl:urlPrefix+"partials/jobs.html",controller:JobsEdit}).when("/jobs/:id/job_events",{templateUrl:urlPrefix+"partials/jobs.html",controller:JobEventsList}).when("/jobs/:id/job_host_summaries",{templateUrl:urlPrefix+"partials/jobs.html",controller:JobHostSummaryList}).when("/jobs/:job_id/job_events/:event_id",{templateUrl:urlPrefix+"partials/jobs.html",controller:JobEventsEdit}).when("/job_templates",{templateUrl:urlPrefix+
"partials/job_templates.html",controller:JobTemplatesList}).when("/job_templates/add",{templateUrl:urlPrefix+"partials/job_templates.html",controller:JobTemplatesAdd}).when("/job_templates/:id",{templateUrl:urlPrefix+"partials/job_templates.html",controller:JobTemplatesEdit}).when("/projects",{templateUrl:urlPrefix+"partials/projects.html",controller:ProjectsList}).when("/projects/add",{templateUrl:urlPrefix+"partials/projects.html",controller:ProjectsAdd}).when("/projects/:id",{templateUrl:urlPrefix+
"partials/projects.html",controller:ProjectsEdit}).when("/inventories",{templateUrl:urlPrefix+"partials/inventories.html",controller:InventoriesList}).when("/inventories/add",{templateUrl:urlPrefix+"partials/inventories.html",controller:InventoriesAdd}).when("/inventories/:id",{templateUrl:urlPrefix+"partials/inventories.html",controller:InventoriesEdit}).when("/organizations",{templateUrl:urlPrefix+"partials/organizations.html",controller:OrganizationsList}).when("/organizations/add",{templateUrl:urlPrefix+
@ -18,128 +18,128 @@ controller:UsersAdd}).when("/organizations/:organization_id/users/:user_id",{tem
{templateUrl:urlPrefix+"partials/teams.html",controller:ProjectsAdd}).when("/teams/:team_id/projects/:project_id",{templateUrl:urlPrefix+"partials/teams.html",controller:ProjectsEdit}).when("/teams/:team_id/credentials",{templateUrl:urlPrefix+"partials/teams.html",controller:CredentialsList}).when("/teams/:team_id/credentials/add",{templateUrl:urlPrefix+"partials/teams.html",controller:CredentialsAdd}).when("/teams/:team_id/credentials/:credential_id",{templateUrl:urlPrefix+"partials/teams.html",
controller:CredentialsEdit}).when("/credentials",{templateUrl:urlPrefix+"partials/credentials.html",controller:CredentialsList}).when("/credentials/:credential_id",{templateUrl:urlPrefix+"partials/credentials.html",controller:CredentialsEdit}).when("/users",{templateUrl:urlPrefix+"partials/users.html",controller:UsersList}).when("/users/add",{templateUrl:urlPrefix+"partials/users.html",controller:UsersAdd}).when("/users/:user_id",{templateUrl:urlPrefix+"partials/users.html",controller:UsersEdit}).when("/users/:user_id/credentials",
{templateUrl:urlPrefix+"partials/users.html",controller:CredentialsList}).when("/users/:user_id/permissions/add",{templateUrl:urlPrefix+"partials/users.html",controller:PermissionsAdd}).when("/users/:user_id/permissions",{templateUrl:urlPrefix+"partials/users.html",controller:PermissionsList}).when("/users/:user_id/permissions/:permission_id",{templateUrl:urlPrefix+"partials/users.html",controller:PermissionsEdit}).when("/users/:user_id/credentials/add",{templateUrl:urlPrefix+"partials/teams.html",
controller:CredentialsAdd}).when("/teams/:user_id/credentials/:credential_id",{templateUrl:urlPrefix+"partials/teams.html",controller:CredentialsEdit}).when("/login",{templateUrl:urlPrefix+"partials/login-dialog.html",controller:Authenticate}).when("/logout",{templateUrl:urlPrefix+"partials/login-dialog.html",controller:Authenticate}).otherwise({redirectTo:"/"})}]).run(["$rootScope","CheckLicense","$location","Authorization","LoadBasePaths",function(l,m,h,g,c){c();l.breadcrumbs=[];l.crumbCache=[];
l.$on("$routeChangeStart",function(c,f,e){!1==g.isTokenValid()?f.templateUrl!=urlPrefix+"partials/login.html"&&h.path("/login"):((void 0==l.current_user||null==l.current_user)&&g.restoreUserInfo(),m());c=h.path().replace(/^\//,"").split("/")[0];""==c?$('.nav-tabs a[href="#organizations"]').tab("show"):(c.replace(/\_/g," "),$('.nav-tabs a[href="#'+c+'"]').tab("show"))});g.isTokenValid()||h.path("/login");c=h.path().replace(/^\//,"").split("/")[0];""==c?(c="organizations",h.path("/organizations")):
c.replace(/\_/g," ");$('.nav-tabs a[href="#'+c+'"]').tab("show");l.viewCurrentUser=function(){h.path("/users/"+l.current_user.id)}}]);var $AnsibleConfig={session_timeout:3600,tooltip_delay:{show:500,hide:100},debug_mode:!0};function AdminsList(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A){l=A("organizations")+c.organization_id+"/users/";var u=k.inject(e,{mode:"select"});u.selected=[];u.PostRefreshRemove&&u.PostRefreshRemove();u.PostRefreshRemove=u.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");u[a]=""})});b({scope:u,set:"admins",list:e,url:l});y({scope:u,list:e,url:l});u.search(e.iterator);a();u.finishSelection=function(){var a=A("organizations")+c.organization_id+"/admins/";p.setUrl(a);u.queue=
controller:CredentialsAdd}).when("/teams/:user_id/credentials/:credential_id",{templateUrl:urlPrefix+"partials/teams.html",controller:CredentialsEdit}).when("/login",{templateUrl:urlPrefix+"partials/login-dialog.html",controller:Authenticate}).when("/logout",{templateUrl:urlPrefix+"partials/login-dialog.html",controller:Authenticate}).otherwise({redirectTo:"/"})}]).run(["$rootScope","CheckLicense","$location","Authorization","LoadBasePaths",function(k,m,h,g,c){c();k.breadcrumbs=[];k.crumbCache=[];
k.$on("$routeChangeStart",function(c,f,e){!1==g.isTokenValid()?f.templateUrl!=urlPrefix+"partials/login.html"&&h.path("/login"):((void 0==k.current_user||null==k.current_user)&&g.restoreUserInfo(),m());c=h.path().replace(/^\//,"").split("/")[0];""==c?$('.nav-tabs a[href="#organizations"]').tab("show"):(c.replace(/\_/g," "),$('.nav-tabs a[href="#'+c+'"]').tab("show"))});g.isTokenValid()||h.path("/login");c=h.path().replace(/^\//,"").split("/")[0];""==c?(c="organizations",h.path("/organizations")):
c.replace(/\_/g," ");$('.nav-tabs a[href="#'+c+'"]').tab("show");k.viewCurrentUser=function(){h.path("/users/"+k.current_user.id)}}]);var $AnsibleConfig={session_timeout:3600,tooltip_delay:{show:500,hide:100},debug_mode:!0};function AdminsList(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A){k=A("organizations")+c.organization_id+"/users/";var u=l.inject(e,{mode:"select"});u.selected=[];u.PostRefreshRemove&&u.PostRefreshRemove();u.PostRefreshRemove=u.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");u[a]=""})});b({scope:u,set:"admins",list:e,url:k});y({scope:u,list:e,url:k});u.search(e.iterator);a();u.finishSelection=function(){var a=A("organizations")+c.organization_id+"/admins/";p.setUrl(a);u.queue=
[];u.$on("callFinished",function(){if(u.queue.length==u.selected.length){$('input[type="checkbox"]').prop("checked",!1);u.selected=[];for(var a=0,b=0;b<u.queue.length;b++)"error"==u.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<u.selected.length)for(var b=0;b<u.selected.length;b++){for(var a=null,d=0;d<u.admins.length;d++)u.admins[d].id==u.selected[b]&&(a=u.admins[d]);null!==a&&p.post(a).success(function(a,b,d,c){u.queue.push({result:"success",
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(l,m,h,g,c,p){"/logout"==h.path()&&g.logout();m.userLoggedIn=!1;l.sessionExpired=g.didSessionExpire();l.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});l.reset=function(){$("#login-form input").each(function(c){$(this).val("")})};l.systemLogin=function(c,e){$(".api-error").empty();g.retrieveToken(c,
e).success(function(c,a,d,b){g.setToken(c.token);l.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)l[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),l.reset(),p(d,c)})}}Authenticate.$inject="$scope $rootScope $location Authorization ToggleClass Alert".split(" ");function CredentialsList(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A,u,C){A("htmlTemplate");var t=C("credentials"),r=h.path().replace(/^\//,"").split("/")[0],n=k.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()+
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+
"/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(l,m,h,g,c,p,f,e,k,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(){k.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;k.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,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: "+
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(l,m,h,g,c,p,f,e,k,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)});k.setUrl(n+":id/");k.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(){k.setUrl(n+E+"/");var a={},b;for(b in B.fields)a[b]=q[b];a.team=q.team;a.user=q.user;k.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=
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+"/";k.setUrl(c);k.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(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A,u,C){A("htmlTemplate");var t=C("inventory");l="inventories"==h.path().replace(/^\//,"").split("/")[0]?"edit":"select";var r=k.inject(e,{mode:l});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 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=
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(l,m,h,g,c,p,f,e,k,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!";
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]);k.setUrl(q);k.post(c).success(function(a,c,e,n){var l=a.id;w.inventory_variables?(k.setUrl(a.related.variable_data),k.put(b).success(function(a,b,d,c){g.path("/inventories/"+l)}).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/"+l)}).error(function(a,b,c,e){d(w,a,b,f,{hdr:"Error!",msg:"Failed to add new inventory. Post returned status: "+
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!";
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(l,m,h,g,c,p,f,e,k,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?(k.setUrl(x.variable_url),k.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]);k.setUrl(H+I+"/");k.put(c).success(function(a,c,e,n){x.inventory_variables?(k.setUrl(a.related.variable_data),k.put(b).success(function(a,b,d,c){g.path("/inventories")}).error(function(a,b,c,e){d(x,
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})};
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+"/";k.setUrl(c);k.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: "+
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){k.setUrl(c);k.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(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A,u,C,t,r,n,B){A("htmlTemplate");e.base=h.path();l=C("jobs")+c.id+"/job_events/";h.path().replace(/^\//,"").split("/");var q=k.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,k=!1;if("string"==typeof c.res)n=(n=c.res.match(/\n/g))?n.length:1,k=!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";k=!0}if("results"==g&&Array.isArray(c.res[g])&&0<c.res[g].length){f+="<label>Results:</label>\n";k="";for(n=0;n<c.res[g].length;n++)k+=c.res[g][n];n=(n=k.match(/\n/g))?n.length:1;f+='<textarea readonly class="input-xxlarge" rows="'+
n+'">'+k+"</textarea>\n";k=!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',k=!0)}}f=k?'<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:l});y({scope:q,list:e,url:l});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/"+
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>
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/"+
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(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A){y("htmlTemplate");var u=e.inject(f,{mode:"edit",related:!0});e.reset();l=v("base")+"job_events/"+p.event_id+"/";g.path().replace(/^\//,"").split("/");k.setUrl(l);k.get().success(function(a,d,c,e){b({path:"/job_events/"+p.event_id,title:a.event});for(var k in f.fields)"status"==k?u.status=a.failed?"error":"success":"event_data"==k?u.event_data=JSON.stringify(a.event_data,void 0,"\t"):"created"==k?u.created=A(new Date(a.created)):a[k]&&(u[k]=a[k])}).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(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A,u,C){A("htmlTemplate");l=C("jobs")+c.id+"/job_host_summaries/";h.path().replace(/^\//,"").split("/");var t=k.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:l});
y({scope:t,list:e,url:l});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(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A,u,C,t,r,n){A("htmlTemplate");var B=C("jobs");h.path().replace(/^\//,"").split("/");var q=k.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,
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,
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,n){var k,g;"pending"==b.status||"running"==b.status?(k=b.related.cancel,g="cancel",b="Cancel Job"):(k=B+a+"/",g="delete",b="Delete Job");d({hdr:b,body:"Are you sure you want to "+g+" job "+a+"?",action:function(){p.setUrl(k);"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 "+
k+" 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 "+k+" 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(l,m,h,g,c,p,f,e,k,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/";k.setUrl(b);k.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(/^\//,
q.deleteJob=function(a,b){p.setUrl(B+a+"/");p.get().success(function(b,c,f,n){var l,g;"pending"==b.status||"running"==b.status?(l=b.related.cancel,g="cancel",b="Cancel Job"):(l=B+a+"/",g="delete",b="Delete Job");d({hdr:b,body:"Are you sure you want to "+g+" job "+a+"?",action:function(){p.setUrl(l);"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 "+
l+" 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 "+l+" 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");
k.setUrl(s.template_url);k.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;k.setUrl(F+":id/");k.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]);
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 k in D.related)e[k]&&(H[k]={url:e[k],iterator:D.related[k].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(){k.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];k.put(a).success(function(a,b,d,c){"job_templates"==g.path().replace(/^\//,"").split("/")[0]?A():A(1)}).error(function(a,
"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+"/";k.setUrl(c);k.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;k.setUrl(F+J+"/");k.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(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A,u,C,t,r,n,B,q){A("htmlTemplate");var w=C("job_templates");l="job_templates"==h.path().replace(/^\//,"").split("/")[0]?"edit":"select";var z=k.inject(e,{mode:l});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);
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);
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(l,m,h,g,c,p,f,e,k,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/";k.setUrl(c);k.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,k){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");k.setUrl(q);k.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,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,
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(l,m,h,g,c,p,f,e,k,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/";k.setUrl(b);k.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=
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?"true":"false"})});k.setUrl(F+":id/");k.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"==
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?"true":"false"})});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 k in D.related)e[k]&&(H[k]={url:e[k],iterator:D.related[k].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,
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");k.setUrl(F+J+"/");k.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+"/";k.setUrl(c);k.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(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A){y("htmlTemplate");l="organizations"==h.path().replace(/^\//,"").split("/")[0]?"edit":"select";var u=k.inject(a,{mode:l}),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()+
"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()+
"/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(l,m,h,g,c,p,f,e,k,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(){k.setUrl(C);k.post({name:l.name,description:l.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=
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(l,m,h,g,c,p,f,e,k,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)});k.setUrl(r+q+"/");k.get().success(function(a,d,c,e){b({path:"/organizations/"+q,title:a.name});for(var k in f.fields)a[k]&&
(t[k]=a[k],B[k]=a[k]);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];k.setUrl(r+q+"/");k.put(a).success(function(b,d,c,e){B=a;m.flashMessage="Your changes were successfully saved!"}).error(function(a,
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+"/";k.setUrl(c);k.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(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A,u,C,t){A("htmlTemplate");l=h.path().replace(/^\//,"").split("/")[0];l=C(l);l+=void 0!==c.user_id?c.user_id:c.team_id;l+="/permissions/";var r=k.inject(e,{mode:"edit"});r.selected=[];b({scope:r,set:"permissions",list:e,url:l});y({scope:r,list:e,url:l});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=
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(l,m,h,g,c,p,f,e,k,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/";k.setUrl(b);k.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(l,m,h,g,c,p,f,e,k,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={};k.setUrl(w);k.get().success(function(a,d,c,e){b({path:"/users/"+B+"/permissions/"+q,title:a.name});for(var k in f.fields)a[k]&&(f.fields[k].sourceModel&&(d=f.fields[k].sourceModel,c=f.fields[k].sourceField,n[d+"_"+c]=a.summary_fields[d][c],
z[d+"_"+c]=a.summary_fields[d][c]),n[k]=a[k],z[k]=n[k]);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];k.setUrl(w);k.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(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A,u,C){A("htmlTemplate");var t=C("projects"),r=h.path().replace(/^\//,"").split("/")[0],n=k.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()+
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+
"/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(l,m,h,g,c,p,f,e,k,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;k.setUrl(b);k.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: "+
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(l,m,h,g,c,p,f,e,k,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})});k.setUrl(B);k.get({params:{id:z}}).success(function(a,d,c,e){b({path:"/projects/"+
z,title:a.name});for(var k in f.fields)a[k]&&(n[k]=a[k],w[k]=a[k]);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];k.setUrl(B);k.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;k.setUrl(c);
k.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(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A,u,C,t){A("htmlTemplate");var r=t("teams");l="teams"==h.path().replace(/^\//,"").split("/")[0]?"edit":"select";var n=k.inject(e,{mode:l});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,
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/"+
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: "+
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(l,m,h,g,c,p,f,e,k,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(){k.setUrl(B);var a={},b;for(b in f.fields)a[b]=q[b];k.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,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()}}
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(l,m,h,g,c,p,f,e,k,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(){k.setUrl(q.organization_url);k.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)});k.setUrl(B+":id/");k.get({params:{id:E}}).success(function(a,d,c,e){b({path:"/teams/"+E,title:a.name});for(var k in f.fields)a[k]&&(q[k]=a[k],z[k]=q[k]);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;k.setUrl(B+p.id+"/");var a={},b;for(b in f.fields)a[b]=q[b];k.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+"/",k.setUrl(c),k.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+"/",k.setUrl(c),k.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(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A,u,C){A("htmlTemplate");var t=C("users"),r=h.path().replace(/^\//,"").split("/")[0],n=k.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()+
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: "+
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")+
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(l,m,h,g,c,p,f,e,k,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,k.setUrl(A("organizations")+p.organization_id+"/"),k.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){k.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];k.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: "+
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(l,m,h,g,c,p,f,e,k,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)});k.setUrl(n+":id/");k.get({params:{id:z}}).success(function(a,d,c,e){b({path:"/users/"+z,title:a.username});for(var k in f.fields)a[k]&&(q[k]="is_superuser"==k?"true"==a[k]||!0==a[k]?"true":"false":a[k],w[k]=q[k]);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;k.setUrl(n+z+"/");var a={},b;for(b in f.fields)a[b]=q[b];k.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!",
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;
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+"/",k.setUrl(c),k.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+"/",k.setUrl(c),k.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')",
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+
"/"+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",
type:"password",addRequired:!1,editRequired:!1,awPassMatch:!0,associated:"sudo_password",autocomplete:!1}},buttons:{save:{label:"Save",icon:"icon-ok","class":"btn-success",ngClick:"formSave()",ngDisabled:!0},reset:{ngClick:"formReset()",label:"Reset",icon:"icon-remove",ngDisabled:!0}},related:{}});angular.module("GroupFormDefinition",[]).value("GroupForm",{addTitle:"Create Group",editTitle:"{{ name }}",name:"group",well:!1,"class":"horizontal-narrow",fields:{name:{label:"Name",type:"text",addRequired:!0,editRequired:!0},description:{label:"Description",type:"text",addRequired:!1,editRequired:!1},variables:{label:"Variables",type:"textarea",addRequired:!1,editRequird:!1,rows:10,"class":"modal-input-xlarge","default":"---",dataTitle:"Group Variables",dataPlacement:"right",awPopOver:'<p>Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.</p>JSON:<br />\n<blockquote>{<br />"somevar": "somevalue",<br />"password": "magic"<br /> }</blockquote>\nYAML:<br />\n<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p><p>View YAML examples at <a href="http://www.ansibleworks.com/docs/YAMLSyntax.html" target="_blank">ansibleworks.com</a></p>',
@ -189,87 +189,87 @@ is_superuser:{label:"Superuser?",type:"checkbox",trueValue:"true",falseValue:"fa
fields:{name:{key:!0,label:"Name"},description:{label:"Description"}},fieldActions:{edit:{label:"Edit",ngClick:"edit('credentials', {{ credential.id }}, '{{ credential.name }}')",icon:"icon-edit","class":"btn-success",awToolTip:"Edit the credential"},"delete":{label:"Delete",ngClick:"delete('credentials', {{ credential.id }}, '{{ credential.name }}', 'credentials')",icon:"icon-remove","class":"btn-danger",awToolTip:"Delete the credential"}}},permissions:{type:"collection",title:"Permissions",iterator:"permission",
open:!1,actions:{add:{ngClick:"add('permissions')",icon:"icon-plus",label:"Add",awToolTip:"Add a permission for this user"}},fields:{name:{key:!0,label:"Name",ngClick:"edit('permissions', {{ permission.id }}, '{{ permission.name }}')"},inventory:{label:"Inventory",sourceModel:"inventory",sourceField:"name",ngBind:"permission.summary_fields.inventory.name"},project:{label:"Project",sourceModel:"project",sourceField:"name",ngBind:"permission.summary_fields.project.name"},permission_type:{label:"Permission"}},
fieldActions:{edit:{label:"Edit",ngClick:"edit('permissions', {{ permission.id }}, '{{ permission.name }}')",icon:"icon-edit","class":"btn-success",awToolTip:"Edit the permission"},"delete":{label:"Delete",ngClick:"delete('permissions', {{ permission.id }}, '{{ permission.name }}', 'permissions')",icon:"icon-remove","class":"btn-danger",awToolTip:"Delete the permission"}}},admin_of_organizations:{type:"collection",title:"Admin of Organizations",iterator:"adminof",open:!1,base:"/organizations",fields:{name:{key:!0,
label:"Name"},description:{label:"Description"}}},organizations:{type:"collection",title:"Organizations",iterator:"organization",open:!1,fields:{name:{key:!0,label:"Name"},description:{label:"Description"}}},teams:{type:"collection",title:"Teams",iterator:"team",open:!1,fields:{name:{key:!0,label:"Name"},description:{label:"Description"}}},projects:{type:"collection",title:"Projects",iterator:"project",open:!1,fields:{name:{key:!0,label:"Name"},description:{label:"Description"}}}}});angular.module("AccessHelper",["RestServices","Utilities","ngCookies"]).factory("CheckAccess",["$rootScope","Alert","Rest","GetBasePath","ProcessErrors",function(l,m,h,g,c){return function(g){var f=l.current_user,e=!1;f.is_superuser?e=!0:f.related.admin_of_organizations&&(h.setUrl(f.related.admin_of_organizations),h.get().success(function(c,a,d,b){0<c.results.length&&(e=!0)}).error(function(e,a,d,b){c(scope,e,a,null,{hdr:"Error!",msg:"Call to "+f.related.admin_of_organizations+" failed. DELETE returned status: "+
a})}));e||m("Access Denied","You do not have access to this function. Please contact your system administrator.");return e}}]).factory("CheckLicense",["$rootScope","$cookieStore","Alert","$location","Authorization",function(l,m,h,g,c){return function(){var g=m.get("license");g&&!c.licenseTested()&&(g.tested=!0,m.remove("license"),m.put("license",g),l.license_tested=!0,void 0!==g.valid_key&&!1==g.valid_key?h("License Error",'Something is wrong with your /etc/awx/license file on this server. Please contact <a href="mailto:info@ansibleworks.com">info@ansibleworks.com</a> for assistance.',
label:"Name"},description:{label:"Description"}}},organizations:{type:"collection",title:"Organizations",iterator:"organization",open:!1,fields:{name:{key:!0,label:"Name"},description:{label:"Description"}}},teams:{type:"collection",title:"Teams",iterator:"team",open:!1,fields:{name:{key:!0,label:"Name"},description:{label:"Description"}}},projects:{type:"collection",title:"Projects",iterator:"project",open:!1,fields:{name:{key:!0,label:"Name"},description:{label:"Description"}}}}});angular.module("AccessHelper",["RestServices","Utilities","ngCookies"]).factory("CheckAccess",["$rootScope","Alert","Rest","GetBasePath","ProcessErrors",function(k,m,h,g,c){return function(g){var f=k.current_user,e=!1;f.is_superuser?e=!0:f.related.admin_of_organizations&&(h.setUrl(f.related.admin_of_organizations),h.get().success(function(c,a,d,b){0<c.results.length&&(e=!0)}).error(function(e,a,d,b){c(scope,e,a,null,{hdr:"Error!",msg:"Call to "+f.related.admin_of_organizations+" failed. DELETE returned status: "+
a})}));e||m("Access Denied","You do not have access to this function. Please contact your system administrator.");return e}}]).factory("CheckLicense",["$rootScope","$cookieStore","Alert","$location","Authorization",function(k,m,h,g,c){return function(){var g=m.get("license");g&&!c.licenseTested()&&(g.tested=!0,m.remove("license"),m.put("license",g),k.license_tested=!0,void 0!==g.valid_key&&!1==g.valid_key?h("License Error",'Something is wrong with your /etc/awx/license file on this server. Please contact <a href="mailto:info@ansibleworks.com">info@ansibleworks.com</a> for assistance.',
"alert-error",null,!1,!0):void 0!==g.demo&&!0==g.demo&&h("AWX Demo",'Thank you for trying AnsibleWorks AWX. You can use this edition to manage up to 5 hosts. Should you wish to acquire a license for additional servers, please visit <a href="http://ansibleworks.com/ansibleworks-awx" target="_blank"><strong>ansibleworks.com/ansibleworks-awx</strong></a>, or contact <a href="mailto:info@ansibleworks.com"><strong>info@ansibleworks.com</strong></a> for assistance.',"alert-info"),void 0!==g.date_warning&&
!0==g.date_warning&&h("License Expired",'Your AnsibleWorks AWX License has expired and is no longer compliant. You can continue, but you will be unable to add any additional hosts. Please visit <a href="http://ansibleworks.com/ansibleworks-awx" target="_blank"><strong>ansibleworks.com/ansibleworks-awx</strong></a> for license and renewal information, or contact <a href="mailto:info@ansibleworks.com"><strong>info@ansibleworks.com</strong></a> for assistance.',"alert-info"),void 0!==g.free_instances&&
0>=parseInt(g.free_instances)&&h("License Warning",'Your AnsibleWorks AWX License has reached capacity for the number of managed hosts allowed. You will not be able to add any additional hosts. To extend your license, please visit <a href="http://ansibleworks.com/ansibleworks-awx" target="_blank"><strong>ansibleworks.com/ansibleworks-awx.</strong></a>, or contact <a href="mailto:info@ansibleworks.com"><strong>info@ansibleworks.com</strong></a> for more information.',"alert-info",null,!0))}}]);angular.module("APIDefaults",["RestServices","Utilities"]).factory("GetAPIDefaults",["Alert","Rest","$rootScope",function(l,m,h){return function(g){function c(c){var a={};for(id in h.apiDefaults)if(id==c||id.iterator==c){a[id]=defaults[id];break}return a}function l(){if(f=={}&&5>e)e++,setTimeout(1E3,l());else if("success"==f.status)return c(g)}var f={},e=0;return null==h.apiDefaults||void 0==h.apiDefaults?(f={},m.setUrl("/api/v1"),m.get().success(function(c,a,d,b){defaults=c;for(var e in defaults)switch(e){case "organizations":dafaults[e].iterator=
"organization";break;case "jobs":defaults[e].iterator="job";break;case "users":defaults[e].iterator="user";break;case "teams":defaults[e].iterator="team";break;case "hosts":defaults[e].iterator="host";break;case "groups":defaults[e].iterator="group";break;case "projects":defaults[e].iterator="project"}h.apiDefaults=defaults;f={status:"success"}}).error(function(c,a,d,b){f={status:"error",msg:"Call to /api/v1 failed. GET returned status: "+a}}),l()):c(g)}}]);angular.module("ChildrenHelper",["RestServices","Utilities"]).factory("ToggleChildren",["Alert","Rest","GetBasePath","ProcessErrors","FormatDate",function(l,m,h,g,c){return function(c){function f(b){a[b].ngicon="icon-collapse-alt";for(var d=b+1;d<a.length;d++)a[d].parent==a[b].id&&(a[d].show=!0)}function e(b){a[b].ngicon="icon-expand-alt";for(var d=b+1;d<a.length;d++)a[d].parent==a[b].id&&(a[d].show=!1,a[d].related.children&&e(d))}var k=c.id,a=c.scope[c.list.name],d;c=!1;for(var b=0;b<a.length&&!1==
c;b++)a[b].id==k&&(d=b,c=!0);"icon-expand-alt"==a[d].ngicon?f(d):e(d)}}]);angular.module("EventsHelper",["RestServices","Utilities","JobEventFormDefinition"]).factory("EventView",["$rootScope","$location","$log","$routeParams","Rest","Alert","JobEventForm","GenerateForm","Prompt","ProcessErrors","GetBasePath","FormatDate",function(l,m,h,g,c,p,f,e,k,a,d,b){return function(k){var g=k.event_id;k=d("base")+"job_events/"+g+"/";var l=e.inject(f,{mode:"edit",modal:!0,related:!1});e.reset();l.formModalAction=function(){$("#form-modal").modal("hide")};l.formModalActionLabel="OK";
l.formModalHeader="View Event";l.formModalCancelShow=!1;$("#form-modal .btn-success").removeClass("btn-success").addClass("btn-none");c.setUrl(k);c.get().success(function(a,d,c,e){for(var k in f.fields)"status"==k?l.status=a.failed?"error":"success":"event_data"==k?l.event_data=JSON.stringify(a.event_data,void 0,"\t"):"host"==k?a.summary_fields&&a.summary_fields.host&&(l.host=a.summary_fields.host.name):"event_display"==k?l.event_display=a.event_display.replace(/^\u00a0*/g,""):"created"==k?l.created=
b(new Date(a.created)):a[k]&&(l[k]=a[k])}).error(function(b,d,c,e){a(l,b,d,f,{hdr:"Error!",msg:"Failed to retrieve host: "+g+". GET status: "+d})});l.$$phase||l.$digest()}}]);angular.module("GroupsHelper","RestServices Utilities ListGenerator GroupListDefinition SearchHelper PaginateHelper ListGenerator AuthService GroupsHelper InventoryHelper".split(" ")).factory("GroupsList",["$rootScope","$location","$log","$routeParams","Rest","Alert","GroupList","GenerateList","Prompt","SearchInit","PaginateInit","ProcessErrors","GetBasePath","GroupsAdd","RefreshTree",function(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A){return function(b){var k=b.inventory_id,l=void 0!==b.group_id?b.group_id:
null;b=y("inventory")+k+"/groups/";var h=e.inject(f,{id:"form-modal-body",mode:"select",breadCrumbs:!1,selectButton:!1});h.formModalActionLabel="Select";h.formModalHeader="Add Groups";h.formModalCancelShow=!0;h.formModalActionClass="btn btn-success";$("#form-modal .btn-none").removeClass("btn-none").addClass("btn-success");$("#form-modal").modal({backdrop:"static",keyboard:!1});h.selected=[];h.PostRefreshRemove&&h.PostRefreshRemove();h.PostRefreshRemove=h.$on("PostRefresh",function(){$("tr.success").each(function(a){a=
$(this).attr("ng-class");h[a]=""});if(g.group_id)for(var a=0;a<h.groups.length;a++)h.groups[a].id==g.group_id&&h.groups.splice(a,1)});a({scope:h,set:"groups",list:f,url:b});d({scope:h,list:f,url:b,mode:"lookup"});h.search(f.iterator);h.$$phase||h.$digest();h.formModalAction=function(){var a=l?y("groups")+l+"/children/":y("inventory")+k+"/groups/";c.setUrl(a);h.queue=[];h.callFinishedRemove&&h.callFinishedRemove();h.callFinishedRemove=h.$on("callFinished",function(){if(h.queue.length==h.selected.length){$('input[type="checkbox"]').prop("checked",
0>=parseInt(g.free_instances)&&h("License Warning",'Your AnsibleWorks AWX License has reached capacity for the number of managed hosts allowed. You will not be able to add any additional hosts. To extend your license, please visit <a href="http://ansibleworks.com/ansibleworks-awx" target="_blank"><strong>ansibleworks.com/ansibleworks-awx.</strong></a>, or contact <a href="mailto:info@ansibleworks.com"><strong>info@ansibleworks.com</strong></a> for more information.',"alert-info",null,!0))}}]);angular.module("APIDefaults",["RestServices","Utilities"]).factory("GetAPIDefaults",["Alert","Rest","$rootScope",function(k,m,h){return function(g){function c(c){var a={};for(id in h.apiDefaults)if(id==c||id.iterator==c){a[id]=defaults[id];break}return a}function k(){if(f=={}&&5>e)e++,setTimeout(1E3,k());else if("success"==f.status)return c(g)}var f={},e=0;return null==h.apiDefaults||void 0==h.apiDefaults?(f={},m.setUrl("/api/v1"),m.get().success(function(c,a,d,b){defaults=c;for(var e in defaults)switch(e){case "organizations":dafaults[e].iterator=
"organization";break;case "jobs":defaults[e].iterator="job";break;case "users":defaults[e].iterator="user";break;case "teams":defaults[e].iterator="team";break;case "hosts":defaults[e].iterator="host";break;case "groups":defaults[e].iterator="group";break;case "projects":defaults[e].iterator="project"}h.apiDefaults=defaults;f={status:"success"}}).error(function(c,a,d,b){f={status:"error",msg:"Call to /api/v1 failed. GET returned status: "+a}}),k()):c(g)}}]);angular.module("ChildrenHelper",["RestServices","Utilities"]).factory("ToggleChildren",["Alert","Rest","GetBasePath","ProcessErrors","FormatDate",function(k,m,h,g,c){return function(c){function f(b){a[b].ngicon="icon-collapse-alt";for(var d=b+1;d<a.length;d++)a[d].parent==a[b].id&&(a[d].show=!0)}function e(b){a[b].ngicon="icon-expand-alt";for(var d=b+1;d<a.length;d++)a[d].parent==a[b].id&&(a[d].show=!1,a[d].related.children&&e(d))}var l=c.id,a=c.scope[c.list.name],d;c=!1;for(var b=0;b<a.length&&!1==
c;b++)a[b].id==l&&(d=b,c=!0);"icon-expand-alt"==a[d].ngicon?f(d):e(d)}}]);angular.module("EventsHelper",["RestServices","Utilities","JobEventFormDefinition"]).factory("EventView",["$rootScope","$location","$log","$routeParams","Rest","Alert","JobEventForm","GenerateForm","Prompt","ProcessErrors","GetBasePath","FormatDate",function(k,m,h,g,c,p,f,e,l,a,d,b){return function(l){var g=l.event_id;l=d("base")+"job_events/"+g+"/";var k=e.inject(f,{mode:"edit",modal:!0,related:!1});e.reset();k.formModalAction=function(){$("#form-modal").modal("hide")};k.formModalActionLabel="OK";
k.formModalHeader="View Event";k.formModalCancelShow=!1;$("#form-modal .btn-success").removeClass("btn-success").addClass("btn-none");c.setUrl(l);c.get().success(function(a,d,c,e){for(var l in f.fields)"status"==l?k.status=a.failed?"error":"success":"event_data"==l?k.event_data=JSON.stringify(a.event_data,void 0,"\t"):"host"==l?a.summary_fields&&a.summary_fields.host&&(k.host=a.summary_fields.host.name):"event_display"==l?k.event_display=a.event_display.replace(/^\u00a0*/g,""):"created"==l?k.created=
b(new Date(a.created)):a[l]&&(k[l]=a[l])}).error(function(b,d,c,e){a(k,b,d,f,{hdr:"Error!",msg:"Failed to retrieve host: "+g+". GET status: "+d})});k.$$phase||k.$digest()}}]);angular.module("GroupsHelper","RestServices Utilities ListGenerator GroupListDefinition SearchHelper PaginateHelper ListGenerator AuthService GroupsHelper InventoryHelper".split(" ")).factory("GroupsList",["$rootScope","$location","$log","$routeParams","Rest","Alert","GroupList","GenerateList","Prompt","SearchInit","PaginateInit","ProcessErrors","GetBasePath","GroupsAdd","RefreshTree",function(k,m,h,g,c,p,f,e,l,a,d,b,y,v,A){return function(b){var l=b.inventory_id,k=void 0!==b.group_id?b.group_id:
null;b=y("inventory")+l+"/groups/";var h=e.inject(f,{id:"form-modal-body",mode:"select",breadCrumbs:!1,selectButton:!1});h.formModalActionLabel="Select";h.formModalHeader="Add Groups";h.formModalCancelShow=!0;h.formModalActionClass="btn btn-success";$("#form-modal .btn-none").removeClass("btn-none").addClass("btn-success");$("#form-modal").modal({backdrop:"static",keyboard:!1});h.selected=[];h.PostRefreshRemove&&h.PostRefreshRemove();h.PostRefreshRemove=h.$on("PostRefresh",function(){$("tr.success").each(function(a){a=
$(this).attr("ng-class");h[a]=""});if(g.group_id)for(var a=0;a<h.groups.length;a++)h.groups[a].id==g.group_id&&h.groups.splice(a,1)});a({scope:h,set:"groups",list:f,url:b});d({scope:h,list:f,url:b,mode:"lookup"});h.search(f.iterator);h.$$phase||h.$digest();h.formModalAction=function(){var a=k?y("groups")+k+"/children/":y("inventory")+l+"/groups/";c.setUrl(a);h.queue=[];h.callFinishedRemove&&h.callFinishedRemove();h.callFinishedRemove=h.$on("callFinished",function(){if(h.queue.length==h.selected.length){$('input[type="checkbox"]').prop("checked",
!1);h.selected=[];for(var a=0,b=0;b<h.queue.length;b++)"error"==h.queue[b].result&&a++;0<a?p("Error","There was an error while adding one or more of the selected groups."):($("#form-modal").modal("hide"),A({scope:h}))}});if(0<h.selected.length)for(var b=0;b<h.selected.length;b++){for(var a=null,d=0;d<h.groups.length;d++)h.groups[d].id==h.selected[b]&&(a=h.groups[d]);null!==a&&c.post(a).success(function(a,b,d,c){h.queue.push({result:"success",data:a,status:b});h.$emit("callFinished")}).error(function(a,
b,d,c){h.queue.push({result:"error",data:a,status:b,headers:d});h.$emit("callFinished")})}else $("#form-modal").modal("hide")};h.toggle_group=function(a){"success"==h[f.iterator+"_"+a+"_class"]?(h[f.iterator+"_"+a+"_class"]="",document.getElementById("check_"+a).checked=!1,-1<h.selected.indexOf(a)&&h.selected.splice(h.selected.indexOf(a),1)):(h[f.iterator+"_"+a+"_class"]="success",document.getElementById("check_"+a).checked=!0,-1==h.selected.indexOf(a)&&h.selected.push(a))};h.createGroup=function(){$("#form-modal").modal("hide");
v({inventory_id:k,group_id:l})}}}]).factory("GroupsAdd",["$rootScope","$location","$log","$routeParams","Rest","Alert","GroupForm","GenerateForm","Prompt","ProcessErrors","GetBasePath","RefreshTree","ParseTypeChange",function(l,m,h,g,c,p,f,e,k,a,d,b,y){return function(k){var g=k.inventory_id;k=void 0!==k.group_id?k.group_id:null;var h=null!==k?d("groups")+k+"/children/":d("inventory")+g+"/groups/",l=e.inject(f,{mode:"add",modal:!0,related:!1});l.formModalActionLabel="Save";l.formModalHeader="Create Group";
l.formModalCancelShow=!0;l.parseType="yaml";y(l);$("#form-modal .btn-none").removeClass("btn-none").addClass("btn-success");e.reset();l.$$phase||l.$digest();l.formModalAction=function(){try{var d="json"==l.parseType?JSON.parse(l.variables):jsyaml.load(l.variables);if("object"!==typeof d)throw"failed to return an object!";var e={},k;for(k in f.fields)"variables"!=k&&(e[k]=l[k]);g&&(e.inventory=g);c.setUrl(h);c.post(e).success(function(e,k,n,g){l.variables?(c.setUrl(e.related.variable_data),c.put(d).success(function(a,
d,c,e){$("#form-modal").modal("hide");b({scope:l})}).error(function(b,d,c,e){a(l,b,d,f,{hdr:"Error!",msg:"Failed to add group varaibles. PUT returned status: "+d})})):($("#form-modal").modal("hide"),b({scope:l}))}).error(function(b,d,c,e){a(l,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)}};l.formReset=function(){e.reset()}}}]).factory("GroupsEdit",["$rootScope","$location","$log","$routeParams",
"Rest","Alert","GroupForm","GenerateForm","Prompt","ProcessErrors","GetBasePath","RefreshTree","ParseTypeChange",function(l,m,h,g,c,p,f,e,k,a,d,b,y){return function(k){var h=k.group_id,l=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";y(t);$("#form-modal .btn-none").removeClass("btn-none").addClass("btn-success");t.groupLoadedRemove&&t.groupLoadedRemove();
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";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 k in f.related)b[k]&&(n[k]={url:b[k],iterator:f.related[k].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 k={},n;for(n in f.fields)k[n]=t[n];k.inventory=
l;c.setUrl(m);c.put(k).success(function(k,n,g,h){t.variables?(c.setUrl(d("groups")+k.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(l,m,h,g,c,p,f,e,k,a,d){return function(b){var e=b.scope,f=b.group_id;b=b.inventory_id;var k=$('#tree-view li[group_id="'+f+'"]'),g="LI"==k.parent().last().prop("tagName")?k.parent().last():k.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 "+$(k).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",k)}).error(function(b,d,c,k){$("#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(l,m,h,g,c,p,f,e,k,a,d,b,y,v,A){return function(b){var k=
b.inventory_id,g=b.group_id;f.iterator="subhost";f.name="subhosts";var h=y("inventory")+k+"/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)});$("#form-modal .btn-none").removeClass("btn-none").addClass("btn-success");$("#form-modal").modal({backdrop:"static",keyboard:!1});
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+'"]'),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,l){$("#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)});$("#form-modal .btn-none").removeClass("btn-none").addClass("btn-success");$("#form-modal").modal({backdrop:"static",keyboard:!1});
n.selected=[];n.PostRefreshRemove&&n.PostRefreshRemove();n.PostRefreshRemove=n.$on("PostRefresh",function(){$("tr.success").each(function(a){a=$(this).attr("ng-class");n[a]=""})});a({scope:n,set:"subhosts",list:f,url:h});d({scope:n,list:f,url:h,mode:"lookup"});n.search(f.iterator);n.$$phase||n.$digest();n.formModalAction=function(){var a=y("groups")+g+"/hosts/";c.setUrl(a);n.queue=[];n.callFinishedRemove&&n.callFinishedRemove();n.callFinishedRemove=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&&p("Error","There was an error while adding one or more of the selected hosts.");$("#form-modal").modal("hide");n.$emit("hostsReload")}});if(0<n.selected.length)for(var b=0;b<n.selected.length;b++){for(var a=null,d=0;d<n.subhosts.length;d++)n.subhosts[d].id==n.selected[b]&&(a=n.subhosts[d]);null!==a&&c.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 $("#form-modal").modal("hide"),n.$emit("hostsReload")};n.toggle_subhost=function(a){"success"==n[f.iterator+"_"+a+"_class"]?(n[f.iterator+"_"+a+"_class"]="",document.getElementById("check_"+a).checked=!1,-1<n.selected.indexOf(a)&&n.selected.splice(n.selected.indexOf(a),1)):(n[f.iterator+"_"+a+"_class"]="success",document.getElementById("check_"+
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:k,group_id:g})}}}]).factory("HostsAdd",["$rootScope","$location","$log","$routeParams","Rest","Alert","HostForm","GenerateForm","Prompt","ProcessErrors","GetBasePath","HostsReload","ParseTypeChange",function(l,m,h,g,c,p,f,e,k,a,d,b,y){return function(k){var g=k.inventory_id,h=void 0!==k.group_id?k.group_id:null,l=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(k)});$("#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(l);c.post(d).success(function(d,e,k,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(k){p("Error","Error parsing host variables. Parser returned: "+k)}};m.formReset=function(){e.reset()}}}]).factory("HostsEdit",["$rootScope","$location","$log","$routeParams","Rest","Alert","HostForm","GenerateForm","Prompt","ProcessErrors","GetBasePath","HostsReload","ParseTypeChange",function(l,m,h,g,c,p,f,e,k,a,d,b,y){return function(k){var g=k.host_id,h=k.inventory_id,l=d("hosts")+g+"/",m=e.inject(f,{mode:"edit",modal:!0,related:!1});e.reset();var r={};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(k)});$("#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(l);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 k 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={},k;for(k in f.fields)e[k]=m[k];e.inventory=h;c.setUrl(l);c.put(e).success(function(e,k,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(l,m,h,g,c,p,f,e,k,a){return function(d){var b=
d.scope,f=d.inventory_id,g=d.host_id,h=d.host_name,l=null!==b.group_id?k("groups")+b.group_id+"/hosts/":k("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(l);c.post({id:g,disassociate:1}).success(function(a,d,c,e){$("#prompt-modal").modal("hide");b.$emit("hostsReload")}).error(function(a,d,c,k){$("#prompt-modal").modal("hide");b.$emit("hostsReload");e(b,a,d,null,{hdr:"Error!",msg:"Call to "+l+" failed. DELETE returned status: "+d})})};$("#prompt-modal").modal({backdrop:"static",keyboard:!0,show:!0})}}]).factory("HostsReload",["RelatedSearchInit","RelatedPaginateInit",
"InventoryForm","GetBasePath",function(l,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"}};l({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(l,m,h,g){return function(c){var g=c.scope,f=c.inventory,e=f.related.root_groups,k=f.related.hosts,a=f.name,d=f.url,b=f.id,h=f.description,v=0,A=[];g.HostLoadedRemove&&g.HostLoadedRemove();g.HostLoadedRemove=
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";
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=
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.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=
g.$on("hostsLoaded",function(){m.setUrl(e+"?"+(g.inventoryFailureFilter?"has_active_failures__int=1&":"")+"order_by=name");m.get().success(function(a,b,d,c){for(b=0;b<a.results.length;b++)A[0].children.push({data:{title:a.results[b].name},attr:{id:v,group_id:a.results[b].id,type:"group",name:a.results[b].name,description:a.results[b].description,inventory:a.results[b].inventory,all:a.results[b].related.all_hosts,children:a.results[b].related.children,hosts:a.results[b].related.hosts,variable:a.results[b].related.variable_data,
"data-failures":a.results[b].has_active_failures},state:"closed"}),v++;g.$emit("buildTree",A,v)}).error(function(a,b,d,c){l("Error","Failed to laod tree data. Url: "+e+" GET status: "+b)})});m.setUrl(k+"?order_by=name");m.get().success(function(c,e,l,m){A=[{data:{title:a},attr:{type:"inventory",id:"inventory-node",url:d,inventory_id:b,hosts:k,name:a,description:h,"data-failures":f.has_active_failures},state:"open",children:[]}];g.$emit("hostsLoaded")}).error(function(a,b,d,c){l("Error","Failed to laod tree data. Url: "+
k+" GET status: "+b)})}}]).factory("TreeInit",["Alert","Rest","Authorization","$http","LoadTreeData",function(l,m,h,g,c){return function(g){var f=g.scope;f.buildTreeRemove&&f.buildTreeRemove();f.buildTreeRemove=f.$on("buildTree",function(c,k,a){var d=a;$("#tree-view").jstree({core:{initially_open:["inventory-node"]},plugins:["themes","json_data","ui","contextmenu"],themes:{theme:"ansible",dots:!1,icons:!0},ui:{initially_select:["inventory-node"]},json_data:{data:k,ajax:{url:function(a){f.selected_node=
a;return $(a).attr("children")},headers:{Authorization:"Token "+h.getToken()},success:function(a){for(var c=[],e=f.inventoryFailureFilter?"has_active_failures__int=1&":"",k=0;k<a.results.length;k++)c.push({data:{title:a.results[k].name},attr:{id:d,group_id:a.results[k].id,type:"group",name:a.results[k].name,description:a.results[k].description,inventory:a.results[k].inventory,all:a.results[k].related.all_hosts,children:a.results[k].related.children+"?"+e+"order_by=name",hosts:a.results[k].related.hosts,
variable:a.results[k].related.variable_data,"data-failures":a.results[k].has_active_failures},state:"closed"}),d++;return c}}},contextmenu:{items:f.treeController}});$("#tree-view").bind("loaded.jstree",function(){f.$emit("treeLoaded")});$("#tree-view").bind("select_node.jstree",function(a,d){f.$emit("NodeSelect",d.inst.get_json()[0])})});c(g)}}]).factory("LoadInventory",["$routeParams","Alert","Rest","Authorization","$http","ProcessErrors","RelatedSearchInit","RelatedPaginateInit","GetBasePath",
"LoadBreadCrumbs","InventoryForm",function(l,m,h,g,c,p,f,e,k,a,d){return function(b){var c=b.scope;c.relatedSets=[];c.master={};h.setUrl(k("inventory")+l.id+"/");h.get().success(function(b,k,g,h){a({path:"/inventories/"+l.id,title:b.name});for(var m in d.fields)d.fields[m].realName?b[d.fields[m].realName]&&(c[m]=b[d.fields[m].realName],c.master[m]=c[m]):b[m]&&(c[m]=b[m],c.master[m]=c[m]),"lookup"==d.fields[m].type&&b.summary_fields[d.fields[m].sourceModel]&&(c[d.fields[m].sourceModel+"_"+d.fields[m].sourceField]=
b.summary_fields[d.fields[m].sourceModel][d.fields[m].sourceField],c.master[d.fields[m].sourceModel+"_"+d.fields[m].sourceField]=c[d.fields[m].sourceModel+"_"+d.fields[m].sourceField]);c.TreeParams={scope:c,inventory:b};c.variable_url=b.related.variable_data;c.relatedSets.hosts={url:b.related.hosts,iterator:"host"};f({scope:c,form:d,relatedSets:c.relatedSets});e({scope:c,relatedSets:c.relatedSets});c.$emit("inventoryLoaded")}).error(function(a,b,e,k){p(c,a,b,d,{hdr:"Error!",msg:"Failed to retrieve inventory: "+
l.id+". GET status: "+b})})}}]).factory("RefreshTree",["Alert","Rest","Authorization","$http","TreeInit","LoadInventory",function(l,m,h,g,c,p){return function(f){var e=f.scope,k=[],a;e.treeLoadedRemove&&e.treeLoadedRemove();e.treeLoadedRemove=e.$on("treeLoaded",function(){var d;0<k.length?(d=k.pop(),d=$('#tree-view li[id="'+d+'"]'),$.jstree._reference("#tree-view").open_node(d,function(){e.$emit("treeLoaded")},!0)):null!==a&&void 0!==a&&$('#tree-view li[id="'+a+'"] a').first().click()});e.inventoryLoadedRemove&&
e.inventoryLoadedRemove();e.inventoryLoadedRemove=e.$on("inventoryLoaded",function(){function d(a){"inventory-node"!=a.attr("id")&&("LI"==a.prop("tagName")&&(a.hasClass("jstree-open")||a.find(".jstree-clicked"))&&k.push(a.attr("id")),d(a.parent()))}a=e.selectedNode.attr("id");d(e.selectedNode);$("#tree-view").jstree("destroy");c(e.TreeParams)});p({scope:e})}}]);angular.module("JobTemplateHelper","RestServices Utilities CredentialFormDefinition CredentialsListDefinition LookUpHelper JobTemplateFormDefinition".split(" ")).factory("PromptPasswords",["CredentialForm","$compile","Rest","$location","ProcessErrors","GetBasePath",function(l,m,h,g,c,p){return function(f){function e(b){!b&&"jobs"==A?a.refreshJob():g.path("/"+A)}function k(){var b=p("jobs")+a.job_id+"/";h.setUrl(b);h.destroy().success(function(a,b,d,c){e(!0)}).error(function(d,e,k,f){c(a,d,e,null,
{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+e})})}var a=f.scope,d=f.passwords,b=f.start_url;f="";var y,v,A=g.path().replace(/^\//,"").split("/")[0];a.cancelJob=function(){$("#password-modal").modal("hide");k()};a.startJob=function(){$("#password-modal").modal("hide");var d={},k=!1;$(".password-field").each(function(a){d[$(this).attr("name")]=$(this).val();""!=$(this).val()&&null!==$(this).val()&&(k=!0)});k?(h.setUrl(b),h.post(d).success(function(a,b,d,c){e(!1)}).error(function(b,
d,e,k){c(a,b,d,null,{hdr:"Error!",msg:"Failed to start job. POST returned status: "+d})})):a.cancelJob()};f+=f+='<form class="form-horizontal" name="password_form" novalidate>\n';for(var u=0;u<d.length;u++)y=l.fields[d[u]],v=d[u],a[v]="",f+='<div class="control-group">\n',f+='<label class="control-label" for="'+v+'">'+y.label+"</label>\n",f+='<div class="controls">\n',f+='<input type="password" ',f+='ng-model="'+v+'" ',f+='name="'+v+'" ',f+='class="password-field" ',f+="required ",f+="/>",f+="<br />\n",
f+='<span class="error" ng-show="password_form.'+v+".$dirty && password_form."+v+'.$error.required">A value is required!</span>\n',f+='<span class="error api-error" ng-bind="'+v+'_api_error"></span>\n',f+="</div>\n",f+="</div>\n",v=y.associated,y=l.fields[y.associated],a[v]="",f+='<div class="control-group">\n',f+='<label class="control-label" for="'+v+'">'+y.label+"</label>\n",f+='<div class="controls">\n',f+='<input type="password" ',f+='ng-model="'+v+'" ',f+='name="'+v+'" ',f+="required ",f+=y.awPassMatch?
"data-failures":a.results[b].has_active_failures},state:"closed"}),v++;g.$emit("buildTree",A,v)}).error(function(a,b,d,c){k("Error","Failed to laod tree data. Url: "+e+" GET status: "+b)})});m.setUrl(l+"?order_by=name");m.get().success(function(c,e,k,m){A=[{data:{title:a},attr:{type:"inventory",id:"inventory-node",url:d,inventory_id:b,hosts:l,name:a,description:h,"data-failures":f.has_active_failures},state:"open",children:[]}];g.$emit("hostsLoaded")}).error(function(a,b,d,c){k("Error","Failed to laod tree data. Url: "+
l+" GET status: "+b)})}}]).factory("TreeInit",["Alert","Rest","Authorization","$http","LoadTreeData",function(k,m,h,g,c){return function(g){var f=g.scope;f.buildTreeRemove&&f.buildTreeRemove();f.buildTreeRemove=f.$on("buildTree",function(c,l,a){var d=a;$("#tree-view").jstree({core:{initially_open:["inventory-node"]},plugins:["themes","json_data","ui","contextmenu"],themes:{theme:"ansible",dots:!1,icons:!0},ui:{initially_select:["inventory-node"]},json_data:{data:l,ajax:{url:function(a){f.selected_node=
a;return $(a).attr("children")},headers:{Authorization:"Token "+h.getToken()},success:function(a){for(var c=[],e=f.inventoryFailureFilter?"has_active_failures__int=1&":"",l=0;l<a.results.length;l++)c.push({data:{title:a.results[l].name},attr:{id:d,group_id:a.results[l].id,type:"group",name:a.results[l].name,description:a.results[l].description,inventory:a.results[l].inventory,all:a.results[l].related.all_hosts,children:a.results[l].related.children+"?"+e+"order_by=name",hosts:a.results[l].related.hosts,
variable:a.results[l].related.variable_data,"data-failures":a.results[l].has_active_failures},state:"closed"}),d++;return c}}},contextmenu:{items:f.treeController}});$("#tree-view").bind("loaded.jstree",function(){f.$emit("treeLoaded")});$("#tree-view").bind("select_node.jstree",function(a,d){f.$emit("NodeSelect",d.inst.get_json()[0])})});c(g)}}]).factory("LoadInventory",["$routeParams","Alert","Rest","Authorization","$http","ProcessErrors","RelatedSearchInit","RelatedPaginateInit","GetBasePath",
"LoadBreadCrumbs","InventoryForm",function(k,m,h,g,c,p,f,e,l,a,d){return function(b){var c=b.scope;c.relatedSets=[];c.master={};h.setUrl(l("inventory")+k.id+"/");h.get().success(function(b,l,g,h){a({path:"/inventories/"+k.id,title:b.name});for(var m in d.fields)d.fields[m].realName?b[d.fields[m].realName]&&(c[m]=b[d.fields[m].realName],c.master[m]=c[m]):b[m]&&(c[m]=b[m],c.master[m]=c[m]),"lookup"==d.fields[m].type&&b.summary_fields[d.fields[m].sourceModel]&&(c[d.fields[m].sourceModel+"_"+d.fields[m].sourceField]=
b.summary_fields[d.fields[m].sourceModel][d.fields[m].sourceField],c.master[d.fields[m].sourceModel+"_"+d.fields[m].sourceField]=c[d.fields[m].sourceModel+"_"+d.fields[m].sourceField]);c.TreeParams={scope:c,inventory:b};c.variable_url=b.related.variable_data;c.relatedSets.hosts={url:b.related.hosts,iterator:"host"};f({scope:c,form:d,relatedSets:c.relatedSets});e({scope:c,relatedSets:c.relatedSets});c.$emit("inventoryLoaded")}).error(function(a,b,e,l){p(c,a,b,d,{hdr:"Error!",msg:"Failed to retrieve inventory: "+
k.id+". GET status: "+b})})}}]).factory("RefreshTree",["Alert","Rest","Authorization","$http","TreeInit","LoadInventory",function(k,m,h,g,c,p){return function(f){var e=f.scope,l=[],a;e.treeLoadedRemove&&e.treeLoadedRemove();e.treeLoadedRemove=e.$on("treeLoaded",function(){var d;0<l.length?(d=l.pop(),d=$('#tree-view li[id="'+d+'"]'),$.jstree._reference("#tree-view").open_node(d,function(){e.$emit("treeLoaded")},!0)):null!==a&&void 0!==a&&$('#tree-view li[id="'+a+'"] a').first().click()});e.inventoryLoadedRemove&&
e.inventoryLoadedRemove();e.inventoryLoadedRemove=e.$on("inventoryLoaded",function(){function d(a){"inventory-node"!=a.attr("id")&&("LI"==a.prop("tagName")&&(a.hasClass("jstree-open")||a.find(".jstree-clicked"))&&l.push(a.attr("id")),d(a.parent()))}a=e.selectedNode.attr("id");d(e.selectedNode);$("#tree-view").jstree("destroy");c(e.TreeParams)});p({scope:e})}}]);angular.module("JobTemplateHelper","RestServices Utilities CredentialFormDefinition CredentialsListDefinition LookUpHelper JobTemplateFormDefinition".split(" ")).factory("PromptPasswords",["CredentialForm","$compile","Rest","$location","ProcessErrors","GetBasePath",function(k,m,h,g,c,p){return function(f){function e(b){!b&&"jobs"==A?a.refreshJob():g.path("/"+A)}function l(){var b=p("jobs")+a.job_id+"/";h.setUrl(b);h.destroy().success(function(a,b,d,c){e(!0)}).error(function(d,e,l,f){c(a,d,e,null,
{hdr:"Error!",msg:"Call to "+b+" failed. DELETE returned status: "+e})})}var a=f.scope,d=f.passwords,b=f.start_url;f="";var y,v,A=g.path().replace(/^\//,"").split("/")[0];a.cancelJob=function(){$("#password-modal").modal("hide");l()};a.startJob=function(){$("#password-modal").modal("hide");var d={},l=!1;$(".password-field").each(function(a){d[$(this).attr("name")]=$(this).val();""!=$(this).val()&&null!==$(this).val()&&(l=!0)});l?(h.setUrl(b),h.post(d).success(function(a,b,d,c){e(!1)}).error(function(b,
d,e,l){c(a,b,d,null,{hdr:"Error!",msg:"Failed to start job. POST returned status: "+d})})):a.cancelJob()};f+=f+='<form class="form-horizontal" name="password_form" novalidate>\n';for(var u=0;u<d.length;u++)y=k.fields[d[u]],v=d[u],a[v]="",f+='<div class="control-group">\n',f+='<label class="control-label" for="'+v+'">'+y.label+"</label>\n",f+='<div class="controls">\n',f+='<input type="password" ',f+='ng-model="'+v+'" ',f+='name="'+v+'" ',f+='class="password-field" ',f+="required ",f+="/>",f+="<br />\n",
f+='<span class="error" ng-show="password_form.'+v+".$dirty && password_form."+v+'.$error.required">A value is required!</span>\n',f+='<span class="error api-error" ng-bind="'+v+'_api_error"></span>\n',f+="</div>\n",f+="</div>\n",v=y.associated,y=k.fields[y.associated],a[v]="",f+='<div class="control-group">\n',f+='<label class="control-label" for="'+v+'">'+y.label+"</label>\n",f+='<div class="controls">\n',f+='<input type="password" ',f+='ng-model="'+v+'" ',f+='name="'+v+'" ',f+="required ",f+=y.awPassMatch?
'awpassmatch="'+y.associated+'" ':"",f+="/>",f+="<br />\n",f+='<span class="error" ng-show="password_form.'+v+".$dirty && password_form."+v+'.$error.required">A value is required!</span>\n',y.awPassMatch&&(f+='<span class="error" ng-show="password_form.'+v+'.$error.awpassmatch">Must match Password value</span>\n'),f+='<span class="error api-error" ng-bind="'+v+'_api_error"></span>\n',f+="</div>\n",f+="</div>\n";f+="</form>\n";d=angular.element(document.getElementById("password-body"));d.html(f);m(d.contents())(a);
$("#password-modal").modal({})}}]).factory("SubmitJob",["PromptPasswords","$compile","Rest","$location","GetBasePath","CredentialList","LookUpInit","JobTemplateForm","ProcessErrors",function(l,m,h,g,c,p,f,e,k){return function(a){function d(a){b.credentialWatchRemove&&b.credentialWatchRemove();var d=(new Date).toISOString(),c=v?v:a.name;h.setUrl(a.related.jobs?a.related.jobs:a.related.job_template+"jobs/");h.post({name:c+" "+d,description:a.description,job_template:a.id,inventory:a.inventory,project:a.project,
playbook:a.playbook,credential:a.credential,forks:a.forks,limit:a.limit,verbosity:a.verbosity,extra_vars:a.extra_vars}).success(function(a,d,c,e){b.job_id=a.id;0<a.passwords_needed_to_start.length?l({scope:b,passwords:a.passwords_needed_to_start,start_url:a.related.start}):(h.setUrl(a.related.start),h.post().success(function(a,d,c,e){"jobs"==g.path().replace(/^\//,"").split("/")[0]?b.refreshJob():g.path("/jobs")}).error(function(a,d,c,e){k(b,a,d,null,{hdr:"Error!",msg:"Failed to start job. POST returned status: "+
d})}))}).error(function(a,d,c,e){k(b,a,d,null,{hdr:"Error!",msg:"Failed to create job. POST returned status: "+d})})}var b=a.scope,m=a.id,v=a.template?a.template:null;a=g.path().replace(/^\//,"").split("/")[0];m=c(a)+m+"/";h.setUrl(m);h.get().success(function(a,c,k,g){b.credential="";""==a.credential||null==a.credential?(b.credentialWatchRemove&&b.credentialWatchRemove(),b.credentialWatchRemove=b.$watch("credential",function(c,e){c!==e&&(""!=b.credential&&null!==b.credential&&void 0!==b.credential)&&
(a.credential=b.credential,d(a))}),f({scope:b,form:e,current_item:null,list:p,field:"credential",hdr:"Credential Required"}),b.lookUpCredential()):d(a)}).error(function(a,d,c,e){k(b,a,d,null,{hdr:"Error!",msg:"Failed to get job template details. GET returned status: "+d})})}}]);angular.module("LookUpHelper","RestServices Utilities SearchHelper PaginateHelper ListGenerator ApiLoader".split(" ")).factory("LookUpInit",["Alert","Rest","GenerateList","SearchInit","PaginateInit","GetBasePath",function(l,m,h,g,c,p){return function(f){var e=f.scope,k=f.form,a=f.current_item,d=f.list,b=f.field,m=f.postAction,v=d.iterator.charAt(0).toUpperCase()+d.iterator.substring(1),A="inventories"==d.name?p("inventory"):p(d.name),u=f.hdr?f.hdr:"Select "+v;$('input[name="'+k.fields[b].sourceModel+
"_"+k.fields[b].sourceField+'"]').attr("data-url",A+"?"+k.fields[b].sourceField+"__iexact=:value");$('input[name="'+k.fields[b].sourceModel+"_"+k.fields[b].sourceField+'"]').attr("data-source",b);e["lookUp"+v]=function(){var f=h.inject(d,{mode:"lookup",hdr:u});f.selectAction=function(){for(var a=!1,c=0;c<f[d.name].length;c++)"success"==f[d.iterator+"_"+f[d.name][c].id+"_class"]&&(a=!0,e[b]=f[d.name][c].id,e[k.name+"_form"]&&(k.fields[b]&&k.fields[b].sourceModel)&&(e[k.fields[b].sourceModel+"_"+k.fields[b].sourceField]=
f[d.name][c][k.fields[b].sourceField],e[k.name+"_form"][k.fields[b].sourceModel+"_"+k.fields[b].sourceField]&&e[k.name+"_form"][k.fields[b].sourceModel+"_"+k.fields[b].sourceField].$setValidity("awlookup",!0)),e[k.name+"_form"]&&e[k.name+"_form"].$setDirty(),h.hide());!1==a?l("Missing Selection","Oops, you failed to make a selection. Click on a row to make your selection, and then click the Select button."):m&&m()};f["toggle_"+d.iterator]=function(a){if(f[d.name])for(var b=0;b<f[d.name].length;b++)f[d.iterator+
"_"+f[d.name][b].id+"_class"]="";null!=a&&void 0!=a&&(f[d.iterator+"_"+a+"_class"]="success")};g({scope:f,set:d.name,list:d,url:A});c({scope:f,list:d,url:A,mode:"lookup"});f.search(d.iterator);if(a)f["toggle_"+d.iterator](a)}}}]);angular.module("md5Helper",["RestServices","Utilities"]).factory("md5Setup",["Alert","Rest","GetBasePath","ProcessErrors",function(l,m,h,g){return function(c){var g=c.scope,f=c.master,e=c.check_field;c=c.default_val;g[e]=c;f[e]=c;g.genMD5=function(c){g[c]=$.md5("AnsibleWorks"+(new Date).getTime())};g.toggleCallback=function(c){"false"==g.allow_callbacks&&(g[c]=null)};g.selectAll=function(c){$('input[name="'+c+'"]').focus().select()}}}]);angular.module("PaginateHelper",["RefreshHelper","ngCookies"]).factory("PaginateInit",["Refresh","$cookieStore",function(l,m){return function(h){var g=h.scope,c=h.list,c=h.iterator?h.iterator:c.iterator,p=h.url,f=h.mode?h.mode:null,e=m.get(c+"PageSize");g[c+"Page"]=0;g[c+"PageSize"]=e&&"lookup"!=f?e:h.pageSize?h.pageSize:"lookup"==f?5:20;g.nextSet=function(c,a){g[a+"NextUrl"]&&(g[a+"Page"]++,l({scope:g,set:c,iterator:a,url:g[a+"NextUrl"]}))};g.prevSet=function(c,a){g[a+"PrevUrl"]&&(g[a+"Page"]--,
l({scope:g,set:c,iterator:a,url:g[a+"PrevUrl"]}))};g.changePageSize=function(c,a){m.put(a+"PageSize",g[a+"PageSize"]);g[a+"Page"]=0;var d=p.replace(/\?page_size\=\d+/,""),b=/\/$/.test(d)?"?":"&",d=d+(g[a+"SearchParams"]?b+g[a+"SearchParams"]+"&page_size="+g[a+"PageSize"]:+b+"page_size="+g[a+"PageSize"]);l({scope:g,set:c,iterator:a,url:d})}}}]);angular.module("ParseHelper",[]).factory("ParseTypeChange",[function(){return function(l,m,h){var g=m?m:"variables";m=h?h:"parseType";l.blockParseTypeWatch=!1;l.blockVariableDataWatch=!1;l.removeParseTypeWatch&&l.removeParseTypeWatch();l.removeParseTypeWatch=l.$watch(m,function(c,h){if(c!==h)if("json"==c)if(l[g]&&!/^---$/.test(l[g]))try{var f=jsyaml.load(l[g]);l[g]=JSON.stringify(f,null," ")}catch(e){}else l[g]="{}";else if(l[g]&&!/^\{\}$/.test(l[g]))try{f=JSON.parse(l[g]),l[g]=jsyaml.safeDump(f)}catch(k){}else l[g]=
"---"})}}]);angular.module("ProjectPathHelper",["RestServices","Utilities"]).factory("GetProjectPath",["Alert","Rest","GetBasePath","ProcessErrors",function(l,m,h,g){return function(c){var p=c.scope,f=c.master;m.setUrl(h("config"));m.get().success(function(c,k,a,d){k=[];for(a=0;a<c.project_local_paths.length;a++)k.push(c.project_local_paths[a]);p.local_path&&k.push(p.local_path);p.project_local_paths=k;p.base_dir=c.project_base_dir;f.base_dir=p.base_dir;0==k.length&&l("Missing project path","All of the project paths have been assigned to existing projects, or there are no directories found in the base path. You will need to add a project path before creating a new project.",
"alert-info")}).error(function(c,k,a,d){g(p,c,k,null,{hdr:"Error!",msg:"Failed to access API config. GET status: "+k})})}}]);angular.module("RefreshRelatedHelper",["RestServices","Utilities"]).factory("RefreshRelated",["Alert","Rest",function(l,m){return function(h){var g=h.scope,c=h.set,p=h.iterator;m.setUrl(h.url);m.get().success(function(f,e,k,a){g[c]=f.results;g[p+"NextUrl"]=f.next;g[p+"PrevUrl"]=f.previous;g[p+"Count"]=f.count;g[p+"PageCount"]=Math.ceil(f.count/g[p+"PageSize"]);g[p+"SearchSpin"]=!1;g[p+"Loading"]=!1}).error(function(f,e,k,a){g[p+"SearchSpin"]=!0;l("Error!","Failed to retrieve related set: "+c+". GET returned status: "+
e)})}}]);angular.module("RefreshHelper",["RestServices","Utilities"]).factory("Refresh",["Alert","Rest",function(l,m){return function(h){var g=h.scope,c=h.set,p=h.iterator;m.setUrl(h.url);m.get().success(function(f,e,k,a){g[p+"NextUrl"]=f.next;g[p+"PrevUrl"]=f.previous;g[p+"Count"]=f.count;g[p+"PageCount"]=Math.ceil(f.count/g[p+"PageSize"]);g[p+"SearchSpin"]=!1;g[p+"Loading"]=!1;g[c]=f.results;g.$emit("PostRefresh")}).error(function(f,e,k,a){g[p+"SearchSpin"]=!1;l("Error!","Failed to retrieve "+c+". GET returned status: "+
e)})}}]);angular.module("RelatedPaginateHelper",["RefreshRelatedHelper","ngCookies"]).factory("RelatedPaginateInit",["RefreshRelated","$cookieStore",function(l,m){return function(h){var g=h.scope,c=h.relatedSets,p;for(p in c)(cookieSize=m.get(c[p].iterator+"PageSize"))?g[c[p].iterator+"PageSize"]=cookieSize:(g[c[p].iterator+"Page"]=0,g[c[p].iterator+"PageSize"]=10);g.nextSet=function(c,e){g[e+"Page"]++;l({scope:g,set:c,iterator:e,url:g[e+"NextUrl"]})};g.prevSet=function(c,e){g[e+"Page"]--;l({scope:g,set:c,
iterator:e,url:g[e+"PrevUrl"]})};g.changePageSize=function(f,e){var k;g[e+"Page"]=0;for(var a in c)if(a==f){k=c[a].url;break}m.put(e+"PageSize",g[e+"PageSize"]);k=k.replace(/\/\?.*$/,"/");k+=g[e+"SearchParams"]?g[e+"SearchParams"]+"&page_size="+g[e+"PageSize"]:"?page_size="+g[e+"PageSize"];l({scope:g,set:f,iterator:e,url:k})}}}]);angular.module("RelatedSearchHelper",["RestServices","Utilities","RefreshRelatedHelper"]).factory("RelatedSearchInit",["Alert","Rest","RefreshRelated",function(l,m,h){return function(g){var c=g.scope,l=g.relatedSets,f=g.form,e,k;for(k in f.related)if("tree"!=f.related[k].type){g=f.related[k].iterator;for(var a in f.related[k].fields)if(f.related[k].fields[a].key){c[g+"SearchField"]=a;c[g+"SearchFieldLabel"]=f.related[k].fields[a].label;break}c[g+"SortOrder"]=null;c[g+"SearchType"]="contains";c[g+
"SearchTypeLabel"]="Contains";c[g+"SelectShow"]=!1;c[g+"HideSearchType"]=!1;e=c[g+"SearchField"];if(f.related[k].fields[e].searchType&&("boolean"==f.related[k].fields[e].searchType||"select"==f.related[k].fields[e].searchType))c[g+"SelectShow"]=!0,c[g+"SearchSelectOpts"]=list.fields[e].searchOptions;f.related[k].fields[e].searchType&&"int"==f.related[k].fields[e].searchType&&(c[g+"HideSearchType"]=!0);f.related[k].fields[e].searchType&&"gtzero"==f.related[k].fields[e].searchType&&(c[g+"InputHide"]=
!0)}c.setSearchField=function(a,b,e){for(var k in f.related)if(f.related[k].iterator==a)var g=f.related[k].fields[b];c[a+"SearchFieldLabel"]=e;c[a+"SearchField"]=b;c[a+"SearchValue"]="";c[a+"SelectShow"]=!1;c[a+"HideSearchType"]=!1;c[a+"InputHide"]=!1;void 0!==g.searchType&&"gtzero"==g.searchType&&(c[a+"InputHide"]=!0);if(void 0!==g.searchType&&("boolean"==g.searchType||"select"==g.searchType))c[a+"SelectShow"]=!0,c[a+"SearchSelectOpts"]=g.searchOptions;void 0!==g.searchType&&"int"==g.searchType&&
(c[a+"HideSearchType"]=!0);c.search(a)};c.setSearchType=function(a,b,e){c[a+"SearchTypeLabel"]=e;c[a+"SearchType"]=b;c.search(a)};c.search=function(a){c[a+"SearchSpin"]=!0;c[a+"Loading"]=!0;var b,e,k,g;for(g in l)if(l[g].iterator==a){b=g;e=l[g].url;for(var m in f.related[g].fields)f.related[g].fields[m].key&&(k=f.related[g].fields[m].desc?"-"+m:m);break}k=null==c[a+"SortOrder"]?k:c[a+"SortOrder"];g=f.related[b].fields[c[a+"SearchField"]];if(!1==c[a+"SelectShow"]&&""!=c[a+"SearchValue"]&&void 0!=c[a+
$("#password-modal").modal({})}}]).factory("SubmitJob",["PromptPasswords","$compile","Rest","$location","GetBasePath","CredentialList","LookUpInit","JobTemplateForm","ProcessErrors",function(k,m,h,g,c,p,f,e,l){return function(a){function d(a){b.credentialWatchRemove&&b.credentialWatchRemove();var d=(new Date).toISOString(),c=v?v:a.name;h.setUrl(a.related.jobs?a.related.jobs:a.related.job_template+"jobs/");h.post({name:c+" "+d,description:a.description,job_template:a.id,inventory:a.inventory,project:a.project,
playbook:a.playbook,credential:a.credential,forks:a.forks,limit:a.limit,verbosity:a.verbosity,extra_vars:a.extra_vars}).success(function(a,d,c,e){b.job_id=a.id;0<a.passwords_needed_to_start.length?k({scope:b,passwords:a.passwords_needed_to_start,start_url:a.related.start}):(h.setUrl(a.related.start),h.post().success(function(a,d,c,e){"jobs"==g.path().replace(/^\//,"").split("/")[0]?b.refreshJob():g.path("/jobs")}).error(function(a,d,c,e){l(b,a,d,null,{hdr:"Error!",msg:"Failed to start job. POST returned status: "+
d})}))}).error(function(a,d,c,e){l(b,a,d,null,{hdr:"Error!",msg:"Failed to create job. POST returned status: "+d})})}var b=a.scope,m=a.id,v=a.template?a.template:null;a=g.path().replace(/^\//,"").split("/")[0];m=c(a)+m+"/";h.setUrl(m);h.get().success(function(a,c,l,g){b.credential="";""==a.credential||null==a.credential?(b.credentialWatchRemove&&b.credentialWatchRemove(),b.credentialWatchRemove=b.$watch("credential",function(c,e){c!==e&&(""!=b.credential&&null!==b.credential&&void 0!==b.credential)&&
(a.credential=b.credential,d(a))}),f({scope:b,form:e,current_item:null,list:p,field:"credential",hdr:"Credential Required"}),b.lookUpCredential()):d(a)}).error(function(a,d,c,e){l(b,a,d,null,{hdr:"Error!",msg:"Failed to get job template details. GET returned status: "+d})})}}]);angular.module("LookUpHelper","RestServices Utilities SearchHelper PaginateHelper ListGenerator ApiLoader".split(" ")).factory("LookUpInit",["Alert","Rest","GenerateList","SearchInit","PaginateInit","GetBasePath",function(k,m,h,g,c,p){return function(f){var e=f.scope,l=f.form,a=f.current_item,d=f.list,b=f.field,m=f.postAction,v=d.iterator.charAt(0).toUpperCase()+d.iterator.substring(1),A="inventories"==d.name?p("inventory"):p(d.name),u=f.hdr?f.hdr:"Select "+v;$('input[name="'+l.fields[b].sourceModel+
"_"+l.fields[b].sourceField+'"]').attr("data-url",A+"?"+l.fields[b].sourceField+"__iexact=:value");$('input[name="'+l.fields[b].sourceModel+"_"+l.fields[b].sourceField+'"]').attr("data-source",b);e["lookUp"+v]=function(){var f=h.inject(d,{mode:"lookup",hdr:u});f.selectAction=function(){for(var a=!1,c=0;c<f[d.name].length;c++)"success"==f[d.iterator+"_"+f[d.name][c].id+"_class"]&&(a=!0,e[b]=f[d.name][c].id,e[l.name+"_form"]&&(l.fields[b]&&l.fields[b].sourceModel)&&(e[l.fields[b].sourceModel+"_"+l.fields[b].sourceField]=
f[d.name][c][l.fields[b].sourceField],e[l.name+"_form"][l.fields[b].sourceModel+"_"+l.fields[b].sourceField]&&e[l.name+"_form"][l.fields[b].sourceModel+"_"+l.fields[b].sourceField].$setValidity("awlookup",!0)),e[l.name+"_form"]&&e[l.name+"_form"].$setDirty(),h.hide());!1==a?k("Missing Selection","Oops, you failed to make a selection. Click on a row to make your selection, and then click the Select button."):m&&m()};f["toggle_"+d.iterator]=function(a){if(f[d.name])for(var b=0;b<f[d.name].length;b++)f[d.iterator+
"_"+f[d.name][b].id+"_class"]="";null!=a&&void 0!=a&&(f[d.iterator+"_"+a+"_class"]="success")};g({scope:f,set:d.name,list:d,url:A});c({scope:f,list:d,url:A,mode:"lookup"});f.search(d.iterator);if(a)f["toggle_"+d.iterator](a)}}}]);angular.module("md5Helper",["RestServices","Utilities"]).factory("md5Setup",["Alert","Rest","GetBasePath","ProcessErrors",function(k,m,h,g){return function(c){var g=c.scope,f=c.master,e=c.check_field;c=c.default_val;g[e]=c;f[e]=c;g.genMD5=function(c){g[c]=$.md5("AnsibleWorks"+(new Date).getTime())};g.toggleCallback=function(c){"false"==g.allow_callbacks&&(g[c]=null)};g.selectAll=function(c){$('input[name="'+c+'"]').focus().select()}}}]);angular.module("PaginateHelper",["RefreshHelper","ngCookies"]).factory("PaginateInit",["Refresh","$cookieStore",function(k,m){return function(h){var g=h.scope,c=h.list,c=h.iterator?h.iterator:c.iterator,p=h.url,f=h.mode?h.mode:null,e=m.get(c+"PageSize");g[c+"Page"]=0;g[c+"PageSize"]=e&&"lookup"!=f?e:h.pageSize?h.pageSize:"lookup"==f?5:20;g.nextSet=function(c,a){g[a+"NextUrl"]&&(g[a+"Page"]++,k({scope:g,set:c,iterator:a,url:g[a+"NextUrl"]}))};g.prevSet=function(c,a){g[a+"PrevUrl"]&&(g[a+"Page"]--,
k({scope:g,set:c,iterator:a,url:g[a+"PrevUrl"]}))};g.changePageSize=function(c,a){m.put(a+"PageSize",g[a+"PageSize"]);g[a+"Page"]=0;var d=p.replace(/\?page_size\=\d+/,""),b=/\/$/.test(d)?"?":"&",d=d+(g[a+"SearchParams"]?b+g[a+"SearchParams"]+"&page_size="+g[a+"PageSize"]:+b+"page_size="+g[a+"PageSize"]);k({scope:g,set:c,iterator:a,url:d})}}}]);angular.module("ParseHelper",[]).factory("ParseTypeChange",[function(){return function(k,m,h){var g=m?m:"variables";m=h?h:"parseType";k.blockParseTypeWatch=!1;k.blockVariableDataWatch=!1;k.removeParseTypeWatch&&k.removeParseTypeWatch();k.removeParseTypeWatch=k.$watch(m,function(c,h){if(c!==h)if("json"==c)if(k[g]&&!/^---$/.test(k[g]))try{var f=jsyaml.load(k[g]);k[g]=JSON.stringify(f,null," ")}catch(e){}else k[g]="{}";else if(k[g]&&!/^\{\}$/.test(k[g]))try{f=JSON.parse(k[g]),k[g]=jsyaml.safeDump(f)}catch(l){}else k[g]=
"---"})}}]);angular.module("ProjectPathHelper",["RestServices","Utilities"]).factory("GetProjectPath",["Alert","Rest","GetBasePath","ProcessErrors",function(k,m,h,g){return function(c){var p=c.scope,f=c.master;m.setUrl(h("config"));m.get().success(function(c,l,a,d){l=[];for(a=0;a<c.project_local_paths.length;a++)l.push(c.project_local_paths[a]);p.local_path&&l.push(p.local_path);p.project_local_paths=l;p.base_dir=c.project_base_dir;f.base_dir=p.base_dir;0==l.length&&k("Missing project path","All of the project paths have been assigned to existing projects, or there are no directories found in the base path. You will need to add a project path before creating a new project.",
"alert-info")}).error(function(c,l,a,d){g(p,c,l,null,{hdr:"Error!",msg:"Failed to access API config. GET status: "+l})})}}]);angular.module("RefreshRelatedHelper",["RestServices","Utilities"]).factory("RefreshRelated",["Alert","Rest",function(k,m){return function(h){var g=h.scope,c=h.set,p=h.iterator;m.setUrl(h.url);m.get().success(function(f,e,l,a){g[c]=f.results;g[p+"NextUrl"]=f.next;g[p+"PrevUrl"]=f.previous;g[p+"Count"]=f.count;g[p+"PageCount"]=Math.ceil(f.count/g[p+"PageSize"]);g[p+"SearchSpin"]=!1;g[p+"Loading"]=!1}).error(function(f,e,l,a){g[p+"SearchSpin"]=!0;k("Error!","Failed to retrieve related set: "+c+". GET returned status: "+
e)})}}]);angular.module("RefreshHelper",["RestServices","Utilities"]).factory("Refresh",["Alert","Rest",function(k,m){return function(h){var g=h.scope,c=h.set,p=h.iterator;m.setUrl(h.url);m.get().success(function(f,e,l,a){g[p+"NextUrl"]=f.next;g[p+"PrevUrl"]=f.previous;g[p+"Count"]=f.count;g[p+"PageCount"]=Math.ceil(f.count/g[p+"PageSize"]);g[p+"SearchSpin"]=!1;g[p+"Loading"]=!1;g[c]=f.results;g.$emit("PostRefresh")}).error(function(f,e,l,a){g[p+"SearchSpin"]=!1;k("Error!","Failed to retrieve "+c+". GET returned status: "+
e)})}}]);angular.module("RelatedPaginateHelper",["RefreshRelatedHelper","ngCookies"]).factory("RelatedPaginateInit",["RefreshRelated","$cookieStore",function(k,m){return function(h){var g=h.scope,c=h.relatedSets,p;for(p in c)(cookieSize=m.get(c[p].iterator+"PageSize"))?g[c[p].iterator+"PageSize"]=cookieSize:(g[c[p].iterator+"Page"]=0,g[c[p].iterator+"PageSize"]=10);g.nextSet=function(c,e){g[e+"Page"]++;k({scope:g,set:c,iterator:e,url:g[e+"NextUrl"]})};g.prevSet=function(c,e){g[e+"Page"]--;k({scope:g,set:c,
iterator:e,url:g[e+"PrevUrl"]})};g.changePageSize=function(f,e){var l;g[e+"Page"]=0;for(var a in c)if(a==f){l=c[a].url;break}m.put(e+"PageSize",g[e+"PageSize"]);l=l.replace(/\/\?.*$/,"/");l+=g[e+"SearchParams"]?g[e+"SearchParams"]+"&page_size="+g[e+"PageSize"]:"?page_size="+g[e+"PageSize"];k({scope:g,set:f,iterator:e,url:l})}}}]);angular.module("RelatedSearchHelper",["RestServices","Utilities","RefreshRelatedHelper"]).factory("RelatedSearchInit",["Alert","Rest","RefreshRelated",function(k,m,h){return function(g){var c=g.scope,k=g.relatedSets,f=g.form,e,l;for(l in f.related)if("tree"!=f.related[l].type){g=f.related[l].iterator;for(var a in f.related[l].fields)if(f.related[l].fields[a].key){c[g+"SearchField"]=a;c[g+"SearchFieldLabel"]=f.related[l].fields[a].label;break}c[g+"SortOrder"]=null;c[g+"SearchType"]="contains";c[g+
"SearchTypeLabel"]="Contains";c[g+"SelectShow"]=!1;c[g+"HideSearchType"]=!1;e=c[g+"SearchField"];if(f.related[l].fields[e].searchType&&("boolean"==f.related[l].fields[e].searchType||"select"==f.related[l].fields[e].searchType))c[g+"SelectShow"]=!0,c[g+"SearchSelectOpts"]=list.fields[e].searchOptions;f.related[l].fields[e].searchType&&"int"==f.related[l].fields[e].searchType&&(c[g+"HideSearchType"]=!0);f.related[l].fields[e].searchType&&"gtzero"==f.related[l].fields[e].searchType&&(c[g+"InputHide"]=
!0)}c.setSearchField=function(a,b,e){for(var l in f.related)if(f.related[l].iterator==a)var g=f.related[l].fields[b];c[a+"SearchFieldLabel"]=e;c[a+"SearchField"]=b;c[a+"SearchValue"]="";c[a+"SelectShow"]=!1;c[a+"HideSearchType"]=!1;c[a+"InputHide"]=!1;void 0!==g.searchType&&"gtzero"==g.searchType&&(c[a+"InputHide"]=!0);if(void 0!==g.searchType&&("boolean"==g.searchType||"select"==g.searchType))c[a+"SelectShow"]=!0,c[a+"SearchSelectOpts"]=g.searchOptions;void 0!==g.searchType&&"int"==g.searchType&&
(c[a+"HideSearchType"]=!0);c.search(a)};c.setSearchType=function(a,b,e){c[a+"SearchTypeLabel"]=e;c[a+"SearchType"]=b;c.search(a)};c.search=function(a){c[a+"SearchSpin"]=!0;c[a+"Loading"]=!0;var b,e,l,g;for(g in k)if(k[g].iterator==a){b=g;e=k[g].url;for(var m in f.related[g].fields)f.related[g].fields[m].key&&(l=f.related[g].fields[m].desc?"-"+m:m);break}l=null==c[a+"SortOrder"]?l:c[a+"SortOrder"];g=f.related[b].fields[c[a+"SearchField"]];if(!1==c[a+"SelectShow"]&&""!=c[a+"SearchValue"]&&void 0!=c[a+
"SearchValue"]||c[a+"SelectShow"]&&c[a+"SearchSelectValue"]||g.searchType&&"gtzero"==g.searchType){c[a+"SearchParams"]=g.sourceModel?"?"+g.sourceModel+"__"+g.sourceField+"__":g.searchField?"?"+g.searchField+"__":"?"+c[a+"SearchField"]+"__";c[a+"SearchParams"]=g.searchType&&("int"==g.searchType||"boolean"==g.searchType)?c[a+"SearchParams"]+"int=":g.searchType&&"gtzero"==g.searchType?c[a+"SearchParams"]+"gt=0":c[a+"SearchParams"]+(c[a+"SearchType"]+"=");if(g.searchType&&("boolean"==g.searchType||"select"==
g.searchType))c[a+"SearchParams"]+=c[a+"SearchSelectValue"].value;else if(void 0==g.searchType||"gtzero"==g.searchType)c[a+"SearchParams"]+=escape(c[a+"SearchValue"]);c[a+"SearchParams"]+=k?"&order_by="+escape(k):""}else c[a+"SearchParams"]="",c[a+"SearchParams"]+=k?"?order_by="+escape(k):"";c[a+"Page"]=0;e+=c[a+"SearchParams"];e+=c[a+"PageSize"]?"&page_size="+c[a+"PageSize"]:"";h({scope:c,set:b,iterator:a,url:e})};c.sort=function(a,b){var e;$("."+a+" .list-header").each(function(c){$(this).attr("id")!=
a+"-"+b+"-header"&&$(this).find("i").attr("class","icon-sort")});var k=$("#"+a+"-"+b+"-header i"),g="";k.hasClass("icon-sort")?(k.removeClass("icon-sort"),k.addClass("icon-sort-up")):k.hasClass("icon-sort-up")?(k.removeClass("icon-sort-up"),k.addClass("icon-sort-down"),g="-"):k.hasClass("icon-sort-down")&&(k.removeClass("icon-sort-down"),k.addClass("icon-sort-up"));for(var h in f.related)f.related[h].iterator==a&&(e=f.related[h].fields[b].sourceModel?g+f.related[h].fields[b].sourceModel+"__"+f.related[h].fields[b].sourceModel:
g+b);c[a+"SortOrder"]=e;c.search(a)}}}]);angular.module("SearchHelper",["RestServices","Utilities","RefreshHelper"]).factory("SearchInit",["Alert","Rest","Refresh",function(l,m,h){return function(g){var c=g.scope,l=g.set,f=g.url,e=g.list;g=g.iterator?g.iterator:e.iterator;var k;for(fld in e.fields)if(e.fields[fld].key){if(e.fields[fld].sourceModel){var a=e.fields[fld].sourceModel+"__"+e.fields[fld].sourceField;k=e.fields[fld].desc?"-"+a:a}else k=e.fields[fld].desc?"-"+fld:fld;if(void 0==e.fields[fld].searchable||!0==e.fields[fld].searchable)c[g+
g.searchType))c[a+"SearchParams"]+=c[a+"SearchSelectValue"].value;else if(void 0==g.searchType||"gtzero"==g.searchType)c[a+"SearchParams"]+=escape(c[a+"SearchValue"]);c[a+"SearchParams"]+=l?"&order_by="+escape(l):""}else c[a+"SearchParams"]="",c[a+"SearchParams"]+=l?"?order_by="+escape(l):"";c[a+"Page"]=0;e+=c[a+"SearchParams"];e+=c[a+"PageSize"]?"&page_size="+c[a+"PageSize"]:"";h({scope:c,set:b,iterator:a,url:e})};c.sort=function(a,b){var e;$("."+a+" .list-header").each(function(c){$(this).attr("id")!=
a+"-"+b+"-header"&&$(this).find("i").attr("class","icon-sort")});var l=$("#"+a+"-"+b+"-header i"),g="";l.hasClass("icon-sort")?(l.removeClass("icon-sort"),l.addClass("icon-sort-up")):l.hasClass("icon-sort-up")?(l.removeClass("icon-sort-up"),l.addClass("icon-sort-down"),g="-"):l.hasClass("icon-sort-down")&&(l.removeClass("icon-sort-down"),l.addClass("icon-sort-up"));for(var h in f.related)f.related[h].iterator==a&&(e=f.related[h].fields[b].sourceModel?g+f.related[h].fields[b].sourceModel+"__"+f.related[h].fields[b].sourceModel:
g+b);c[a+"SortOrder"]=e;c.search(a)}}}]);angular.module("SearchHelper",["RestServices","Utilities","RefreshHelper"]).factory("SearchInit",["Alert","Rest","Refresh",function(k,m,h){return function(g){var c=g.scope,k=g.set,f=g.url,e=g.list;g=g.iterator?g.iterator:e.iterator;var l;for(fld in e.fields)if(e.fields[fld].key){if(e.fields[fld].sourceModel){var a=e.fields[fld].sourceModel+"__"+e.fields[fld].sourceField;l=e.fields[fld].desc?"-"+a:a}else l=e.fields[fld].desc?"-"+fld:fld;if(void 0==e.fields[fld].searchable||!0==e.fields[fld].searchable)c[g+
"SearchField"]=fld,c[g+"SearchFieldLabel"]=e.fields[fld].label;break}if(!c[g+"SearchField"])for(fld in e.fields)if(void 0==e.fields[fld].searchable||!0==e.fields[fld].searchable){c[g+"SearchField"]=fld;c[g+"SearchFieldLabel"]=e.fields[fld].label;break}c[g+"SearchType"]="icontains";c[g+"SearchTypeLabel"]="Contains";c[g+"SearchParams"]="";c[g+"SearchValue"]="";c[g+"SelectShow"]=!1;c[g+"HideSearchType"]=!1;a=c[g+"SearchField"];if(e.fields[a].searchType&&("boolean"==e.fields[a].searchType||"select"==
e.fields[a].searchType))c[g+"SelectShow"]=!0,c[g+"SearchSelectOpts"]=e.fields[a].searchOptions;e.fields[a].searchType&&"int"==e.fields[a].searchType&&(c[g+"HideSearchType"]=!0);e.fields[a].searchType&&"gtzero"==e.fields[a].searchType&&(c[g+"InputHide"]=!0);c.setSearchField=function(a,b,k){c[a+"SearchFieldLabel"]=k;c[a+"SearchField"]=b;c[a+"SearchValue"]="";c[a+"SelectShow"]=!1;c[a+"HideSearchType"]=!1;c[a+"InputHide"]=!1;e.fields[b].searchType&&"gtzero"==e.fields[b].searchType&&(c[a+"InputHide"]=
e.fields[a].searchType))c[g+"SelectShow"]=!0,c[g+"SearchSelectOpts"]=e.fields[a].searchOptions;e.fields[a].searchType&&"int"==e.fields[a].searchType&&(c[g+"HideSearchType"]=!0);e.fields[a].searchType&&"gtzero"==e.fields[a].searchType&&(c[g+"InputHide"]=!0);c.setSearchField=function(a,b,l){c[a+"SearchFieldLabel"]=l;c[a+"SearchField"]=b;c[a+"SearchValue"]="";c[a+"SelectShow"]=!1;c[a+"HideSearchType"]=!1;c[a+"InputHide"]=!1;e.fields[b].searchType&&"gtzero"==e.fields[b].searchType&&(c[a+"InputHide"]=
!0);if(e.fields[b].searchType&&("boolean"==e.fields[b].searchType||"select"==e.fields[b].searchType))c[a+"SelectShow"]=!0,c[a+"SearchSelectOpts"]=e.fields[b].searchOptions;e.fields[b].searchType&&"int"==e.fields[b].searchType&&(c[a+"HideSearchType"]=!0);c.search(a)};c.setSearchType=function(a,b,e){c[a+"SearchTypeLabel"]=e;c[a+"SearchType"]=b;c.search(a)};c.search=function(a){c[a+"SearchSpin"]=!0;c[a+"Loading"]=!0;c[a+"SearchParms"]="";var b=f;!1==c[a+"SelectShow"]&&""!=c[a+"SearchValue"]&&void 0!=
c[a+"SearchValue"]||c[a+"SelectShow"]&&c[a+"SearchSelectValue"]||e.fields[c[a+"SearchField"]].searchType&&"gtzero"==e.fields[c[a+"SearchField"]].searchType?(c[a+"SearchParams"]=e.fields[c[a+"SearchField"]].searchField?e.fields[c[a+"SearchField"]].searchField+"__":e.fields[c[a+"SearchField"]].sourceModel?e.fields[c[a+"SearchField"]].sourceModel+"__"+e.fields[c[a+"SearchField"]].sourceField+"__":c[a+"SearchField"]+"__",c[a+"SearchParams"]=e.fields[c[a+"SearchField"]].searchType&&("int"==e.fields[c[a+
"SearchField"]].searchType||"boolean"==e.fields[c[a+"SearchField"]].searchType)?c[a+"SearchParams"]+"int=":e.fields[c[a+"SearchField"]].searchType&&"gtzero"==e.fields[c[a+"SearchField"]].searchType?c[a+"SearchParams"]+"gt=0":c[a+"SearchParams"]+(c[a+"SearchType"]+"="),c[a+"SearchParams"]=e.fields[c[a+"SearchField"]].searchType&&("boolean"==e.fields[c[a+"SearchField"]].searchType||"select"==e.fields[c[a+"SearchField"]].searchType)?c[a+"SearchParams"]+c[a+"SearchSelectValue"].value:c[a+"SearchParams"]+
escape(c[a+"SearchValue"]),c[a+"SearchParams"]+=k?"&order_by="+escape(k):""):c[a+"SearchParams"]=k?"order_by="+escape(k):"";c[a+"Page"]=0;b=/\/$/.test(b)?b+("?"+c[a+"SearchParams"]):b+("&"+c[a+"SearchParams"]);b=b.replace(/\&\&/,"&");b+=c[a+"PageSize"]?"&page_size="+c[a+"PageSize"]:"";h({scope:c,set:l,iterator:a,url:b})};c.sort=function(a){$(".list-header").each(function(b){$(this).attr("id")!=a+"-header"&&$(this).find("i").attr("class","icon-sort")});var b=$("#"+a+"-header i"),f="";b.hasClass("icon-sort")?
(b.removeClass("icon-sort"),b.addClass("icon-sort-up")):b.hasClass("icon-sort-up")?(b.removeClass("icon-sort-up"),b.addClass("icon-sort-down"),f="-"):b.hasClass("icon-sort-down")&&(b.removeClass("icon-sort-down"),b.addClass("icon-sort-up"));k=e.fields[a].searchField?f+e.fields[a].searchField:e.fields[a].sourceModel?f+e.fields[a].sourceModel+"__"+e.fields[a].sourceField:f+a;c.search(e.iterator)}}}]);angular.module("TeamHelper","RestServices Utilities OrganizationListDefinition SearchHelper PaginateHelper ListGenerator".split(" ")).factory("SetTeamListeners",["Alert","Rest",function(l,m){return function(h){var g=h.scope,c=h.set,l=h.iterator;g.$on("TeamResultFound",function(f,e,k){if(k.length==e.length){key="organization";property="organization_name";for(f=0;f<e.length;f++)for(var a=0;a<k.length;a++)e[f][key]==k[a].id&&(e[f][property]=k[a].value);g[l+"SearchSpin"]=!1;g[c]=e}});g.$on("TeamRefreshFinished",
function(c,e){for(var k=[],a=0;a<e.length;a++)m.setUrl("/api/v1/organizations/"+e[a].organization+"/"),m.get().success(function(a,b,c,f){k.push({id:a.id,value:a.name});g.$emit("TeamResultFound",e,k)}).error(function(a,b,c,f){k.push({id:"error"});g.$emit("TeamResultFound",e,k)})})}}]).factory("TeamLookUpOrganizationInit",["Alert","Rest","OrganizationList","GenerateList","SearchInit","PaginateInit",function(l,m,h,g,c,p){return function(f){var e=f.scope;e.lookUpOrganization=function(){var k=g.inject(h,
{mode:"lookup",hdr:"Select Organization"});k.selectAction=function(){for(var a=!1,c=0;c<k[h.name].length;c++)"success"==k[h.iterator+"_"+k[h.name][c].id+"_class"]&&(a=!0,e.organization=k[h.name][c].id,e.organization_name=k[h.name][c].name,e.team_form.$setDirty(),g.hide());!1==a&&l("No Selection","Click on a row to select an Organization before clicking the Select button.")};k.toggle_organization=function(a){if(k[h.name])for(var c=0;c<k[h.name].length;c++)k[h.iterator+"_"+k[h.name][c].id+"_class"]=
"";null!=a&&void 0!=a&&(k[h.iterator+"_"+a+"_class"]="success")};c({scope:k,set:h.name,list:h,url:"/api/v1/organizations/"});p({scope:k,list:h,url:"/api/v1/organizations/",mode:"lookup"});e.search(h.iterator);k.toggle_organization(e.organization)}}}]);angular.module("AdminListDefinition",[]).value("AdminList",{name:"admins",iterator:"admin",selectTitle:"Add Administrators",editTitle:"Admins",selectInstructions:"Click on a row to select it. Click the Finished button when done.",base:"users",index:!0,fields:{username:{key:!0,label:"Username"},first_name:{label:"First Name"},last_name:{label:"Last Name"}},actions:{},fieldActions:{}});angular.module("CredentialsListDefinition",[]).value("CredentialList",{name:"credentials",iterator:"credential",selectTitle:"Add Credentials",editTitle:"Credentials",selectInstructions:'Check the Select checkbox next to each credential to be added, and click Finished when done. Use the green <i class="icon-plus"></i> button to create a new user.',editInstructions:"Create a new credential from either the Teams tab or the Users tab. Teams and Users each have an associated set of Credentials.",index:!0,
escape(c[a+"SearchValue"]),c[a+"SearchParams"]+=l?"&order_by="+escape(l):""):c[a+"SearchParams"]=l?"order_by="+escape(l):"";c[a+"Page"]=0;b=/\/$/.test(b)?b+("?"+c[a+"SearchParams"]):b+("&"+c[a+"SearchParams"]);b=b.replace(/\&\&/,"&");b+=c[a+"PageSize"]?"&page_size="+c[a+"PageSize"]:"";h({scope:c,set:k,iterator:a,url:b})};c.sort=function(a){$(".list-header").each(function(b){$(this).attr("id")!=a+"-header"&&$(this).find("i").attr("class","icon-sort")});var b=$("#"+a+"-header i"),f="";b.hasClass("icon-sort")?
(b.removeClass("icon-sort"),b.addClass("icon-sort-up")):b.hasClass("icon-sort-up")?(b.removeClass("icon-sort-up"),b.addClass("icon-sort-down"),f="-"):b.hasClass("icon-sort-down")&&(b.removeClass("icon-sort-down"),b.addClass("icon-sort-up"));l=e.fields[a].searchField?f+e.fields[a].searchField:e.fields[a].sourceModel?f+e.fields[a].sourceModel+"__"+e.fields[a].sourceField:f+a;c.search(e.iterator)}}}]);angular.module("TeamHelper","RestServices Utilities OrganizationListDefinition SearchHelper PaginateHelper ListGenerator".split(" ")).factory("SetTeamListeners",["Alert","Rest",function(k,m){return function(h){var g=h.scope,c=h.set,k=h.iterator;g.$on("TeamResultFound",function(f,e,l){if(l.length==e.length){key="organization";property="organization_name";for(f=0;f<e.length;f++)for(var a=0;a<l.length;a++)e[f][key]==l[a].id&&(e[f][property]=l[a].value);g[k+"SearchSpin"]=!1;g[c]=e}});g.$on("TeamRefreshFinished",
function(c,e){for(var l=[],a=0;a<e.length;a++)m.setUrl("/api/v1/organizations/"+e[a].organization+"/"),m.get().success(function(a,b,c,f){l.push({id:a.id,value:a.name});g.$emit("TeamResultFound",e,l)}).error(function(a,b,c,f){l.push({id:"error"});g.$emit("TeamResultFound",e,l)})})}}]).factory("TeamLookUpOrganizationInit",["Alert","Rest","OrganizationList","GenerateList","SearchInit","PaginateInit",function(k,m,h,g,c,p){return function(f){var e=f.scope;e.lookUpOrganization=function(){var l=g.inject(h,
{mode:"lookup",hdr:"Select Organization"});l.selectAction=function(){for(var a=!1,c=0;c<l[h.name].length;c++)"success"==l[h.iterator+"_"+l[h.name][c].id+"_class"]&&(a=!0,e.organization=l[h.name][c].id,e.organization_name=l[h.name][c].name,e.team_form.$setDirty(),g.hide());!1==a&&k("No Selection","Click on a row to select an Organization before clicking the Select button.")};l.toggle_organization=function(a){if(l[h.name])for(var c=0;c<l[h.name].length;c++)l[h.iterator+"_"+l[h.name][c].id+"_class"]=
"";null!=a&&void 0!=a&&(l[h.iterator+"_"+a+"_class"]="success")};c({scope:l,set:h.name,list:h,url:"/api/v1/organizations/"});p({scope:l,list:h,url:"/api/v1/organizations/",mode:"lookup"});e.search(h.iterator);l.toggle_organization(e.organization)}}}]);angular.module("AdminListDefinition",[]).value("AdminList",{name:"admins",iterator:"admin",selectTitle:"Add Administrators",editTitle:"Admins",selectInstructions:"Click on a row to select it. Click the Finished button when done.",base:"users",index:!0,fields:{username:{key:!0,label:"Username"},first_name:{label:"First Name"},last_name:{label:"Last Name"}},actions:{},fieldActions:{}});angular.module("CredentialsListDefinition",[]).value("CredentialList",{name:"credentials",iterator:"credential",selectTitle:"Add Credentials",editTitle:"Credentials",selectInstructions:'Check the Select checkbox next to each credential to be added, and click Finished when done. Use the green <i class="icon-plus"></i> button to create a new user.',editInstructions:"Create a new credential from either the Teams tab or the Users tab. Teams and Users each have an associated set of Credentials.",index:!0,
hover:!0,fields:{name:{key:!0,label:"Name"},description:{label:"Description"},team:{label:"Team",ngBind:"credential.summary_fields.team.name",sourceModel:"team",sourceField:"name"},user:{label:"User",ngBind:"credential.summary_fields.user.usename",sourceModel:"user",sourceField:"username"}},actions:{add:{icon:"icon-plus",label:"Add",mode:"all",ngClick:"addCredential()",basePaths:["teams","users"],"class":"btn-success btn-small",awToolTip:"Create a new credential"}},fieldActions:{edit:{ngClick:"editCredential({{ credential.id }})",
icon:"icon-edit",label:"Edit","class":"btn-small btn-success",awToolTip:"View/Edit credential"},"delete":{ngClick:"deleteCredential({{ credential.id }},'{{ credential.name }}')",icon:"icon-remove",label:"Delete","class":"btn-small btn-danger",awToolTip:"Delete credential"}}});angular.module("GroupListDefinition",[]).value("GroupList",{name:"groups",iterator:"group",selectTitle:"Add Group",editTitle:"Groups",index:!0,well:!1,fields:{name:{key:!0,label:"Name"},description:{label:"Description"}},actions:{add:{label:"Create New Group",icon:"icon-plus",mode:"all",ngClick:"createGroup()","class":"btn-success btn-small",awToolTip:"Create a new group"},help:{awPopOver:"Select groups by clicking on each group you wish to add. Add the selected groups to your inventory or to the selected parent group by clicking the Select button. You can also create a new group by clicking the Create New Group button.",
dataPlacement:"left",dataContainer:"#form-modal",icon:"icon-question-sign",mode:"all","class":"btn-small btn-info",awToolTip:"Click for help",dataTitle:"Adding Groups"}},fieldActions:{edit:{label:"Edit",ngClick:"editGroup({{ group.id }})",icon:"icon-edit","class":"btn-small btn-success",awToolTip:"View/Edit group"},"delete":{label:"Delete",ngClick:"deleteGroup({{ group.id }},'{{ group.name }}')",icon:"icon-remove","class":"btn-small btn-danger",awToolTip:"Delete group"}}});angular.module("HostListDefinition",[]).value("HostList",{name:"hosts",iterator:"host",selectTitle:"Select Host",editTitle:"Hosts",index:!0,well:!0,fields:{name:{key:!0,label:"Host Name",linkTo:"/inventories/{{ inventory_id }}/hosts/{{ host.id }}"},description:{label:"Description"}},actions:{help:{awPopOver:"Select hosts by clicking on each host you wish to add. Add the selected hosts to the group by clicking the Select button.",dataPlacement:"left",dataContainer:"#form-modal",icon:"icon-question-sign",
@ -291,96 +291,93 @@ project:{label:"Project",sourceModel:"project",sourceField:"name",ngBind:"permis
icon:"icon-remove","class":"btn-small btn-danger",awToolTip:"Delete permission"}}});angular.module("ProjectsListDefinition",[]).value("ProjectList",{name:"projects",iterator:"project",selectTitle:"Add Project",editTitle:"{{ name }}",selectInstructions:'Click on a row to select it, and click Finished when done. Use the green <i class="icon-plus"></i> button to create a new row.',index:!0,hover:!0,fields:{name:{key:!0,label:"Name"},description:{label:"Description"}},actions:{add:{label:"Add",icon:"icon-plus",mode:"all",ngClick:"addProject()","class":"btn-success btn-small",awToolTip:"Create a new project"}},
fieldActions:{edit:{label:"Edit",ngClick:"editProject({{ project.id }})",icon:"icon-edit","class":"btn-small btn-success",awToolTip:"View/edit project"},"delete":{label:"Delete",ngClick:"deleteProject({{ project.id }},'{{ project.name }}')",icon:"icon-remove","class":"btn-small btn-danger",awToolTip:"Delete project"}}});angular.module("TeamsListDefinition",[]).value("TeamList",{name:"teams",iterator:"team",selectTitle:"Add Team",editTitle:"Teams",selectInstructions:'Click on a row to select it, and click Finished when done. Use the green <i class="icon-plus"></i> button to create a new row.',index:!0,hover:!0,fields:{name:{key:!0,label:"Name"},description:{label:"Description"},organization:{label:"Organization",ngBind:"team.organization_name",sourceModel:"organization",sourceField:"name"}},actions:{add:{label:"Add",
icon:"icon-plus",mode:"all",ngClick:"addTeam()","class":"btn-success btn-small",awToolTip:"Create a new team"}},fieldActions:{edit:{label:"Edit",ngClick:"editTeam({{ team.id }})",icon:"icon-edit","class":"btn-small btn-success",awToolTip:"View/Edit team"},"delete":{label:"Delete",ngClick:"deleteTeam({{ team.id }},'{{ team.name }}')",icon:"icon-remove","class":"btn-small btn-danger",awToolTip:"Delete team"}}});angular.module("UserListDefinition",[]).value("UserList",{name:"users",iterator:"user",selectTitle:"Add Users",editTitle:"Users",selectInstructions:'Check the Select checkbox next to each user to be added, and click Finished when done. Use the green <i class="icon-plus"></i> button to create a new user.',index:!0,hover:!0,fields:{username:{key:!0,label:"Username"},first_name:{label:"First Name"},last_name:{label:"Last Name"}},actions:{add:{label:"Add",icon:"icon-plus",mode:"all",ngClick:"addUser()",
basePaths:["organizations","users"],"class":"btn-success btn-small",awToolTip:"Create a new user"}},fieldActions:{edit:{label:"Edit",ngClick:"editUser({{ user.id }})",icon:"icon-edit","class":"btn-small btn-success",awToolTip:"View/Edit user"},"delete":{label:"Delete",ngClick:"deleteUser({{ user.id }},'{{ user.username }}')",icon:"icon-remove","class":"btn-small btn-danger",awToolTip:"Delete user"}}});angular.module("ApiLoader",["ngCookies"]).factory("LoadBasePaths",["$http","$rootScope","$cookieStore","ProcessErrors",function(l,m,h,g){return function(){l.get("/api/").success(function(c,p,f,e){var k=c.current_version;l.get(k).success(function(a,c,b,e){a.base=k;m.defaultUrls=a;h.remove("api");h.put("api",a)}).error(function(a,c,b,e){m.defaultUrls={status:"error"};g(null,a,c,null,{hdr:"Error",msg:"Failed to read "+k+". GET status: "+c})})}).error(function(c,h,f,e){m.defaultUrls={status:"error"};
g(null,c,h,null,{hdr:"Error",msg:"Failed to read /api. GET status: "+h})})}}]).factory("GetBasePath",["$rootScope","$cookieStore","LoadBasePaths",function(l,m,h){return function(g){null==l.defaultUrls||void 0==l.defaultUrls?(g=m.get("api")[g],h()):g=l.defaultUrls[g];return g}}]);angular.module("AuthService",["ngCookies"]).factory("Authorization",["$http","$rootScope","$location","$cookieStore",function(l,m,h,g){return{setToken:function(c){var h=new Date;h.setTime(h.getTime()+1E3*$AnsibleConfig.session_timeout);g.remove("token");g.remove("token_expire");g.put("token",c);g.put("token_expire",h.getTime());m.userLoggedIn=!0},isTokenValid:function(){var c=!1;if(g.get("token")&&g.get("token_expire")){var h=g.get("token"),f=new Date(g.get("token_expire"));new Date<f&&(this.setToken(h),
c=!0)}return c},didSessionExpire:function(){var c=!1;g.get("token_expire")&&new Date(g.get("token_expire"))<new Date&&(c=!0);return c},getToken:function(){return this.isTokenValid()?g.get("token"):null},retrieveToken:function(c,g){return l({method:"POST",url:"/api/v1/authtoken/",data:{username:c,password:g}})},logout:function(){m.current_user={};m.license_tested=void 0;g.remove("token");g.remove("token_expire");g.remove("current_user");m.userLoggedIn=!1},getLicense:function(){return l({method:"GET",
url:"/api/v1/config/",headers:{Authorization:"Token "+this.getToken()}})},setLicense:function(c){c.tested=!1;g.put("license",c)},licenseTested:function(){var c;c=void 0!==m.license_tested?m.license_tested:(c=g.get("license"))&&void 0!==c.tested?c.tested:!1;return c},getUser:function(){return l({method:"GET",url:"/api/v1/me/",headers:{Authorization:"Token "+this.getToken()}})},setUserInfo:function(c){m.current_user=c.results[0];g.put("current_user",c.results[0])},restoreUserInfo:function(){m.current_user=
basePaths:["organizations","users"],"class":"btn-success btn-small",awToolTip:"Create a new user"}},fieldActions:{edit:{label:"Edit",ngClick:"editUser({{ user.id }})",icon:"icon-edit","class":"btn-small btn-success",awToolTip:"View/Edit user"},"delete":{label:"Delete",ngClick:"deleteUser({{ user.id }},'{{ user.username }}')",icon:"icon-remove","class":"btn-small btn-danger",awToolTip:"Delete user"}}});angular.module("ApiLoader",["ngCookies"]).factory("LoadBasePaths",["$http","$rootScope","$cookieStore","ProcessErrors",function(k,m,h,g){return function(){k.get("/api/").success(function(c,p,f,e){var l=c.current_version;k.get(l).success(function(a,c,b,e){a.base=l;m.defaultUrls=a;h.remove("api");h.put("api",a)}).error(function(a,c,b,e){m.defaultUrls={status:"error"};g(null,a,c,null,{hdr:"Error",msg:"Failed to read "+l+". GET status: "+c})})}).error(function(c,h,f,e){m.defaultUrls={status:"error"};
g(null,c,h,null,{hdr:"Error",msg:"Failed to read /api. GET status: "+h})})}}]).factory("GetBasePath",["$rootScope","$cookieStore","LoadBasePaths",function(k,m,h){return function(g){null==k.defaultUrls||void 0==k.defaultUrls?(g=m.get("api")[g],h()):g=k.defaultUrls[g];return g}}]);angular.module("AuthService",["ngCookies"]).factory("Authorization",["$http","$rootScope","$location","$cookieStore",function(k,m,h,g){return{setToken:function(c){var h=new Date;h.setTime(h.getTime()+1E3*$AnsibleConfig.session_timeout);g.remove("token");g.remove("token_expire");g.put("token",c);g.put("token_expire",h.getTime());m.userLoggedIn=!0},isTokenValid:function(){var c=!1;if(g.get("token")&&g.get("token_expire")){var h=g.get("token"),f=new Date(g.get("token_expire"));new Date<f&&(this.setToken(h),
c=!0)}return c},didSessionExpire:function(){var c=!1;g.get("token_expire")&&new Date(g.get("token_expire"))<new Date&&(c=!0);return c},getToken:function(){return this.isTokenValid()?g.get("token"):null},retrieveToken:function(c,g){return k({method:"POST",url:"/api/v1/authtoken/",data:{username:c,password:g}})},logout:function(){m.current_user={};m.license_tested=void 0;g.remove("token");g.remove("token_expire");g.remove("current_user");m.userLoggedIn=!1},getLicense:function(){return k({method:"GET",
url:"/api/v1/config/",headers:{Authorization:"Token "+this.getToken()}})},setLicense:function(c){c.tested=!1;g.put("license",c)},licenseTested:function(){var c;c=void 0!==m.license_tested?m.license_tested:(c=g.get("license"))&&void 0!==c.tested?c.tested:!1;return c},getUser:function(){return k({method:"GET",url:"/api/v1/me/",headers:{Authorization:"Token "+this.getToken()}})},setUserInfo:function(c){m.current_user=c.results[0];g.put("current_user",c.results[0])},restoreUserInfo:function(){m.current_user=
g.get("current_user")},getUserInfo:function(c){return m.current_user[c]?m.current_user[c]:null}}}]);var INTEGER_REGEXP=/^\-?\d*$/;
angular.module("AWDirectives",["RestServices"]).directive("awpassmatch",function(){return{require:"ngModel",link:function(l,m,h,g){g.$parsers.unshift(function(c){var l=$('input[name="'+h.awpassmatch+'"]').val();if(c==l)return g.$setValidity("awpassmatch",!0),c;g.$setValidity("awpassmatch",!1)})}}}).directive("capitalize",function(){return{require:"ngModel",link:function(l,m,h,g){g.$parsers.unshift(function(c){var h=c.split(" "),f="";for(i=0;i<h.length;i++)f+=h[i].charAt(0).toUpperCase()+h[i].substr(1)+
" ";f=f.trim();f!=c&&(g.$setViewValue(f),g.$render());return f})}}}).directive("integer",function(){return{require:"ngModel",link:function(l,m,h,g){g.$parsers.unshift(function(c){g.$setValidity("min",!0);g.$setValidity("max",!0);if(INTEGER_REGEXP.test(c)){g.$setValidity("integer",!0);if(m.attr("min")&&(""==c||null==c||parseInt(c)<parseInt(m.attr("min")))){g.$setValidity("min",!1);return}if(m.attr("max")&&parseInt(c)>parseInt(m.attr("max"))){g.$setValidity("max",!1);return}return c}g.$setValidity("integer",
!1)})}}}).directive("awRequiredWhen",function(){return{require:"ngModel",link:function(l,m,h,g){function c(){var c=m.val();validity=!0;l[h.awRequiredWhen]&&(null==m.attr("required")||void 0==m.attr("required"))?$(m).attr("required","required"):l[h.awRequiredWhen]||m.removeAttr("required");if(l[h.awRequiredWhen]&&(void 0==c||null==c||""==c))validity=!1;g.$setValidity("required",validity)}l[h.awRequiredWhen]=h.awrequiredInit;c();l.$watch(h.awRequiredWhen,function(){c()});l.$watch($(m).attr("name"),
function(){c()})}}}).directive("awlookup",["Rest",function(l){return{require:"ngModel",link:function(m,h,g,c){c.$parsers.unshift(function(g){if(""!==g){var f=h.attr("data-url"),f=f.replace(/\:value/,escape(g));m[h.attr("data-source")]=null;l.setUrl(f);l.get().then(function(e){e=e.data.results;if(0<e.length)return m[h.attr("data-source")]=e[0].id,m[h.attr("name")]=e[0].name,c.$setValidity("required",!0),c.$setValidity("awlookup",!0),g;c.$setValidity("required",!0);c.$setValidity("awlookup",!1)})}else c.$setValidity("awlookup",
!0),m[h.attr("data-source")]=null})}}}]).directive("awToolTip",function(){return function(l,m,h){l=void 0!=h.delay&&null!=h.delay?h.delay:$AnsibleConfig.tooltip_delay;var g=void 0!=h.placement&&null!=h.placement?h.placement:"left";$(m).tooltip({placement:g,delay:l,title:h.awToolTip})}}).directive("awPopOver",function(){return function(l,m,h){l=void 0!=h.placement&&null!=h.placement?h.placement:"left";var g=void 0!=h.title&&null!=h.title?h.title:"Help",c=void 0!==h.container?h.container:!1;$(m).popover({placement:l,
delay:0,title:g,content:h.awPopOver,delay:0,trigger:"click",html:!0,container:c});$(document).bind("keydown",function(c){27===c.keyCode&&$(m).popover("hide")})}}).directive("ngSlider",[function(){return{require:"ngModel",link:function(l,m,h,g){var c=m.attr("name");$("#"+c+"-slider").slider({value:0,step:1,min:m.attr("min"),max:m.attr("max"),slide:function(c,f){g.$setViewValue(f.value);g.$setValidity("required",!0);g.$setValidity("min",!0);g.$setValidity("max",!0);g.$dirty=!0;g.$render();l.$$phase||
l.$digest()}});$("#"+c+"-number").change(function(){$("#"+c+"-slider").slider("value",parseInt($(this).val()))})}}}]);angular.module("AWFilters",[]).filter("capitalize",function(){return function(l){l=l.replace(/\_/g," ").split(" ");var m="";for(i=0;i<l.length;i++)m+=l[i].charAt(0).toUpperCase()+l[i].substr(1)+" ";return m=m.trim()}});angular.module("FormGenerator",["GeneratorHelpers","ngCookies"]).factory("GenerateForm",["$location","$cookieStore","$compile","SearchWidget","PaginateWidget","Attr","Icon","Column",function(l,m,h,g,c,p,f,e){return{setForm:function(c){this.form=c},attr:p,icon:f,has:function(c){return this.form[c]&&null!=this.form[c]&&void 0!=this.form[c]?!0:!1},inject:function(c,a){var d;d=a.modal?angular.element(document.getElementById("form-modal-body")):angular.element(document.getElementById("htmlTemplate"));
angular.module("AWDirectives",["RestServices"]).directive("awpassmatch",function(){return{require:"ngModel",link:function(k,m,h,g){g.$parsers.unshift(function(c){var k=$('input[name="'+h.awpassmatch+'"]').val();if(c==k)return g.$setValidity("awpassmatch",!0),c;g.$setValidity("awpassmatch",!1)})}}}).directive("capitalize",function(){return{require:"ngModel",link:function(k,m,h,g){g.$parsers.unshift(function(c){var h=c.split(" "),f="";for(i=0;i<h.length;i++)f+=h[i].charAt(0).toUpperCase()+h[i].substr(1)+
" ";f=f.trim();f!=c&&(g.$setViewValue(f),g.$render());return f})}}}).directive("integer",function(){return{require:"ngModel",link:function(k,m,h,g){g.$parsers.unshift(function(c){g.$setValidity("min",!0);g.$setValidity("max",!0);if(INTEGER_REGEXP.test(c)){g.$setValidity("integer",!0);if(m.attr("min")&&(""==c||null==c||parseInt(c)<parseInt(m.attr("min")))){g.$setValidity("min",!1);return}if(m.attr("max")&&parseInt(c)>parseInt(m.attr("max"))){g.$setValidity("max",!1);return}return c}g.$setValidity("integer",
!1)})}}}).directive("awRequiredWhen",function(){return{require:"ngModel",link:function(k,m,h,g){function c(){var c=m.val();validity=!0;k[h.awRequiredWhen]&&(null==m.attr("required")||void 0==m.attr("required"))?$(m).attr("required","required"):k[h.awRequiredWhen]||m.removeAttr("required");if(k[h.awRequiredWhen]&&(void 0==c||null==c||""==c))validity=!1;g.$setValidity("required",validity)}k[h.awRequiredWhen]=h.awrequiredInit;c();k.$watch(h.awRequiredWhen,function(){c()});k.$watch($(m).attr("name"),
function(){c()})}}}).directive("awlookup",["Rest",function(k){return{require:"ngModel",link:function(m,h,g,c){c.$parsers.unshift(function(g){if(""!==g){var f=h.attr("data-url"),f=f.replace(/\:value/,escape(g));m[h.attr("data-source")]=null;k.setUrl(f);k.get().then(function(e){e=e.data.results;if(0<e.length)return m[h.attr("data-source")]=e[0].id,m[h.attr("name")]=e[0].name,c.$setValidity("required",!0),c.$setValidity("awlookup",!0),g;c.$setValidity("required",!0);c.$setValidity("awlookup",!1)})}else c.$setValidity("awlookup",
!0),m[h.attr("data-source")]=null})}}}]).directive("awToolTip",function(){return function(k,m,h){k=void 0!=h.delay&&null!=h.delay?h.delay:$AnsibleConfig.tooltip_delay;var g=void 0!=h.placement&&null!=h.placement?h.placement:"left";$(m).tooltip({placement:g,delay:k,title:h.awToolTip})}}).directive("awPopOver",function(){return function(k,m,h){k=void 0!=h.placement&&null!=h.placement?h.placement:"left";var g=void 0!=h.title&&null!=h.title?h.title:"Help",c=void 0!==h.container?h.container:!1;$(m).popover({placement:k,
delay:0,title:g,content:h.awPopOver,delay:0,trigger:"click",html:!0,container:c});$(document).bind("keydown",function(c){27===c.keyCode&&$(m).popover("hide")})}}).directive("ngSlider",[function(){return{require:"ngModel",link:function(k,m,h,g){var c=m.attr("name");$("#"+c+"-slider").slider({value:0,step:1,min:m.attr("min"),max:m.attr("max"),slide:function(c,f){g.$setViewValue(f.value);g.$setValidity("required",!0);g.$setValidity("min",!0);g.$setValidity("max",!0);g.$dirty=!0;g.$render();k.$$phase||
k.$digest()}});$("#"+c+"-number").change(function(){$("#"+c+"-slider").slider("value",parseInt($(this).val()))})}}}]);angular.module("AWFilters",[]).filter("capitalize",function(){return function(k){k=k.replace(/\_/g," ").split(" ");var m="";for(i=0;i<k.length;i++)m+=k[i].charAt(0).toUpperCase()+k[i].substr(1)+" ";return m=m.trim()}});angular.module("FormGenerator",["GeneratorHelpers","ngCookies"]).factory("GenerateForm",["$location","$cookieStore","$compile","SearchWidget","PaginateWidget","Attr","Icon","Column",function(k,m,h,g,c,p,f,e){return{setForm:function(c){this.form=c},attr:p,icon:f,has:function(c){return this.form[c]&&null!=this.form[c]&&void 0!=this.form[c]?!0:!1},inject:function(c,a){var d;d=a.modal?angular.element(document.getElementById("form-modal-body")):angular.element(document.getElementById("htmlTemplate"));
this.mode=a.mode;this.modal=a.modal?!0:!1;this.setForm(c);d.html(this.build(a));this.scope=d.scope();h(d)(this.scope);!a.modal&&a.related&&this.addListeners();"add"==a.mode&&this.applyDefaults();a.modal&&(this.scope.formHeader="add"==a.mode?c.addTitle:c.editTitle,$("#form-modal").modal({backdrop:"static",keyboard:!1}));return this.scope},applyDefaults:function(){for(fld in this.form.fields)if(this.form.fields[fld]["default"]||0==this.form.fields[fld]["default"])this.scope[fld]="select"==this.form.fields[fld].type&&
this.scope[fld+"_options"]?this.scope[fld+"_options"][this.form.fields[fld]["default"]]:this.form.fields[fld]["default"]},reset:function(){this.scope[this.form.name+"_form"].$setPristine();for(var c in this.form.fields)this.scope[c]="",this.scope[c+"_api_error"]="",this.form.fields[c].sourceModel&&(this.scope[this.form.fields[c].sourceModel+"_"+this.form.fields[c].sourceField]="",this.scope[this.form.fields[c].sourceModel+"_"+this.form.fields[c].sourceField+"_api_error"]=""),"lookup"==this.form.fields[c].type&&
this.scope[this.form.name+"_form"][this.form.fields[c].sourceModel+"_"+this.form.fields[c].sourceField]&&this.scope[this.form.name+"_form"][this.form.fields[c].sourceModel+"_"+this.form.fields[c].sourceField].$setPristine(),this.scope[this.form.name+"_form"][c]&&this.scope[this.form.name+"_form"][c].$setPristine(),this.form.fields[c].awPassMatch&&this.scope[this.form.name+"_form"][c].$setValidity("awpassmatch",!0),this.form.fields[c].ask&&(this.scope[c+"_ask"]=!1);"add"==this.mode&&this.applyDefaults()},
addListeners:function(){$(".jqui-accordion").each(function(c){c=!1;var a=m.get("accordions"),d=!1;if(a)for(var b=$(this).attr("id"),e=l.path().replace(/^\//,"").split("/")[0],f=0;f<a.length&&!1==d;f++)a[f].base==e&&a[f].id==b&&(d=!0,c=a[f].active);!1==d&&"true"==$(this).attr("data-open")&&(c=0);$(this).accordion({collapsible:!0,heightStyle:"content",active:c,activate:function(a,b){$(".jqui-accordion").each(function(a){a=$(this).accordion("option","active");var b=$(this).attr("id"),c=l.path().replace(/^\//,
addListeners:function(){$(".jqui-accordion").each(function(c){c=!1;var a=m.get("accordions"),d=!1;if(a)for(var b=$(this).attr("id"),e=k.path().replace(/^\//,"").split("/")[0],f=0;f<a.length&&!1==d;f++)a[f].base==e&&a[f].id==b&&(d=!0,c=a[f].active);!1==d&&"true"==$(this).attr("data-open")&&(c=0);$(this).accordion({collapsible:!0,heightStyle:"content",active:c,activate:function(a,b){$(".jqui-accordion").each(function(a){a=$(this).accordion("option","active");var b=$(this).attr("id"),c=k.path().replace(/^\//,
"").split("/")[0],d=m.get("accordions");if(null==d||void 0==d)d=[];for(var e=!1,f=0;f<d.length&&!1==e;f++)d[f].base==c&&d[f].id==b&&(e=!0,d[f].active=a);!1==e&&d.push({base:c,id:b,active:a});m.put("accordions",d)})}})})},genID:function(){return(new Date).getTime()},headerField:function(c,a,d){d="";a.label&&(d+="<label>"+a.label+"</label>\n");d=d+('<input type="text" name="'+c+'" ')+('ng-model="'+c+'" ');d+=a["class"]?this.attr(a,"class"):"";return d+=" readonly />\n"},buildField:function(c,a,d){var b=
"";if("text"==a.type||"password"==a.type||"email"==a.type)if(!a.readonly||a.readonly&&"edit"==d.mode){b=b+'<div class="control-group"'+(a.ngShow?this.attr(a,"ngShow"):"");b+=a.ngHide?this.attr(a,"ngHide"):"";b+=">\n";b+='<label class="control-label';b+=a.labelClass?" "+a.labelClass:"";b+='" for="'+c+'">';a.awPopOver&&(b+='<a href="" '+this.attr(a,"awPopOver"),b+=a.dataTitle?this.attr(a,"dataTitle"):"",b+=a.dataPlacement?this.attr(a,"dataPlacement"):"",b+=a.dataContainer?this.attr(a,"dataContainer"):
"",b+='><i class="icon-info-sign"></i></a> ');b+=a.icon?this.icon(a.icon):"";b+=a.label+"</label>\n";b+='<div class="controls">\n';b+=a.clear||a.genMD5?'<div class="input-append">\n':"";if(null===a.control||void 0===a.control||a.control){b+="<input ";b+=this.attr(a,"type");b+='ng-model="'+c+'" ';b+='name="'+c+'" ';b+=a.ngChange?this.attr(a,"ngChange"):"";b+=a.id?this.attr(a,"id"):"";b+=a["class"]?this.attr(a,"class"):"";b+=a.placeholder?this.attr(a,"placeholder"):"";b+="edit"==d.mode&&a.editRequired?
"required ":"";b+="add"==d.mode&&a.addRequired?"required ":"";b+=a.readonly||a.showonly?"readonly ":"";b+=a.awPassMatch?'awpassmatch="'+a.associated+'" ':"";b+=a.capitalize?"capitalize ":"";b+=a.ask?'ng-disabled="'+c+'_ask" ':"";b+=void 0!==a.autocomplete?this.attr(a,"autocomplete"):"";b+=a.awRequiredWhen?'data-awrequired-init="'+a.awRequiredWhen.init+'" aw-required-when="'+a.awRequiredWhen.variable+'" ':"";b+=a.associated&&this.form.fields[a.associated].ask?'ng-disabled="'+a.associated+'_ask" ':
"";b+="/>";a.clear&&(b+=' \n<button class="btn" ng-click="clear(\''+c+"','"+a.associated+'\')" aw-tool-tip="Clear '+a.label+'" id="'+c+'-clear-btn"><i class="icon-undo"></i></button>\n',b+="</div>\n");a.genMD5&&(b+=' \n<button class="btn" ng-click="genMD5(\''+c+'\')" aw-tool-tip="Generate '+a.label+'" data-placement="top" id="'+c+'-gen-btn"><i class="icon-repeat"></i></button>\n',b+="</div>\n");a.ask&&(b+=' \n<label class="checkbox inline ask-checkbox"><input type="checkbox" ng-model="'+c+'_ask" ng-change="ask(\''+
c+"','"+a.associated+"')\" /> Ask at runtime?</label>");b+="<br />\n";if("add"==d.mode&&a.addRequired||"edit"==d.mode&&a.editRequired||a.awRequiredWhen)b+='<span class="error" ng-show="'+this.form.name+"_form."+c+".$dirty && "+this.form.name+"_form."+c+'.$error.required">A value is required!</span>\n';"email"==a.type&&(b+='<span class="error" ng-show="'+this.form.name+"_form."+c+".$dirty && "+this.form.name+"_form."+c+'.$error.email">A valid email address is required!</span>\n');a.awPassMatch&&(b+=
'<span class="error" ng-show="'+this.form.name+"_form."+c+'.$error.awpassmatch">Must match Password value</span>\n');b+='<span class="error api-error" ng-bind="'+c+'_api_error"></span>\n'}b+="</div>\n";b+="</div>\n"}if("textarea"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode)){b+='<div class="control-group"';b+=a.ngShow?this.attr(a,"ngShow"):"";b+=">\n";b+='<label class="control-label" for="'+c+'">';a.awPopOver&&(b+='<a href="" '+this.attr(a,"awPopOver"),b+=a.dataTitle?this.attr(a,"dataTitle"):
"",b+=a.dataPlacement?this.attr(a,"dataPlacement"):"",b+=a.dataContainer?this.attr(a,"dataContainer"):"",b+='><i class="icon-info-sign"></i></a> ');b+=a.label+"</label>\n";b+='<div class="controls">\n';if("variables"==c||"extra_vars"==c||"inventory_variables"==c)b+='<div class="parse-selection">Parse as: <label class="radio inline"><input type="radio" ng-model="',b+=this.form.parseTypeName?this.form.parseTypeName:"parseType",b+='" value="yaml"> YAML</label>\n',b+='<label class="radio inline"><input type="radio" ng-model="',
b+=this.form.parseTypeName?this.form.parseTypeName:"parseType",b+='" value="json"> JSON</label></div>\n';b+="<textarea ";b+=a.rows?this.attr(a,"rows"):"";b+='ng-model="'+c+'" ';b+='name="'+c+'" ';b+=a["class"]?this.attr(a,"class"):"";b+=a.ngChange?this.attr(a,"ngChange"):"";b+=a.id?this.attr(a,"id"):"";b+=a.placeholder?this.attr(a,"placeholder"):"";b+="edit"==d.mode&&a.editRequired?"required ":"";b+="add"==d.mode&&a.addRequired?"required ":"";b+=a.readonly||a.showonly?"readonly ":"";b+="></textarea><br />\n";
if("add"==d.mode&&a.addRequired||"edit"==d.mode&&a.editRequired)b+='<span class="error" ng-show="'+this.form.name+"_form."+c+".$dirty && "+this.form.name+"_form."+c+'.$error.required">A value is required!</span>\n';b+='<span class="error api-error" ng-bind="'+c+'_api_error"></span>\n';b+="</div>\n";b+="</div>\n"}if("select"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode)){b+='<div class="control-group"';b+=a.ngShow?this.attr(a,"ngShow"):"";b+=">\n";b+='<label class="control-label" for="'+c+'">';
a.awPopOver&&(b+='<a href="" '+this.attr(a,"awPopOver"),b+=a.dataTitle?this.attr(a,"dataTitle"):"",b+=a.dataPlacement?this.attr(a,"dataPlacement"):"",b+='><i class="icon-info-sign"></i></a> ');b+=a.label+"</label>\n";b+='<div class="controls">\n';b+="<select ";b+='ng-model="'+c+'" ';b+='name="'+c+'" ';b+=this.attr(a,"ngOptions");b+=a.ngChange?this.attr(a,"ngChange"):"";b+=a.id?this.attr(a,"id"):"";b+="edit"==d.mode&&a.editRequired?"required ":"";b+="add"==d.mode&&a.addRequired?"required ":"";b+=a.readonly?
"readonly ":"";b+=">\n";b+='<option value="">Choose '+a.label+"</option>\n";b+="</select><br />\n";if("add"==d.mode&&a.addRequired||"edit"==d.mode&&a.editRequired)b+='<span class="error" ng-show="'+this.form.name+"_form."+c+".$dirty && "+this.form.name+"_form."+c+'.$error.required">A value is required!</span>\n';b+='<span class="error api-error" ng-bind="'+c+'_api_error"></span>\n';b+="</div>\n";b+="</div>\n"}if("number"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode)){b+='<div class="control-group"';
b+=a.ngShow?this.attr(a,"ngShow"):"";b+=">\n";b+='<label class="control-label" for="'+c+'">';a.awPopOver&&(b+='<a href="" '+this.attr(a,"awPopOver"),b+=a.dataTitle?this.attr(a,"dataTitle"):"",b+=a.dataPlacement?this.attr(a,"dataPlacement"):"",b+='><i class="icon-info-sign"></i></a> ');b+=a.label+"</label>\n";b+='<div class="controls">\n';b+=a.slider?'<div class="slider" id="'+c+'-slider"></div>\n':"";b+='<input type="text" value="'+a["default"]+'" ';b+=a["class"]?this.attr(a,"class"):"";b+=a.slider?
'ng-slider="'+c+'" ':"";b+='ng-model="'+c+'" ';b+='name="'+c+'" ';b+=a.min||0==a.min?this.attr(a,"min"):"";b+=a.max?this.attr(a,"max"):"";b+=a.ngChange?this.attr(a,"ngChange"):"";b+=a.slider?'id="'+c+'-number"':a.id?this.attr(a,"id"):"";b+="edit"==d.mode&&a.editRequired?"required ":"";b+="add"==d.mode&&a.addRequired?"required ":"";b+=a.readonly?"readonly ":"";b+=a.integer?"integer ":"";b+="/>\n";b+="<br />\n";if("add"==d.mode&&a.addRequired||"edit"==d.mode&&a.editRequired)b+='<span class="error" ng-show="'+
this.form.name+"_form."+c+".$dirty && "+this.form.name+"_form."+c+'.$error.required">A value is required!</span>\n';a.integer&&(b+='<span class="error" ng-show="'+this.form.name+"_form."+c+'.$error.integer">Must be an integer value</span>\n');if(a.min||a.max)b+='<span class="error" ng-show="'+this.form.name+"_form."+c+".$error.min || "+this.form.name+"_form."+c+'.$error.max">Must be in range '+a.min+" to "+a.max+"</span>\n";b+='<span class="error api-error" ng-bind="'+c+'_api_error"></span>\n';b+=
"</div>\n";b+="</div>\n"}if("checkbox"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode))b+='<div class="control-group" ',b+=a.ngShow?this.attr(a,"ngShow"):"",b+=">\n",b+='<div class="controls">\n',b+='<label class="checkbox">',b+="<input ",b+=this.attr(a,"type"),b+='ng-model="'+c+'" ',b+='name="'+c+'" ',b+=a.ngChange?this.attr(a,"ngChange"):"",b+=a.id?this.attr(a,"id"):"",b+=this.attr(a,"trueValue"),b+=this.attr(a,"falseValue"),b+=a.checked?"checked ":"",b+=a.readonly?"readonly ":"",b+=" /> "+a.label+
"\n",a.awPopOver&&(b+='<a href="" '+this.attr(a,"awPopOver"),b+=a.dataTitle?this.attr(a,"dataTitle"):"",b+=a.dataPlacement?this.attr(a,"dataPlacement"):"",b+=a.dataContainer?this.attr(a,"dataContainer"):"",b+='><i class="icon-info-sign"></i></a> '),b+="</label>\n",b+='<span class="error api-error" ng-bind="'+c+'_api_error"></span>\n',b+="</div>\n",b+="</div>\n";if("radio"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode)){b+='<div class="control-group" ';b+=a.ngShow?this.attr(a,"ngShow"):"";b+=">\n";
b+='<label class="control-label" for="'+c+'">';a.awPopOver&&(b+='<a href="" '+this.attr(a,"awPopOver"),b+=a.dataTitle?this.attr(a,"dataTitle"):"",b+=a.dataPlacement?this.attr(a,"dataPlacement"):"",b+='><i class="icon-info-sign"></i></a> ');for(var b=b+(a.label+"</label>\n"),b=b+'<div class="controls">\n',e=0;e<a.options.length;e++)b+='<label class="radio inline" ',b+=a.options[e].ngShow?this.attr(a.options[e],"ngShow"):"",b+=">",b+='<input type="radio" ',b+='name="'+c+'" ',b+='value="'+a.options[e].value+
'" ',b+='ng-model="'+c+'" ',b+=a.ngChange?this.attr(a,"ngChange"):"",b+=a.readonly?"readonly ":"",b+="edit"==d.mode&&a.editRequired?"required ":"",b+="add"==d.mode&&a.addRequired?"required ":"",b+=" /> "+a.options[e].label+"\n",b+="</label>\n";if("add"==d.mode&&a.addRequired||"edit"==d.mode&&a.editRequired)b+='<p><span class="error" ng-show="'+this.form.name+"_form."+c+".$dirty && "+this.form.name+"_form."+c+'.$error.required">A value is required!</span></p>\n';b+='<p><span class="error api-error" ng-bind="'+
c+'_api_error"></span></p>\n';b+="</div>\n";b+="</div>\n"}if("hidden"==a.type&&("edit"==d.mode&&a.includeOnEdit||"add"==d.mode&&a.includeOnAdd))b+='<input type="hidden" ng-model="'+c+'" name="'+c+'" />';if("lookup"==a.type&&(void 0==a.excludeMode||a.excludeMode!=d.mode)){b+='<div class="control-group"';b+=a.ngShow?this.attr(a,"ngShow"):"";b+=">\n";b+='<label class="control-label" for="'+c+'">';a.awPopOver&&(b+='<a href="" '+this.attr(a,"awPopOver"),b+=a.dataTitle?this.attr(a,"dataTitle"):"",b+=a.dataPlacement?
this.attr(a,"dataPlacement"):"",b+='><i class="icon-info-sign"></i></a> ');b+=a.label+"</label>\n";b+='<div class="controls">\n';b+='<div class="input-prepend">\n';b+='<button class="lookup-btn btn" '+this.attr(a,"ngClick")+'><i class="icon-search"></i></button>\n';b+='<input class="input-medium" type="text" ';b+='ng-model="'+a.sourceModel+"_"+a.sourceField+'" ';b+='name="'+a.sourceModel+"_"+a.sourceField+'" ';b+=a.ngChange?this.attr(a,"ngChange"):"";b+=a.id?this.attr(a,"id"):"";b+=a.placeholder?
this.attr(a,"placeholder"):"";b+="edit"==d.mode&&a.editRequired?"required ":"";b+=a.awRequiredWhen?'data-awrequired-init="'+a.awRequiredWhen.init+'" aw-required-when="'+a.awRequiredWhen.variable+'" ':"";b+=" awlookup />\n";b+="</div><br />\n";if("add"==d.mode&&a.addRequired||"edit"==d.mode&&a.editRequired||a.awRequiredWhen)b+='<span class="error" ng-show="'+this.form.name+"_form."+a.sourceModel+"_"+a.sourceField+".$dirty && "+this.form.name+"_form."+a.sourceModel+"_"+a.sourceField+'.$error.required">A value is required!</span>\n';
b+='<span class="error" ng-show="'+this.form.name+"_form."+a.sourceModel+"_"+a.sourceField+".$dirty && "+this.form.name+"_form."+a.sourceModel+"_"+a.sourceField+'.$error.awlookup">Value not found</span>\n';b+='<span class="error api-error" ng-bind="'+a.sourceModel+"_"+a.sourceField+'_api_error"></span>\n';b+="</div>\n";b+="</div>\n"}if("custom"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode))b+='<div class="control-group"',b+=a.ngShow?this.attr(a,"ngShow"):"",b+=">\n",b+='<label class="control-label',
b+=a.labelClass?" "+a.labelClass:"",b+='" for="'+c+'">',a.awPopOver&&(b+='<a href="" '+this.attr(a,"awPopOver"),b+=a.dataTitle?this.attr(a,"dataTitle"):"",b+=a.dataPlacement?this.attr(a,"dataPlacement"):"",b+='><i class="icon-info-sign"></i></a> '),b+=a.icon?this.icon(a.icon):"",b+=a.label+"</label>\n",b+='<div class="controls">\n',b+=a.control,b+="</div>\n",b+="</div>\n";return b},build:function(c){var a="";this.modal||(a+='<div class="nav-path">\n<ul class="breadcrumb">\n',a+='<li ng-repeat="crumb in breadcrumbs"><a href="{{ \'#\' + crumb.path }}">{{ crumb.title | capitalize }}</a> <span class="divider">/</span></li>\n',
a+='<li class="active">',a="edit"==c.mode?a+this.form.editTitle:a+this.form.addTitle,a+="</li>\n</ul>\n</div>\n");if(!this.modal&&this.form.statusFields){a+='<div class="well">\n';if(this.form.statusActions){var a=a+'<div class="status-actions">\n',d;for(action in this.form.statusActions)d=this.form.statusActions[action],a+="<button "+this.attr(d,"ngClick")+'class="btn btn-small',a+=d["class"]?" "+d["class"]:"",a+='" ',a+=d.awToolTip?this.attr(d,"awToolTip"):"",a+=d.awToolTip?'data-placement="top" ':
"",a+=" >"+this.icon(d.icon),a+=d.label?d.label:"",a+="</button> ";a+="</div>\n";a+='<div class="status-spin"><i class="icon-spinner icon-spin" ng-show="statusSearchSpin == true"></i></div>\n'}var a=a+'<div class="status-fields">\n',b;for(b in this.form.statusFields)d=this.form.statusFields[b],a+=this.buildField(b,d,c);a+="</div>\x3c!-- status fields --\x3e\n";a+="</div>\x3c!-- well --\x3e\n"}if(this.form.fieldsAsHeader){a+='<div class="well">\n';a+='<form class="form-inline" name="'+this.form.name+
'_form" id="'+this.form.name+'" novalidate >\n';for(b in this.form.fields)d=this.form.fields[b],a+=this.headerField(b,d,c);a+="</form>\n";a+="</div>\n"}else{this.form.collapse&&this.form.collapseMode==c.mode&&(a+='<div id="'+this.form.name+'-collapse-0" ',a+=this.form.collapseOpen?'data-open="true" ':"",a+='class="jqui-accordion">\n',a+="<h3>"+this.form.collapseTitle+"<h3>\n",a+="<div>\n");this.has("well")&&(a+='<div class="well">\n');a+='<form class="form-horizontal';a+=this.form["class"]?" "+this.form["class"]:
"";a+='" name="'+this.form.name+'_form" id="'+this.form.name+'" autocomplete="false" novalidate>\n';a+='<div ng-show="flashMessage != null && flashMessage != undefined" class="alert alert-info">{{ flashMessage }}</div>\n';if(this.form.twoColumns){a+='<div class="row-fluid">\n';a+='<div class="span6">\n';for(b in this.form.fields)d=this.form.fields[b],1==d.column&&(a+=this.buildField(b,d,c));a+="</div>\x3c!-- column 1 --\x3e\n";a+='<div class="span6">\n';for(b in this.form.fields)d=this.form.fields[b],
2==d.column&&(a+=this.buildField(b,d,c));a+="</div>\x3c!-- column 2 --\x3e\n";a+="</div>\x3c!-- inner row --\x3e\n"}else for(b in this.form.fields)d=this.form.fields[b],a+=this.buildField(b,d,c);if(!this.modal){this.has("buttons")&&(a+=this.form.twoColumns?"<hr />":"",a+='<div class="control-group">\n',a+='<div class="controls buttons">\n');for(var e in this.form.buttons)d=this.form.buttons[e],a+="<button ",a+='class="btn btn-small',a+=d["class"]?" "+d["class"]:"",a+='" ',d.ngClick&&(a+=this.attr(d,
"ngClick")),d.ngDisabled&&(a="reset"!==e?a+('ng-disabled="'+this.form.name+"_form.$pristine || "+this.form.name+"_form.$invalid"):a+('ng-disabled="'+this.form.name+"_form.$pristine"),a+=this.form.allowReadonly?" || "+this.form.name+"ReadOnly == true":"",a+='" '),a+=">",d.icon&&(a+=this.icon(d.icon)),a+=d.label+"</button>\n";this.has("buttons")&&(a+="</div>\n",a+="</div>\n");a+="</form>\n"}this.has("well")&&(a+="</div>\n");this.form.collapse&&this.form.collapseMode==c.mode&&(a+="</div>\n",a+="</div>\n")}if(!this.modal&&
this.form.items)for(itm in this.form.items){a+='<div class="well form-items">\n';a+=g({iterator:this.form.items[itm].iterator,template:this.form.items[itm],mini:!1,label:"Filter Events"});a+='<div class="item-count pull-right">Viewing {{ '+this.form.items[itm].iterator+"Page + 1 }} of {{ "+this.form.items[itm].iterator+"Count }}</div>\n";a+="<hr />\n";a+='<ul class="pager">\n';a+='<li ng-class="'+this.form.items[itm].iterator+'PrevUrlDisable"><a href="" ng-click="prevSet(\''+this.form.items[itm].set+
"','"+this.form.items[itm].iterator+"')\">&larr; Prev</a></li>\n";a+='<li ng-class="'+this.form.items[itm].iterator+'NextUrlDisable"><a href="" ng-click="nextSet(\''+this.form.items[itm].set+"','"+this.form.items[itm].iterator+"')\">&rarr; Next</a></li>\n";a+="</ul>\n";a+='<form class="form-horizontal" name="'+this.form.name+'_items_form" id="'+this.form.name+'_items_form" novalidate>\n';for(b in this.form.items[itm].fields)d=this.form.items[itm].fields[b],a+=this.buildField(b,d,c);a+="</form>\n";
a+='<ul class="pager">\n';a+='<li ng-class="'+this.form.items[itm].iterator+'PrevUrlDisable"><a href="" ng-click="prevSet(\''+this.form.items[itm].set+"','"+this.form.items[itm].iterator+"')\">&larr; Prev</a></li>\n";a+='<li ng-class="'+this.form.items[itm].iterator+'NextUrlDisable"><a href="" ng-click="nextSet(\''+this.form.items[itm].set+"','"+this.form.items[itm].iterator+"')\">&rarr; Next</a></li>\n";a+="</ul>\n";a+="</div>\x3c!-- well --\x3e\n"}"inventory"==this.form.name&&"edit"==c.mode?a+=
this.buildTree(c):!this.modal&&(c.related&&this.form.related)&&(a+=this.buildCollections(c));return a},buildTree:function(f){var a=1,d=this.form;html='<div id="'+this.form.name+'-collapse-2" data-open="true" class="jqui-accordion">\n';html+="<h3>Inventory Content<h3>\n";html+="<div>\n";for(var b in d.related){if("tree"==d.related[b].type)html+='<div class="span5">',html+='<div class="inventory-buttons">',html+='<button ng-click="addGroup()" ng-hide="groupAddHide" id="inv-group-add" class="btn btn-mini btn-success" aw-tool-tip="Add existing groups or create a new group" data-placement="bottom"><i class="icon-plus"></i> Add Groups</button>',
html+='<button ng-click="editGroup()" ng-hide="groupEditHide" id="inv-group-edit" class="btn btn-mini btn-success" aw-tool-tip="Edit the selected group" data-placement="bottom" <i class="icon-edit"></i> Edit Group</button>',html+='<button ng-click="deleteGroup()" ng-hide="groupDeleteHide" id="inv-group-delete" aw-tool-tip="Delete the selected group" data-placement="bottom" class="btn btn-mini btn-danger"><i class="icon-remove"></i> Delete Group</button>',html+="</div>\n",html+='<div id="tree-view"></div>\n',
html+='<div class=" inventory-filter">',html+='<span ng-show="has_active_failures == true"><label class="checkbox inline">',html+='<input ng-model="inventoryFailureFilter" ng-change="filterInventory()" type="checkbox">Show only groups with failures</label></span></div>\n',html+="</div>\n";else{html+='<div id="group-view" class="span7">\n';html+='<div id="hosts-well" class="well">\n';html+='<h4 id="hosts-title">'+d.related[b].title+"</h4>\n";html+=g({iterator:d.related[b].iterator,template:d.related[b],
mini:!0});html+='<div class="list-actions">\n';for(var h in d.related[b].actions)html+='<button class="btn btn-mini ',html+=d.related[b].actions[h]["class"]?d.related[b].actions[h]["class"]:"btn-success",html+='" ',html+=d.related[b].actions[h].id?this.attr(d.related[b].actions[h],"id"):"",html+=this.attr(d.related[b].actions[h],"ngClick"),html+=d.related[b].actions[h].awToolTip?this.attr(d.related[b].actions[h],"awToolTip"):"",html+=d.related[b].actions[h].awToolTip?'data-placement="top" ':"",html+=
d.related[b].actions[h].ngHide?this.attr(d.related[b].actions[h],"ngHide"):"",html+='><i class="'+d.related[b].actions[h].icon+'"></i>',html+=d.related[b].actions[h].label?" "+d.related[b].actions[h].label:"",html+="</button>\n";html+="</div>\n";html+='<div class="list">\n';html+='<table class="'+d.related[b].iterator+' table table-condensed table-hover">\n';html+="<thead>\n";html+="<tr>\n";html+="<th>#</th>\n";for(var l in d.related[b].fields)html+='<th class="list-header" id="'+d.related[b].iterator+
"-"+l+'-header" ng-click="sort(\''+d.related[b].iterator+"', '"+l+"')\">"+d.related[b].fields[l].label,html+=' <i class="',html=d.related[b].fields[l].key?d.related[b].fields[l].desc?html+"icon-sort-down":html+"icon-sort-up":html+"icon-sort",html+='"></i></a></th>\n';html+="<th></th>\n";html+="</tr>\n";html+="</thead>";html+="<tbody>\n";html+='<tr ng-repeat="'+d.related[b].iterator+" in "+b+'" >\n';html+="<td>{{ $index + ("+d.related[b].iterator+"Page * "+d.related[b].iterator+"PageSize) + 1 }}.</td>\n";
var m=1,p=d.related[b].base?d.related[b].base:b,p=p.replace(/^\//,"");for(l in d.related[b].fields)m++,html+=e({list:d.related[b],fld:l,options:f,base:p});html+='<td class="actions">';for(h in d.related[b].fieldActions)html+='<button class="btn btn-mini',html+=d.related[b].fieldActions[h]["class"]?" "+d.related[b].fieldActions[h]["class"]:"",html+='" ',html+=d.related[b].fieldActions[h].awToolTip?this.attr(d.related[b].fieldActions[h],"awToolTip"):"",html+=this.attr(d.related[b].fieldActions[h],"ngClick")+
">"+this.icon(d.related[b].fieldActions[h].icon),html+=d.related[b].fieldActions[h].label?" "+d.related[b].fieldActions[h].label:"",html+="</button> ";html+="</td>";html+="</tr>\n";html+='<tr class="info" ng-show="'+d.related[b].iterator+"Loading == false && ("+b+" == null || "+b+'.length == 0)">\n';html+='<td colspan="'+m+'"><div class="alert alert-info">No records matched your search.</div></td>\n';html+="</tr>\n";html+='<tr class="info" ng-show="'+d.related[b].iterator+'Loading == true">\n';html+=
'<td colspan="'+m+'"><div class="alert alert-info">Loading...</div></td>\n';html+="</tr>\n";html+="</tbody>\n";html+="</table>\n";html+="</div>\n";html+="</div>\n";html+=c({set:b,iterator:d.related[b].iterator,mini:!0})}a++}html+="</div>\n";return html+="</div>\n"},buildCollections:function(f){var a=1,d=this.form;html='<div id="'+this.form.name+"-collapse-"+a+'" class="jqui-accordion">\n';for(var b in d.related)if("collection"==d.related[b].type){html+="<h3>"+d.related[b].title+"<h3>\n";html+="<div>\n";
d.related[b].instructions&&(html+='<div class="alert alert-info alert-block">\n',html+='<button type="button" class="close" data-dismiss="alert">&times;</button>\n',html+="<strong>Hint: </strong>"+d.related[b].instructions+"\n",html+="</div>\n");html+='<div class="well">\n';html+=g({iterator:d.related[b].iterator,template:d.related[b],mini:!0});html+='<div class="list-actions">\n';for(var h in d.related[b].actions){var l=d.related[b].actions[h];html+='<button class="btn btn-small ';html+=d.related[b].actions[h]["class"]?
d.related[b].actions[h]["class"]:"btn-success";html+='" ';html+=this.attr(l,"ngClick");html+=l.awToolTip?this.attr(l,"awToolTip"):"";html+=l.awToolTip?'data-placement="right" ':"";html+='><i class="'+l.icon+'"></i>';html+=l.label?" "+l.label:"";html+="</button>\n"}html+="</div>\n";html+='<div class="list">\n';html+='<table class="'+d.related[b].iterator+' table table-condensed table-hover">\n';html+="<thead>\n";html+="<tr>\n";html+=void 0==d.related[b].index||!1!==d.related[b].index?"<th>#</th>\n":
"";for(var m in d.related[b].fields)html+='<th class="list-header" id="'+d.related[b].iterator+"-"+m+'-header" ng-click="sort(\''+d.related[b].iterator+"', '"+m+"')\">"+d.related[b].fields[m].label,html+=' <i class="',html=d.related[b].fields[m].key?d.related[b].fields[m].desc?html+"icon-sort-down":html+"icon-sort-up":html+"icon-sort",html+='"></i></a></th>\n';html+="<th></th>\n";html+="</tr>\n";html+="</thead>";html+="<tbody>\n";html+='<tr ng-repeat="'+d.related[b].iterator+" in "+b+'" >\n';if(void 0==
d.related[b].index||!1!==d.related[b].index)html+="<td>{{ $index + ("+d.related[b].iterator+"Page * "+d.related[b].iterator+"PageSize) + 1 }}.</td>\n";var p=1,l=d.related[b].base?d.related[b].base:b,l=l.replace(/^\//,"");for(m in d.related[b].fields)p++,html+=e({list:d.related[b],fld:m,options:f,base:l});html+='<td class="actions">';for(h in d.related[b].fieldActions)l=d.related[b].fieldActions[h],html+='<button class="btn btn-small',html+=l["class"]?" "+l["class"]:"",html+='" '+this.attr(l,"ngClick"),
html+=l.awToolTip?this.attr(l,"awToolTip"):"",html+=l.awToolTip?'data-placement="top" ':"",html+=">"+this.icon(l.icon),html+=l.label?" "+l.label:"",html+="</button> ";html+="</td>";html+="</tr>\n";html+='<tr class="info" ng-show="'+d.related[b].iterator+"Loading == false && ("+b+" == null || "+b+'.length == 0)">\n';html+='<td colspan="'+p+'"><div class="alert alert-info">No records matched your search.</div></td>\n';html+="</tr>\n";html+='<tr class="info" ng-show="'+d.related[b].iterator+'Loading == true">\n';
html+='<td colspan="'+p+'"><div class="alert alert-info">Loading...</div></td>\n';html+="</tr>\n";html+="</tbody>\n";html+="</table>\n";html+="</div>\n";html+="</div>\n";html+=c({set:b,iterator:d.related[b].iterator,mini:!0});html+="</div>\n";a++}html+="</div>\n";return html+="</div>\n"}}}]);angular.module("GeneratorHelpers",["GeneratorHelpers"]).factory("Attr",function(){return function(l,m){var h;h="string"===typeof l[m]?l[m].replace(/\'/g,"&quot;"):l[m];switch(m){case "ngClick":h='ng-click="'+h+'" ';break;case "ngOptions":h='ng-options="'+h+'" ';break;case "ngClass":h='ng-class="'+h+'" ';break;case "ngChange":h='ng-change="'+h+'" ';break;case "ngDisabled":h='ng-disabled="'+h+'" ';break;case "ngShow":h='ng-show="'+h+'" ';break;case "ngHide":h='ng-hide="'+h+'" ';break;case "ngBind":h=
'ng-bind="'+h+'" ';break;case "trueValue":h='ng-true-value="'+h+'" ';break;case "falseValue":h='ng-false-value="'+h+'" ';break;case "awToolTip":h='aw-tool-tip="'+h+'" ';break;case "awPopOver":h="aw-pop-over='"+h+"' ";break;case "dataTitle":h='data-title="'+h+'" ';break;case "dataPlacement":h='data-placement="'+h+'" ';break;case "dataContainer":h='data-container="'+h+'" ';break;case "icon":h='<i class="'+h+(l.iconSize?" icon-"+l.iconSize:"");h+='"></i>';break;case "autocomplete":h='autocomplete="'+
(h?"true":"false");h+='" ';break;default:h=m+'="'+h+'" '}return h}}).factory("Icon",function(){return function(l){return'<i class="'+l+'"></i> '}}).factory("Column",["Attr","Icon",function(l,m){return function(h){var g=h.list,c=h.fld,p=h.options;h=h.base;var f=g.fields[c],e;e="<td "+('<td class="'+c+"-column");e+=f["class"]?" "+f["class"]:"";e+=f.columnClass?" "+f.columnClass:"";e+='" ';e+=f.ngClass?l(f,"ngClass"):"";e+=">\n";e+=f.ngShow?"<span "+l(f,"ngShow")+">":"";g.hasChildren&&f.hasChildren&&
(e+='<span class="level-{{ '+g.iterator+'.event_level }}"><a href="" ng-click="{{ '+g.iterator+'.ngclick }}"> <i class="{{ '+g.iterator+'.ngicon }}" ng-show="\'{{ '+g.iterator+".related.children }}' !== ''\" ></i></a> ");if((f.key||f.link||f.linkTo||f.ngClick)&&"lookup"!=p.mode&&"select"!=p.mode)if(f.linkTo)e+='<a href="#'+f.linkTo+'">';else if(f.ngClick)e+='<a href=""'+l(f,"ngClick")+'">';else if(void 0==f.link||f.link)e+='<a href="#/'+h+"/{{"+g.iterator+'.id }}">';f.ngShowIcon?e+='<i ng-show="'+
f.ngShowIcon+'" class="'+f.icon+'"></i> ':f.icon&&(e+=m(f.icon)+" ");if(void 0==f.showValue||!0==f.showValue)e=f.ngBind?e+("{{ "+f.ngBind+" }}"):e+("{{"+g.iterator+"."+c+"}}");f.text&&(e+=f.text);g.hasChildren&&f.hasChildren&&(e+="</span>");if((f.key||f.link||f.linkTo||f.ngClick)&&"lookup"!=p.mode&&"select"!=p.mode)e+="</a>";e+=f.ngShow?"</span>":"";e+=f.appendHTML?'<div ng-show="'+f.appendHTML+' !== null" ng-bind-html-unsafe="'+f.appendHTML+'" class="level-{{ '+g.iterator+'.event_level }}-detail" ></div>\n':
"";return e+"</td>\n"}}]).factory("SearchWidget",function(){return function(l){var m=l.iterator,h=l.template,g=l.mini;l=l.label?l.label:null;l='<div class="search-widget">\n'+(l?"<label>"+l+"</label>":"");l+='<div class="input-prepend input-append">\n';l+='<div class="btn-group">\n';l+='<button class="btn ';l+=g?"btn-mini ":"btn-small";l+='dropdown-toggle" data-toggle="dropdown">\n';l+='<span ng-bind="'+m+'SearchFieldLabel"></span>\n';l+='<span class="caret"></span>\n';l+="</button>\n";l+='<ul class="dropdown-menu" id="'+
m+'SearchDropdown">\n';for(var c in h.fields)if(void 0==h.fields[c].searchable||!0==h.fields[c].searchable)l+='<li><a href="" ng-click="setSearchField(\''+m+"','",l+=c+"','"+h.fields[c].label+"')\">"+h.fields[c].label+"</a></li>\n";l+="</ul>\n";l+="</div>\n";l+='<select ng-show="'+m+'SelectShow" ng-model="'+m+'SearchSelectValue" ng-change="search(\''+m+"')\" ";l+='ng-options="c.name for c in '+m+'SearchSelectOpts" class="search-select';l+=g?" field-mini-height":"";l+='"></select>\n';l+='<input ng-hide="'+
m+"SelectShow || "+m+'InputHide" class="input-medium';l+=g?" field-mini-height":"";l+='" ng-model="'+m+'SearchValue" ng-change="search(\''+m+'\')" placeholder="Search" type="text" >\n';l+='<div class="btn-group">\n';l+='<button ng-hide="'+m+"SelectShow || "+m+"HideSearchType || "+m+'InputHide" class="btn ';l+=g?"btn-mini ":"btn-small";l+='dropdown-toggle" data-toggle="dropdown">\n';l+='<span ng-bind="'+m+'SearchTypeLabel"></span>\n';l+='<span class="caret"></span>\n';l+="</button>\n";l+='<ul class="dropdown-menu">\n';
l+='<li><a href="" ng-click="setSearchType(\''+m+"','iexact','Exact Match')\">Exact Match</a></li>\n";l+='<li><a href="" ng-click="setSearchType(\''+m+"','icontains','Contains')\">Contains</a></li>\n";l+="</ul>\n";l+="</div>\n";l+="</div>\n";l+='<div class="spin"><i class="icon-spinner icon-spin" ng-show="'+m+'SearchSpin == true"></i></div>\n';return l+="</div>\n"}}).factory("PaginateWidget",function(){return function(l){var m=l.set,h=l.iterator,g=l.mini;l=l.mode?l.mode:null;var c="",c=("lookup"==
l?c+'<div class="lookup-navigation':c+'<div class="footer-navigation')+(g?" related-footer":""),c=c+'">\n',c=c+'<form class="form-inline">\n',c=c+'<button class="previous btn',c=c+(g?' btn-mini" ':'" '),c=c+("ng-click=\"prevSet('"+m+"','"+h+'\')" ng-disabled="'+h+"PrevUrl == null || "+h+'PrevUrl == undefined"><i class="icon-chevron-left"></i> Prev</button>\n'),c=c+'<button class="next btn btn',c=c+(g?' btn-mini" ':'" '),c=c+(" ng-click=\"nextSet('"+m+"','"+h+'\')"ng-disabled="'+h+"NextUrl == null || "+
h+'NextUrl == undefined">Next <i class="icon-chevron-right"></i></button>\n');"lookup"!=l&&(c+='<label class="page-size-label">Rows per page:</label>\n',c+='<select ng-model="'+h+'PageSize" ng-change="changePageSize(\''+m+"','"+h+'\')" class="input-mini',c+=g?" field-mini-height":"",c+=' page-size">\n',c+='<option value="10" selected>10</option>\n',c+='<option value="20" selected>20</option>\n',c+='<option value="40">40</option>\n',c+='<option value="60">60</option>\n',c+='<option value="80">80</option>\n',
c+="</select>\n");c+='<div class="page-number-small" ng-show="'+h+'PageCount > 0" ';c+=">Page: {{ "+h+"Page + 1 }} of {{ "+h+"PageCount }}</div>\n";c+="</form>\n";return c+="</div>\n"}});angular.module("ListGenerator",["GeneratorHelpers"]).factory("GenerateList",["$location","$compile","$rootScope","SearchWidget","PaginateWidget","Attr","Icon","Column",function(l,m,h,g,c,p,f,e){return{setList:function(c){this.list=c},attr:p,icon:f,has:function(c){return this.form[c]&&null!=this.form[c]&&void 0!=this.form[c]?!0:!1},hide:function(){$("#lookup-modal").modal("hide")},inject:function(c,a){var d="lookup"==a.mode?angular.element(document.getElementById("lookup-modal-body")):a.id?angular.element(document.getElementById(a.id)):
"";if("text"==a.type||"password"==a.type||"email"==a.type)if(!a.readonly||a.readonly&&"edit"==d.mode){b=b+'<div class="control-group"'+(a.ngShow?this.attr(a,"ngShow"):"");b+=a.ngHide?this.attr(a,"ngHide"):"";b+=">\n";b+='<label class="control-label';b+=a.labelClass?" "+a.labelClass:"";b+='" for="'+c+'">';b+=a.awPopOver?this.attr(a,"awPopOver"):"";b+=a.icon?this.icon(a.icon):"";b+=a.label+"</label>\n";b+='<div class="controls">\n';b+=a.clear||a.genMD5?'<div class="input-append">\n':"";if(null===a.control||
void 0===a.control||a.control){b+="<input ";b+=this.attr(a,"type");b+='ng-model="'+c+'" ';b+='name="'+c+'" ';b+=a.ngChange?this.attr(a,"ngChange"):"";b+=a.id?this.attr(a,"id"):"";b+=a["class"]?this.attr(a,"class"):"";b+=a.placeholder?this.attr(a,"placeholder"):"";b+="edit"==d.mode&&a.editRequired?"required ":"";b+="add"==d.mode&&a.addRequired?"required ":"";b+=a.readonly||a.showonly?"readonly ":"";b+=a.awPassMatch?'awpassmatch="'+a.associated+'" ':"";b+=a.capitalize?"capitalize ":"";b+=a.ask?'ng-disabled="'+
c+'_ask" ':"";b+=void 0!==a.autocomplete?this.attr(a,"autocomplete"):"";b+=a.awRequiredWhen?'data-awrequired-init="'+a.awRequiredWhen.init+'" aw-required-when="'+a.awRequiredWhen.variable+'" ':"";b+=a.associated&&this.form.fields[a.associated].ask?'ng-disabled="'+a.associated+'_ask" ':"";b+="/>";a.clear&&(b+=' \n<button class="btn" ng-click="clear(\''+c+"','"+a.associated+'\')" aw-tool-tip="Clear '+a.label+'" id="'+c+'-clear-btn"><i class="icon-undo"></i></button>\n',b+="</div>\n");a.genMD5&&(b+=
' \n<button class="btn" ng-click="genMD5(\''+c+'\')" aw-tool-tip="Generate '+a.label+'" data-placement="top" id="'+c+'-gen-btn"><i class="icon-repeat"></i></button>\n',b+="</div>\n");a.ask&&(b+=' \n<label class="checkbox inline ask-checkbox"><input type="checkbox" ng-model="'+c+'_ask" ng-change="ask(\''+c+"','"+a.associated+"')\" /> Ask at runtime?</label>");b+="<br />\n";if("add"==d.mode&&a.addRequired||"edit"==d.mode&&a.editRequired||a.awRequiredWhen)b+='<span class="error" ng-show="'+this.form.name+
"_form."+c+".$dirty && "+this.form.name+"_form."+c+'.$error.required">A value is required!</span>\n';"email"==a.type&&(b+='<span class="error" ng-show="'+this.form.name+"_form."+c+".$dirty && "+this.form.name+"_form."+c+'.$error.email">A valid email address is required!</span>\n');a.awPassMatch&&(b+='<span class="error" ng-show="'+this.form.name+"_form."+c+'.$error.awpassmatch">Must match Password value</span>\n');b+='<span class="error api-error" ng-bind="'+c+'_api_error"></span>\n'}b+="</div>\n";
b+="</div>\n"}if("textarea"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode)){b+='<div class="control-group"';b+=a.ngShow?this.attr(a,"ngShow"):"";b+=">\n";b+='<label class="control-label" for="'+c+'">';b+=a.awPopOver?this.attr(a,"awPopOver"):"";b+=a.label+"</label>\n";b+='<div class="controls">\n';if("variables"==c||"extra_vars"==c||"inventory_variables"==c)b+='<div class="parse-selection">Parse as: <label class="radio inline"><input type="radio" ng-model="',b+=this.form.parseTypeName?this.form.parseTypeName:
"parseType",b+='" value="yaml"> YAML</label>\n',b+='<label class="radio inline"><input type="radio" ng-model="',b+=this.form.parseTypeName?this.form.parseTypeName:"parseType",b+='" value="json"> JSON</label></div>\n';b+="<textarea ";b+=a.rows?this.attr(a,"rows"):"";b+='ng-model="'+c+'" ';b+='name="'+c+'" ';b+=a["class"]?this.attr(a,"class"):"";b+=a.ngChange?this.attr(a,"ngChange"):"";b+=a.id?this.attr(a,"id"):"";b+=a.placeholder?this.attr(a,"placeholder"):"";b+="edit"==d.mode&&a.editRequired?"required ":
"";b+="add"==d.mode&&a.addRequired?"required ":"";b+=a.readonly||a.showonly?"readonly ":"";b+="></textarea><br />\n";if("add"==d.mode&&a.addRequired||"edit"==d.mode&&a.editRequired)b+='<span class="error" ng-show="'+this.form.name+"_form."+c+".$dirty && "+this.form.name+"_form."+c+'.$error.required">A value is required!</span>\n';b+='<span class="error api-error" ng-bind="'+c+'_api_error"></span>\n';b+="</div>\n";b+="</div>\n"}if("select"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode)){b+='<div class="control-group"';
b+=a.ngShow?this.attr(a,"ngShow"):"";b+=">\n";b+='<label class="control-label" for="'+c+'">';b+=a.awPopOver?this.attr(a,"awPopOver"):"";b+=a.label+"</label>\n";b+='<div class="controls">\n';b+="<select ";b+='ng-model="'+c+'" ';b+='name="'+c+'" ';b+=this.attr(a,"ngOptions");b+=a.ngChange?this.attr(a,"ngChange"):"";b+=a.id?this.attr(a,"id"):"";b+="edit"==d.mode&&a.editRequired?"required ":"";b+="add"==d.mode&&a.addRequired?"required ":"";b+=a.readonly?"readonly ":"";b+=">\n";b+='<option value="">Choose '+
a.label+"</option>\n";b+="</select><br />\n";if("add"==d.mode&&a.addRequired||"edit"==d.mode&&a.editRequired)b+='<span class="error" ng-show="'+this.form.name+"_form."+c+".$dirty && "+this.form.name+"_form."+c+'.$error.required">A value is required!</span>\n';b+='<span class="error api-error" ng-bind="'+c+'_api_error"></span>\n';b+="</div>\n";b+="</div>\n"}if("number"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode)){b+='<div class="control-group"';b+=a.ngShow?this.attr(a,"ngShow"):"";b+=">\n";
b+='<label class="control-label" for="'+c+'">';b+=a.awPopOver?this.attr(a,"awPopOver"):"";b+=a.label+"</label>\n";b+='<div class="controls">\n';b+=a.slider?'<div class="slider" id="'+c+'-slider"></div>\n':"";b+='<input type="text" value="'+a["default"]+'" ';b+=a["class"]?this.attr(a,"class"):"";b+=a.slider?'ng-slider="'+c+'" ':"";b+='ng-model="'+c+'" ';b+='name="'+c+'" ';b+=a.min||0==a.min?this.attr(a,"min"):"";b+=a.max?this.attr(a,"max"):"";b+=a.ngChange?this.attr(a,"ngChange"):"";b+=a.slider?'id="'+
c+'-number"':a.id?this.attr(a,"id"):"";b+="edit"==d.mode&&a.editRequired?"required ":"";b+="add"==d.mode&&a.addRequired?"required ":"";b+=a.readonly?"readonly ":"";b+=a.integer?"integer ":"";b+="/>\n";b+="<br />\n";if("add"==d.mode&&a.addRequired||"edit"==d.mode&&a.editRequired)b+='<span class="error" ng-show="'+this.form.name+"_form."+c+".$dirty && "+this.form.name+"_form."+c+'.$error.required">A value is required!</span>\n';a.integer&&(b+='<span class="error" ng-show="'+this.form.name+"_form."+
c+'.$error.integer">Must be an integer value</span>\n');if(a.min||a.max)b+='<span class="error" ng-show="'+this.form.name+"_form."+c+".$error.min || "+this.form.name+"_form."+c+'.$error.max">Must be in range '+a.min+" to "+a.max+"</span>\n";b+='<span class="error api-error" ng-bind="'+c+'_api_error"></span>\n';b+="</div>\n";b+="</div>\n"}if("checkbox"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode))b+='<div class="control-group" ',b+=a.ngShow?this.attr(a,"ngShow"):"",b+=">\n",b+='<div class="controls">\n',
b+='<label class="checkbox">',b+="<input ",b+=this.attr(a,"type"),b+='ng-model="'+c+'" ',b+='name="'+c+'" ',b+=a.ngChange?this.attr(a,"ngChange"):"",b+=a.id?this.attr(a,"id"):"",b+=this.attr(a,"trueValue"),b+=this.attr(a,"falseValue"),b+=a.checked?"checked ":"",b+=a.readonly?"readonly ":"",b+=" /> "+a.label+"\n",b+=a.awPopOver?this.attr(a,"awPopOver"):"",b+="</label>\n",b+='<span class="error api-error" ng-bind="'+c+'_api_error"></span>\n',b+="</div>\n",b+="</div>\n";if("radio"==a.type&&(!a.readonly||
a.readonly&&"edit"==d.mode)){for(var b=b+'<div class="control-group" ',b=b+(a.ngShow?this.attr(a,"ngShow"):""),b=b+">\n",b=b+('<label class="control-label" for="'+c+'">'),b=b+(a.awPopOver?this.attr(a,"awPopOver"):""),b=b+(a.label+"</label>\n"),b=b+'<div class="controls">\n',e=0;e<a.options.length;e++)b+='<label class="radio inline" ',b+=a.options[e].ngShow?this.attr(a.options[e],"ngShow"):"",b+=">",b+='<input type="radio" ',b+='name="'+c+'" ',b+='value="'+a.options[e].value+'" ',b+='ng-model="'+c+
'" ',b+=a.ngChange?this.attr(a,"ngChange"):"",b+=a.readonly?"readonly ":"",b+="edit"==d.mode&&a.editRequired?"required ":"",b+="add"==d.mode&&a.addRequired?"required ":"",b+=" /> "+a.options[e].label+"\n",b+="</label>\n";if("add"==d.mode&&a.addRequired||"edit"==d.mode&&a.editRequired)b+='<p><span class="error" ng-show="'+this.form.name+"_form."+c+".$dirty && "+this.form.name+"_form."+c+'.$error.required">A value is required!</span></p>\n';b+='<p><span class="error api-error" ng-bind="'+c+'_api_error"></span></p>\n';
b+="</div>\n";b+="</div>\n"}if("hidden"==a.type&&("edit"==d.mode&&a.includeOnEdit||"add"==d.mode&&a.includeOnAdd))b+='<input type="hidden" ng-model="'+c+'" name="'+c+'" />';if("lookup"==a.type&&(void 0==a.excludeMode||a.excludeMode!=d.mode)){b+='<div class="control-group"';b+=a.ngShow?this.attr(a,"ngShow"):"";b+=">\n";b+='<label class="control-label" for="'+c+'">';b+=a.awPopOver?this.attr(a,"awPopOver"):"";b+=a.label+"</label>\n";b+='<div class="controls">\n';b+='<div class="input-prepend">\n';b+=
'<button class="lookup-btn btn" '+this.attr(a,"ngClick")+'><i class="icon-search"></i></button>\n';b+='<input class="input-medium" type="text" ';b+='ng-model="'+a.sourceModel+"_"+a.sourceField+'" ';b+='name="'+a.sourceModel+"_"+a.sourceField+'" ';b+=a.ngChange?this.attr(a,"ngChange"):"";b+=a.id?this.attr(a,"id"):"";b+=a.placeholder?this.attr(a,"placeholder"):"";b+="edit"==d.mode&&a.editRequired?"required ":"";b+=a.awRequiredWhen?'data-awrequired-init="'+a.awRequiredWhen.init+'" aw-required-when="'+
a.awRequiredWhen.variable+'" ':"";b+=" awlookup />\n";b+="</div><br />\n";if("add"==d.mode&&a.addRequired||"edit"==d.mode&&a.editRequired||a.awRequiredWhen)b+='<span class="error" ng-show="'+this.form.name+"_form."+a.sourceModel+"_"+a.sourceField+".$dirty && "+this.form.name+"_form."+a.sourceModel+"_"+a.sourceField+'.$error.required">A value is required!</span>\n';b+='<span class="error" ng-show="'+this.form.name+"_form."+a.sourceModel+"_"+a.sourceField+".$dirty && "+this.form.name+"_form."+a.sourceModel+
"_"+a.sourceField+'.$error.awlookup">Value not found</span>\n';b+='<span class="error api-error" ng-bind="'+a.sourceModel+"_"+a.sourceField+'_api_error"></span>\n';b+="</div>\n";b+="</div>\n"}if("custom"==a.type&&(!a.readonly||a.readonly&&"edit"==d.mode))b+='<div class="control-group"',b+=a.ngShow?this.attr(a,"ngShow"):"",b+=">\n",b+='<label class="control-label',b+=a.labelClass?" "+a.labelClass:"",b+='" for="'+c+'">',b+=a.awPopOver?this.attr(a,"awPopOver"):"",b+=a.icon?this.icon(a.icon):"",b+=a.label+
"</label>\n",b+='<div class="controls">\n',b+=a.control,b+="</div>\n",b+="</div>\n";return b},build:function(c){var a="";this.modal||(a+='<div class="nav-path">\n<ul class="breadcrumb">\n',a+='<li ng-repeat="crumb in breadcrumbs"><a href="{{ \'#\' + crumb.path }}">{{ crumb.title | capitalize }}</a> <span class="divider">/</span></li>\n',a+='<li class="active">',a="edit"==c.mode?a+this.form.editTitle:a+this.form.addTitle,a+="</li>\n</ul>\n</div>\n");if(!this.modal&&this.form.statusFields){a+='<div class="well">\n';
if(this.form.statusActions){var a=a+'<div class="status-actions">\n',d;for(action in this.form.statusActions)d=this.form.statusActions[action],a+="<button "+this.attr(d,"ngClick")+'class="btn btn-small',a+=d["class"]?" "+d["class"]:"",a+='" ',a+=d.awToolTip?this.attr(d,"awToolTip"):"",a+=d.awToolTip?'data-placement="top" ':"",a+=" >"+this.icon(d.icon),a+=d.label?d.label:"",a+="</button> ";a+="</div>\n";a+='<div class="status-spin"><i class="icon-spinner icon-spin" ng-show="statusSearchSpin == true"></i></div>\n'}var a=
a+'<div class="status-fields">\n',b;for(b in this.form.statusFields)d=this.form.statusFields[b],a+=this.buildField(b,d,c);a+="</div>\x3c!-- status fields --\x3e\n";a+="</div>\x3c!-- well --\x3e\n"}if(this.form.fieldsAsHeader){a+='<div class="well">\n';a+='<form class="form-inline" name="'+this.form.name+'_form" id="'+this.form.name+'" novalidate >\n';for(b in this.form.fields)d=this.form.fields[b],a+=this.headerField(b,d,c);a+="</form>\n";a+="</div>\n"}else{this.form.collapse&&this.form.collapseMode==
c.mode&&(a+='<div id="'+this.form.name+'-collapse-0" ',a+=this.form.collapseOpen?'data-open="true" ':"",a+='class="jqui-accordion">\n',a+="<h3>"+this.form.collapseTitle+"<h3>\n",a+="<div>\n");this.has("well")&&(a+='<div class="well">\n');a+='<form class="form-horizontal';a+=this.form["class"]?" "+this.form["class"]:"";a+='" name="'+this.form.name+'_form" id="'+this.form.name+'" autocomplete="false" novalidate>\n';a+='<div ng-show="flashMessage != null && flashMessage != undefined" class="alert alert-info">{{ flashMessage }}</div>\n';
if(this.form.twoColumns){a+='<div class="row-fluid">\n';a+='<div class="span6">\n';for(b in this.form.fields)d=this.form.fields[b],1==d.column&&(a+=this.buildField(b,d,c));a+="</div>\x3c!-- column 1 --\x3e\n";a+='<div class="span6">\n';for(b in this.form.fields)d=this.form.fields[b],2==d.column&&(a+=this.buildField(b,d,c));a+="</div>\x3c!-- column 2 --\x3e\n";a+="</div>\x3c!-- inner row --\x3e\n"}else for(b in this.form.fields)d=this.form.fields[b],a+=this.buildField(b,d,c);if(!this.modal){this.has("buttons")&&
(a+=this.form.twoColumns?"<hr />":"",a+='<div class="control-group">\n',a+='<div class="controls buttons">\n');for(var e in this.form.buttons)d=this.form.buttons[e],a+="<button ",a+='class="btn btn-small',a+=d["class"]?" "+d["class"]:"",a+='" ',d.ngClick&&(a+=this.attr(d,"ngClick")),d.ngDisabled&&(a="reset"!==e?a+('ng-disabled="'+this.form.name+"_form.$pristine || "+this.form.name+"_form.$invalid"):a+('ng-disabled="'+this.form.name+"_form.$pristine"),a+=this.form.allowReadonly?" || "+this.form.name+
"ReadOnly == true":"",a+='" '),a+=">",d.icon&&(a+=this.icon(d.icon)),a+=d.label+"</button>\n";this.has("buttons")&&(a+="</div>\n",a+="</div>\n");a+="</form>\n"}this.has("well")&&(a+="</div>\n");this.form.collapse&&this.form.collapseMode==c.mode&&(a+="</div>\n",a+="</div>\n")}if(!this.modal&&this.form.items)for(itm in this.form.items){a+='<div class="well form-items">\n';a+=g({iterator:this.form.items[itm].iterator,template:this.form.items[itm],mini:!1,label:"Filter Events"});a+='<div class="item-count pull-right">Viewing {{ '+
this.form.items[itm].iterator+"Page + 1 }} of {{ "+this.form.items[itm].iterator+"Count }}</div>\n";a+="<hr />\n";a+='<ul class="pager">\n';a+='<li ng-class="'+this.form.items[itm].iterator+'PrevUrlDisable"><a href="" ng-click="prevSet(\''+this.form.items[itm].set+"','"+this.form.items[itm].iterator+"')\">&larr; Prev</a></li>\n";a+='<li ng-class="'+this.form.items[itm].iterator+'NextUrlDisable"><a href="" ng-click="nextSet(\''+this.form.items[itm].set+"','"+this.form.items[itm].iterator+"')\">&rarr; Next</a></li>\n";
a+="</ul>\n";a+='<form class="form-horizontal" name="'+this.form.name+'_items_form" id="'+this.form.name+'_items_form" novalidate>\n';for(b in this.form.items[itm].fields)d=this.form.items[itm].fields[b],a+=this.buildField(b,d,c);a+="</form>\n";a+='<ul class="pager">\n';a+='<li ng-class="'+this.form.items[itm].iterator+'PrevUrlDisable"><a href="" ng-click="prevSet(\''+this.form.items[itm].set+"','"+this.form.items[itm].iterator+"')\">&larr; Prev</a></li>\n";a+='<li ng-class="'+this.form.items[itm].iterator+
'NextUrlDisable"><a href="" ng-click="nextSet(\''+this.form.items[itm].set+"','"+this.form.items[itm].iterator+"')\">&rarr; Next</a></li>\n";a+="</ul>\n";a+="</div>\x3c!-- well --\x3e\n"}"inventory"==this.form.name&&"edit"==c.mode?a+=this.buildTree(c):!this.modal&&(c.related&&this.form.related)&&(a+=this.buildCollections(c));return a},buildTree:function(f){var a=1,d=this.form;html='<div id="'+this.form.name+'-collapse-2" data-open="true" class="jqui-accordion">\n';html+="<h3>Inventory Content<h3>\n";
html+="<div>\n";for(var b in d.related){if("tree"==d.related[b].type)html+='<div class="span5">',html+='<div class="inventory-buttons">',html+='<button ng-click="addGroup()" ng-hide="groupAddHide" id="inv-group-add" class="btn btn-mini btn-success" aw-tool-tip="Add existing groups or create a new group" data-placement="bottom"><i class="icon-plus"></i> Add Groups</button>',html+='<button ng-click="editGroup()" ng-hide="groupEditHide" id="inv-group-edit" class="btn btn-mini btn-success" aw-tool-tip="Edit the selected group" data-placement="bottom" <i class="icon-edit"></i> Edit Group</button>',
html+='<button ng-click="deleteGroup()" ng-hide="groupDeleteHide" id="inv-group-delete" aw-tool-tip="Delete the selected group" data-placement="bottom" class="btn btn-mini btn-danger"><i class="icon-remove"></i> Delete Group</button>',html+="</div>\n",html+='<div id="tree-view"></div>\n',html+='<div class=" inventory-filter">',html+='<span ng-show="has_active_failures == true"><label class="checkbox inline">',html+='<input ng-model="inventoryFailureFilter" ng-change="filterInventory()" type="checkbox">Show only groups with failures</label></span></div>\n',
html+="</div>\n";else{html+='<div id="group-view" class="span7">\n';html+='<div id="hosts-well" class="well">\n';html+='<h4 id="hosts-title">'+d.related[b].title+"</h4>\n";html+=g({iterator:d.related[b].iterator,template:d.related[b],mini:!0});html+='<div class="list-actions">\n';for(var h in d.related[b].actions)html+='<button class="btn btn-mini ',html+=d.related[b].actions[h]["class"]?d.related[b].actions[h]["class"]:"btn-success",html+='" ',html+=d.related[b].actions[h].id?this.attr(d.related[b].actions[h],
"id"):"",html+=this.attr(d.related[b].actions[h],"ngClick"),html+=d.related[b].actions[h].awToolTip?this.attr(d.related[b].actions[h],"awToolTip"):"",html+=d.related[b].actions[h].awToolTip?'data-placement="top" ':"",html+=d.related[b].actions[h].ngHide?this.attr(d.related[b].actions[h],"ngHide"):"",html+='><i class="'+d.related[b].actions[h].icon+'"></i>',html+=d.related[b].actions[h].label?" "+d.related[b].actions[h].label:"",html+="</button>\n";html+="</div>\n";html+='<div class="list">\n';html+=
'<table class="'+d.related[b].iterator+' table table-condensed table-hover">\n';html+="<thead>\n";html+="<tr>\n";html+="<th>#</th>\n";for(var k in d.related[b].fields)html+='<th class="list-header" id="'+d.related[b].iterator+"-"+k+'-header" ng-click="sort(\''+d.related[b].iterator+"', '"+k+"')\">"+d.related[b].fields[k].label,html+=' <i class="',html=d.related[b].fields[k].key?d.related[b].fields[k].desc?html+"icon-sort-down":html+"icon-sort-up":html+"icon-sort",html+='"></i></a></th>\n';html+="<th></th>\n";
html+="</tr>\n";html+="</thead>";html+="<tbody>\n";html+='<tr ng-repeat="'+d.related[b].iterator+" in "+b+'" >\n';html+="<td>{{ $index + ("+d.related[b].iterator+"Page * "+d.related[b].iterator+"PageSize) + 1 }}.</td>\n";var m=1,p=d.related[b].base?d.related[b].base:b,p=p.replace(/^\//,"");for(k in d.related[b].fields)m++,html+=e({list:d.related[b],fld:k,options:f,base:p});html+='<td class="actions">';for(h in d.related[b].fieldActions)html+='<button class="btn btn-mini',html+=d.related[b].fieldActions[h]["class"]?
" "+d.related[b].fieldActions[h]["class"]:"",html+='" ',html+=d.related[b].fieldActions[h].awToolTip?this.attr(d.related[b].fieldActions[h],"awToolTip"):"",html+=this.attr(d.related[b].fieldActions[h],"ngClick")+">"+this.icon(d.related[b].fieldActions[h].icon),html+=d.related[b].fieldActions[h].label?" "+d.related[b].fieldActions[h].label:"",html+="</button> ";html+="</td>";html+="</tr>\n";html+='<tr class="info" ng-show="'+d.related[b].iterator+"Loading == false && ("+b+" == null || "+b+'.length == 0)">\n';
html+='<td colspan="'+m+'"><div class="alert alert-info">No records matched your search.</div></td>\n';html+="</tr>\n";html+='<tr class="info" ng-show="'+d.related[b].iterator+'Loading == true">\n';html+='<td colspan="'+m+'"><div class="alert alert-info">Loading...</div></td>\n';html+="</tr>\n";html+="</tbody>\n";html+="</table>\n";html+="</div>\n";html+="</div>\n";html+=c({set:b,iterator:d.related[b].iterator,mini:!0})}a++}html+="</div>\n";return html+="</div>\n"},buildCollections:function(f){var a=
1,d=this.form;html='<div id="'+this.form.name+"-collapse-"+a+'" class="jqui-accordion">\n';for(var b in d.related)if("collection"==d.related[b].type){html+="<h3>"+d.related[b].title+"<h3>\n";html+="<div>\n";d.related[b].instructions&&(html+='<div class="alert alert-info alert-block">\n',html+='<button type="button" class="close" data-dismiss="alert">&times;</button>\n',html+="<strong>Hint: </strong>"+d.related[b].instructions+"\n",html+="</div>\n");html+='<div class="well">\n';html+=g({iterator:d.related[b].iterator,
template:d.related[b],mini:!0});html+='<div class="list-actions">\n';for(var h in d.related[b].actions){var k=d.related[b].actions[h];html+='<button class="btn btn-small ';html+=d.related[b].actions[h]["class"]?d.related[b].actions[h]["class"]:"btn-success";html+='" ';html+=this.attr(k,"ngClick");html+=k.awToolTip?this.attr(k,"awToolTip"):"";html+=k.awToolTip?'data-placement="right" ':"";html+='><i class="'+k.icon+'"></i>';html+=k.label?" "+k.label:"";html+="</button>\n"}html+="</div>\n";html+='<div class="list">\n';
html+='<table class="'+d.related[b].iterator+' table table-condensed table-hover">\n';html+="<thead>\n";html+="<tr>\n";html+=void 0==d.related[b].index||!1!==d.related[b].index?"<th>#</th>\n":"";for(var m in d.related[b].fields)html+='<th class="list-header" id="'+d.related[b].iterator+"-"+m+'-header" ng-click="sort(\''+d.related[b].iterator+"', '"+m+"')\">"+d.related[b].fields[m].label,html+=' <i class="',html=d.related[b].fields[m].key?d.related[b].fields[m].desc?html+"icon-sort-down":html+"icon-sort-up":
html+"icon-sort",html+='"></i></a></th>\n';html+="<th></th>\n";html+="</tr>\n";html+="</thead>";html+="<tbody>\n";html+='<tr ng-repeat="'+d.related[b].iterator+" in "+b+'" >\n';if(void 0==d.related[b].index||!1!==d.related[b].index)html+="<td>{{ $index + ("+d.related[b].iterator+"Page * "+d.related[b].iterator+"PageSize) + 1 }}.</td>\n";var p=1,k=d.related[b].base?d.related[b].base:b,k=k.replace(/^\//,"");for(m in d.related[b].fields)p++,html+=e({list:d.related[b],fld:m,options:f,base:k});html+='<td class="actions">';
for(h in d.related[b].fieldActions)k=d.related[b].fieldActions[h],html+='<button class="btn btn-small',html+=k["class"]?" "+k["class"]:"",html+='" '+this.attr(k,"ngClick"),html+=k.awToolTip?this.attr(k,"awToolTip"):"",html+=k.awToolTip?'data-placement="top" ':"",html+=">"+this.icon(k.icon),html+=k.label?" "+k.label:"",html+="</button> ";html+="</td>";html+="</tr>\n";html+='<tr class="info" ng-show="'+d.related[b].iterator+"Loading == false && ("+b+" == null || "+b+'.length == 0)">\n';html+='<td colspan="'+
p+'"><div class="alert alert-info">No records matched your search.</div></td>\n';html+="</tr>\n";html+='<tr class="info" ng-show="'+d.related[b].iterator+'Loading == true">\n';html+='<td colspan="'+p+'"><div class="alert alert-info">Loading...</div></td>\n';html+="</tr>\n";html+="</tbody>\n";html+="</table>\n";html+="</div>\n";html+="</div>\n";html+=c({set:b,iterator:d.related[b].iterator,mini:!0});html+="</div>\n";a++}html+="</div>\n";return html+="</div>\n"}}}]);angular.module("GeneratorHelpers",["GeneratorHelpers"]).factory("Attr",function(){return function(k,m){var h;h="string"===typeof k[m]?k[m].replace(/[\'\"]/g,"&quot;"):k[m];switch(m){case "ngClick":h='ng-click="'+h+'" ';break;case "ngOptions":h='ng-options="'+h+'" ';break;case "ngClass":h='ng-class="'+h+'" ';break;case "ngChange":h='ng-change="'+h+'" ';break;case "ngDisabled":h='ng-disabled="'+h+'" ';break;case "ngShow":h='ng-show="'+h+'" ';break;case "ngHide":h='ng-hide="'+h+'" ';break;case "ngBind":h=
'ng-bind="'+h+'" ';break;case "trueValue":h='ng-true-value="'+h+'" ';break;case "falseValue":h='ng-false-value="'+h+'" ';break;case "awToolTip":h='aw-tool-tip="'+h+'" ';break;case "awPopOver":h='<a href="" aw-pop-over="'+h+'" '+(k.dataTitle?'data-title="'+k.dataTitle.replace(/[\'\"]/g,"&quot;")+'" ':"");h+=k.dataPlacement?'data-placement="'+k.dataPlacement.replace(/[\'\"]/g,"&quot;")+'" ':"";h+=k.dataContainer?'data-container="'+k.dataContainer.replace(/[\'\"]/g,"&quot;")+'" ':"";h+='class="help-link" ';
h+='><i class="icon-question-sign"></i></a> ';break;case "dataTitle":h='data-title="'+h+'" ';break;case "dataPlacement":h='data-placement="'+h+'" ';break;case "dataContainer":h='data-container="'+h+'" ';break;case "icon":h='<i class="'+h+(k.iconSize?" icon-"+k.iconSize:"");h+='"></i>';break;case "autocomplete":h='autocomplete="'+(h?"true":"false");h+='" ';break;default:h=m+'="'+h+'" '}return h}}).factory("Icon",function(){return function(k){return'<i class="'+k+'"></i> '}}).factory("Column",["Attr",
"Icon",function(k,m){return function(h){var g=h.list,c=h.fld,p=h.options;h=h.base;var f=g.fields[c],e;e="<td "+('<td class="'+c+"-column");e+=f["class"]?" "+f["class"]:"";e+=f.columnClass?" "+f.columnClass:"";e+='" ';e+=f.ngClass?k(f,"ngClass"):"";e+=">\n";e+=f.ngShow?"<span "+k(f,"ngShow")+">":"";g.hasChildren&&f.hasChildren&&(e+='<span class="level-{{ '+g.iterator+'.event_level }}"><a href="" ng-click="{{ '+g.iterator+'.ngclick }}"> <i class="{{ '+g.iterator+'.ngicon }}" ng-show="\'{{ '+g.iterator+
".related.children }}' !== ''\" ></i></a> ");if((f.key||f.link||f.linkTo||f.ngClick)&&"lookup"!=p.mode&&"select"!=p.mode)if(f.linkTo)e+='<a href="#'+f.linkTo+'">';else if(f.ngClick)e+='<a href=""'+k(f,"ngClick")+'">';else if(void 0==f.link||f.link)e+='<a href="#/'+h+"/{{"+g.iterator+'.id }}">';f.ngShowIcon?e+='<i ng-show="'+f.ngShowIcon+'" class="'+f.icon+'"></i> ':f.icon&&(e+=m(f.icon)+" ");if(void 0==f.showValue||!0==f.showValue)e=f.ngBind?e+("{{ "+f.ngBind+" }}"):e+("{{"+g.iterator+"."+c+"}}");
f.text&&(e+=f.text);g.hasChildren&&f.hasChildren&&(e+="</span>");if((f.key||f.link||f.linkTo||f.ngClick)&&"lookup"!=p.mode&&"select"!=p.mode)e+="</a>";e+=f.ngShow?"</span>":"";e+=f.appendHTML?'<div ng-show="'+f.appendHTML+' !== null" ng-bind-html-unsafe="'+f.appendHTML+'" class="level-{{ '+g.iterator+'.event_level }}-detail" ></div>\n':"";return e+"</td>\n"}}]).factory("SearchWidget",function(){return function(k){var m=k.iterator,h=k.template,g=k.mini;k=k.label?k.label:null;k='<div class="search-widget">\n'+
(k?"<label>"+k+"</label>":"");k+='<div class="input-prepend input-append">\n';k+='<div class="btn-group">\n';k+='<button class="btn ';k+=g?"btn-mini ":"btn-small";k+='dropdown-toggle" data-toggle="dropdown">\n';k+='<span ng-bind="'+m+'SearchFieldLabel"></span>\n';k+='<span class="caret"></span>\n';k+="</button>\n";k+='<ul class="dropdown-menu" id="'+m+'SearchDropdown">\n';for(var c in h.fields)if(void 0==h.fields[c].searchable||!0==h.fields[c].searchable)k+='<li><a href="" ng-click="setSearchField(\''+
m+"','",k+=c+"','"+h.fields[c].label+"')\">"+h.fields[c].label+"</a></li>\n";k+="</ul>\n";k+="</div>\n";k+='<select ng-show="'+m+'SelectShow" ng-model="'+m+'SearchSelectValue" ng-change="search(\''+m+"')\" ";k+='ng-options="c.name for c in '+m+'SearchSelectOpts" class="search-select';k+=g?" field-mini-height":"";k+='"></select>\n';k+='<input ng-hide="'+m+"SelectShow || "+m+'InputHide" class="input-medium';k+=g?" field-mini-height":"";k+='" ng-model="'+m+'SearchValue" ng-change="search(\''+m+'\')" placeholder="Search" type="text" >\n';
k+='<div class="btn-group">\n';k+='<button ng-hide="'+m+"SelectShow || "+m+"HideSearchType || "+m+'InputHide" class="btn ';k+=g?"btn-mini ":"btn-small";k+='dropdown-toggle" data-toggle="dropdown">\n';k+='<span ng-bind="'+m+'SearchTypeLabel"></span>\n';k+='<span class="caret"></span>\n';k+="</button>\n";k+='<ul class="dropdown-menu">\n';k+='<li><a href="" ng-click="setSearchType(\''+m+"','iexact','Exact Match')\">Exact Match</a></li>\n";k+='<li><a href="" ng-click="setSearchType(\''+m+"','icontains','Contains')\">Contains</a></li>\n";
k+="</ul>\n";k+="</div>\n";k+="</div>\n";k+='<div class="spin"><i class="icon-spinner icon-spin" ng-show="'+m+'SearchSpin == true"></i></div>\n';return k+="</div>\n"}}).factory("PaginateWidget",function(){return function(k){var m=k.set,h=k.iterator,g=k.mini;k=k.mode?k.mode:null;var c="",c=("lookup"==k?c+'<div class="lookup-navigation':c+'<div class="footer-navigation')+(g?" related-footer":""),c=c+'">\n',c=c+'<form class="form-inline">\n',c=c+'<button class="previous btn',c=c+(g?' btn-mini" ':'" '),
c=c+("ng-click=\"prevSet('"+m+"','"+h+'\')" ng-disabled="'+h+"PrevUrl == null || "+h+'PrevUrl == undefined"><i class="icon-chevron-left"></i> Prev</button>\n'),c=c+'<button class="next btn btn',c=c+(g?' btn-mini" ':'" '),c=c+(" ng-click=\"nextSet('"+m+"','"+h+'\')"ng-disabled="'+h+"NextUrl == null || "+h+'NextUrl == undefined">Next <i class="icon-chevron-right"></i></button>\n');"lookup"!=k&&(c+='<label class="page-size-label">Rows per page:</label>\n',c+='<select ng-model="'+h+'PageSize" ng-change="changePageSize(\''+
m+"','"+h+'\')" class="input-mini',c+=g?" field-mini-height":"",c+=' page-size">\n',c+='<option value="10" selected>10</option>\n',c+='<option value="20" selected>20</option>\n',c+='<option value="40">40</option>\n',c+='<option value="60">60</option>\n',c+='<option value="80">80</option>\n',c+="</select>\n");c+='<div class="page-number-small" ng-show="'+h+'PageCount > 0" ';c+=">Page: {{ "+h+"Page + 1 }} of {{ "+h+"PageCount }}</div>\n";c+="</form>\n";return c+="</div>\n"}});angular.module("ListGenerator",["GeneratorHelpers"]).factory("GenerateList",["$location","$compile","$rootScope","SearchWidget","PaginateWidget","Attr","Icon","Column",function(k,m,h,g,c,p,f,e){return{setList:function(c){this.list=c},attr:p,icon:f,has:function(c){return this.form[c]&&null!=this.form[c]&&void 0!=this.form[c]?!0:!1},hide:function(){$("#lookup-modal").modal("hide")},inject:function(c,a){var d="lookup"==a.mode?angular.element(document.getElementById("lookup-modal-body")):a.id?angular.element(document.getElementById(a.id)):
angular.element(document.getElementById("htmlTemplate"));this.setList(c);d.html(this.build(a));this.scope=d.scope();m(d)(this.scope);"lookup"==a.mode&&(this.scope.lookupHeader=a.hdr,$("#lookup-modal").modal({backdrop:"static",keyboard:!1}));return this.scope},build:function(f){var a="",d=this.list;if("lookup"!=f.mode&&(void 0==f.breadCrumbs||!0==f.breadCrumbs))a+='<div class="nav-path">\n<ul class="breadcrumb">\n',a+='<li ng-repeat="crumb in breadcrumbs"><a href="{{ \'#\' + crumb.path }}">{{ crumb.title | capitalize }}</a> <span class="divider">/</span></li>\n',
a+='<li class="active">',a="select"==f.mode?a+d.selectTitle:a+d.editTitle,a+="</li>\n</ul>\n</div>\n";"select"==f.mode&&d.selectInstructions?(a+='<div class="alert alert-info alert-block">\n',a+='<button type="button" class="close" data-dismiss="alert">&times;</button>\n',a+="<strong>Hint: </strong>"+d.selectInstructions+"\n",a+="</div>\n"):"edit"==f.mode&&d.editInstructions&&(a+='<div class="alert alert-info alert-block">\n',a+='<button type="button" class="close" data-dismiss="alert">&times;</button>\n',
a+="<strong>Hint: </strong>"+d.editInstructions+"\n",a+="</div>\n");if("lookup"!=f.mode&&(void 0==d.well||"true"==d.well))a+='<div class="well">\n';a="lookup"==f.mode||void 0!=f.id?a+g({iterator:d.iterator,template:d,mini:!0}):a+g({iterator:d.iterator,template:d,mini:!1});if("lookup"!=f.mode){var b=l.path().replace(/^\//,"").split("/")[0],a=a+'<div class="list-actions">\n';for(action in d.actions)if("all"==d.actions[action].mode||d.actions[action].mode==f.mode)if(void 0==d.actions[action].basePaths||
d.actions[action].basePaths&&-1<d.actions[action].basePaths.indexOf(b))a+="<button "+this.attr(d.actions[action],"ngClick")+'class="btn',a+=d.actions[action]["class"]?" "+d.actions[action]["class"]:" btn-small",a+='" ',a+=d.actions[action].ngHide?this.attr(d.actions[action],"ngHide"):"",a+=d.actions[action].awToolTip?this.attr(d.actions[action],"awToolTip"):"",a+=d.actions[action].awToolTip&&void 0==d.actions[action].dataPlacement?'data-placement="top" ':"",a+=d.actions[action].awPopOver?this.attr(d.actions[action],
"awPopOver"):"",a+=d.actions[action].dataPlacement?this.attr(d.actions[action],"dataPlacement"):"",a+=d.actions[action].dataContainer?this.attr(d.actions[action],"dataContainer"):"",a+=d.actions[action].dataTitle?this.attr(d.actions[action],"dataTitle"):"",a+=" >"+this.attr(d.actions[action],"icon"),a+=d.actions[action].label?" "+d.actions[action].label:"",a+="</button> ";if("select"==f.mode&&(void 0==f.selectButton||!0==f.selectButton))a+=' <button class="btn btn-small btn-success" aw-tool-tip="Complete your selection" ng-click="finishSelection()"><i class="icon-ok"></i> Finished</button>\n';
a+="<strong>Hint: </strong>"+d.editInstructions+"\n",a+="</div>\n");if("lookup"!=f.mode&&(void 0==d.well||"true"==d.well))a+='<div class="well">\n';a="lookup"==f.mode||void 0!=f.id?a+g({iterator:d.iterator,template:d,mini:!0}):a+g({iterator:d.iterator,template:d,mini:!1});if("lookup"!=f.mode){var b=k.path().replace(/^\//,"").split("/")[0],a=a+'<div class="list-actions">\n';for(action in d.actions)if("all"==d.actions[action].mode||d.actions[action].mode==f.mode)if(void 0==d.actions[action].basePaths||
d.actions[action].basePaths&&-1<d.actions[action].basePaths.indexOf(b))a+="<button "+this.attr(d.actions[action],"ngClick")+'class="btn',a+=d.actions[action]["class"]?" "+d.actions[action]["class"]:" btn-small",a+='" ',a+=d.actions[action].ngHide?this.attr(d.actions[action],"ngHide"):"",a+=d.actions[action].awToolTip?this.attr(d.actions[action],"awToolTip"):"",a+=d.actions[action].awToolTip&&void 0==d.actions[action].dataPlacement?'data-placement="top" ':"",a+=d.actions[action].awPopOver?'aw-pop-over="'+
d.actions[action].awPopOver.replace(/[\'\"]/g,"&quot;")+'" ':"",a+=d.actions[action].dataPlacement?this.attr(d.actions[action],"dataPlacement"):"",a+=d.actions[action].dataContainer?this.attr(d.actions[action],"dataContainer"):"",a+=d.actions[action].dataTitle?this.attr(d.actions[action],"dataTitle"):"",a+=" >"+this.attr(d.actions[action],"icon"),a+=d.actions[action].label?" "+d.actions[action].label:"",a+="</button> ";if("select"==f.mode&&(void 0==f.selectButton||!0==f.selectButton))a+=' <button class="btn btn-small btn-success" aw-tool-tip="Complete your selection" ng-click="finishSelection()"><i class="icon-ok"></i> Finished</button>\n';
a+="</div>\n"}a+='<table class="table table-condensed';a+=d["class"]?" "+d["class"]:"";if(f.id)a+=" table-hover-inverse";else if("lookup"==f.mode||d.hover)a+=" table-hover";a+='">\n';a+="<thead>\n";a+="<tr>\n";d.index&&(a+="<th>#</th>\n");for(var h in d.fields)if((void 0==d.fields[h].searchOnly||!1==d.fields[h].searchOnly)&&!("lookup"==f.mode&&void 0!==d.fields[h].excludeModal&&!0==d.fields[h].excludeModal)){a+='<th class="list-header';a+=d.fields[h].columnClass?" "+d.fields[h].columnClass:"";a+=
'" id="';a+=d.fields[h].id?d.fields[h].id:h+"-header";a+='"';a+=void 0===d.fields[h].nosort||!0!==d.fields[h].nosort?"ng-click=\"sort('"+h+"')\"":"";a+=">";a+=d.fields[h].label;if(void 0===d.fields[h].nosort||!0!==d.fields[h].nosort)a+=' <i class="',a=d.fields[h].key?d.fields[h].desc?a+"icon-sort-down":a+"icon-sort-up":a+"icon-sort",a+='"></i></a>';a+="</th>\n"}"select"==f.mode?a+="<th>Select</th>":"edit"==f.mode&&(a+="<th></th>\n");a+="</tr>\n";a+="</thead>\n";a+="<tbody>\n";a+="<tr ";a+="lookup"==
f.mode||"select"==f.mode?'ng-class="'+d.iterator+"_{{ "+d.iterator+'.id }}_class" ':"";a+='class="'+d.iterator+'_class" ng-repeat="'+d.iterator+" in "+d.name;a+=d.orderBy?" | orderBy:'"+d.orderBy+"'":"";a+=d.filterBy?" | filter: "+d.filterBy:"";a+='"';a+="lookup"==f.mode||"select"==f.mode?' ng-click="toggle_'+d.iterator+"({{ "+d.iterator+'.id }})"':"";a+=">\n";d.index&&(a+='<td class="index-column">{{ $index + ('+d.iterator+"Page * "+d.iterator+"PageSize) + 1 }}.</td>\n");var m=2,b=d.base?d.base:
d.name,b=b.replace(/^\//,"");for(h in d.fields)if(m++,(void 0==d.fields[h].searchOnly||!1==d.fields[h].searchOnly)&&!("lookup"==f.mode&&void 0!==d.fields[h].excludeModal&&!0==d.fields[h].excludeModal))a+=e({list:d,fld:h,options:f,base:b});if("select"==f.mode)a+='<td><input type="checkbox" name="check_{{'+d.iterator+'.id}}" id="check_{{'+d.iterator+'.id}}" /></td>';else if("edit"==f.mode){a+='<td class="actions">';for(action in d.fieldActions)a+='<button class="btn',a+=d.fieldActions[action]["class"]?
" "+d.fieldActions[action]["class"]:" btn-small",a+='" '+this.attr(d.fieldActions[action],"ngClick"),a+=d.fieldActions[action].ngShow?this.attr(d.fieldActions[action],"ngShow"):"",a+=d.fieldActions[action].awToolTip?this.attr(d.fieldActions[action],"awToolTip"):"",a+=d.fieldActions[action].ngDisabled?this.attr(d.fieldActions[action],"ngDisabled"):"",a+=">",a+=d.fieldActions[action].icon?this.icon(d.fieldActions[action].icon):"",a+=d.fieldActions[action].label?" "+d.fieldActions[action].label:"",a+=
"</button> ";a+="</td>"}a+="</tr>\n";a+='<tr class="info" ng-show="'+d.iterator+"Loading == false && ("+d.name+" == null || "+d.name+'.length == 0)">\n';a+='<td colspan="'+m+'"><div class="alert alert-info">No records matched your search.</div></td>\n';a+="</tr>\n";a+='<tr class="info" ng-show="'+d.iterator+'Loading == true">\n';a+='<td colspan="'+m+'"><div class="alert alert-info">Loading...</div></td>\n';a+="</tr>\n";a+="</tbody>\n";a+="</table>\n";if("lookup"!=f.mode&&(void 0==d.well||"true"==
d.well))a+="</div>\n";return a="lookup"==f.mode||f.id&&"form-modal-body"==f.id?a+c({set:d.name,iterator:d.iterator,mini:!0,mode:"lookup"}):a+c({set:d.name,iterator:d.iterator,mini:!0})}}}]);angular.module("PromptDialog",["Utilities"]).factory("Prompt",["Alert",function(l){return function(l){var h=angular.element(document.getElementById("prompt-modal")),g=h.scope();g.promptHeader=l.hdr;g.promptBody=l.body;var c=null==l["class"]||void 0==l["class"]?"btn-danger":l["class"];$("#prompt-action-btn").addClass(c);g.promptAction=l.action;$(h).modal({backdrop:"static",keyboard:!0,show:!0})}}]);angular.module("RestServices",["ngCookies","AuthService"]).factory("Rest",["$http","$rootScope","$cookieStore","Authorization",function(l,m,h,g){return{setUrl:function(c){this.url=c},auth:{Authorization:"Token "+g.getToken()},pReplace:function(){var c,g;for(c in this.params)g=RegExp("\\:"+c,"gm"),g.test(this.url)&&(this.url=this.url.replace(g,this.params[c]),delete this.params[c])},get:function(c){c=c?c:{};this.params=c.params?c.params:null;this.pReplace();return l({method:"GET",url:this.url,headers:this.auth,
params:this.params})},post:function(c){return l({method:"POST",url:this.url,headers:this.auth,data:c})},put:function(c){return l({method:"PUT",url:this.url,headers:this.auth,data:c})},destroy:function(c){return l({method:"DELETE",url:this.url,headers:this.auth,data:c})}}}]);angular.module("Utilities",[]).factory("ClearScope",function(){return function(l){l=document.getElementById(l);angular.element(l).scope().$destroy()}}).factory("ToggleClass",function(){return function(l,m){$(l)&&$(l).hasClass(m)?$(l).removeClass(m):$(l)&&$(l).addClass(m)}}).factory("Alert",["$rootScope","$location",function(l,m){return function(h,g,c,m,f,e){if(f){if(l.alertHeader2=h,l.alertBody2=g,l.alertClass2=c?c:"alert-error",$("#alert-modal2").modal({show:!0,keyboard:!0,backdrop:"static"}),l.disableButtons2=
e?!0:!1,m)$("#alert-modal2").on("hidden",function(){m()})}else if(l.alertHeader=h,l.alertBody=g,l.alertClass=c?c:"alert-error",$("#alert-modal").modal({show:!0,keyboard:!0,backdrop:"static"}),l.disableButtons=e?!0:!1,m)$("#alert-modal").on("hidden",function(){m()})}}]).factory("ProcessErrors",["$log","Alert",function(l,m){return function(h,g,c,l,f){if(403==c)h="The API responded with a 403 Access Denied error. You do not have permission to perform the requested action. ",h=g.detail?h+("Detail: "+
g.detail):h+"Please contact your system administrator.",m("Access Denied",h);else if(g.non_field_errors)m("Error!",g.non_field_errors);else if(g.detail)m(f.hdr,f.msg+" "+g.detail);else if(g.__all__)m("Error!",g.__all__);else if(l){c=!1;for(var e in l.fields)l.fields[e].realName&&g[l.fields[e].realName]&&(h[e+"_api_error"]=g[l.fields[e]][0],c=!0),l.fields[e].sourceModel?g[e]&&(h[l.fields[e].sourceModel+"_"+l.fields[e].sourceField+"_api_error"]=g[e][0],c=!0):g[e]&&(h[e+"_api_error"]=g[e][0],c=!0);!c&&
f&&m(f.hdr,f.msg)}else m(f.hdr,f.msg)}}]).factory("LoadBreadCrumbs",["$rootScope","$routeParams","$location",function(l,m,h,g){return function(c){if(null!==c&&void 0!==c){for(var g=!1,f=0;f<l.crumbCache.length;f++)if(l.crumbCache[f].path==c.path){g=!0;l.crumbCache[f]=c;break}!1==g&&l.crumbCache.push(c)}c=h.path().replace(/^\//,"").split("/");g="";l.breadcrumbs=[];if(1<c.length)for(var e,k,f=0;f<c.length-1;f++){if(0<f&&c[f].match(/\d+/)){e=c[f-1];k="inventories"==e?"inventory":e.substring(0,e.length-
1);for(var a=0;a<l.crumbCache.length;a++)if(l.crumbCache[a].path=="/"+e+"/"+c[f]){k=l.crumbCache[a].title;break}l.breadcrumbs.push({title:k,path:g+"/"+c[f]})}else l.breadcrumbs.push({title:c[f],path:g+"/"+c[f]});g+="/"+c[f]}}}]).factory("ReturnToCaller",["$location",function(l){return function(m){var h=l.path().replace(/^\//,"").split("/"),g="";m=null==m||void 0==m?h.length-1:m+1;for(var c=0;c<m;c++)g+="/"+h[c];l.path(g)}}]).factory("FormatDate",[function(){return function(l){var m=("0"+(l.getMonth()+
1)).slice(-2)+"/",m=m+(("0"+l.getDate()).slice(-2)+"/"),m=m+(("0"+(l.getFullYear()-2E3)).slice(-2)+" "),m=m+(("0"+l.getHours()).slice(-2)+":"),m=m+(("0"+l.getMinutes()).slice(-2)+":");return m+=("0"+l.getSeconds()).slice(-2)}}]);
d.well))a+="</div>\n";return a="lookup"==f.mode||f.id&&"form-modal-body"==f.id?a+c({set:d.name,iterator:d.iterator,mini:!0,mode:"lookup"}):a+c({set:d.name,iterator:d.iterator,mini:!0})}}}]);angular.module("PromptDialog",["Utilities"]).factory("Prompt",["Alert",function(k){return function(k){var h=angular.element(document.getElementById("prompt-modal")),g=h.scope();g.promptHeader=k.hdr;g.promptBody=k.body;var c=null==k["class"]||void 0==k["class"]?"btn-danger":k["class"];$("#prompt-action-btn").addClass(c);g.promptAction=k.action;$(h).modal({backdrop:"static",keyboard:!0,show:!0})}}]);angular.module("RestServices",["ngCookies","AuthService"]).factory("Rest",["$http","$rootScope","$cookieStore","Authorization",function(k,m,h,g){return{setUrl:function(c){this.url=c},auth:{Authorization:"Token "+g.getToken()},pReplace:function(){var c,g;for(c in this.params)g=RegExp("\\:"+c,"gm"),g.test(this.url)&&(this.url=this.url.replace(g,this.params[c]),delete this.params[c])},get:function(c){c=c?c:{};this.params=c.params?c.params:null;this.pReplace();return k({method:"GET",url:this.url,headers:this.auth,
params:this.params})},post:function(c){return k({method:"POST",url:this.url,headers:this.auth,data:c})},put:function(c){return k({method:"PUT",url:this.url,headers:this.auth,data:c})},destroy:function(c){return k({method:"DELETE",url:this.url,headers:this.auth,data:c})}}}]);angular.module("Utilities",[]).factory("ClearScope",function(){return function(k){k=document.getElementById(k);angular.element(k).scope().$destroy()}}).factory("ToggleClass",function(){return function(k,m){$(k)&&$(k).hasClass(m)?$(k).removeClass(m):$(k)&&$(k).addClass(m)}}).factory("Alert",["$rootScope","$location",function(k,m){return function(h,g,c,m,f,e){if(f){if(k.alertHeader2=h,k.alertBody2=g,k.alertClass2=c?c:"alert-error",$("#alert-modal2").modal({show:!0,keyboard:!0,backdrop:"static"}),k.disableButtons2=
e?!0:!1,m)$("#alert-modal2").on("hidden",function(){m()})}else if(k.alertHeader=h,k.alertBody=g,k.alertClass=c?c:"alert-error",$("#alert-modal").modal({show:!0,keyboard:!0,backdrop:"static"}),k.disableButtons=e?!0:!1,m)$("#alert-modal").on("hidden",function(){m()})}}]).factory("ProcessErrors",["$log","Alert",function(k,m){return function(h,g,c,k,f){if(403==c)h="The API responded with a 403 Access Denied error. You do not have permission to perform the requested action. ",h=g.detail?h+("Detail: "+
g.detail):h+"Please contact your system administrator.",m("Access Denied",h);else if(g.non_field_errors)m("Error!",g.non_field_errors);else if(g.detail)m(f.hdr,f.msg+" "+g.detail);else if(g.__all__)m("Error!",g.__all__);else if(k){c=!1;for(var e in k.fields)k.fields[e].realName&&g[k.fields[e].realName]&&(h[e+"_api_error"]=g[k.fields[e]][0],c=!0),k.fields[e].sourceModel?g[e]&&(h[k.fields[e].sourceModel+"_"+k.fields[e].sourceField+"_api_error"]=g[e][0],c=!0):g[e]&&(h[e+"_api_error"]=g[e][0],c=!0);!c&&
f&&m(f.hdr,f.msg)}else m(f.hdr,f.msg)}}]).factory("LoadBreadCrumbs",["$rootScope","$routeParams","$location",function(k,m,h,g){return function(c){if(null!==c&&void 0!==c){for(var g=!1,f=0;f<k.crumbCache.length;f++)if(k.crumbCache[f].path==c.path){g=!0;k.crumbCache[f]=c;break}!1==g&&k.crumbCache.push(c)}c=h.path().replace(/^\//,"").split("/");g="";k.breadcrumbs=[];if(1<c.length)for(var e,l,f=0;f<c.length-1;f++){if(0<f&&c[f].match(/\d+/)){e=c[f-1];l="inventories"==e?"inventory":e.substring(0,e.length-
1);for(var a=0;a<k.crumbCache.length;a++)if(k.crumbCache[a].path=="/"+e+"/"+c[f]){l=k.crumbCache[a].title;break}k.breadcrumbs.push({title:l,path:g+"/"+c[f]})}else k.breadcrumbs.push({title:c[f],path:g+"/"+c[f]});g+="/"+c[f]}}}]).factory("ReturnToCaller",["$location",function(k){return function(m){var h=k.path().replace(/^\//,"").split("/"),g="";m=null==m||void 0==m?h.length-1:m+1;for(var c=0;c<m;c++)g+="/"+h[c];k.path(g)}}]).factory("FormatDate",[function(){return function(k){var m=("0"+(k.getMonth()+
1)).slice(-2)+"/",m=m+(("0"+k.getDate()).slice(-2)+"/"),m=m+(("0"+(k.getFullYear()-2E3)).slice(-2)+" "),m=m+(("0"+k.getHours()).slice(-2)+":"),m=m+(("0"+k.getMinutes()).slice(-2)+":");return m+=("0"+k.getSeconds()).slice(-2)}}]);

View File

@ -162,7 +162,7 @@ angular.module('JobFormDefinition', [])
dataContainer: '#jobs',
dataTitle: 'Callback URL'
},
callback_url: {d
callback_url: {
label: 'Callback URL',
type: 'text',
addRequired: false,

View File

@ -196,13 +196,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += "<label class=\"control-label";
html += (field.labelClass) ? " " + field.labelClass : "";
html += "\" for=\"" + fld + '">';
if (field.awPopOver) {
html += "<a href=\"\" " + this.attr(field,'awPopOver');
html += (field.dataTitle) ? this.attr(field, 'dataTitle') : "";
html += (field.dataPlacement) ? this.attr(field, 'dataPlacement') : "";
html += (field.dataContainer) ? this.attr(field, 'dataContainer') : "";
html += "><i class=\"icon-info-sign\"></i></a> ";
}
html += (field.awPopOver) ? this.attr(field, 'awPopOver') : "";
html += (field.icon) ? this.icon(field.icon) : "";
html += field.label + '</label>' + "\n";
html += "<div class=\"controls\">\n";
@ -272,13 +266,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += (field.ngShow) ? this.attr(field,'ngShow') : "";
html += ">\n";
html += "<label class=\"control-label\" for=\"" + fld + '">';
if (field.awPopOver) {
html += "<a href=\"\" " + this.attr(field,'awPopOver');
html += (field.dataTitle) ? this.attr(field, 'dataTitle') : "";
html += (field.dataPlacement) ? this.attr(field, 'dataPlacement') : "";
html += (field.dataContainer) ? this.attr(field, 'dataContainer') : "";
html += "><i class=\"icon-info-sign\"></i></a> ";
}
html += (field.awPopOver) ? this.attr(field, 'awPopOver') : "";
html += field.label + '</label>' + "\n";
html += "<div class=\"controls\">\n";
@ -323,12 +311,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += (field.ngShow) ? this.attr(field,'ngShow') : "";
html += ">\n";
html += "<label class=\"control-label\" for=\"" + fld + '">';
if (field.awPopOver) {
html += "<a href=\"\" " + this.attr(field,'awPopOver');
html += (field.dataTitle) ? this.attr(field, 'dataTitle') : "";
html += (field.dataPlacement) ? this.attr(field, 'dataPlacement') : "";
html += "><i class=\"icon-info-sign\"></i></a> ";
}
html += (field.awPopOver) ? this.attr(field, 'awPopOver') : "";
html += field.label + '</label>' + "\n";
html += "<div class=\"controls\">\n";
html += "<select ";
@ -362,12 +345,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += (field.ngShow) ? this.attr(field,'ngShow') : "";
html += ">\n";
html += "<label class=\"control-label\" for=\"" + fld + '">';
if (field.awPopOver) {
html += "<a href=\"\" " + this.attr(field,'awPopOver');
html += (field.dataTitle) ? this.attr(field, 'dataTitle') : "";
html += (field.dataPlacement) ? this.attr(field, 'dataPlacement') : "";
html += "><i class=\"icon-info-sign\"></i></a> ";
}
html += (field.awPopOver) ? this.attr(field, 'awPopOver') : "";
html += field.label + '</label>' + "\n";
html += "<div class=\"controls\">\n";
// Use 'text' rather than 'number' so that our integer directive works correctly
@ -425,16 +403,9 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += (field.checked) ? "checked " : "";
html += (field.readonly) ? "readonly " : "";
html += " /> " + field.label + "\n";
if (field.awPopOver) {
html += "<a href=\"\" " + this.attr(field,'awPopOver');
html += (field.dataTitle) ? this.attr(field, 'dataTitle') : "";
html += (field.dataPlacement) ? this.attr(field, 'dataPlacement') : "";
html += (field.dataContainer) ? this.attr(field, 'dataContainer') : "";
html += "><i class=\"icon-info-sign\"></i></a> ";
}
html += (field.awPopOver) ? this.attr(field, 'awPopOver') : "";
html += "</label>\n";
html += "<span class=\"error api-error\" ng-bind=\"" + fld + "_api_error\"></span>\n";
html += "</div>\n";
html += "</div>\n";
}
@ -447,12 +418,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += (field.ngShow) ? this.attr(field,'ngShow') : "";
html += ">\n";
html += "<label class=\"control-label\" for=\"" + fld + '">';
if (field.awPopOver) {
html += "<a href=\"\" " + this.attr(field,'awPopOver');
html += (field.dataTitle) ? this.attr(field, 'dataTitle') : "";
html += (field.dataPlacement) ? this.attr(field, 'dataPlacement') : "";
html += "><i class=\"icon-info-sign\"></i></a> ";
}
html += (field.awPopOver) ? this.attr(field, 'awPopOver') : "";
html += field.label + '</label>' + "\n";
html += "<div class=\"controls\">\n";
for (var i=0; i < field.options.length; i++) {
@ -493,12 +459,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += (field.ngShow) ? this.attr(field,'ngShow') : "";
html += ">\n";
html += "<label class=\"control-label\" for=\"" + fld + '">';
if (field.awPopOver) {
html += "<a href=\"\" " + this.attr(field,'awPopOver');
html += (field.dataTitle) ? this.attr(field, 'dataTitle') : "";
html += (field.dataPlacement) ? this.attr(field, 'dataPlacement') : "";
html += "><i class=\"icon-info-sign\"></i></a> ";
}
html += (field.awPopOver) ? this.attr(field, 'awPopOver') : "";
html += field.label + '</label>' + "\n";
html += "<div class=\"controls\">\n";
html += "<div class=\"input-prepend\">\n";
@ -541,12 +502,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += "<label class=\"control-label";
html += (field.labelClass) ? " " + field.labelClass : "";
html += "\" for=\"" + fld + '">';
if (field.awPopOver) {
html += "<a href=\"\" " + this.attr(field,'awPopOver');
html += (field.dataTitle) ? this.attr(field, 'dataTitle') : "";
html += (field.dataPlacement) ? this.attr(field, 'dataPlacement') : "";
html += "><i class=\"icon-info-sign\"></i></a> ";
}
html += (field.awPopOver) ? this.attr(field, 'awPopOver') : "";
html += (field.icon) ? this.icon(field.icon) : "";
html += field.label + '</label>' + "\n";
html += "<div class=\"controls\">\n";

View File

@ -12,7 +12,7 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
.factory('Attr', function() {
return function(obj, key) {
var result;
var value = (typeof obj[key] === "string") ? obj[key].replace(/\'/g, '&quot;') : obj[key];
var value = (typeof obj[key] === "string") ? obj[key].replace(/[\'\"]/g, '&quot;') : obj[key];
switch(key) {
case 'ngClick':
result = "ng-click=\"" + value + "\" ";
@ -48,7 +48,13 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
result = "aw-tool-tip=\"" + value + "\" ";
break;
case 'awPopOver':
result = "aw-pop-over='" + value + "' ";
// construct the entire help link
result = "<a href=\"\" aw-pop-over=\"" + value + "\" ";
result += (obj.dataTitle) ? "data-title=\"" + obj['dataTitle'].replace(/[\'\"]/g, '&quot;') + "\" " : "";
result += (obj.dataPlacement) ? "data-placement=\"" + obj['dataPlacement'].replace(/[\'\"]/g, '&quot;') + "\" " : "";
result += (obj.dataContainer) ? "data-container=\"" + obj['dataContainer'].replace(/[\'\"]/g, '&quot;') + "\" " : "";
result += "class=\"help-link\" ";
result += "><i class=\"icon-question-sign\"></i></a> ";
break;
case 'dataTitle':
result = "data-title=\"" + value + "\" ";

View File

@ -129,7 +129,8 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
html += (list.actions[action].ngHide) ? this.attr(list.actions[action],'ngHide') : "";
html += (list.actions[action].awToolTip) ? this.attr(list.actions[action],'awToolTip') : "";
html += (list.actions[action].awToolTip && list.actions[action].dataPlacement == undefined) ? "data-placement=\"top\" " : "";
html += (list.actions[action].awPopOver) ? this.attr(list.actions[action],'awPopOver') : "";
html += (list.actions[action].awPopOver) ? "aw-pop-over=\"" +
list.actions[action].awPopOver.replace(/[\'\"]/g, '&quot;') + "\" " : "";
html += (list.actions[action].dataPlacement) ? this.attr(list.actions[action], 'dataPlacement') : "";
html += (list.actions[action].dataContainer) ? this.attr(list.actions[action], 'dataContainer') : "";
html += (list.actions[action].dataTitle) ? this.attr(list.actions[action], 'dataTitle') : "";