MaxKey 3 лет назад
Родитель
Сommit
86aa0f9ed9

+ 11 - 0
maxkey-core/src/main/java/org/maxkey/entity/apps/Apps.java

@@ -140,6 +140,9 @@ public class Apps extends JpaBaseEntity implements Serializable {
     
     @Column
     private String adapter;
+    
+    @Column
+    protected int accountMgmt;
 
     protected Accounts appUser;
     @Column
@@ -583,6 +586,14 @@ public class Apps extends JpaBaseEntity implements Serializable {
 		this.adapterName = adapterName;
 	}
 
+	public int getAccountMgmt() {
+		return accountMgmt;
+	}
+
+	public void setAccountMgmt(int accountMgmt) {
+		this.accountMgmt = accountMgmt;
+	}
+
 	@Override
 	public String toString() {
 		StringBuilder builder = new StringBuilder();

+ 28 - 21
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/AppsMapper.xml

@@ -4,23 +4,27 @@
 
 	<sql id="where_statement">
 		<if test="id != null and id != ''">
-			and id = #{id}
+			and id 			= #{id}
 		</if>
 		<if test="name != null and name != ''">
-			and name  like  '%${name}%'
+			and name  		like  	'%${name}%'
 		</if>
 		<if test="protocol != null and protocol != ''">
-			and protocol = #{protocol}
+			and protocol 	= #{protocol}
 		</if>
 		<if test="credential != null and credential != ''">
-			and credential = #{credential}
+			and credential 	= #{credential}
 		</if>
 		<if test="category != null and category != ''">
-			and category = #{category}
+			and category 	= #{category}
 		</if>
 		<if test="vendor != null and vendor != ''">
-			and vendor = #{vendor}
+			and vendor 		= #{vendor}
 		</if>
+		<if test="accountMgmt == 1 or accountMgmt == 2">
+			and accountmgmt = #{accountMgmt}
+		</if>
+		
 	</sql>
 	
 	
@@ -67,6 +71,7 @@
 			
 			principal,
 			credentials,
+			accountmgmt,
 			
 			visible,
 			
@@ -108,6 +113,7 @@
 			
 			#{principal},
 			#{credentials},
+			#{accountMgmt},
 			
 			#{visible},
 			
@@ -125,17 +131,17 @@
 	
 	<update id="updateApp" parameterType="Apps" >
     	update mxk_apps set
-    		name			=	#{name},
+    		name				=	#{name},
     		<if test="icon != null">
-			icon			=	#{icon},
+			icon				=	#{icon},
 			</if>
-			loginurl		=	#{loginUrl},
-			protocol		=	#{protocol},
-			category		=	#{category},
-			secret 			=	#{secret},
-			description		=	#{description},
-			vendor			=	#{vendor},
-			vendorurl		=	#{vendorUrl},
+			loginurl			=	#{loginUrl},
+			protocol			=	#{protocol},
+			category			=	#{category},
+			secret 				=	#{secret},
+			description			=	#{description},
+			vendor				=	#{vendor},
+			vendorurl			=	#{vendorUrl},
 			
 			credential			=	#{credential},
 			sharedusername		=	#{sharedUsername},
@@ -154,20 +160,21 @@
 			adaptername			=	#{adapterName},
 			adapter				=	#{adapter},
 			</if>
-			principal		=	#{principal},
-			credentials		=	#{credentials},
+			principal			=	#{principal},
+			credentials			=	#{credentials},
+			accountmgmt			=	#{accountMgmt},
 			visible				=	#{visible},
 			sortindex			=	#{sortIndex},
 			
-			modifiedby		=	#{modifiedBy},
-			modifieddate	=	#{modifiedDate},
+			modifiedby			=	#{modifiedBy},
+			modifieddate		=	#{modifiedDate},
 			
-			status			=	#{status},
+			status				=	#{status},
 
 			logouturl			=	#{logoutUrl},
 			logouttype			=	#{logoutType}
     	where 
-			ID	=	#{id}
+			ID					=	#{id}
     </update>
     
     <select id="queryMyApps" parameterType="UserApps" resultType="UserApps">

+ 9 - 2
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/apps/contorller/ApplicationsController.java

@@ -33,6 +33,7 @@ import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
@@ -48,8 +49,14 @@ public class ApplicationsController extends BaseAppContorller {
 	}
 	
 	@RequestMapping(value={"/select"})
-	public ModelAndView select(){
-		return new ModelAndView("apps/selectAppsList");
+	public ModelAndView select(@RequestParam(name="accountMgmt",required=false) String accountMgmt){
+		ModelAndView modelAndView=new ModelAndView("apps/selectAppsList");
+		if(accountMgmt != null) {
+			modelAndView.addObject("accountMgmt", accountMgmt);
+		}else {
+			modelAndView.addObject("accountMgmt", 3);
+		}
+		return modelAndView;
 	}
 	
 	

+ 1 - 0
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message.properties

@@ -313,6 +313,7 @@ apps.extendAttr.parameter.type=\u7c7b\u578b
 apps.extendAttr.parameter.value=\u503c
 apps.principal=\u51ed\u8bc1
 apps.credentials=\u79d8\u94a5
+apps.accountMgmt=\u8D26\u53F7\u7BA1\u7406
 #adapter
 apps.adapter.name=\u540D\u79F0
 apps.adapter.adapter=\u9002\u914D\u5668

+ 1 - 0
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_en.properties

@@ -316,6 +316,7 @@ apps.extendAttr.parameter.type=type
 apps.extendAttr.parameter.value=value
 apps.principal=principal
 apps.credentials=credentials
+apps.accountMgmt=AccountMgmt
 
 #adapter
 apps.adapter.name=name

+ 1 - 1
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_zh_CN.properties

@@ -315,7 +315,7 @@ apps.extendAttr.parameter.type=\u7c7b\u578b
 apps.extendAttr.parameter.value=\u503c
 apps.principal=\u51ed\u8bc1
 apps.credentials=\u79d8\u94a5
-
+apps.accountMgmt=\u8D26\u53F7\u7BA1\u7406
 apps.adapter.name=\u540D\u79F0
 apps.adapter.adapter=\u9002\u914D\u5668
 apps.adapter.protocol=\u534F\u8BAE

+ 1 - 1
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accounts/accountsAdd.ftl

@@ -73,7 +73,7 @@
 				</td>
 				<td>
 				    <input class="button btn btn-primary mr-3 window"  type="button"    id="selectAppsubmitBtn" value="<@locale code="button.text.select" />"
-                      wurl="<@base/>/apps/select"
+                      wurl="<@base/>/apps/select?accountMgmt=1"
                                     wwidth="800"
                                     wheight="620"
                                     target="window"/>

+ 10 - 1
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/apps/appAddCommon.ftl

@@ -31,8 +31,17 @@
       </tr>
       <tr>
          <th><@locale code="apps.logoutUrl"/>:</th>
+         <td colspan="3">
+            <input type="text" class="form-control"  id="logoutUrl" name="logoutUrl" size="100"  title="" value=""  required=""   />
+         </td>
+      </tr>
+      <tr>
+         <th><@locale code="apps.accountMgmt"/>:</th>
          <td>
-            <input  type="text" id="logoutUrl" class="form-control"  name="logoutUrl"  title="" value=""/>
+         	<select  id="accountMgmt" name="accountMgmt" class="form-control  form-select" >
+				<option value="1" ><@locale code="common.text.status.enabled"/></option>
+				<option value="2" selected ><@locale code="common.text.status.disabled"/></option>
+			</select>
          </td>
          <th><@locale code="apps.logoutType"/></th>
          <td>

+ 10 - 1
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/apps/appUpdateCommon.ftl

@@ -31,8 +31,17 @@
       </tr>
       <tr>
          <th><@locale code="apps.logoutUrl"/>:</th>
+         <td colspan="3">
+            <input type="text" class="form-control" id="logoutUrl" name="logoutUrl"  title="" value="${model.logoutUrl!}"  required="" />
+         </td>
+      </tr>
+      <tr>
+         <th><@locale code="apps.accountMgmt"/>:</th>
          <td>
-            <input  type="text" id="logoutUrl" class="form-control"  name="logoutUrl"  title="" value="${model.logoutUrl!}"/>
+         	<select  id="accountMgmt" name="accountMgmt" class="form-control  form-select" >
+				<option value="1" <#if 1==model.accountMgmt!>selected</#if> ><@locale code="common.text.status.enabled"/></option>
+				<option value="2" <#if 2==model.accountMgmt!>selected</#if> ><@locale code="common.text.status.disabled"/></option>
+			</select>
          </td>
          <th><@locale code="apps.logoutType"/></th>
          <td>

+ 1 - 0
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/apps/selectAppsList.ftl

@@ -31,6 +31,7 @@
 		 			<td  width="300px" nowrap>
 		 				<form id="basic_search_form">
 			 				<input type="text" class="form-control" name="name" >
+			 				<input type="hidden" class="form-control" name="accountMgmt" value="${accountMgmt}">
 		 				 </form>
 		 			</td>
 		 			<td colspan="2">