diff options
| author | Ed Tanous <ed.tanous@intel.com> | 2017-03-03 14:19:33 -0800 |
|---|---|---|
| committer | Ed Tanous <ed.tanous@intel.com> | 2017-03-03 14:19:33 -0800 |
| commit | 38bdb986b9133f5d728cc44b3d82321ce132eee3 (patch) | |
| tree | a5546e1f070c547f19dafe10969dc66e21d6e8fc /static/js | |
| parent | 904063f6e5eccdd15d7a9d2a21200f99abc679ae (diff) | |
| download | bmcweb-38bdb986b9133f5d728cc44b3d82321ce132eee3.tar.gz bmcweb-38bdb986b9133f5d728cc44b3d82321ce132eee3.zip | |
incremetnal
Diffstat (limited to 'static/js')
| -rw-r--r-- | static/js/bmcApp.js | 36 | ||||
| -rw-r--r-- | static/js/logincontroller.js | 32 | ||||
| -rw-r--r-- | static/js/run_prettify.js | 2 |
3 files changed, 33 insertions, 37 deletions
diff --git a/static/js/bmcApp.js b/static/js/bmcApp.js index dfd4d4b..7392c47 100644 --- a/static/js/bmcApp.js +++ b/static/js/bmcApp.js @@ -130,42 +130,6 @@ app.controller('PaginationDemoCtrl', function($scope, $log) { angular .module('Authentication') - .controller('LoginController', [ - '$scope', '$rootScope', '$location', '$state', 'AuthenticationService', - function($scope, $rootScope, $location, $state, AuthenticationService) { - $scope.logoutreason = AuthenticationService.logoutreason; - - $scope.login = function() { - $scope.dataLoading = true; - AuthenticationService.Login( - $scope.username, $scope.password, - function(response) { - AuthenticationService.SetCredentials( - $scope.username, response.token); - if (typeof $state.after_login_state === "undefined") { - $state.after_login_state = "systeminfo"; - } - $state.go($state.after_login_state); - delete $state.after_login_state; - - }, - function(response) { - if (response.status === 401) { - // reset login status - AuthenticationService.ClearCredentials( - "Username or Password is incorrect"); - } - $scope.logoutreason = AuthenticationService.logoutreason; - $scope.error = response.message; - $scope.dataLoading = false; - }); - }; - } - ]); - -angular - .module('Authentication') - .factory( 'AuthenticationService', [ diff --git a/static/js/logincontroller.js b/static/js/logincontroller.js new file mode 100644 index 0000000..d0b7a7f --- /dev/null +++ b/static/js/logincontroller.js @@ -0,0 +1,32 @@ +angular.module('Authentication').controller('LoginController', [ + '$scope', '$rootScope', '$location', '$state', 'AuthenticationService', + function($scope, $rootScope, $location, $state, AuthenticationService) { + $scope.logoutreason = AuthenticationService.logoutreason; + + $scope.login = function() { + $scope.dataLoading = true; + AuthenticationService.Login( + $scope.username, $scope.password, + function(response) { + AuthenticationService.SetCredentials( + $scope.username, response.token); + if (typeof $state.after_login_state === "undefined") { + $state.after_login_state = "systeminfo"; + } + $state.go($state.after_login_state); + delete $state.after_login_state; + + }, + function(response) { + if (response.status === 401) { + // reset login status + AuthenticationService.ClearCredentials( + "Username or Password is incorrect"); + } + $scope.logoutreason = AuthenticationService.logoutreason; + $scope.error = response.message; + $scope.dataLoading = false; + }); + }; + } +]);
\ No newline at end of file diff --git a/static/js/run_prettify.js b/static/js/run_prettify.js index 1aab571..8204930 100644 --- a/static/js/run_prettify.js +++ b/static/js/run_prettify.js @@ -31,7 +31,7 @@ (function(){function ba(g){function k(){try{M.doScroll("left")}catch(g){t.setTimeout(k,50);return}z("poll")}function z(k){if("readystatechange"!=k.type||"complete"==A.readyState)("load"==k.type?t:A)[B](p+k.type,z,!1),!q&&(q=!0)&&g.call(t,k.type||k)}var Y=A.addEventListener,q=!1,C=!0,x=Y?"addEventListener":"attachEvent",B=Y?"removeEventListener":"detachEvent",p=Y?"":"on";if("complete"==A.readyState)g.call(t,"lazy");else{if(A.createEventObject&&M.doScroll){try{C=!t.frameElement}catch(da){}C&&k()}A[x](p+ "DOMContentLoaded",z,!1);A[x](p+"readystatechange",z,!1);t[x](p+"load",z,!1)}}function U(){V&&ba(function(){var g=N.length;ca(g?function(){for(var k=0;k<g;++k)(function(g){t.setTimeout(function(){t.exports[N[g]].apply(t,arguments)},0)})(k)}:void 0)})}for(var t=window,A=document,M=A.documentElement,O=A.head||A.getElementsByTagName("head")[0]||M,B="",F=A.getElementsByTagName("script"),q=F.length;0<=--q;){var P=F[q],Z=P.src.match(/^[^?#]*\/run_prettify\.js(\?[^#]*)?(?:#.*)?$/);if(Z){B=Z[1]||"";P.parentNode.removeChild(P); break}}var V=!0,H=[],Q=[],N=[];B.replace(/[?&]([^&=]+)=([^&]+)/g,function(g,k,z){z=decodeURIComponent(z);k=decodeURIComponent(k);"autorun"==k?V=!/^[0fn]/i.test(z):"lang"==k?H.push(z):"skin"==k?Q.push(z):"callback"==k&&N.push(z)});q=0;for(B=H.length;q<B;++q)(function(){var g=A.createElement("script");g.onload=g.onerror=g.onreadystatechange=function(){!g||g.readyState&&!/loaded|complete/.test(g.readyState)||(g.onerror=g.onload=g.onreadystatechange=null,--T,T||t.setTimeout(U,0),g.parentNode&&g.parentNode.removeChild(g), -g=null)};g.type="text/javascript";g.src="../static/css/loader/lang-"+encodeURIComponent(H[q])+".js";O.insertBefore(g,O.firstChild)})(H[q]);for(var T=H.length,F=[],q=0,B=Q.length;q<B;++q)F.push("https://cdn.rawgit.com/google/code-prettify/master/loader/skins/"+encodeURIComponent(Q[q])+".css");F.push("../static/css/prettify.css");(function(g){function k(q){if(q!==z){var t=A.createElement("link");t.rel="stylesheet";t.type= +g=null)};g.type="text/javascript";g.src="../css/loader/lang-"+encodeURIComponent(H[q])+".js";O.insertBefore(g,O.firstChild)})(H[q]);for(var T=H.length,F=[],q=0,B=Q.length;q<B;++q)F.push("https://cdn.rawgit.com/google/code-prettify/master/loader/skins/"+encodeURIComponent(Q[q])+".css");F.push("../css/prettify.css");(function(g){function k(q){if(q!==z){var t=A.createElement("link");t.rel="stylesheet";t.type= "text/css";q+1<z&&(t.error=t.onerror=function(){k(q+1)});t.href=g[q];O.appendChild(t)}}var z=g.length;k(0)})(F);var ca=function(){window.PR_SHOULD_USE_CONTINUATION=!0;var g;(function(){function k(a){function d(e){var b=e.charCodeAt(0);if(92!==b)return b;var a=e.charAt(1);return(b=W[a])?b:"0"<=a&&"7">=a?parseInt(e.substring(1),8):"u"===a||"x"===a?parseInt(e.substring(2),16):e.charCodeAt(1)}function f(e){if(32>e)return(16>e?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return"\\"===e||"-"=== e||"]"===e||"^"===e?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[0-9A-Fa-f]{4}|\\x[0-9A-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\s\S]|-|[^-\\]/g);e=[];var a="^"===b[0],c=["["];a&&c.push("^");for(var a=a?1:0,h=b.length;a<h;++a){var l=b[a];if(/\\[bdsw]/i.test(l))c.push(l);else{var l=d(l),n;a+2<h&&"-"===b[a+1]?(n=d(b[a+2]),a+=2):n=l;e.push([l,n]);65>n||122<l||(65>n||90<l||e.push([Math.max(65,l)|32,Math.min(n,90)|32]),97>n||122<l||e.push([Math.max(97,l)&-33,Math.min(n,122)&-33]))}}e.sort(function(e, a){return e[0]-a[0]||a[1]-e[1]});b=[];h=[];for(a=0;a<e.length;++a)l=e[a],l[0]<=h[1]+1?h[1]=Math.max(h[1],l[1]):b.push(h=l);for(a=0;a<b.length;++a)l=b[a],c.push(f(l[0])),l[1]>l[0]&&(l[1]+1>l[0]&&c.push("-"),c.push(f(l[1])));c.push("]");return c.join("")}function g(e){for(var a=e.source.match(/(?:\[(?:[^\x5C\x5D]|\\[\s\S])*\]|\\u[A-Fa-f0-9]{4}|\\x[A-Fa-f0-9]{2}|\\[0-9]+|\\[^ux0-9]|\(\?[:!=]|[\(\)\^]|[^\x5B\x5C\(\)\^]+)/g),c=a.length,d=[],h=0,l=0;h<c;++h){var n=a[h];"("===n?++l:"\\"===n.charAt(0)&&(n= |

