mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Fixed bug in login license warning causing the warning to be displayed 2x.
This commit is contained in:
parent
42071315b5
commit
554f8225d8
@ -22,8 +22,7 @@ SECRET_KEY = None
|
||||
ALLOWED_HOSTS = []
|
||||
|
||||
# Production should only use minified JS for UI.
|
||||
# CLH 6/20/13 - leave the following set to False until we actually have minified js ready
|
||||
USE_MINIFIED_JS = False
|
||||
USE_MINIFIED_JS = True
|
||||
|
||||
# URL used by inventory script and callback plugin to access API.
|
||||
INTERNAL_API_URL = 'http://127.0.0.1:80'
|
||||
|
||||
6
awx/ui/static/js/awx-min.js
vendored
6
awx/ui/static/js/awx-min.js
vendored
@ -2,9 +2,9 @@
|
||||
* Copyright (c) 2013 AnsibleWorks, Inc.
|
||||
* All rights reserved
|
||||
*
|
||||
* ansibleworks-min.js
|
||||
* awx-min.js
|
||||
*
|
||||
* master-f0cf62a, Wed Jul 3 18:43:51 2013 -0400
|
||||
* master-a774576, Mon Jul 8 13:28:56 2013 -0400
|
||||
*
|
||||
*/
|
||||
var urlPrefix="/static/";
|
||||
@ -284,7 +284,7 @@ icon:"icon-plus",mode:"all",ngClick:"addTeam()","class":"btn-success btn-small",
|
||||
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(h,m,k,g){return function(){h.get("/api/").success(function(c,p,f,e){var l=c.current_version;h.get(l).success(function(a,c,b,e){a.base=l;m.defaultUrls=a;k.remove("api");k.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(h,m,k){return function(g){null==h.defaultUrls||void 0==h.defaultUrls?(g=m.get("api")[g],k()):g=h.defaultUrls[g];return g}}]);angular.module("AuthService",["ngCookies"]).factory("Authorization",["$http","$rootScope","$location","$cookieStore",function(h,m,k,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 h({method:"POST",url:"/api/v1/authtoken/",data:{username:c,password:g}})},logout:function(){m.current_user={};g.remove("token");g.remove("token_expire");g.remove("current_user");m.userLoggedIn=!1},getLicense:function(){return h({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_test?m.license_test:(c=g.get("license"))&&void 0!==c.tested?c.tested:!1;return c},getUser:function(){return h({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")},
|
||||
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 h({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(h,m,k,g){g.$parsers.unshift(function(c){var h=$('input[name="'+k.awpassmatch+'"]').val();if(c==h)return g.$setValidity("awpassmatch",!0),c;g.$setValidity("awpassmatch",!1)})}}}).directive("capitalize",function(){return{require:"ngModel",link:function(h,m,k,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(h,m,k,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",
|
||||
|
||||
@ -84,8 +84,8 @@ angular.module('AuthService', ['ngCookies'])
|
||||
|
||||
licenseTested: function() {
|
||||
var result;
|
||||
if ($rootScope.license_test !== undefined) {
|
||||
result = $rootScope.license_test;
|
||||
if ($rootScope.license_tested !== undefined) {
|
||||
result = $rootScope.license_tested;
|
||||
}
|
||||
else {
|
||||
var license = $cookieStore.get('license');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user