Parcourir la source

v1.2.2GA ,fix app account

shimingxy il y a 5 ans
Parent
commit
70e25496e3

+ 1 - 1
.classpath

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
 	<classpathentry kind="output" path="bin/default"/>
 </classpath>

+ 13 - 2
maxkey-web-maxkey/src/main/resources/messages/message.properties

@@ -34,6 +34,8 @@ common.text.createdby=\u521B\u5EFA\u4EBA
 common.text.createddate=\u521B\u5EFA\u65F6\u95F4
 common.text.modifiedby=\u4FEE\u6539\u4EBA
 common.text.modifieddate=\u4FEE\u6539\u65F6\u95F4
+common.text.status.enabled=\u542F\u7528
+common.text.status.disabled=\u505C\u7528
 		
 login.text.login.twofactor.obtain.valid=\u91CD\u65B0\u83B7\u53D6
 login.text.login.twofactor.obtain=\u83B7\u53D6\u52A8\u6001\u9A8C\u8BC1\u7801
@@ -139,6 +141,14 @@ userinfo.authnType.authnType.8=RSA\u4EE4\u724C
 userinfo.authnType.authnType.9=\u6570\u5B57\u8BC1\u4E66
 userinfo.authnType.authnType.10=USB Key
 
+#account
+account.username=\u7528\u6237\u540D
+account.displayName=\u7528\u6237\u59D3\u540D
+account.appId=\u5E94\u7528\u7F16\u53F7
+account.appName=\u5E94\u7528\u540D\u79F0
+account.relatedUsername=\u7528\u6237\u8D26\u53F7
+account.relatedPassword=\u8D26\u53F7\u5BC6\u7801
+
 login.totp.sharedSecret=\u5171\u4EAB\u5BC6\u7801
 login.totp.period=\u5468\u671F
 login.totp.digits=\u6570\u5B57
@@ -160,10 +170,12 @@ login.counter.crypto=\u52A0\u5BC6\u65B9\u5F0F
 login.counter.generate=\u91CD\u65B0\u751F\u6210
 login.counter.title=Counter Based One Time Password
 
+apps.number=\u5E8F\u53F7
 apps.icon=\u56FE\u6807
 apps.name=\u5E94\u7528\u540D\u79F0
 apps.protocol=\u8BBF\u95EE\u534F\u8BAE
 apps.category=\u7C7B\u578B
+apps.account=\u8D26\u53F7
 
 button.text.action=\u8BBF\u95EE
 button.text.visit=\u8BBF\u95EE
@@ -212,8 +224,7 @@ navs.setting=\u8BBE\u7F6E
 navs.setting.security=\u5B89\u5168\u8BBE\u7F6E
 navs.setting.sociallink=\u8BA4\u8BC1\u5173\u8054
 navs.setting.changepassword=\u5BC6\u7801\u4FEE\u6539
-navs.setting.apppassword=\u5E94\u7528\u767B\u5F55\u5BC6\u7801
-navs.setting.appsetting=\u5E94\u7528\u914D\u7F6E
+navs.setting.appaccount=\u5E94\u7528\u8D26\u53F7
 navs.setting.timetoken=\u65F6\u95F4\u4EE4\u724C
 
 navs.myprofile=\u6211\u7684\u8D44\u6599

+ 13 - 1
maxkey-web-maxkey/src/main/resources/messages/message_en.properties

@@ -33,6 +33,8 @@ common.text.createdby=CreatedBy
 common.text.createddate=CreatedDate
 common.text.modifiedby=ModifiedBy
 common.text.modifieddate=ModifiedDate
+common.text.status.enabled=enabled
+common.text.status.disabled=disabled
 		
 login.text.login.twofactor.obtain.valid=Regain
 login.text.login.twofactor.obtain=Get dynamic verification code
@@ -138,6 +140,14 @@ userinfo.authnType.authnType.8=RSA Token
 userinfo.authnType.authnType.9=Digital Certificate
 userinfo.authnType.authnType.10=USB Key
 
+#account
+account.username=username
+account.displayName=displayName
+account.appId=appId
+account.appName=appName
+account.relatedUsername=relatedUsername
+account.relatedPassword=relatedPassword
+
 login.totp.sharedSecret=sharedSecret
 login.totp.period=period
 login.totp.digits=digits
@@ -159,10 +169,12 @@ login.counter.crypto=crypto
 login.counter.generate=generate
 login.counter.title=Counter Based One Time Password
 
