From e940c1935b4c22cccd051b34c42b604dd674fc07 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Wed, 8 Jun 2011 05:14:43 +0000 Subject: [PATCH] redesign the login dialog git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9761 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/css/style.css | 39 ++++++++++++++++++++++++++++++ xCAT-UI/images/logo.png | Bin 0 -> 5691 bytes xCAT-UI/js/xcatauth.js | 52 ++++++++++++++++++++++------------------ xCAT-UI/lib/ui.php | 22 ++++++++++------- 4 files changed, 81 insertions(+), 32 deletions(-) create mode 100644 xCAT-UI/images/logo.png diff --git a/xCAT-UI/css/style.css b/xCAT-UI/css/style.css index 6e51fb9b1..09558fabf 100644 --- a/xCAT-UI/css/style.css +++ b/xCAT-UI/css/style.css @@ -30,6 +30,45 @@ .tooltip h3 { margin: 0px; } +/*--------------- login dialog ---------*/ +#logdialog { + width: 600px; +} + +#logdialog td{ + width: 110px; + height: 30px; + color: #0078AE; + font-size: 14px; + font-weight: bold; +} + +#logdialog input{ + width: 225px; + border: solid 1px #0078AE; + font-size: 14px; +} + +#logdialog p{ + + font-size: 18px; +} + +#logdialog button{ + font-weight: bold; + width: 90px; +} + +#loginput { + background-color: #f5f5f5; + height: 260px; +} + +#loginfo{ + text-align:right; + color: #f5f5f5; + font-weight:bold; +} /*--------------- Header ---------------*/ #header { diff --git a/xCAT-UI/images/logo.png b/xCAT-UI/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a4dd30cb98aa93929fb2e30b76611d3c9586926b GIT binary patch literal 5691 zcmWkyc|6nqAOCE#%`r!bZ8seZ=cK9;IWBl_Ska->}dTr`2gr&PX!p_|bvHvtS z-Mny7W!~mWrAEc|e+mkUIkVZcCRCQuLncZ1dp&k=Tp*9i#*@XSLZqW=uqwjmuM^KY z`!96L$t*=mNo(J|$|hZ^*n4Z=5;xW?S+x8Q2akKy3Mdck5(-OW9d|=Dd?~HHZ&9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AS~IFtvUEP81XvWE=7>o@9A@;&Kmb`6h7W>RhqGeSYTg_$^U8(he?wmmMZoqPKv%+=%Qp07DaEdE()fs_lRx%{DO|d){oLw zqF=%R*MrS8CW+NJanH~UB{J3vd3Czo$}jR7`_^l_Wh)U z1^a9*d^+p|-dg%)A_BQ` zn${u&&_>_{3+(KXvHZ(9N3B$yyd_i!S4|15Pg+#D=vF-6-m}4nEOglFfjV!*JPSn1 ziG~AYk@&elCcK4PyM&WeVCJ=JK>dMUldiS*tdrthjBIViojXr^DZx4xm@qd`)zF5q zsjC?7sGS7Wp!`-)^2$;1tG_afW!+Hp#b-)$%SD2X2HskURaQ3Dg{y}1gPAX&J)gmE z9oj~O0B-4+;APnNn7ew0AYv*60n^a+{8R8Mq5o?`&ydEYTT6BD;3QRg(zT~l#FTx6 zsUOK0Aqk_DZaEt4!!w*=Lt|nisz!ndQM#5oa?ReB#p*f)0` zej0@S2G*TkZLK`)ra&gviWf&M}N n#@x@#o2;%^(n?l>YJ-4dsm;c<=RPu$?JwYR#NFwIBQf=Vn1HqQ literal 0 HcmV?d00001 diff --git a/xCAT-UI/js/xcatauth.js b/xCAT-UI/js/xcatauth.js index a86ec48c4..e449f8d69 100644 --- a/xCAT-UI/js/xcatauth.js +++ b/xCAT-UI/js/xcatauth.js @@ -5,28 +5,35 @@ $(document).ready(function() { $('#header').remove(); $('#content').remove(); - $("#logdialog").dialog( { - modal : true, - closeOnEscape : false, - closebutton : false, - height : 300, - width : 350, - autoOpen : true, - buttons : { - "Log in" : authenticate - }, - open : function(type, dialog) { - if (document.location.protocol == "http:") { - $("#logstatus").html("You are using an unencrypted session!"); - $("#logstatus").css("color", "#ff0000"); - } - if ($("#username").val() == "") { - $("#username").focus(); - } else { - $("#password").focus(); - } - } - }); + var winheight = document.body.clientHeight; + var diaheight = $('#logdialog').css('height'); + diaheight = diaheight.substr(0, diaheight.length - 2); + diaheight = Number(diaheight); + //the window's height is to small to show the dialog + var tempheight = 0; + if ((winheight - 50) < diaheight){ + tempheight = 0; + } + else{ + tempheight = parseInt((winheight - diaheight - 50) / 2); + } + + $('#logdialog').css('margin', tempheight + 'px auto'); + $('button').bind('click', function(){ + authenticate(); + }); + + $('button').button(); + + if (document.location.protocol == "http:") { + $("#logstatus").html("You are using an unencrypted session!"); + $("#logstatus").css("color", "#ff0000"); + } + if ($("#username").val() == "") { + $("#username").focus(); + } else { + $("#password").focus(); + } // When enter is hit while in username, advance to password $("#username").keydown(function(event) { @@ -57,7 +64,6 @@ function onlogin(data, txtStatus) { $("#password").val(""); if (data.authenticated == "yes") { $("#logstatus").text("Login successful"); - $("#logdialog").dialog("close"); // Not the first time to log if ($.cookie('logonflag')){ diff --git a/xCAT-UI/lib/ui.php b/xCAT-UI/lib/ui.php index 0b146aa51..e0ad9eb84 100644 --- a/xCAT-UI/lib/ui.php +++ b/xCAT-UI/lib/ui.php @@ -83,15 +83,19 @@ function login() { echo ' -
-

Give the user name and password for the xCAT management node

-
- - - -
-
-

+
+
+ + + + + + + + +

eXtreme Cloud Administration Toolkit

+
+
Open Source. EPL License
'; } ?> \ No newline at end of file