From e4868fec9e0d239e266a1d7b5590de60474ae06d Mon Sep 17 00:00:00 2001 From: xjs <1294405880@qq.com> Date: Sat, 8 Jan 2022 14:25:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B4=E6=98=8E=EF=BC=9A1=E3=80=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=9C=8D=E5=8A=A1=E7=9B=91=E6=8E=A7=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=90=8E=E7=AB=AF=E8=8E=B7=E5=8F=96=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/business/monitor/service/index.vue | 189 +++++++++--------- .../controller/ServiceMonitorController.java | 12 +- .../domain/ServiceMonitorInfo.java | 15 ++ 3 files changed, 124 insertions(+), 92 deletions(-) diff --git a/ruoyi-ui/src/views/business/monitor/service/index.vue b/ruoyi-ui/src/views/business/monitor/service/index.vue index cd164159..3c8fd602 100644 --- a/ruoyi-ui/src/views/business/monitor/service/index.vue +++ b/ruoyi-ui/src/views/business/monitor/service/index.vue @@ -1,80 +1,95 @@ @@ -86,9 +101,7 @@ export default { name: "Online", data() { return { - serviceMonitorInfo:{ - - } + serviceMonitorInfo: {} } }, @@ -97,8 +110,8 @@ export default { }, methods: { getServiceMonitor() { - getServiceMonitor().then(res =>{ - this.serviceMonitorInfo=res.data + getServiceMonitor().then(res => { + this.serviceMonitorInfo = res.data }) }, }, @@ -106,21 +119,15 @@ export default { diff --git a/xjs-business/xjs-business-monitor/src/main/java/com/xjs/servicemonitor/controller/ServiceMonitorController.java b/xjs-business/xjs-business-monitor/src/main/java/com/xjs/servicemonitor/controller/ServiceMonitorController.java index 65a48595..b9ee939d 100644 --- a/xjs-business/xjs-business-monitor/src/main/java/com/xjs/servicemonitor/controller/ServiceMonitorController.java +++ b/xjs-business/xjs-business-monitor/src/main/java/com/xjs/servicemonitor/controller/ServiceMonitorController.java @@ -9,6 +9,8 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletRequest; + /** * @author xiejs * @desc 业务监控控制器 @@ -25,8 +27,16 @@ public class ServiceMonitorController { @GetMapping - public AjaxResult getServiceMonitor() { + public AjaxResult getServiceMonitor(HttpServletRequest request) { ServiceMonitorInfo serviceMonitorInfo = new ServiceMonitorInfo(); + //获取客户端信息 + String characterEncoding = request.getCharacterEncoding(); + int serverPort = request.getServerPort(); + String userAgent = request.getHeader("user-agent"); + serviceMonitorInfo.setCharacterEncoding(characterEncoding); + serviceMonitorInfo.setServerPort(serverPort); + serviceMonitorInfo.setUserAgent(userAgent); + //获取服务器信息 serviceMonitorInfo.setFreeMemory(systemOSService.getRuntimeInfo().getFreeMemory()); serviceMonitorInfo.setCurrentDir(systemOSService.getUserInfo().getCurrentDir()); serviceMonitorInfo.setHomeDir(systemOSService.getUserInfo().getHomeDir()); diff --git a/xjs-business/xjs-business-monitor/src/main/java/com/xjs/servicemonitor/domain/ServiceMonitorInfo.java b/xjs-business/xjs-business-monitor/src/main/java/com/xjs/servicemonitor/domain/ServiceMonitorInfo.java index 66a29f25..30a3ab4b 100644 --- a/xjs-business/xjs-business-monitor/src/main/java/com/xjs/servicemonitor/domain/ServiceMonitorInfo.java +++ b/xjs-business/xjs-business-monitor/src/main/java/com/xjs/servicemonitor/domain/ServiceMonitorInfo.java @@ -101,4 +101,19 @@ public class ServiceMonitorInfo { */ private Long usableMemory; + /** + * 编码 + */ + private String characterEncoding; + + /** + * 端口 + */ + private Integer serverPort; + + /** + * 浏览器标识 + */ + private String userAgent; + }