Index: forgon-core/src/main/java/com/forgon/system/system/model/SystemInfo.java =================================================================== diff -u -r23630 -r23644 --- forgon-core/src/main/java/com/forgon/system/system/model/SystemInfo.java (.../SystemInfo.java) (revision 23630) +++ forgon-core/src/main/java/com/forgon/system/system/model/SystemInfo.java (.../SystemInfo.java) (revision 23644) @@ -6,12 +6,15 @@ import java.math.BigDecimal; import java.math.RoundingMode; +import com.forgon.Constants; + /** * @author dandan 2018年6月20日 下午5:54:14 * */ public class SystemInfo { + private String version = Constants.SOFTWARE_VERSION_ARRAY[Constants.SOFTWARE_VERSION_ARRAY.length-1]; private long maxMemory; private long allocatedMemory; private long freeMemory; @@ -79,4 +82,7 @@ return s; } + public String getVersion() { + return version; + } } Index: ssts-web/src/main/webapp/systemmanage/system/systemInfo.js =================================================================== diff -u -r23630 -r23644 --- ssts-web/src/main/webapp/systemmanage/system/systemInfo.js (.../systemInfo.js) (revision 23630) +++ ssts-web/src/main/webapp/systemmanage/system/systemInfo.js (.../systemInfo.js) (revision 23644) @@ -30,6 +30,20 @@ labelAlign:"right", items:[{ xtype : 'textfield', + fieldLabel : "软件版本", + id : "version", + name : "version", + readOnly : true, + cls:'fieldReadOnlyNoRemove', + anchor : '100%' + }] + },{ + columnWidth : .25, + layout : 'form', + labelWidth : 80, + labelAlign:"right", + items:[{ + xtype : 'textfield', fieldLabel : "最大内存", id : "maxMemory", name : "maxMemory", @@ -79,6 +93,62 @@ cls:'fieldReadOnlyNoRemove', anchor : '100%' }] + },{ + columnWidth : .25, + layout : 'form', + labelWidth : 80, + labelAlign:"right", + items:[{ + xtype : 'textfield', + fieldLabel : "驱动", + id : "dbConnection.driverClass", + name : "dbConnection.driverClass", + readOnly : true, + cls:'fieldReadOnlyNoRemove', + anchor : '100%' + }] + },{ + columnWidth : .25, + layout : 'form', + labelWidth : 80, + labelAlign:"right", + items:[{ + xtype : 'textfield', + fieldLabel : "连接", + id : "dbConnection.jdbcUrl", + name : "dbConnection.jdbcUrl", + readOnly : true, + cls:'fieldReadOnlyNoRemove', + anchor : '100%' + }] + },{ + columnWidth : .25, + layout : 'form', + labelWidth : 80, + labelAlign:"right", + items:[{ + xtype : 'textfield', + fieldLabel : "用户", + id : "dbConnection.user", + name : "dbConnection.user", + readOnly : true, + cls:'fieldReadOnlyNoRemove', + anchor : '100%' + }] + },{ + columnWidth : .25, + layout : 'form', + labelWidth : 80, + labelAlign:"right", + items:[{ + xtype : 'textfield', + fieldLabel : "数据库", + id : "dbConnection.database", + name : "dbConnection.database", + readOnly : true, + cls:'fieldReadOnlyNoRemove', + anchor : '100%' + }] }] }); Index: forgon-core/src/main/java/com/forgon/system/system/controller/SystemController.java =================================================================== diff -u -r23630 -r23644 --- forgon-core/src/main/java/com/forgon/system/system/controller/SystemController.java (.../SystemController.java) (revision 23630) +++ forgon-core/src/main/java/com/forgon/system/system/controller/SystemController.java (.../SystemController.java) (revision 23644) @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.forgon.system.system.model.SystemInfo; +import com.forgon.system.system.service.SystemManager; import com.forgon.tools.json.JSONUtil; import com.forgon.tools.util.ResponseUtils; @@ -22,15 +23,24 @@ @Controller @RequestMapping("/system/system") public class SystemController { + + private SystemManager systemManager; + + public void setSystemManager(SystemManager systemManager) { + this.systemManager = systemManager; + } + @RequestMapping(value = "/getSysInfo") public void getSysInfo(HttpServletRequest request, HttpServletResponse response) { JSONObject json = new JSONObject(); SystemInfo systemInfo = new SystemInfo(); systemInfo.refreshRuntimeInfo(); + JSONObject systemInfoJSon = JSONObject.fromObject(systemInfo); + systemManager.setSystemInfo(systemInfoJSon); JSONUtil.addSuccess(json, true); - JSONUtil.addProperty(json, "data", systemInfo); + JSONUtil.addProperty(json, "data", systemInfoJSon); ResponseUtils.doOutput(json, response); } Index: forgon-core/src/main/java/com/forgon/system/system/service/SystemManager.java =================================================================== diff -u --- forgon-core/src/main/java/com/forgon/system/system/service/SystemManager.java (revision 0) +++ forgon-core/src/main/java/com/forgon/system/system/service/SystemManager.java (revision 23644) @@ -0,0 +1,29 @@ +/** + * + */ +package com.forgon.system.system.service; + +import net.sf.json.JSONObject; + +import org.springframework.stereotype.Service; + +import com.forgon.tools.db.InitDbConnection; + +/** + * @author dandan 2018年6月22日 上午10:22:11 + * + */ +@Service +public class SystemManager { + + private InitDbConnection dbConnection; + + public void setDbConnection(InitDbConnection dbConnection) { + this.dbConnection = dbConnection; + } + + public void setSystemInfo(JSONObject systemInfo){ + JSONObject con = JSONObject.fromObject(dbConnection); + systemInfo.put("dbConnection", con); + } +}