+apps.number=No.
 apps.icon=Icon
 apps.name=appName
 apps.protocol=protocol
 apps.category=category
+apps.account=account
 
 button.text.action=Action
 button.text.visit=Visit
@@ -213,7 +225,7 @@ navs.setting.security=Security
 navs.setting.sociallink=SocialLink
 navs.setting.changepassword=ChangePassword
 navs.setting.apppassword=AppsPassword
-navs.setting.appsetting=AppsSettings
+navs.setting.appaccount=AppsAccount
 navs.setting.timetoken=Timetoken
 
 navs.myprofile=My Profile

+ 7 - 0
maxkey-web-maxkey/src/main/resources/static/css/base.css

@@ -57,6 +57,13 @@ body{
 	/*border-top: 1px solid #e5e5e5;*/
 }
 
+#topBar .grid_list_sel{
+    width: 31px;
+    height: 31px;
+    border: 1px solid;
+    border-color: #A9A9A9;
+}
+
 .container {
 	width: 990px;
 	margin-left: auto;

+ 1 - 7
maxkey-web-maxkey/src/main/resources/templates/views/layout/nav_primary.ftl

@@ -28,15 +28,9 @@
 					</li>
 				</ul>
 				<ul>
-					<!--应用登录密码-->
-					<li id="nav_second_1303" class="nav_second_level">
-						<a   href="<@base/>/safe/forward/changeAppLoginPasswod"><@locale code="navs.setting.apppassword"/></a>
-					</li>
-				</ul>
-				<ul>
 					<!--应用配置-->
 					<li id="nav_second_1304" class="nav_second_level">
-						<a   href="<@base/>/appConfigList"><@locale code="navs.setting.appsetting"/></a>
+						<a   href="<@base/>/appConfigList"><@locale code="navs.setting.appaccount"/></a>
 					</li>
 				</ul>
 				<ul>

+ 2 - 8
maxkey-web-maxkey/src/main/resources/templates/views/layout/top.ftl

@@ -17,17 +17,11 @@
 					</td>
 					<#if  Session["current_user"].gridList==0 >
 					<td>
-						<img src='<@base/>/static/images/grid_sel.png'  style="width=:31px;height:31px;border:0;">
-					</td>
-					<td>
-						<a href="<@base/>/appList?mnid=110101020000&gridList=1"><img src='<@base/>/static/images/list.png'  style="width=:31px;height:31px;border:0;"></a>
+						<a href="<@base/>/appList?mnid=110101020000&gridList=1"><img class="grid_list_sel" src='<@base/>/static/images/list_sel.png' ></a>
 					</td>
 					<#else>
 					<td>
-						<a href="<@base/>/appList?mnid=110101020000&gridList=0" ><img src='<@base/>/static/images/grid.png'  style="width=:31px;height:31px;border:0;"></a>
-					</td>
-					<td>
-						<img src='<@base/>/static/images/list_sel.png'  style="width=:31px;height:31px;border:0;">
+						<a href="<@base/>/appList?mnid=110101020000&gridList=0" ><img class="grid_list_sel"  src='<@base/>/static/images/grid_sel.png'></a>
 					</td>
 					</#if>
 					<td id="changepassword" nowrap>

+ 53 - 82
maxkey-web-maxkey/src/main/resources/templates/views/main/appConfigList.ftl

@@ -1,86 +1,57 @@
-<script type="text/javascript">	
-$(function () {
-	$(".configUser").on("click",function(){
-		$.window({url:$(this).attr("url"),width:480,height:200});
-	});
-		
-	$(".configProtected").on("click",function(){
-		$.window({url:$(this).attr("url"),width:480,height:200});
+<!DOCTYPE HTML >
+<html>
+<head>
+	<#include  "../layout/header.ftl"/>
+	<#include  "../layout/common.cssjs.ftl"/>
+	<script type="text/javascript">	
+	$(function () {
+		$(".configUser").on("click",function(){
+			$.window({url:$(this).attr("url"),width:480,height:200});
+		});
+			
+		$(".configProtected").on("click",function(){
+			$.window({url:$(this).attr("url"),width:480,height:200});
+		});
 	});
-});
-</script>
-<%if(WebContext.getUserInfo().getGridList()==0) {%>
-<table class="datatable">
-	<c:forEach begin="1" end="${(length(appList)+4)/5}" var="num">
-		<tr>
-			<c:forEach items="${appList}" var="app" begin="${(num-1)*5}" end="${5*num-1}">
-			<td align="left" nowrap  style="width:20%">
-				<c:if test="${null!=app.id}">
-	  				<table class="none" >
-	  				<tr><td  style="text-align: center;border-spacing: 0;border-collapse: collapse;border: 0px;">
-	  					<!-- <a href="<s:Base />/authz/${app.id}" target="_blank" title="${app.name}" ></a> -->
-	  						<img src="<s:Base />/image/${app.id}" title="${app.name}" width="65px;" height="65px;"/>
-	  					
-	  				</td></tr>
-	  				<tr><td style="text-align: center;border-spacing: 0;border-collapse: collapse;border: 0px;">${app.name}</td></tr>
-	  				<tr><td  style="text-align: center;border-spacing: 0;border-collapse: collapse;border: 0px;">${app.protocol}<div>
-	  				<input class="configUser button"  type="button" 
-	  						value="<s:Locale code="access.security.applogin.credential" />" 
-				 		    url="<s:Base/>/forward/appUserConfig/${app.protocol}/${app.credential}/${app.id}"
-				 		    target="window">
-  					<input class="configProtected button"  type="button" 
-  							value="<s:Locale code="access.security.applogin.protection" />" 
-			 		    	url="<s:Base/>/forward/appProtectedConfig/${app.protocol}/${app.credential}/${app.id}"
-			 		    	target="window"></div></td></tr>
-	  				</table>
-	  			</c:if>
-			</td>
-			</c:forEach>
-		</tr>
-	</c:forEach>
-</table>
-<%}else{%>
-<table  class="datatable">
+	</script>
+</head>
+<body>
+<#include  "../layout/top.ftl"/>
+<#include  "../layout/nav_primary.ftl"/>
+<div class="container">
+<table  class="table">
+	<tr>
+		<td>
+			<@locale code="apps.number"/>
+		</td>
+		<td>
+			<@locale code="apps.icon"/>
+		</td>
+		<td><@locale code="apps.name"/></td>
+		<td><@locale code="apps.account"/></td>
+	</tr>
+	<#list appList as app>
 	<tr>
-			<td>
-				<s:Locale code="apps.icon"/>
-			</td>
-			<td><s:Locale code="apps.name"/></td>
-			<td><s:Locale code="apps.protocol"/></td>
-			<td><s:Locale code="apps.category"/></td>
-			<td>
-				<s:Locale code="button.text.action"/>
-			</td>
-			<td>
-				<s:Locale code="button.text.action"/>
-			</td>
-		</tr>
-	<c:forEach items="${appList}" var="app">
-	<c:if test="${null!=app.id}">
-		<tr>
-			<td>
-				<a href="<s:Base />/authz/${app.id}" target="_blank" title="${app.name}" >
-					<img src="<s:Base />/image/${app.id}" title="${app.name}" width="65px;" height="65px;"/>
-				</a>
-			</td>
-			<td>${app.name}</td>
-			<td>${app.protocol}</td>
-			<td>${app.category}</td>
+		<td>${app_index +1 }</td>
+		<td>
+			<img src="<@base/>/image/${app.id}" title="${app.name}" width="65px" height="65px"  style="border:0;"/>
+		</td>
+		<td>${app.name}</td>
+		<td>
+			<#if 3==app.credential>
 			
-			<td>
-				<input class="configUser button"  type="button" 
-	  						value="<s:Locale code="access.security.applogin.credential" />" 
-				 		    url="<s:Base/>/forward/appUserConfig/${app.protocol}/${app.credential}/${app.id}"
-				 		    target="window">
-			</td>
-			<td>
-				<input class="configProtected button"  type="button" 
-  							value="<s:Locale code="access.security.applogin.protection" />" 
-			 		    	url="<s:Base/>/forward/appProtectedConfig/${app.protocol}/${app.credential}/${app.id}"
-			 		    	target="window">
-			</td>
-		</tr>
-	</c:if>
-	</c:forEach>
+			<input class="configUser button btn btn-primary mr-2"  type="button" 
+  						value="<@locale code="apps.account" />" 
+			 		    url="<@base/>/forward/appUserConfig/${app.protocol}/${app.credential}/${app.id}"
+			 		    target="window">
+			 </#if>
+		</td>
+	</tr>
+	</#list>
 </table>
-<%} %>
+</div>
+<div id="footer">
+	<#include  "../layout/footer.ftl"/>
+</div>
+<body>
+</html>

+ 45 - 41
maxkey-web-maxkey/src/main/resources/templates/views/main/appList.ftl

@@ -44,47 +44,51 @@
 
 <table  class="table">
 	<tr>
-			<td>
-				<@locale code="apps.icon"/>
-			</td>
-			<td><@locale code="apps.name"/></td>
-			<!--<td><@locale code="apps.protocol"/></td>-->
-			<td><@locale code="apps.category"/></td>
-			<td>
-				<@locale code="button.text.action"/>
-			</td>
-		</tr>
-	<#list appList as app>
-		<tr>
-			<td>
-				<#if app.protocol?contains("Desktop")>
-					<a href="javascript:void(0);"  title="${app.name}" 
-					onclick="window.open('<@base/>/authz/${app.id}');">
-						<img src="<@base/>/image/${app.id}" title="${app.name}" width="65px" height="65px"  style="border:0;"/>
-					</a>
-				<#else>
-					<a href="<@base/>/authz/${app.id}" target="_blank" title="${app.name}" >
-						<img src="<@base/>/image/${app.id}" title="${app.name}" width="65px" height="65px"  style="border:0;"/>
-					</a>
-				</#if>
-			</td>
-			<td>${app.name}</td>
-			<!--<td>${app.protocol}</td>-->
-			<td>${app.category}</td>
-			<td>
-				<#if app.protocol ?contains("Desktop")>
-					<a href="javascript:void(0);" title="${app.name}" 
-					onclick="window.open('<@base/>/authz/${app.id}');">
-						<@locale code="button.text.visit"/>
-					</a>
-				<#else>
-					<a href="<@base/>/authz/${app.id}" target="_blank" title="${app.name}" >
-						<@locale code="button.text.visit"/>
-					</a>
-				</#if>
-			</td>
-		</tr>
-	</#list>
+		<td>
+			<@locale code="apps.number"/>
+		</td>
+		<td>
+			<@locale code="apps.icon"/>
+		</td>
+		<td><@locale code="apps.name"/></td>
+		<!--<td><@locale code="apps.protocol"/></td>-->
+		<td><@locale code="apps.category"/></td>
+		<td>
+			<@locale code="button.text.action"/>
+		</td>
+	</tr>
+<#list appList as app>
+	<tr>
+		<td>${app_index +1 }</td>
+		<td>
+			<#if app.protocol?contains("Desktop")>
+				<a href="javascript:void(0);"  title="${app.name}" 
+				onclick="window.open('<@base/>/authz/${app.id}');">
+					<img src="<@base/>/image/${app.id}" title="${app.name}" width="65px" height="65px"  style="border:0;"/>
+				</a>
+			<#else>
+				<a href="<@base/>/authz/${app.id}" target="_blank" title="${app.name}" >
+					<img src="<@base/>/image/${app.id}" title="${app.name}" width="65px" height="65px"  style="border:0;"/>
+				</a>
+			</#if>
+		</td>
+		<td>${app.name}</td>
+		<!--<td>${app.protocol}</td>-->
+		<td>${app.category}</td>
+		<td>
+			<#if app.protocol ?contains("Desktop")>
+				<a href="javascript:void(0);" title="${app.name}" 
+				onclick="window.open('<@base/>/authz/${app.id}');">
+					<@locale code="button.text.visit"/>
+				</a>
+			<#else>
+				<a href="<@base/>/authz/${app.id}" target="_blank" title="${app.name}" >
+					<@locale code="button.text.visit"/>
+				</a>
+			</#if>
+		</td>
+	</tr>
+</#list>
 </table>
 </#if>
 </div>

+ 0 - 34
maxkey-web-maxkey/src/main/resources/templates/views/main/appProtectedConfig.ftl

@@ -1,34 +0,0 @@
-<script type="text/javascript">
-
-
-</script>
-	 
-	     <!-- content -->  
-	<form id="actionForm" name="credentialsubmit" action="<@base/>/appProtectedConfig" method="post" type="type">
-		<input type="hidden" id="protocol" name="protocol" value="${protocol}" />
-		<input type="hidden" id="credential" name="credential" value="${credential}" />
-		<table width="420px">
-			<tr style="display:none">
-				<td>uid</td>
-				<td><input type="text" id="uid" name="uid" value="${uid}" /></td>
-			</tr>
-			<tr style="display:none">
-				<td>appId</td>
-				<td><input type="text" id="appId" name="appId" value="${appId}" /></td>
-			</tr>
-			<tr>
-				<td  width="120px"><@locale code="access.security.applogin.protection" /> </td>
-				<td><select  id="protectedappId" name="protectedappId" >
-						<option value="YES" <#if true==protectedappId>selected</#if> ><s:Locale code="common.text.status.3" /></option>
-						<option value="NO"  <#if false==protectedappId>selected</#if>><s:Locale code="common.text.status.4" /></option>
-					</select></td>
-			</tr>
-			<tr >
-				<td><s:Locale code="userinfo.password" /></td>
-				<td><input type="password" id="password" name="password"  /></td>
-			</tr>
-			<tr>
-				<td colspan="2"><input class="button" type="submit" style="width: 400px" id="credentialsubmitbutton"value="<@locale code="button.text.save" />"/></td>
-			</tr>
-		</table>
-	</form>

+ 26 - 12
maxkey-web-maxkey/src/main/resources/templates/views/main/appUserConfig.ftl

@@ -1,33 +1,47 @@
-<script type="text/javascript">
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<#include  "../layout/header.ftl"/>
+	<#include  "../layout/common.cssjs.ftl"/>
+	<script type="text/javascript">
 
 
-</script>
-	 
-	     <!-- content -->  
+	</script>
+<style   type="text/css">
+  .table th, .table td {
+    padding: .2rem;
+    vertical-align: middle;
+  }
+</style>
+</head>
+<body>
+	 <!-- content -->  
 	<form id="actionForm" name="credentialsubmit" action="<@base/>/appUserConfig" method="post">
 		<input type="hidden" id="protocol" name="protocol" value="${protocol}" />
 		<input type="hidden" id="credential" name="credential" value="${credential}" />
-		<table width="420px">
+		<table  class="table table-bordered">
 			
 			<tr <#if false==username>style="display:none"</#if>>
-				<td><@locale code="userinfo.appaccouts.relatedUsername" /></td>
-				<td><input type="text" id="identity_username" name="identity_username" value="${identity_username}" /></td>
+				<td><@locale code="account.relatedUsername" /></td>
+				<td><input  class="form-control"  type="text" id="identity_username" name="identity_username" value="${identity_username!}" /></td>
 			</tr>
 			<tr <#if false==password> style="display:none"</#if> >
-				<td><@locale code="userinfo.appaccouts.relatedPassword" /></td>
-				<td><input type="password" id="identity_password" name="identity_password" value="${identity_password}" /></td>
+				<td><@locale code="account.relatedPassword" /></td>
+				<td><input  class="form-control"  type="password" id="identity_password" name="identity_password" value="${identity_password!}" /></td>
 			</tr>
 			
 			<tr style="display:none">
 				<td>uid</td>
-				<td><input type="text" id="uid" name="uid" value="${uid}" /></td>
+				<td><input  class="form-control"  type="text" id="uid" name="uid" value="${uid}" /></td>
 			</tr>
 			<tr style="display:none">
 				<td>appId</td>
-				<td><input type="text" id="appId" name="appId" value="${appId}" /></td>
+				<td><input  class="form-control"  type="text" id="appId" name="appId" value="${appId}" /></td>
 			</tr>
 			<tr>
-				<td colspan="2"><input class="button" type="submit" style="width: 400px" id="credentialsubmitbutton"value="<@locale code="button.text.save" />"/></td>
+				<td colspan="2"><input  class="button btn btn-primary mr-3"  type="submit" style="width: 400px" id="credentialsubmitbutton"value="<@locale code="button.text.save" />"/></td>
 			</tr>
 		</table>
 	</form> 
+</body>
+</html>

+ 1 - 1
maxkey-web-maxkey/src/main/resources/templates/views/profile/myProfile.ftl

@@ -39,7 +39,7 @@
 					</td>
 					<th style="width:15%;"><@locale code="userinfo.userType" />:</th>
 					<td  style="width:35%;">
-						<input readonly type="text" id="userType" name="userType"  title="" value="${model.userType !}"/>
+						<input  class="form-control"  readonly type="text" id="userType" name="userType"  title="" value="${model.userType !}"/>
 					</td>
 				</tr>
 				<tr>

+ 1 - 1
maxkey-web-maxkey/src/main/resources/templates/views/safe/setting.ftl

@@ -17,7 +17,7 @@
 	  <table  class="table table-bordered" >
 			<tbody>
 			<tr>
-				<th  colspan="2">authnSetting</th>
+				<th  colspan="2"><@locale code="userinfo.authnType" /></th>
 			</tr>
 			<tr>
 				<th><@locale code="userinfo.displayName" /> :</th>