From 31d2e690182dde9ca0ea525b86d87e3f9c143d21 Mon Sep 17 00:00:00 2001 From: shimingxy Date: Fri, 20 Sep 2019 00:09:08 +0800 Subject: [PATCH] freemark --- .../main/java/org/maxkey/domain/Groups.java | 59 ++++- .../maxkey/web/InitApplicationContext.java | 32 ++- .../src/main/java/org/maxkey/web/tag/St.java | 15 ++ .../maxkey/web/tag/StaticTagDirective.java | 68 ++++++ .../persistence/xml/mysql/AccountsMapper.xml | 14 +- .../xml/mysql/ApplicationsMapper.xml | 13 +- .../persistence/xml/mysql/GroupsMapper.xml | 13 +- .../bin/main/.gitignore | 2 - .../maxkey-protocol-cas/bin/main/.gitignore | 2 +- .../bin/main/.gitignore | 2 - .../bin/main/.gitignore | 2 - .../bin/main/.gitignore | 2 +- .../maxkey-protocol-ltpa/bin/main/.gitignore | 2 - .../bin/main/.gitignore | 2 +- .../bin/main/.gitignore | 1 - .../bin/main/.gitignore | 2 - maxkey-web-manage/.classpath | 14 +- .../org.eclipse.core.resources.prefs | 3 +- .../org.eclipse.wst.common.component | 6 +- .../java/org/maxkey/MaxKeyMgtApplication.java | 34 ++- .../main/java/org/maxkey/MaxKeyMgtConfig.java | 16 +- .../web/contorller/AccountsController.java | 8 +- .../maxkey/web/endpoint/CaptchaEndpoint.java | 4 +- .../src/main/resources/log4j2.xml | 2 +- .../resources/messages/message.properties | 19 ++ .../views/accounts/appAccountsList.ftl | 214 ++++++++++-------- .../templates/views/apps/appsList.ftl | 116 ++++------ .../templates/views/apps/cas/appAdd.ftl | 19 +- .../templates/views/apps/cas/appUpdate.ftl | 23 +- .../templates/views/apps/desktop/appAdd.ftl | 67 +++--- .../views/apps/desktop/appUpdate.ftl | 69 +++--- .../templates/views/apps/extendapi/appAdd.ftl | 57 +++-- .../views/apps/extendapi/appUpdate.ftl | 59 +++-- .../templates/views/apps/formbased/appAdd.ftl | 64 +++--- .../views/apps/formbased/appUpdate.ftl | 65 +++--- .../templates/views/apps/ltpa/appAdd.ftl | 47 ++-- .../templates/views/apps/ltpa/appUpdate.ftl | 53 ++--- .../templates/views/apps/oauth20/appAdd.ftl | 57 +++-- .../views/apps/oauth20/appUpdate.ftl | 61 +++-- .../templates/views/apps/saml20/appAdd.ftl | 59 +++-- .../templates/views/apps/saml20/appUpdate.ftl | 65 +++--- .../views/apps/tokenbased/appAdd.ftl | 12 +- .../views/apps/tokenbased/appUpdate.ftl | 13 +- .../config/ipaddrfilter/ipaddrfilterList.ftl | 197 ++++++++++++++++ ...drfilterList.jsp => ipaddrfilterList2.jsp} | 0 .../config/passwordpolicy/passwordpolicy.ftl | 13 +- .../templates/views/exception/error.ftl | 5 + .../views/groupapp/addGroupAppsList.jsp | 12 - .../views/groupapp/groupAppsList.jsp | 13 +- .../templates/views/groups/groupAdd.jsp | 6 +- .../templates/views/groups/groupsList.ftl | 158 +++++++++---- .../views/logs/loginAppsHistoryList.ftl | 158 +++++++++---- .../views/logs/loginAppsHistoryList2.ftl | 85 +++++++ .../templates/views/logs/loginHistoryList.ftl | 162 +++++++++++++ .../templates/views/logs/loginHistoryList.jsp | 79 ------- .../views/logs/loginHistoryList2.ftl | 93 ++++++++ .../templates/views/logs/logsList.ftl | 150 ++++++++++++ .../templates/views/logs/logsList.jsp | 99 -------- .../templates/views/logs/logsList2.ftl | 73 ++++++ .../main/resources/templates/views/main.ftl | 13 +- .../templates/views/orgs/orgsList.ftl | 2 +- .../templates/views/orgs/orgsList2.jsp | 206 +++++++++++++++++ .../templates/views/report/loginApp.ftl | 14 +- .../templates/views/report/loginBrowser.ftl | 14 +- .../templates/views/report/loginDay.ftl | 12 +- .../templates/views/report/loginMonth.ftl | 12 +- .../templates/views/report/loginYear.ftl | 12 +- .../views/userinfo/changePassword.ftl | 12 +- .../views/userinfo/selectUserTypeList.jsp | 64 ------ .../java/org/maxkey/MaxKeyApplication.java | 27 ++- .../main/java/org/maxkey/MaxKeyConfig.java | 13 ++ .../src/main/resources/log4j2.xml | 2 +- 72 files changed, 2062 insertions(+), 1101 deletions(-) create mode 100644 maxkey-core/src/main/java/org/maxkey/web/tag/St.java create mode 100644 maxkey-core/src/main/java/org/maxkey/web/tag/StaticTagDirective.java delete mode 100644 maxkey-protocols/maxkey-protocol-authorize/bin/main/.gitignore delete mode 100644 maxkey-protocols/maxkey-protocol-desktop/bin/main/.gitignore delete mode 100644 maxkey-protocols/maxkey-protocol-extendapi/bin/main/.gitignore delete mode 100644 maxkey-protocols/maxkey-protocol-ltpa/bin/main/.gitignore delete mode 100644 maxkey-protocols/maxkey-protocol-tokenbased/bin/main/.gitignore create mode 100644 maxkey-web-manage/src/main/resources/templates/views/config/ipaddrfilter/ipaddrfilterList.ftl rename maxkey-web-manage/src/main/resources/templates/views/config/ipaddrfilter/{ipaddrfilterList.jsp => ipaddrfilterList2.jsp} (100%) create mode 100644 maxkey-web-manage/src/main/resources/templates/views/exception/error.ftl create mode 100644 maxkey-web-manage/src/main/resources/templates/views/logs/loginAppsHistoryList2.ftl create mode 100644 maxkey-web-manage/src/main/resources/templates/views/logs/loginHistoryList.ftl delete mode 100644 maxkey-web-manage/src/main/resources/templates/views/logs/loginHistoryList.jsp create mode 100644 maxkey-web-manage/src/main/resources/templates/views/logs/loginHistoryList2.ftl create mode 100644 maxkey-web-manage/src/main/resources/templates/views/logs/logsList.ftl delete mode 100644 maxkey-web-manage/src/main/resources/templates/views/logs/logsList.jsp create mode 100644 maxkey-web-manage/src/main/resources/templates/views/logs/logsList2.ftl create mode 100644 maxkey-web-manage/src/main/resources/templates/views/orgs/orgsList2.jsp delete mode 100644 maxkey-web-manage/src/main/resources/templates/views/userinfo/selectUserTypeList.jsp diff --git a/maxkey-core/src/main/java/org/maxkey/domain/Groups.java b/maxkey-core/src/main/java/org/maxkey/domain/Groups.java index b5f47e039..174201131 100644 --- a/maxkey-core/src/main/java/org/maxkey/domain/Groups.java +++ b/maxkey-core/src/main/java/org/maxkey/domain/Groups.java @@ -2,11 +2,13 @@ package org.maxkey.domain; import java.io.Serializable; +import javax.persistence.Table; + import org.apache.mybatis.jpa.persistence.JpaBaseDomain; import org.hibernate.validator.constraints.Length; - +@Table(name = "GROUPS") public class Groups extends JpaBaseDomain implements Serializable{ /** * @@ -18,7 +20,12 @@ public class Groups extends JpaBaseDomain implements Serializable{ @Length(max=60) private String name; private int isdefault; - + String description; + String createdBy; + String createdDate; + String modifiedBy; + String modifiedDate; + String status; public Groups() {} @@ -58,6 +65,54 @@ public class Groups extends JpaBaseDomain implements Serializable{ this.isdefault = isdefault; } + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public String getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(String createdDate) { + this.createdDate = createdDate; + } + + public String getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(String modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public String getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(String modifiedDate) { + this.modifiedDate = modifiedDate; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + /* (non-Javadoc) * @see java.lang.Object#toString() */ diff --git a/maxkey-core/src/main/java/org/maxkey/web/InitApplicationContext.java b/maxkey-core/src/main/java/org/maxkey/web/InitApplicationContext.java index 969743b5b..e287169ed 100644 --- a/maxkey-core/src/main/java/org/maxkey/web/InitApplicationContext.java +++ b/maxkey-core/src/main/java/org/maxkey/web/InitApplicationContext.java @@ -21,6 +21,8 @@ import org.maxkey.util.PathUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.web.context.support.WebApplicationContextUtils; @@ -28,8 +30,11 @@ import org.springframework.web.context.support.WebApplicationContextUtils; * @author Crystal.Sea * */ -public class InitWebContext extends HttpServlet { - private static final Logger _logger = LoggerFactory.getLogger(InitWebContext.class); +public class InitApplicationContext extends HttpServlet { + private static final Logger _logger = LoggerFactory.getLogger(InitApplicationContext.class); + + ApplicationContext applicationContext; + /** * */ @@ -62,8 +67,12 @@ public class InitWebContext extends HttpServlet { /** * */ - public InitWebContext() { - + public InitApplicationContext() { + this.applicationContext=WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()); + } + + public InitApplicationContext(ConfigurableApplicationContext applicationContext) { + this.applicationContext=applicationContext; } public void loadCaches(){ @@ -71,8 +80,8 @@ public class InitWebContext extends HttpServlet { _logger.info("Load Caches "); try { - if(WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()).containsBean("cacheFactory")){ - CacheFactory cacheFactory=WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()).getBean("cacheFactory", CacheFactory.class); + if(applicationContext.containsBean("cacheFactory")){ + CacheFactory cacheFactory=applicationContext.getBean("cacheFactory", CacheFactory.class); cacheFactory.start(); } } catch (BeansException e) { @@ -82,11 +91,11 @@ public class InitWebContext extends HttpServlet { } public void listDataBaseVariables(){ - if(WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()).containsBean("dataSource")){ + if(applicationContext.containsBean("dataSource")){ try { _logger.info("----------------------------------------------------------------------------------------------------"); _logger.info("List DatabaseMetaData Variables "); - Connection connection = ((javax.sql.DataSource)WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()).getBean("dataSource")).getConnection(); + Connection connection = ((javax.sql.DataSource)applicationContext.getBean("dataSource")).getConnection(); java.sql.DatabaseMetaData databaseMetaData = connection.getMetaData(); _logger.info("DatabaseProductName : " + databaseMetaData.getDatabaseProductName()); @@ -113,10 +122,10 @@ public class InitWebContext extends HttpServlet { //propertySourcesPlaceholderConfigurer public void listProperties(){ - if(WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()).containsBean("propertySourcesPlaceholderConfigurer")){ + if(applicationContext.containsBean("propertySourcesPlaceholderConfigurer")){ _logger.info("----------------------------------------------------------------------------------------------------"); _logger.info("List Properties Variables "); - PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = ((PropertySourcesPlaceholderConfigurer)WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()).getBean("propertySourcesPlaceholderConfigurer")); + PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = ((PropertySourcesPlaceholderConfigurer)applicationContext.getBean("propertySourcesPlaceholderConfigurer")); Properties properties=(Properties)propertySourcesPlaceholderConfigurer.getAppliedPropertySources().get(PropertySourcesPlaceholderConfigurer.LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME).getSource(); Set keyValue = properties.keySet(); SortedSet keyValueSet=new TreeSet(); @@ -158,8 +167,7 @@ public class InitWebContext extends HttpServlet { _logger.info("+ MaxKey Version 1.0 GA"); _logger.info(""); _logger.info("+ Copyright (c) 2018-2019 Maxkey ."); - _logger.info("+ We're focus on Identity and Access Management "); - _logger.info("+ https://github.com/shimingxy/MaxKey"); + _logger.info("+ https://github.com/shimingxy/MaxKey"); _logger.info("----------------------------------------------------------------------------------------------------"); } diff --git a/maxkey-core/src/main/java/org/maxkey/web/tag/St.java b/maxkey-core/src/main/java/org/maxkey/web/tag/St.java new file mode 100644 index 000000000..7346ec7ad --- /dev/null +++ b/maxkey-core/src/main/java/org/maxkey/web/tag/St.java @@ -0,0 +1,15 @@ +package org.maxkey.web.tag; + +public class St { + + public static void main(String[] args) { + // TODO Auto-generated method stub + String cv="com.ddm.core.utils.TestClass@InnerClass1@InnerClass2@p2"; + + String[] c = cv.trim().split("@"); + for(String cs : c) { + System.out.println(cs); + } + } + +} diff --git a/maxkey-core/src/main/java/org/maxkey/web/tag/StaticTagDirective.java b/maxkey-core/src/main/java/org/maxkey/web/tag/StaticTagDirective.java new file mode 100644 index 000000000..3d0293a19 --- /dev/null +++ b/maxkey-core/src/main/java/org/maxkey/web/tag/StaticTagDirective.java @@ -0,0 +1,68 @@ +package org.maxkey.web.tag; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.util.Map; + +import freemarker.core.Environment; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateDirectiveModel; +import freemarker.template.TemplateException; +import freemarker.template.TemplateModel; +/** + * 静态变量读取 + * <@static/> + * @author Crystal.Sea + * + */ + +@FreemarkerTag("static") +public class StaticTagDirective implements TemplateDirectiveModel { + + + @Override + public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) + throws TemplateException, IOException { + + // 获取字符串变量 + String[] c = params.get("name").toString().trim().split("@"); + + StringBuffer sb = new StringBuffer(); + try { + if(null == c || c.length < 2) { + throw new TemplateException("至少应该包含一个@符。", env); + } + + Class clazz = null; + for(int i=0;i[] clazzs = clazz.getDeclaredClasses(); + boolean flag = false; + for(Class clz : clazzs) { + if(clz.getSimpleName().equals(c[i])) { + clazz = clz; + flag = true; + break; + } + } + if(!flag) { + throw new TemplateException("内部类 " + sb.substring(0, sb.length() - 1) + " 未找到。", env); + } + } else { + Field sp = clazz.getDeclaredField(c[i]); + env.getOut().write(sp.get(clazz).toString()); + } + } + } catch (ClassNotFoundException e) { + throw new TemplateException("类 " + sb.substring(0, sb.length() - 1) + " 未找到。", e.getCause(), env); + } catch (NoSuchFieldException e) { + throw new TemplateException("属性 " + sb.substring(0, sb.length() - 1) + " 未找到。", e.getCause(), env); + } catch (IllegalAccessException e) { + throw new TemplateException("没权限访问 " + sb.substring(0, sb.length() - 1) + " 属性。", e.getCause(), env); + } + } + +} diff --git a/maxkey-dao/src/main/resources/org/maxkey/dao/persistence/xml/mysql/AccountsMapper.xml b/maxkey-dao/src/main/resources/org/maxkey/dao/persistence/xml/mysql/AccountsMapper.xml index e3715529b..f9a1f0261 100644 --- a/maxkey-dao/src/main/resources/org/maxkey/dao/persistence/xml/mysql/AccountsMapper.xml +++ b/maxkey-dao/src/main/resources/org/maxkey/dao/persistence/xml/mysql/AccountsMapper.xml @@ -19,24 +19,14 @@ - SELECT * FROM - APP_ACCOUNTS + ACCOUNTS WHERE (1=1) - - \ No newline at end of file diff --git a/maxkey-dao/src/main/resources/org/maxkey/dao/persistence/xml/mysql/ApplicationsMapper.xml b/maxkey-dao/src/main/resources/org/maxkey/dao/persistence/xml/mysql/ApplicationsMapper.xml index 19b25154e..6a6e9cead 100644 --- a/maxkey-dao/src/main/resources/org/maxkey/dao/persistence/xml/mysql/ApplicationsMapper.xml +++ b/maxkey-dao/src/main/resources/org/maxkey/dao/persistence/xml/mysql/ApplicationsMapper.xml @@ -24,7 +24,7 @@ - SELECT * FROM @@ -35,16 +35,5 @@ ORDER BY SORTORDER - - \ No newline at end of file diff --git a/maxkey-dao/src/main/resources/org/maxkey/dao/persistence/xml/mysql/GroupsMapper.xml b/maxkey-dao/src/main/resources/org/maxkey/dao/persistence/xml/mysql/GroupsMapper.xml index 193b5e5b4..8120c5c5f 100644 --- a/maxkey-dao/src/main/resources/org/maxkey/dao/persistence/xml/mysql/GroupsMapper.xml +++ b/maxkey-dao/src/main/resources/org/maxkey/dao/persistence/xml/mysql/GroupsMapper.xml @@ -13,7 +13,7 @@ - SELECT * FROM @@ -23,17 +23,6 @@ - - - UPDATE GROUPS SET diff --git a/maxkey-protocols/maxkey-protocol-authorize/bin/main/.gitignore b/maxkey-protocols/maxkey-protocol-authorize/bin/main/.gitignore deleted file mode 100644 index 59d60644b..000000000 --- a/maxkey-protocols/maxkey-protocol-authorize/bin/main/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/META-INF/ -/org/ diff --git a/maxkey-protocols/maxkey-protocol-cas/bin/main/.gitignore b/maxkey-protocols/maxkey-protocol-cas/bin/main/.gitignore index 59d60644b..f1f834d4a 100644 --- a/maxkey-protocols/maxkey-protocol-cas/bin/main/.gitignore +++ b/maxkey-protocols/maxkey-protocol-cas/bin/main/.gitignore @@ -1,2 +1,2 @@ -/META-INF/ /org/ +/META-INF/ diff --git a/maxkey-protocols/maxkey-protocol-desktop/bin/main/.gitignore b/maxkey-protocols/maxkey-protocol-desktop/bin/main/.gitignore deleted file mode 100644 index 59d60644b..000000000 --- a/maxkey-protocols/maxkey-protocol-desktop/bin/main/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/META-INF/ -/org/ diff --git a/maxkey-protocols/maxkey-protocol-extendapi/bin/main/.gitignore b/maxkey-protocols/maxkey-protocol-extendapi/bin/main/.gitignore deleted file mode 100644 index 59d60644b..000000000 --- a/maxkey-protocols/maxkey-protocol-extendapi/bin/main/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/META-INF/ -/org/ diff --git a/maxkey-protocols/maxkey-protocol-formbased/bin/main/.gitignore b/maxkey-protocols/maxkey-protocol-formbased/bin/main/.gitignore index 59d60644b..f1f834d4a 100644 --- a/maxkey-protocols/maxkey-protocol-formbased/bin/main/.gitignore +++ b/maxkey-protocols/maxkey-protocol-formbased/bin/main/.gitignore @@ -1,2 +1,2 @@ -/META-INF/ /org/ +/META-INF/ diff --git a/maxkey-protocols/maxkey-protocol-ltpa/bin/main/.gitignore b/maxkey-protocols/maxkey-protocol-ltpa/bin/main/.gitignore deleted file mode 100644 index 59d60644b..000000000 --- a/maxkey-protocols/maxkey-protocol-ltpa/bin/main/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/META-INF/ -/org/ diff --git a/maxkey-protocols/maxkey-protocol-oauth-2.0/bin/main/.gitignore b/maxkey-protocols/maxkey-protocol-oauth-2.0/bin/main/.gitignore index 59d60644b..f1f834d4a 100644 --- a/maxkey-protocols/maxkey-protocol-oauth-2.0/bin/main/.gitignore +++ b/maxkey-protocols/maxkey-protocol-oauth-2.0/bin/main/.gitignore @@ -1,2 +1,2 @@ -/META-INF/ /org/ +/META-INF/ diff --git a/maxkey-protocols/maxkey-protocol-saml-2.0/bin/main/.gitignore b/maxkey-protocols/maxkey-protocol-saml-2.0/bin/main/.gitignore index 59d60644b..cf1db2eed 100644 --- a/maxkey-protocols/maxkey-protocol-saml-2.0/bin/main/.gitignore +++ b/maxkey-protocols/maxkey-protocol-saml-2.0/bin/main/.gitignore @@ -1,2 +1 @@ -/META-INF/ /org/ diff --git a/maxkey-protocols/maxkey-protocol-tokenbased/bin/main/.gitignore b/maxkey-protocols/maxkey-protocol-tokenbased/bin/main/.gitignore deleted file mode 100644 index 59d60644b..000000000 --- a/maxkey-protocols/maxkey-protocol-tokenbased/bin/main/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/META-INF/ -/org/ diff --git a/maxkey-web-manage/.classpath b/maxkey-web-manage/.classpath index cd5c0025d..2a1397787 100644 --- a/maxkey-web-manage/.classpath +++ b/maxkey-web-manage/.classpath @@ -1,7 +1,17 @@ - - + + + + + + + + + + + + diff --git a/maxkey-web-manage/.settings/org.eclipse.core.resources.prefs b/maxkey-web-manage/.settings/org.eclipse.core.resources.prefs index 15a88db17..896a9a53a 100644 --- a/maxkey-web-manage/.settings/org.eclipse.core.resources.prefs +++ b/maxkey-web-manage/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,2 @@ eclipse.preferences.version=1 -encoding//src/main/resources/templates/views/login.ftl=UTF-8 -encoding/=UTF-8 +encoding/=UTF-8 \ No newline at end of file diff --git a/maxkey-web-manage/.settings/org.eclipse.wst.common.component b/maxkey-web-manage/.settings/org.eclipse.wst.common.component index 5c3db0275..97c8a9e93 100644 --- a/maxkey-web-manage/.settings/org.eclipse.wst.common.component +++ b/maxkey-web-manage/.settings/org.eclipse.wst.common.component @@ -1,12 +1,10 @@ - + + - - - uses diff --git a/maxkey-web-manage/src/main/java/org/maxkey/MaxKeyMgtApplication.java b/maxkey-web-manage/src/main/java/org/maxkey/MaxKeyMgtApplication.java index 90e7563b3..a14390c01 100644 --- a/maxkey-web-manage/src/main/java/org/maxkey/MaxKeyMgtApplication.java +++ b/maxkey-web-manage/src/main/java/org/maxkey/MaxKeyMgtApplication.java @@ -1,26 +1,56 @@ package org.maxkey; +import java.util.Date; + +import javax.servlet.ServletException; + +import org.maxkey.web.InitApplicationContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ImportResource; @SpringBootApplication @ImportResource(locations={"classpath:spring/maxkey-mgt.xml"}) @ComponentScan(basePackages = { - "org.maxkey.MaxKeyConfig" + "org.maxkey.MaxKeyMgtConfig" } ) public class MaxKeyMgtApplication extends SpringBootServletInitializer { + private static final Logger _logger = LoggerFactory.getLogger(MaxKeyMgtApplication.class); + + @Bean + MaxKeyMgtConfig MaxKeyMgtConfig() { + return new MaxKeyMgtConfig(); + } + public static void main(String[] args) { - SpringApplication.run(MaxKeyMgtApplication.class, args); + + ConfigurableApplicationContext applicationContext =SpringApplication.run(MaxKeyMgtApplication.class, args); + InitApplicationContext initWebContext=new InitApplicationContext(applicationContext); + try { + initWebContext.init(null); + } catch (ServletException e) { + e.printStackTrace(); + _logger.error("",e); + } + _logger.info("MaxKeyMgt at "+new Date(applicationContext.getStartupDate())); + _logger.info("MaxKeyMgt Server Port "+applicationContext.getBean(MaxKeyMgtConfig.class).getPort()); + _logger.info("MaxKeyMgt started."); + + } protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(MaxKeyMgtApplication.class); } diff --git a/maxkey-web-manage/src/main/java/org/maxkey/MaxKeyMgtConfig.java b/maxkey-web-manage/src/main/java/org/maxkey/MaxKeyMgtConfig.java index b464e09dd..a6e1f05b6 100644 --- a/maxkey-web-manage/src/main/java/org/maxkey/MaxKeyMgtConfig.java +++ b/maxkey-web-manage/src/main/java/org/maxkey/MaxKeyMgtConfig.java @@ -1,10 +1,22 @@ package org.maxkey; -import org.springframework.context.annotation.ComponentScan; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.ImportResource; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; @Configuration +@Component +@PropertySource("classpath:/application.properties") public class MaxKeyMgtConfig { + @Value("${server.port:8080}") + private int port; + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } } diff --git a/maxkey-web-manage/src/main/java/org/maxkey/web/contorller/AccountsController.java b/maxkey-web-manage/src/main/java/org/maxkey/web/contorller/AccountsController.java index 9335ebf3d..4b390793e 100644 --- a/maxkey-web-manage/src/main/java/org/maxkey/web/contorller/AccountsController.java +++ b/maxkey-web-manage/src/main/java/org/maxkey/web/contorller/AccountsController.java @@ -43,7 +43,7 @@ public class AccountsController { @RequestMapping(value={"/list"}) public ModelAndView appAccountsList(){ - ModelAndView modelAndView=new ModelAndView("app/accounts/list"); + ModelAndView modelAndView=new ModelAndView("/accounts/appAccountsList"); return modelAndView; } @@ -56,14 +56,14 @@ public class AccountsController { @RequestMapping(value = { "/forwardSelect/{appId}" }) public ModelAndView forwardSelect(@PathVariable("appId") String appId) { - ModelAndView modelAndView=new ModelAndView("app/accounts/appAccountsAddSelect"); + ModelAndView modelAndView=new ModelAndView("/accounts/appAccountsAddSelect"); modelAndView.addObject("appId",appId); return modelAndView; } @RequestMapping(value = { "/forwardAdd" }) public ModelAndView forwardAdd(@ModelAttribute("appAccounts") Accounts appAccounts) { - ModelAndView modelAndView=new ModelAndView("app/accounts/appAccountsAdd"); + ModelAndView modelAndView=new ModelAndView("/accounts/appAccountsAdd"); Applications app= applicationsService.get(appAccounts.getAppId()); appAccounts.setAppName(app.getName()); modelAndView.addObject("model",appAccounts); @@ -88,7 +88,7 @@ public class AccountsController { @RequestMapping(value = { "/forwardUpdate/{id}" }) public ModelAndView forwardUpdate(@PathVariable("id") String id) { - ModelAndView modelAndView=new ModelAndView("app/accounts/appAccountsUpdate"); + ModelAndView modelAndView=new ModelAndView("/accounts/appAccountsUpdate"); Accounts appAccounts =accountsService.get(id); appAccounts.setRelatedPassword(ReciprocalUtils.decoder(appAccounts.getRelatedPassword())); diff --git a/maxkey-web-manage/src/main/java/org/maxkey/web/endpoint/CaptchaEndpoint.java b/maxkey-web-manage/src/main/java/org/maxkey/web/endpoint/CaptchaEndpoint.java index ffb3a44ce..b09fc9812 100644 --- a/maxkey-web-manage/src/main/java/org/maxkey/web/endpoint/CaptchaEndpoint.java +++ b/maxkey-web-manage/src/main/java/org/maxkey/web/endpoint/CaptchaEndpoint.java @@ -20,9 +20,9 @@ import com.google.code.kaptcha.Producer; /** * @author Crystal.Sea * - */ + */ @Controller -@RequestMapping(value = "/captcha") +@RequestMapping(value = "/captcha") public class CaptchaEndpoint { private static final Logger _logger = LoggerFactory.getLogger(CaptchaEndpoint.class); diff --git a/maxkey-web-manage/src/main/resources/log4j2.xml b/maxkey-web-manage/src/main/resources/log4j2.xml index 26bfa620e..1f3a1cea6 100644 --- a/maxkey-web-manage/src/main/resources/log4j2.xml +++ b/maxkey-web-manage/src/main/resources/log4j2.xml @@ -15,8 +15,8 @@ - + diff --git a/maxkey-web-manage/src/main/resources/messages/message.properties b/maxkey-web-manage/src/main/resources/messages/message.properties index 3c54a0253..6c8d0dc82 100644 --- a/maxkey-web-manage/src/main/resources/messages/message.properties +++ b/maxkey-web-manage/src/main/resources/messages/message.properties @@ -162,7 +162,26 @@ apps.icon=\u56FE\u6807 apps.name=\u5E94\u7528\u540D\u79F0 apps.protocol=\u8BBF\u95EE\u534F\u8BAE apps.category=\u7C7B\u578B +apps.protocol.formbased=\u8868\u5355\u8BA4\u8BC1 +apps.protocol.desktop=\u684C\u9762\u8BA4\u8BC1 +apps.protocol.tokenbased=\u4EE4\u724C\u8BA4\u8BC1 +apps.protocol.oauth2.0=OAuth2.0 +apps.protocol.saml2.0=SAML2.0 +apps.protocol.ltpa=\u8F7B\u91CF\u7EA7\u8BA4\u8BC1(LTPA) +apps.protocol.cas=CAS\u8BA4\u8BC1 +apps.protocol.extendapi=API\u6269\u5C55\u8BA4\u8BC1 +apps.protocol.basic=\u57FA\u672C\u767B\u5F55 +apps.vendor=\u4F9B\u5E94\u5546 +group.name=\u7528\u6237\u7EC4 + +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 + button.text.action=\u8BBF\u95EE button.text.visit=\u8BBF\u95EE button.text.save=\u4FDD\u5B58 diff --git a/maxkey-web-manage/src/main/resources/templates/views/accounts/appAccountsList.ftl b/maxkey-web-manage/src/main/resources/templates/views/accounts/appAccountsList.ftl index b3b30f4ae..2ae32c9d2 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/accounts/appAccountsList.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/accounts/appAccountsList.ftl @@ -1,100 +1,136 @@ -<%@ page contentType="text/html; charset=UTF-8" import="java.util.Map,java.util.LinkedHashMap" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ page import="org.maxkey.constants.*"%> - - + + + + <#include "../layout/header.ftl"/> + <#include "../layout/common.cssjs.ftl"/> + + +
+
+ + + +
+ +
+
+ + +
+
+ +
+
+
+
- - - - - - - -
: -
- - - - - "> - - -
- " expandValue="" collapseValue=""> - - "> - " target="window" - wurl="/app/accounts/forwardUpdate" wwidth="500px" wheight="300px"> - - " - wurl="/app/accounts/delete" /> -
-
+ + + + + + +
+ <@locale code="account.username"/>: + +
+ + "> + " expandValue="<@locale code="button.text.expandsearch"/>" collapseValue="<@locale code="button.text.collapsesearch"/>"> +
+
+
+ " + wurl="<@base/>/users/forwardSelectUserType" + wwidth="960" + wheight="600" + target="window"> + + " + wurl="<@base/>/users/forwardUpdate" + wwidth="960" + wheight="600" + target="window"> + + " + wurl="<@base/>/users/delete" /> +
+
+ +
- -
- - -
\ No newline at end of file + + + + + + + + + + + +
Id<@locale code="account.username"/><@locale code="account.displayName"/><@locale code="account.appName"/><@locale code="account.appId"/><@locale code="account.relatedUsername"/>
+
+ +
+
+
+ <#include "../layout/footer.ftl"/> +
+ +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/appsList.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/appsList.ftl index 893bc3ef2..c4f466d58 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/appsList.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/appsList.ftl @@ -1,14 +1,11 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="s" uri="http://sso.maxkey.org/tags" %> - - + <#include "../layout/header.ftl"/> + <#include "../layout/common.cssjs.ftl"/>
@@ -33,17 +28,17 @@ $(function(){ - + - + - + - + - + - +
<@locale code="apps.cas.info"/>
<@locale code="apps.cas.service"/>: *
<@locale code="apps.cas.validation"/>: * @@ -58,6 +53,6 @@ $(function(){ - "/> - "/> + "/> + "/> \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/cas/appUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/cas/appUpdate.ftl index d79cbffcd..8b7be70b5 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/cas/appUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/cas/appUpdate.ftl @@ -1,14 +1,9 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
@@ -44,17 +39,17 @@ $(function(){
<@locale code="apps.cas.info"/>
<@locale code="apps.cas.service"/>: *
<@locale code="apps.cas.validation"/>: * @@ -68,6 +63,6 @@ $(function(){
- "/> - "/> + "/> + "/> \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appAdd.ftl index 226866369..1e1ac2066 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appAdd.ftl @@ -1,8 +1,3 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ page import="org.maxkey.constants.*"%>
@@ -75,10 +70,10 @@ $(function(){ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
<@locale code="apps.desktop.info" />
<@locale code="apps.desktop.programPath" />: * @@ -86,7 +81,7 @@ $(function(){
<@locale code="apps.desktop.parameter" />: @@ -94,7 +89,7 @@ $(function(){
<@locale code="apps.desktop.usernameType" />: * <@locale code="apps.desktop.preUsername" />: * @@ -116,7 +111,7 @@ $(function(){
<@locale code="apps.desktop.passwordType" />: * <@locale code="apps.desktop.prePassword" />: * @@ -138,7 +133,7 @@ $(function(){
<@locale code="apps.desktop.submitType" />: * <@locale code="apps.desktop.preSubmit" />: * @@ -156,50 +151,50 @@ $(function(){
<@locale code="apps.credential" />: - + <@locale code="apps.credential.user-defined" /> - + <@locale code="apps.credential.shared" /> - + <@locale code="apps.credential.system" /> * <@locale code="apps.isAdapter" />:
<@locale code="apps.adapter" />:
- "/> - "/> + "/> + "/>
\ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appUpdate.ftl index c2ea17c7e..2e2eb478a 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appUpdate.ftl @@ -1,13 +1,8 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
@@ -80,10 +75,10 @@ $(function(){ - + - + - + - + + <@locale code="apps.desktop.usernameParameter" />: + <@locale code="apps.desktop.preUsername" />: - + + <@locale code="apps.desktop.passwordParameter" />: + <@locale code="apps.desktop.prePassword" />: - + + <@locale code="apps.desktop.preSubmit" />: - + - + - + style="display:none" > - + style="display:none"> - + - +
<@locale code="apps.desktop.info" />
<@locale code="apps.desktop.programPath" />: * @@ -91,7 +86,7 @@ $(function(){
<@locale code="apps.desktop.parameter" />: @@ -99,7 +94,7 @@ $(function(){
<@locale code="apps.desktop.usernameType" />: style="display:none" > - style="display:none" > * style="display:none" > - style="display:none" > * @@ -123,7 +118,7 @@ $(function(){
<@locale code="apps.desktop.passwordType" />: style="display:none" > - style="display:none" > * style="display:none" > - style="display:none" > * @@ -148,7 +143,7 @@ $(function(){
<@locale code="apps.desktop.submitType" />: style="display:none" > - style="display:none" > * @@ -167,50 +162,50 @@ $(function(){
<@locale code="apps.credential" />: checked /> - + <@locale code="apps.credential.user-defined" /> checked /> - + <@locale code="apps.credential.shared" /> checked /> - + <@locale code="apps.credential.system" /> * <@locale code="apps.isAdapter" />:
<@locale code="apps.adapter" />:
<@locale code="apps.credential.system" />: *
<@locale code="apps.credential.shared.sharedUsername" />: * <@locale code="apps.credential.shared.sharedPassword" />: * @@ -222,6 +217,6 @@ $(function(){
- "/> - "/> + "/> + "/>
\ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appAdd.ftl index 226585f1e..4a3cbf8b2 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appAdd.ftl @@ -1,8 +1,3 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ page import="org.maxkey.constants.*"%>
@@ -44,24 +39,24 @@ $(function(){ - + <@locale code="apps.ltpa.info" /> - : + <@locale code="apps.ltpa.redirectUri" />: * - : + <@locale code="apps.ltpa.cookieName" />: * - : + <@locale code="apps.ltpa.algorithm" />: * - : + <@locale code="apps.ltpa.algorithmKey" />: ${model.algorithmKey} @@ -79,38 +74,38 @@ $(function(){ - : + <@locale code="apps.ltpa.token.content" />: - - - - - - - + + + + + + +
checked />checked/>checked/>checked/>checked/>checked/>checked/><@locale code="userinfo.id" />checked /><@locale code="userinfo.username" />checked/><@locale code="userinfo.email" />checked/><@locale code="userinfo.windowsAccount" />checked/><@locale code="userinfo.employeeNumber" />checked/><@locale code="userinfo.departmentId" />checked/><@locale code="userinfo.department" />checked/>
- : + <@locale code="apps.ltpa.expires" />: - : + <@locale code="apps.isAdapter" />: - : + <@locale code="apps.adapter" />: @@ -123,6 +118,6 @@ $(function(){ - "/> - "/> + "/> + "/> \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appAdd.ftl index 83bfc5cdc..6a866f3a4 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appAdd.ftl @@ -1,8 +1,3 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ page import="org.maxkey.constants.*"%>
@@ -27,15 +22,15 @@ $(function(){ - + <@locale code="apps.oauth.v2.0.info" /> - : + <@locale code="apps.oauth.v2.0.clientId" />: ${model.clientId} - : + <@locale code="apps.oauth.v2.0.clientSecret" />: ${model.clientSecret} @@ -43,7 +38,7 @@ $(function(){ - : + <@locale code="apps.oauth.scope" />: @@ -62,7 +57,7 @@ $(function(){ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -178,6 +173,6 @@ $(function(){
<@locale code="apps.oauth.GrantTypes" />: @@ -78,26 +73,26 @@ $(function(){ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -223,6 +218,6 @@ $(function(){
<@locale code="apps.oauth.registeredRedirectUris" />: *
<@locale code="apps.oauth.accessTokenValiditySeconds" />: * <@locale code="apps.oauth.refreshTokenValiditySeconds" />: *
<@locale code="apps.connect.idTokenSigningAlgorithm" />: <@locale code="apps.connect.userInfoSigningAlgorithm" />:
<@locale code="apps.connect.jwksUri" />:
<@locale code="apps.connect.idTokenEncryptedAlgorithm" />: <@locale code="apps.connect.userInfoEncryptedAlgorithm" />:
<@locale code="apps.connect.idTokenEncryptionMethod" />: <@locale code="apps.connect.userInfoEncryptionMethod" />:
<@locale code="apps.oauth.approvalPrompt" />: <@locale code="apps.isAdapter" />:
<@locale code="apps.adapter" />:
- "/> - "/> + "/> + "/> \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appUpdate.ftl index c07ca8bae..7d5c55dc2 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appUpdate.ftl @@ -1,16 +1,9 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -
@@ -37,16 +30,16 @@ $(function(){
<@locale code="apps.oauth.v2.0.info" />
<@locale code="apps.oauth.v2.0.clientId" />: ${model.clientId} <@locale code="apps.oauth.v2.0.clientSecret" />: ${model.clientSecret} @@ -54,7 +47,7 @@ $(function(){
<@locale code="apps.oauth.scope" />: @@ -73,7 +66,7 @@ $(function(){ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -158,6 +153,6 @@ $(function(){
<@locale code="apps.oauth.GrantTypes" />: @@ -90,26 +83,26 @@ $(function(){ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -233,6 +226,6 @@ $(function(){
<@locale code="apps.oauth.registeredRedirectUris" />: *
<@locale code="apps.oauth.accessTokenValiditySeconds" />: * <@locale code="apps.oauth.refreshTokenValiditySeconds" />: *
<@locale code="apps.connect.idTokenSigningAlgorithm" />: <@locale code="apps.connect.userInfoSigningAlgorithm" />:
<@locale code="apps.connect.jwksUri" />:
<@locale code="apps.connect.idTokenEncryptedAlgorithm" />: <@locale code="apps.connect.userInfoEncryptedAlgorithm" />:
<@locale code="apps.connect.idTokenEncryptionMethod" />: <@locale code="apps.connect.userInfoEncryptionMethod" />:
<@locale code="apps.oauth.approvalPrompt" />: <@locale code="apps.isAdapter" />:
<@locale code="apps.adapter" />:
- "/> - "/> + "/> + "/> \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appAdd.ftl index e45dbfa80..9e4cfe3a9 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appAdd.ftl @@ -1,8 +1,3 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ page import="org.maxkey.constants.*"%>
@@ -28,10 +23,10 @@ $(function(){
<@locale code="apps.saml.v2.0.info" />
<@locale code="apps.saml.entityId" />: * @@ -41,7 +36,7 @@ $(function(){
<@locale code="apps.saml.issuer" />: * @@ -49,7 +44,7 @@ $(function(){
<@locale code="apps.saml.spAcsUrl" />: * @@ -57,14 +52,14 @@ $(function(){
<@locale code="apps.saml.audience" />:
<@locale code="apps.saml.nameidFormat" />: * <@locale code="apps.saml.nameIdConvert" />: *
<@locale code="apps.saml.binding" />: * <@locale code="apps.saml.validityInterval" />:
<@locale code="apps.saml.fileType" />: * <@locale code="apps.saml.certMetaFile" />: * @@ -128,25 +123,25 @@ $(function(){
<@locale code="apps.saml.encrypted" />: <@locale code="apps.isAdapter" />:
<@locale code="apps.adapter" />:
- "/> - "/> + "/> + "/> \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appUpdate.ftl index 316c1054e..95d14d086 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appUpdate.ftl @@ -1,8 +1,3 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
@@ -40,38 +35,38 @@ $(function(){
<@locale code="apps.saml.v2.0.info" />
<@locale code="apps.saml.entityId" />: *
<@locale code="apps.saml.spAcsUrl" />: *
<@locale code="apps.saml.issuer" />: *
<@locale code="apps.saml.audience" />: *
<@locale code="apps.saml.nameidFormat" />: * <@locale code="apps.saml.nameIdConvert" />: *
<@locale code="apps.saml.binding" />: <@locale code="apps.saml.validityInterval" />:
<@locale code="apps.saml.fileType" />: * <@locale code="apps.saml.certMetaFile" />: upload certificate or metadata file * @@ -135,39 +130,39 @@ $(function(){
<@locale code="apps.saml.encrypted" />: <@locale code="apps.isAdapter" />:
<@locale code="apps.adapter" />:
<@locale code="apps.saml.certIssuer" />: ${model.certIssuer} <@locale code="apps.saml.certExpiration" />: ${model.certExpiration}
<@locale code="apps.saml.certSubject" />: ${model.certSubject}
- "/> - "/> + "/> + "/> \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appAdd.ftl index 48c6acdde..61a6c4880 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appAdd.ftl @@ -1,14 +1,8 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ page import="org.maxkey.constants.*"%>
diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appUpdate.ftl index 4532d0d44..f2b7054af 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appUpdate.ftl @@ -1,14 +1,9 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> diff --git a/maxkey-web-manage/src/main/resources/templates/views/config/ipaddrfilter/ipaddrfilterList.ftl b/maxkey-web-manage/src/main/resources/templates/views/config/ipaddrfilter/ipaddrfilterList.ftl new file mode 100644 index 000000000..d4cb6480d --- /dev/null +++ b/maxkey-web-manage/src/main/resources/templates/views/config/ipaddrfilter/ipaddrfilterList.ftl @@ -0,0 +1,197 @@ + + + + <#include "../../layout/header.ftl"/> + <#include "../../layout/common.cssjs.ftl"/> + + + +
+
+ + + +
+ +
+
+ + + +
+ + +
+
+
+

Horizontal Two column

+
+
+ +

Personal info

+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+ + +
+
+
+
+
+ +
+
+ + +
+
+
+
+ <#include "../../layout/footer.ftl"/> +
+ +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/config/ipaddrfilter/ipaddrfilterList.jsp b/maxkey-web-manage/src/main/resources/templates/views/config/ipaddrfilter/ipaddrfilterList2.jsp similarity index 100% rename from maxkey-web-manage/src/main/resources/templates/views/config/ipaddrfilter/ipaddrfilterList.jsp rename to maxkey-web-manage/src/main/resources/templates/views/config/ipaddrfilter/ipaddrfilterList2.jsp diff --git a/maxkey-web-manage/src/main/resources/templates/views/config/passwordpolicy/passwordpolicy.ftl b/maxkey-web-manage/src/main/resources/templates/views/config/passwordpolicy/passwordpolicy.ftl index 8f6130744..d4cb6480d 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/config/passwordpolicy/passwordpolicy.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/config/passwordpolicy/passwordpolicy.ftl @@ -1,11 +1,8 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="s" uri="http://sso.maxkey.org/tags" %> - - + <#include "../../layout/header.ftl"/> + <#include "../../layout/common.cssjs.ftl"/> +
+
-
- + + + + + +
+
+
+ +
- - + - - - -
: + <@locale code="group.name"/>:
- - "> -
+ + "> + +
- " target="window" - wurl="/groups/forwardAdd" wheight="150px" > - " target="window" - wurl="/groups/forwardUpdate" wheight="150px" > - - " - wurl="/groups/delete" /> -
-
+ +
+ " + wurl="<@base/>/users/forwardSelectUserType" + wwidth="960" + wheight="600" + target="window"> + + " + wurl="<@base/>/users/forwardUpdate" + wwidth="960" + wheight="600" + target="window"> + + " + wurl="<@base/>/users/delete" /> +
+ + + + +
-
- - - -
\ No newline at end of file + + + + + + + + + + + + + + + +
Id<@locale code="group.name"/><@locale code="common.text.description"/><@locale code="common.text.createdby"/><@locale code="common.text.createddate"/><@locale code="common.text.modifiedby"/><@locale code="common.text.modifieddate"/>
+ + +
+
+
+ <#include "../layout/footer.ftl"/> +
+ +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/logs/loginAppsHistoryList.ftl b/maxkey-web-manage/src/main/resources/templates/views/logs/loginAppsHistoryList.ftl index 834ce174f..19d5691d9 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/logs/loginAppsHistoryList.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/logs/loginAppsHistoryList.ftl @@ -1,32 +1,73 @@ -<%@ page contentType="text/html; charset=UTF-8"%> -<%@ page import="org.maxkey.domain.*"%> -<%@ page import="java.util.Map,java.util.LinkedHashMap"%> -<%@ page import="org.maxkey.web.*"%> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> + + + + <#include "../layout/header.ftl"/> + <#include "../layout/common.cssjs.ftl"/> + + + +
+
+ + + +
+ +
+
- - - +
+
+
+
- +
- : + <@locale code="userinfo.username"/>:
- - "> - " expandValue="" collapseValue=""> + + "> + " expandValue="<@locale code="button.text.expandsearch"/>" collapseValue="<@locale code="button.text.collapsesearch"/>">
- +
+ +
@@ -36,38 +77,77 @@ + + + + + + + + + + + + + +
<@locale code="log.loginappshistory.id" /><@locale code="log.loginappshistory.sessionId" /><@locale code="log.loginappshistory.uid" /><@locale code="log.loginappshistory.username" /><@locale code="log.loginappshistory.displayName" /><@locale code="log.loginappshistory.appId" /><@locale code="log.loginappshistory.appName" /><@locale code="log.loginappshistory.loginTime" />
+
+ +
+
+
+ <#include "../layout/footer.ftl"/> +
-
- - -
\ No newline at end of file +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/logs/loginAppsHistoryList2.ftl b/maxkey-web-manage/src/main/resources/templates/views/logs/loginAppsHistoryList2.ftl new file mode 100644 index 000000000..c9c874ae3 --- /dev/null +++ b/maxkey-web-manage/src/main/resources/templates/views/logs/loginAppsHistoryList2.ftl @@ -0,0 +1,85 @@ + + + + <#include "../layout/header.ftl"/> + <#include "../layout/common.cssjs.ftl"/> + + + +<#include "../layout/top.ftl"/> +<#include "../layout/nav_primary.ftl"/> + +
+
+ + + + + + +
+ <@locale code="apps.name"/>: + +
+ + "> + " expandValue="<@locale code="button.text.expandsearch"/>" collapseValue="<@locale code="button.text.collapsesearch"/>"> +
+
+ +
+ + +
+ + + +
+ + + + + + + + + + + + + +
<@locale code="log.loginappshistory.id" /><@locale code="log.loginappshistory.sessionId" /><@locale code="log.loginappshistory.uid" /><@locale code="log.loginappshistory.username" /><@locale code="log.loginappshistory.displayName" /><@locale code="log.loginappshistory.appId" /><@locale code="log.loginappshistory.appName" /><@locale code="log.loginappshistory.loginTime" />
+
+ +
+ + + \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/logs/loginHistoryList.ftl b/maxkey-web-manage/src/main/resources/templates/views/logs/loginHistoryList.ftl new file mode 100644 index 000000000..e0a37fec0 --- /dev/null +++ b/maxkey-web-manage/src/main/resources/templates/views/logs/loginHistoryList.ftl @@ -0,0 +1,162 @@ + + + + <#include "../layout/header.ftl"/> + <#include "../layout/common.cssjs.ftl"/> + + + +
+
+ + + +
+ +
+
+ + + +
+
+ +
+
+
+ +
+ + + + + + +
+ <@locale code="userinfo.username"/>: + +
+ + "> + " expandValue="<@locale code="button.text.expandsearch"/>" collapseValue="<@locale code="button.text.collapsesearch"/>"> +
+
+
+ +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
<@locale code="log.loginhistory.id"/><@locale code="log.loginhistory.sessionId"/><@locale code="log.loginhistory.username"/><@locale code="log.loginhistory.displayName"/><@locale code="log.loginhistory.provider"/><@locale code="log.loginhistory.message"/><@locale code="log.loginhistory.loginType"/><@locale code="log.loginhistory.sourceIp"/><@locale code="log.loginhistory.browser"/><@locale code="log.loginhistory.loginTime"/><@locale code="log.loginhistory.logoutTime"/><@locale code="log.loginhistory.platform"/><@locale code="log.loginhistory.application"/><@locale code="log.loginhistory.loginUrl"/><@locale code="log.loginhistory.code"/><@locale code="log.loginhistory.rpUserInfo"/>
+
+ +
+
+
+ <#include "../layout/footer.ftl"/> +
+ +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/logs/loginHistoryList.jsp b/maxkey-web-manage/src/main/resources/templates/views/logs/loginHistoryList.jsp deleted file mode 100644 index c5bf6cc04..000000000 --- a/maxkey-web-manage/src/main/resources/templates/views/logs/loginHistoryList.jsp +++ /dev/null @@ -1,79 +0,0 @@ -<%@ page contentType="text/html; charset=UTF-8"%> -<%@ page import="org.maxkey.domain.*"%> -<%@ page import="java.util.Map,java.util.LinkedHashMap"%> -<%@ page import="org.maxkey.web.*"%> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> - -
- - - - - - -
- : - -
- - "> - " expandValue="" collapseValue=""> - -
- -
- - -
- - - - -
- - -
\ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/logs/loginHistoryList2.ftl b/maxkey-web-manage/src/main/resources/templates/views/logs/loginHistoryList2.ftl new file mode 100644 index 000000000..44f5d3d64 --- /dev/null +++ b/maxkey-web-manage/src/main/resources/templates/views/logs/loginHistoryList2.ftl @@ -0,0 +1,93 @@ + + + + <#include "../layout/header.ftl"/> + <#include "../layout/common.cssjs.ftl"/> + + + +<#include "../layout/top.ftl"/> +<#include "../layout/nav_primary.ftl"/> +
+
+ + + + + + +
+ <@locale code="log.loginhistory.sourceIp"/> + +
+ + "> + " expandValue="<@locale code="button.text.expandsearch"/>" collapseValue="<@locale code="button.text.collapsesearch"/>"> +
+
+ +
+ + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
<@locale code="log.loginhistory.id"/><@locale code="log.loginhistory.sessionId"/><@locale code="log.loginhistory.username"/><@locale code="log.loginhistory.displayName"/><@locale code="log.loginhistory.provider"/><@locale code="log.loginhistory.message"/><@locale code="log.loginhistory.loginType"/><@locale code="log.loginhistory.sourceIp"/><@locale code="log.loginhistory.browser"/><@locale code="log.loginhistory.loginTime"/><@locale code="log.loginhistory.logoutTime"/><@locale code="log.loginhistory.platform"/><@locale code="log.loginhistory.application"/><@locale code="log.loginhistory.loginUrl"/><@locale code="log.loginhistory.code"/><@locale code="log.loginhistory.rpUserInfo"/>
+
+
+ + + \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/logs/logsList.ftl b/maxkey-web-manage/src/main/resources/templates/views/logs/logsList.ftl new file mode 100644 index 000000000..b7f3467d6 --- /dev/null +++ b/maxkey-web-manage/src/main/resources/templates/views/logs/logsList.ftl @@ -0,0 +1,150 @@ + + + + <#include "../layout/header.ftl"/> + <#include "../layout/common.cssjs.ftl"/> + + + +
+
+ + + +
+ +
+
+ + + +
+
+ +
+
+
+ +
+ + + + + + +
+ <@locale code="userinfo.username"/>: + +
+ + "> + " expandValue="<@locale code="button.text.expandsearch"/>" collapseValue="<@locale code="button.text.collapsesearch"/>"> +
+
+
+ +
+
+ + +
+ + + + + + + + + + + + + + + + + + +
id<@locale code="log.operate.servicename"/><@locale code="log.operate.message"/><@locale code="log.operate.content"/><@locale code="log.operate.messageType"/><@locale code="log.operate.operateType"/><@locale code="log.operate.username"/><@locale code="common.text.createdby"/><@locale code="common.text.createddate"/><@locale code="common.text.modifiedby"/><@locale code="common.text.modifieddate"/>
+
+ +
+
+
+ <#include "../layout/footer.ftl"/> +
+ +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/logs/logsList.jsp b/maxkey-web-manage/src/main/resources/templates/views/logs/logsList.jsp deleted file mode 100644 index 3a9d2983d..000000000 --- a/maxkey-web-manage/src/main/resources/templates/views/logs/logsList.jsp +++ /dev/null @@ -1,99 +0,0 @@ -<%@ page contentType="text/html; charset=UTF-8"%> -<%@ page import="org.maxkey.domain.*"%> -<%@ page import="java.util.Map,java.util.LinkedHashMap"%> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> - - -
- - - - - - -
: -
- - - "/> - -
-
- " expandValue="" collapseValue=""> - -
- - -
- - -
- - - - -
\ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/logs/logsList2.ftl b/maxkey-web-manage/src/main/resources/templates/views/logs/logsList2.ftl new file mode 100644 index 000000000..6e35a4037 --- /dev/null +++ b/maxkey-web-manage/src/main/resources/templates/views/logs/logsList2.ftl @@ -0,0 +1,73 @@ + + + + <#include "../layout/header.ftl"/> + <#include "../layout/common.cssjs.ftl"/> + + + + +<#include "../layout/top.ftl"/> +<#include "../layout/nav_primary.ftl"/> + +
+ +
+ + + + + + + + + + + + + + + + + +
id<@locale code="log.operate.servicename"/><@locale code="log.operate.message"/><@locale code="log.operate.content"/><@locale code="log.operate.messageType"/><@locale code="log.operate.operateType"/><@locale code="log.operate.username"/><@locale code="common.text.createdby"/><@locale code="common.text.createddate"/><@locale code="common.text.modifiedby"/><@locale code="common.text.modifieddate"/>
+ +
+
+ + + \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/templates/views/main.ftl b/maxkey-web-manage/src/main/resources/templates/views/main.ftl index 10abd1a7e..ed1155e84 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/main.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/main.ftl @@ -1,22 +1,19 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="s" uri="http://sso.maxkey.org/tags" %> - - + <#include "layout/header.ftl"/> + <#include "layout/common.cssjs.ftl"/>
@@ -379,7 +376,7 @@ Request Inquiry
- + <#include "layout/footer.ftl"/>
diff --git a/maxkey-web-manage/src/main/resources/templates/views/orgs/orgsList.ftl b/maxkey-web-manage/src/main/resources/templates/views/orgs/orgsList.ftl index 1a46cc3ca..024c84c7a 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/orgs/orgsList.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/orgs/orgsList.ftl @@ -62,7 +62,7 @@ $(function () { $("#deleteBtn").click(function(){ - $.post('/orgs/delete',{ id:$("#id").val(),_method:"delete"}, function(data) { + $.post('<@base/>/orgs/delete',{ id:$("#id").val(),_method:"delete"}, function(data) { $.fn.zTree.getZTreeObj("orgsTree").removeNode($.fn.zTree.getZTreeObj("orgsTree").getSelectedNodes()[0]); $.alert({content:data.message}); }); diff --git a/maxkey-web-manage/src/main/resources/templates/views/orgs/orgsList2.jsp b/maxkey-web-manage/src/main/resources/templates/views/orgs/orgsList2.jsp new file mode 100644 index 000000000..1a46cc3ca --- /dev/null +++ b/maxkey-web-manage/src/main/resources/templates/views/orgs/orgsList2.jsp @@ -0,0 +1,206 @@ +<%@ page contentType="text/html; charset=UTF-8" import="java.util.Map,java.util.LinkedHashMap" %> +<%@ page import="org.maxkey.web.*"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> +<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> + + + + + + + + + + +
+ + +
+
+ + + + + + +
+
    +
  • +
  • +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
: +
: +
+ : +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ "/> + + "/> + + "/> + +
+ +
+
diff --git a/maxkey-web-manage/src/main/resources/templates/views/report/loginApp.ftl b/maxkey-web-manage/src/main/resources/templates/views/report/loginApp.ftl index db72717ac..9d0f45305 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/report/loginApp.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/report/loginApp.ftl @@ -1,9 +1,5 @@ -<%@ page contentType="text/html; charset=UTF-8" import="java.util.Map,java.util.LinkedHashMap" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> - +
-
+
diff --git a/maxkey-web-manage/src/main/resources/templates/views/report/loginBrowser.ftl b/maxkey-web-manage/src/main/resources/templates/views/report/loginBrowser.ftl index 2f06754a3..59304164f 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/report/loginBrowser.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/report/loginBrowser.ftl @@ -1,9 +1,5 @@ -<%@ page contentType="text/html; charset=UTF-8" import="java.util.Map,java.util.LinkedHashMap" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> - +
- +
- + <@locale code="common.text.startdate"/> @@ -25,9 +21,9 @@ - + <@locale code="common.text.enddate"/> - "> + ">
diff --git a/maxkey-web-manage/src/main/resources/templates/views/report/loginDay.ftl b/maxkey-web-manage/src/main/resources/templates/views/report/loginDay.ftl index 7482b91ab..b4a355c01 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/report/loginDay.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/report/loginDay.ftl @@ -1,9 +1,5 @@ -<%@ page contentType="text/html; charset=UTF-8" import="java.util.Map,java.util.LinkedHashMap" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> - + + + - -
- -
- -
-
- : + <@locale code="common.text.startdate"/>: @@ -25,9 +21,9 @@ - : + <@locale code="common.text.enddate"/>: - "> + ">
- - - - - - -
: - - - "> - -
- " > -
-
-
- -
- - - -
\ No newline at end of file diff --git a/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyApplication.java b/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyApplication.java index f57e1c5fe..3826d7da6 100644 --- a/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyApplication.java +++ b/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyApplication.java @@ -1,15 +1,40 @@ package org.maxkey; +import java.util.Date; + +import javax.servlet.ServletException; + +import org.maxkey.web.InitApplicationContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.Bean; @SpringBootApplication public class MaxKeyApplication extends SpringBootServletInitializer { + private static final Logger _logger = LoggerFactory.getLogger(MaxKeyApplication.class); + @Bean + MaxKeyConfig MaxKeyConfig() { + return new MaxKeyConfig(); + } + public static void main(String[] args) { - SpringApplication.run(MaxKeyApplication.class, args); + ConfigurableApplicationContext applicationContext =SpringApplication.run(MaxKeyApplication.class, args); + InitApplicationContext initWebContext=new InitApplicationContext(applicationContext); + try { + initWebContext.init(null); + } catch (ServletException e) { + e.printStackTrace(); + _logger.error("",e); + } + _logger.info("MaxKey at "+new Date(applicationContext.getStartupDate())); + _logger.info("MaxKey Server Port "+applicationContext.getBean(MaxKeyConfig.class).getPort()); + _logger.info("MaxKey started."); } protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { diff --git a/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyConfig.java b/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyConfig.java index deb10a939..caab213a0 100644 --- a/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyConfig.java +++ b/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyConfig.java @@ -1,10 +1,23 @@ package org.maxkey; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; +import org.springframework.context.annotation.PropertySource; @Configuration @ImportResource(locations={"classpath:spring/maxkey.xml"}) +@PropertySource("classpath:/application.properties") public class MaxKeyConfig { + @Value("${server.port:8080}") + private int port; + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + } diff --git a/maxkey-web-maxkey/src/main/resources/log4j2.xml b/maxkey-web-maxkey/src/main/resources/log4j2.xml index c4c2efcfe..994aeeb7e 100644 --- a/maxkey-web-maxkey/src/main/resources/log4j2.xml +++ b/maxkey-web-maxkey/src/main/resources/log4j2.xml @@ -15,8 +15,8 @@ - +