diff options
7 files changed, 46 insertions, 116 deletions
diff --git a/openo-portal/portal-common/src/main/webapp/common/css/login.css b/openo-portal/portal-common/src/main/webapp/common/css/login.css index 4894c02a..93fa8b1c 100644 --- a/openo-portal/portal-common/src/main/webapp/common/css/login.css +++ b/openo-portal/portal-common/src/main/webapp/common/css/login.css @@ -23,8 +23,7 @@ Login page } .login .logo { - margin: 0 auto; - margin-top:60px; + margin: 0 auto; padding: 15px; text-align: center; } @@ -33,14 +32,14 @@ Login page .login .content { background: url(../image/bg-white-lock.png) repeat; width: 360px; - margin: 0 auto; - margin-bottom: 0px; - padding: 30px; - padding-top: 20px; - padding-bottom: 15px; + margin: 0 auto; + margin-top: 150px; + padding: 30px; + padding-top: 20px; + padding-bottom: 15px; border-radius:5px; - -webkit-box-shadow: 2px 3px 3px #717171; - -moz-box-shadow: 2px 3px 3px #717171; + -webkit-box-shadow: 2px 3px 3px #717171; + -moz-box-shadow: 2px 3px 3px #717171; box-shadow: -1px 1px 1px rgba(255,255,255,0.6) inset,-3px 3px 5px rgba(0,0,0,0.2); } diff --git a/openo-portal/portal-common/src/main/webapp/common/default.html b/openo-portal/portal-common/src/main/webapp/common/default.html index 958b4483..1d11b720 100644 --- a/openo-portal/portal-common/src/main/webapp/common/default.html +++ b/openo-portal/portal-common/src/main/webapp/common/default.html @@ -47,7 +47,7 @@ </script> <div class="header navbar navbar-fixed-top mega-menu"> <div class="header-inner"> - <img id="com_zte_ums_ict_framework_img_netnumenLogo" src="image/integration/openo_logo_black.png" width="7%" name_img="com_zte_ums_ict_framework_img" alt="logo" style="margin-left:50px; margin-top:3px;"/> + <img id="com_zte_ums_ict_framework_img_netnumenLogo" src="image/integration/openo_logo_white.png" width="7%" name_img="com_zte_ums_ict_framework_img" alt="logo" style="margin-left:50px; margin-top:3px;"/> <ul class="nav navbar-nav pull-right"> <div class="zte-theme-panel"> <div class="toggler"></div> @@ -75,7 +75,7 @@ <li> <a href="javascript:;" id="trigger_fullscreen"> <i class="fa fa-arrows"></i> - <span id="fullscreen_label"></span> + <span id="com_zte_ums_ict_framework_ui_group_fullscreen" name_i18n="openo_frame_page_i18n"></span> </a> </li> </div> @@ -83,7 +83,7 @@ <li> <a id="trigger_logout" href="#"> <i class="fa fa-key"></i> - <span id="logout_label"></span> + <span id="com_zte_ums_ict_framework_ui_group_logout" name_i18n="openo_frame_page_i18n"></span> </a> </li> </div> @@ -107,7 +107,7 @@ </div> <ul class="col-md-2 more-botton-zone"></ul> </ul> - <div id ="pageableDiv" style ="display: none" class="row row1"> + <div id="pageableDiv" style="display: none" class="row row1"> <div class="col-xs-12" > <div class="row"> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="false"> @@ -163,6 +163,9 @@ <script> jQuery(document).ready(function() { openoFrameWork.init(); + var initLink = document.getElementById('openo_menu_service_service_management_href'); + initLink.target = '_blank'; + initLink.click(); $("#pageLoading").setToHide(); }); </script> diff --git a/openo-portal/portal-common/src/main/webapp/common/i18n/web-framework-login-i18n-en-US.properties b/openo-portal/portal-common/src/main/webapp/common/i18n/web-framework-login-i18n-en-US.properties index 4698f5d3..dc9f9c70 100644 --- a/openo-portal/portal-common/src/main/webapp/common/i18n/web-framework-login-i18n-en-US.properties +++ b/openo-portal/portal-common/src/main/webapp/common/i18n/web-framework-login-i18n-en-US.properties @@ -15,11 +15,11 @@ # openo_login_title=OPEN-O System openo_login_welcome=Welcome -openo_login_userPassword=User Name or Password Error +openo_login_userPasswordError=User name or password is not available. +openo_login_connectError=System error occurred. openo_input_userName=Please Input User Name openo_input_password=Please Input Password openo_login_rememberMe=Remember Me openo_login_username=Username: openo_login_password=Password: openo_login_login=Login -openo_login_error=Login Error diff --git a/openo-portal/portal-common/src/main/webapp/common/js/core/load_menuList.js b/openo-portal/portal-common/src/main/webapp/common/js/core/load_menuList.js index c56952e5..972e782b 100644 --- a/openo-portal/portal-common/src/main/webapp/common/js/core/load_menuList.js +++ b/openo-portal/portal-common/src/main/webapp/common/js/core/load_menuList.js @@ -39,7 +39,7 @@ var initLeftMenu = function() { "</a>"; var templateChild = "<li>" + - "<a href='{url}' class='iframe'>" + + "<a href='{url}' class='iframe' id='{hrefId}'>" + "<i class='{iconClass}'></i>" + "<span id='{id}' name_i18n='{i18nName}'></span>" + "</a>" + @@ -57,6 +57,7 @@ var initLeftMenu = function() { childMenuContent = childMenuContent + templateChild.replace("{id}", childMenus[j].id) .replace("{url}", childMenus[j].url) .replace("{iconClass}", childMenus[j].iconClass) + .replace("{hrefId}", childMenus[j].id + "_href") .replace("{i18nName}", i18nName); } } diff --git a/openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.js b/openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.js index 0ce09df5..92367a71 100644 --- a/openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.js +++ b/openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.js @@ -329,14 +329,14 @@ var s=!function(w,d){ purl.jQuery(window.jQuery); return purl; }); -//把框架所有的ajax请求集中到一起,发一条请求,获取所有的配置信息。 +//把框架所有的ajax请求集中到一起,发一条请求,获取所有的配置信息。 openoFrameWork_conf = { - userName:store.get('username'), + userName:store("loginUserName"), changePassItem:FrameConst.change_pass?FrameConst.change_pass:true, helpMenuItem:false, aboutMenuItem:false, flightMenuItem:false, - fullscreenMenuItem:false, + fullscreenMenuItem:true, logoutMenuItem:true, defaultThemeColor:"ztebluelight2", dbType:"other", @@ -344,10 +344,10 @@ openoFrameWork_conf = { }; $("#currentUser").html(openoFrameWork_conf.userName); -$.ajax({ - url : FrameConst.REST_FRAMECOMMIFO, +$.ajax({ + url : FrameConst.REST_FRAMECOMMIFO, type : "GET", - cache:false, + cache:false, contentType : 'application/json; charset=utf-8', success: function(data){ var tempConf = data; diff --git a/openo-portal/portal-common/src/main/webapp/common/js/login.js b/openo-portal/portal-common/src/main/webapp/common/js/login.js index 61d96b53..1998aef5 100644 --- a/openo-portal/portal-common/src/main/webapp/common/js/login.js +++ b/openo-portal/portal-common/src/main/webapp/common/js/login.js @@ -23,8 +23,6 @@ function loginSubmitHandler() { "password": $("#openo_input_password").val() } - saveUserInfo(); - $.ajax({ url : "/openoapi/auth/v1/tokens", type : "POST", @@ -33,19 +31,26 @@ function loginSubmitHandler() { }).done(function(data) { var topURL = top.window.document.location.href; if (topURL.indexOf("?service") != -1) { - top.window.document.location.href = decodeURIComponent(topURL.substring(topURL.indexOf("?service")+9)); + top.window.document.location.href = decodeURIComponent(topURL.substring(topURL.indexOf("?service") + 9)); } else { top.window.document.location.href = "/openoui/common/default.html"; } + store("loginUserName", $("#openo_input_userName").val()); }).fail(function(data) { + var tipDivId = $("#loginConnError"); if (data.status == 401) { - alert("the username or password is wrong.") - // username or pasword is wrong. - } else { - // system error. + tipDivId = $("#nameOrpwdError"); } - top.window.document.location.href = "/openoui/common/login.html"; - }); + + tipDivId.addClass('alert-danger'); + if (tipDivId.attr("tipstatus") == "normal") { + tipDivId.show(); + } else if (tipDivId.attr("tipstatus") == "close") { + tipDivId.attr("tipstatus", "normal"); + } + }); + + saveUserInfo(); }; var Login = function () { @@ -99,71 +104,12 @@ var Login = function () { return false; } }); - - $("input[name='remember']").bind("click", function () { - saveUserInfo(); - }); - } - - var handleForgetPassword = function () { - $('.forget-form').validate({ - errorElement: 'span', //default input error message container - errorClass: 'help-block', // default input error message class - focusInvalid: false, // do not focus the last invalid input - ignore: "", - rules: { - email: { - required: true, - email: true - } - }, - messages: { - email: { - required: "Email is required." - } - }, - invalidHandler: function (event, validator) { //display error alert on form submit - }, - highlight: function (element) { // hightlight error inputs - $(element).closest('.form-group').addClass('has-error'); // set error class to the control group - }, - success: function (label) { - label.closest('.form-group').removeClass('has-error'); - label.remove(); - }, - errorPlacement: function (error, element) { - error.insertAfter(element.closest('.input-icon')); - }, - submitHandler: function (form) { - form.submit(); - } - }); - - $('.forget-form input').keypress(function (e) { - if (e.which == 13) { - if ($('.forget-form').validate().form()) { - $('.forget-form').submit(); - } - return false; - } - }); - - $('#forget-password').click(function () { - $('.login-form').hide(); - $('.forget-form').show(); - }); - - $('#back-btn').click(function () { - $('.login-form').show(); - $('.forget-form').hide(); - }); } return { //main function to initiate the module init: function () { handleLogin(); - handleForgetPassword(); $.backstretch([ "image/integration/openo_bg_1.jpg", "image/integration//openo_bg_2.jpg", @@ -187,30 +133,12 @@ $(document).ready(function() { function saveUserInfo() { var rmbcheck = $("input[name='remember']"); if (rmbcheck.attr("checked") == true || rmbcheck.is(':checked')) { - var userName = $("#openo_input_userName").val(); - var passWord = $("#openo_input_password").val(); store("remember", "true"); - store("openo_input_userName", username); - store("openo_input_password", passWord); + store("openo_input_userName", $("#openo_input_userName").val()); + store("openo_input_password", $("#openo_input_password").val()); } else { store.remove("remember"); store.remove("openo_input_userName"); store.remove("openo_input_password"); } } - -function logout() { - alert("logout"); - $.ajax({ - url : "/openoapi/auth/v1/tokens" + "?=" + new Date().getTime(), - type : "DELETE", - contentType : 'application/json', - dataType: "text", - success : function() { - top.window.location = "/openoui/auth/v1/login/html/login.html"; - }, - error : function() { - top.window.location = "/openoui/auth/v1/login/html/login.html"; - } - }); -} diff --git a/openo-portal/portal-common/src/main/webapp/common/login.html b/openo-portal/portal-common/src/main/webapp/common/login.html index 5cc1b782..71e3d3b6 100644 --- a/openo-portal/portal-common/src/main/webapp/common/login.html +++ b/openo-portal/portal-common/src/main/webapp/common/login.html @@ -61,19 +61,19 @@ </script> </head> <body class="login"> - <div class="logo"> - <img id="openo_login_logo_white" src="image/integration/openo_logo_pantone.png" width="30%" name_img="openo_login_logo_white_img" style="display:none" alt=""/> - </div> <div class="content"> <form class="login-form"> + <div class="logo"> + <img id="openo_login_logo" src="image/integration/openo_logo_pantone.png" width="100%" style="display:inline"/> + </div> <h3 class="form-title"><span id="openo_login_welcome" name_i18n="openo_login_i18n_login"></span></h3> <div class="alert display-hide" id="nameOrpwdError" tipstatus="normal"> <button class="close" data-close="alert" onclick="hidetip('nameOrpwdError');"></button> - <div id="openo_login_userPassword" name_i18n="openo_login_i18n_login" style="display:inline"></div> + <div id="openo_login_userPasswordError" name_i18n="openo_login_i18n_login" style="display:inline"></div> </div> <div class="alert display-hide" id="loginConnError" tipstatus="normal"> <button class="close" data-close="alert" onclick="hidetip('loginConnError');"></button> - <div id="openo_login_error" name_i18n="openo_login_i18n_login" style="display:inline"></div> + <div id="openo_login_connectError" name_i18n="openo_login_i18n_login" style="display:inline"></div> </div> <div class="form-group"> <label id="openo_login_username" name_i18n="openo_login_i18n_login" class="control-label visible-ie8 visible-ie9" i18n-html="openo_login_username"></label> @@ -104,7 +104,6 @@ <script> jQuery(document).ready(function() { loadi18n_WebFramework('web-framework-login-i18n', 'i18n/', 'openo_login_i18n_login'); - $("#openo_login_logo_white").css('display','inline'); Login.init(); if(store("openo_input_userName")){ $("#openo_input_userName").val(store("openo_input_userName")); |