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 000000000..a4dd30cb9 Binary files /dev/null and b/xCAT-UI/images/logo.png differ 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 | ||||