From 03a8ae6f043e88fdb607d1a914dd4b327cd49d27 Mon Sep 17 00:00:00 2001 From: MaxKey Date: Thu, 8 Sep 2022 11:12:28 +0800 Subject: [PATCH] visit root path tip --- .../maxkey/web/contorller/IndexEndpoint.java | 41 ++-------------- .../main/resources/templates/views/index.ftl | 21 +++++++++ .../maxkey/web/contorller/IndexEndpoint.java | 44 ++++++++++++++++++ .../resources/application-http.properties | 12 +++++ .../src/main/resources/static/favicon.ico | Bin 0 -> 16958 bytes .../main/resources/templates/views/index.ftl | 21 +++++++++ 6 files changed, 102 insertions(+), 37 deletions(-) create mode 100644 maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/index.ftl create mode 100644 maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/IndexEndpoint.java create mode 100644 maxkey-webs/maxkey-web-mgt/src/main/resources/static/favicon.ico create mode 100644 maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/index.ftl diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/IndexEndpoint.java b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/IndexEndpoint.java index 51c9ba8fd..baf464241 100644 --- a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/IndexEndpoint.java +++ b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/IndexEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright [2020] [MaxKey of copyright http://www.maxkey.top] + * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,19 +17,9 @@ package org.maxkey.web.contorller; -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.maxkey.configuration.ApplicationConfig; -import org.maxkey.entity.Institutions; -import org.maxkey.web.WebConstants; import org.maxkey.web.WebContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; @@ -42,35 +32,12 @@ import org.springframework.web.servlet.ModelAndView; @Controller public class IndexEndpoint { private static Logger _logger = LoggerFactory.getLogger(IndexEndpoint.class); - - @Autowired - ApplicationConfig applicationConfig; - - @RequestMapping(value={"/forwardindex"}) - public ModelAndView forwardindex(HttpServletRequest request, - HttpServletResponse response) throws ServletException, IOException { - _logger.debug("IndexEndpoint /forwardindex."); - Institutions inst = (Institutions)WebContext.getAttribute(WebConstants.CURRENT_INST); - String defaultUri = inst.getDefaultUri(); - if (defaultUri != null && !defaultUri.equals("")) { - _logger.debug("defaultUri " + defaultUri); - return WebContext.redirect(defaultUri); - } - _logger.debug("Uri /appList"); - return new ModelAndView("/appList"); - } - - @RequestMapping(value={"/index"}) - public ModelAndView home(HttpServletRequest request, - HttpServletResponse response) throws ServletException, IOException { - _logger.debug("home /index."); - return new ModelAndView("index"); - } - + @RequestMapping(value={"/"}) public ModelAndView index() { _logger.debug("IndexEndpoint /."); - return new ModelAndView("index"); + return new ModelAndView("index") + .addObject("appVersion", WebContext.properties.getProperty("application.formatted-version")); } diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/index.ftl b/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/index.ftl new file mode 100644 index 000000000..a443d20a3 --- /dev/null +++ b/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/index.ftl @@ -0,0 +1,21 @@ + + + + + + + MaxKey Single Sign-On + + +
+
+ Maxkey Community Edition
+ Single Sign On ( SSO )
+ Version ${appVersion}
+
+ ©Copyright 2018 - ${.now?string["yyyy"]} https://www.maxkey.top/
+ Licensed under the Apache License, Version 2.0
+
+
+ + diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/IndexEndpoint.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/IndexEndpoint.java new file mode 100644 index 000000000..baf464241 --- /dev/null +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/IndexEndpoint.java @@ -0,0 +1,44 @@ +/* + * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.maxkey.web.contorller; + +import org.maxkey.web.WebContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +/** + * Index + * @author Crystal.Sea + * + */ +@Controller +public class IndexEndpoint { + private static Logger _logger = LoggerFactory.getLogger(IndexEndpoint.class); + + @RequestMapping(value={"/"}) + public ModelAndView index() { + _logger.debug("IndexEndpoint /."); + return new ModelAndView("index") + .addObject("appVersion", WebContext.properties.getProperty("application.formatted-version")); + + } + +} diff --git a/maxkey-webs/maxkey-web-mgt/src/main/resources/application-http.properties b/maxkey-webs/maxkey-web-mgt/src/main/resources/application-http.properties index d0fb68660..53556ec52 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/resources/application-http.properties +++ b/maxkey-webs/maxkey-web-mgt/src/main/resources/application-http.properties @@ -206,6 +206,18 @@ maxkey.swagger.title =MaxKey\u5355\u70b9\u767b\u5f55\ maxkey.swagger.description =MaxKey\u5355\u70b9\u767b\u5f55\u8ba4\u8bc1\u7cfb\u7edfAPI\u6587\u6863 maxkey.swagger.version =${application.formatted-version} +############################################################################ +#freemarker configuration # +############################################################################ +spring.freemarker.template-loader-path =classpath:/templates/views +spring.freemarker.cache =false +spring.freemarker.charset =UTF-8 +spring.freemarker.check-template-location =true +spring.freemarker.content-type =text/html +spring.freemarker.expose-request-attributes =false +spring.freemarker.expose-session-attributes =false +spring.freemarker.request-context-attribute =request +spring.freemarker.suffix =.ftl ############################################################################ #static resources configuration # diff --git a/maxkey-webs/maxkey-web-mgt/src/main/resources/static/favicon.ico b/maxkey-webs/maxkey-web-mgt/src/main/resources/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..51f280f3f0ef2082fab0201cc28fc29ef8d86b3c GIT binary patch literal 16958 zcmeHO33!xMmW|@hxP2<_3P~ko13?fKkX1erWn88i6cx4G4QFUux*2R-=w?X}5)u#s z$kGr3v72QuBKrUV5|Thd_Pvr+_Jr(}eLHi{tEx~5Ayicep}(2O_fkJqf4%>md+)pV z-1}bH+1()j#*MR+zy0l;C)nBbv$L~vmM(AE{Y5(8S8be~-Ko0_-SCE;9j;MpZEZzu zZ7qt5ijb0$f)giBVDH|&@b~w}?%lg_^ypE<$HyZ-KOfcA)o5vHxkfYVna4CXHX=Ja z8%K^D!HN|t@X05iVA7;X7&2rC`uFdT2Of9;ci(+C?zrO)+;!Joxc~n9@%ZD9!`h=k|j&<{PWM_&O7h48E;pzy6v{xFlf*q%$qk4 zXU?1fZLGIjVPPQ_FJ6o%o_GQ`+;BsW;Oz2xuab@Giji5ie+Ks+u%a$#0aB%1qTenmO_uhLimM>q9%F4>CCIZTH-MV!> z=GQI7X6b$OM_+vL#Z}=9UyVrQa>E~(MKN@4%`=cLHyy1KPWz;a+TH=)R*U?H0cPkPyB$?J#&!| z@LR-fp00Xgzz6c)AE7(80wwXkqOK$ZXfbg6)YMcgT(}VS1MIt{k3N0+sJM6~0p#W7 zVfgUjHb0Ae_`rb!lD~_#TbfZ*l!nZMo`_sI4xx(%;`CnzAY?&*g#LAabO(ekH1zjUqt+rT;jQtC7cEw195Hq{N>xeUp*qv}@vGgT|9wx8s;U4T7)uVi$fi`F^s`H{{ z#8wm+7vsC{zEgDrTi3+QnKQxl-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(|G!e`;anEP~-U#FdOjVpbN&W+f0yCWkx) zj##gF@4ffh`FqnGEO}-A!t=zJYdnw5x}hawncu@b(}@#bL}+NJ#6_uHN=>3Heh0Gl z&JaI7RB`px&F+`_bfbT3vvuP-&j=VUe(pCYkKG{oO_7=|_iSd&m|@fWOmpR#(XMJ^ zjD_51Hr;RS>m!dmqRx1jd@Sp;RocVIJM;P|&Nk1BIJh^j)oL%N`nLC(-*IotTI{C#d8VB?6?vuU zTxx4mt;D!A=razZEM_x`!#q)R`a9Jxgn7t&8=%+zs^VH}BlnSI4_$mR&(FX6?z`PO zkHLBI>@<0RC5`sM{V-e30hnZ9dgeHj;)5-ZrkJTt_%(xI@GP0(AgY&>OFFN zV(%)>TPqKab^Q2oj2boSy0!y*dwXT`J@wll{?6%*H{MX^b$d#Gwv0<3%K8s=)YFY; zrBMI$n6;1$E|tXV93_y12NgJ$S}e){?j%#T + + + + + + MaxKey Single Sign-On + + +
+
+ Maxkey Community Edition
+ Single Sign On ( SSO )
+ Version ${appVersion}
+
+ ©Copyright 2018 - ${.now?string["yyyy"]} https://www.maxkey.top/
+ Licensed under the Apache License, Version 2.0
+
+
+ +