From 958474c64691557a3348cbbe7c33a42272f09639 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 24 Oct 2022 18:14:31 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=94=B9=E9=80=A0=E5=AE=8C?= =?UTF-8?q?=E6=88=90,=E6=B7=BB=E5=8A=A0=E7=B3=BB=E7=BB=9F=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/common/VersionPo.java | 25 ++++++-- .../genersoft/iot/vmp/conf/VersionInfo.java | 1 + .../com/genersoft/iot/vmp/utils/GitUtil.java | 2 +- .../vmp/vmanager/bean/SystemConfigInfo.java | 47 +++++++++++++++ .../vmp/vmanager/server/ServerController.java | 13 ++++ web_src/src/components/console.vue | 17 +++++- web_src/src/components/dialog/configInfo.vue | 59 +++++++++++++++++++ 7 files changed, 156 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/genersoft/iot/vmp/vmanager/bean/SystemConfigInfo.java create mode 100644 web_src/src/components/dialog/configInfo.vue diff --git a/src/main/java/com/genersoft/iot/vmp/common/VersionPo.java b/src/main/java/com/genersoft/iot/vmp/common/VersionPo.java index a7d8ce67..29b2caa4 100644 --- a/src/main/java/com/genersoft/iot/vmp/common/VersionPo.java +++ b/src/main/java/com/genersoft/iot/vmp/common/VersionPo.java @@ -6,28 +6,33 @@ public class VersionPo { /** * git的全版本号 */ - @JSONField(name="GIT-Revision") + @JSONField(name="GIT_Revision") private String GIT_Revision; /** * maven版本 */ - @JSONField(name = "Create-By") + @JSONField(name = "Create_By") private String Create_By; /** * git的分支 */ - @JSONField(name = "GIT-BRANCH") + @JSONField(name = "GIT_BRANCH") private String GIT_BRANCH; /** * git的url */ - @JSONField(name = "GIT-URL") + @JSONField(name = "GIT_URL") private String GIT_URL; /** * 构建日期 */ - @JSONField(name = "BUILD-DATE") + @JSONField(name = "BUILD_DATE") private String BUILD_DATE; + /** + * 构建日期 + */ + @JSONField(name = "GIT_DATE") + private String GIT_DATE; /** * 项目名称 配合pom使用 */ @@ -36,7 +41,7 @@ public class VersionPo { /** * git局部版本号 */ - @JSONField(name = "GIT-Revision-SHORT") + @JSONField(name = "GIT_Revision_SHORT") private String GIT_Revision_SHORT; /** * 项目的版本如2.0.1.0 配合pom使用 @@ -133,4 +138,12 @@ public class VersionPo { public String getBuild_Jdk() { return Build_Jdk; } + + public String getGIT_DATE() { + return GIT_DATE; + } + + public void setGIT_DATE(String GIT_DATE) { + this.GIT_DATE = GIT_DATE; + } } diff --git a/src/main/java/com/genersoft/iot/vmp/conf/VersionInfo.java b/src/main/java/com/genersoft/iot/vmp/conf/VersionInfo.java index 5551b4f3..eb408ab8 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/VersionInfo.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/VersionInfo.java @@ -19,6 +19,7 @@ public class VersionInfo { versionPo.setBUILD_DATE(gitUtil.getBuildDate()); versionPo.setGIT_Revision_SHORT(gitUtil.getCommitIdShort()); versionPo.setVersion(gitUtil.getBuildVersion()); + versionPo.setGIT_DATE(gitUtil.getCommitTime()); return versionPo; } diff --git a/src/main/java/com/genersoft/iot/vmp/utils/GitUtil.java b/src/main/java/com/genersoft/iot/vmp/utils/GitUtil.java index ed0e0fd4..ca637dda 100644 --- a/src/main/java/com/genersoft/iot/vmp/utils/GitUtil.java +++ b/src/main/java/com/genersoft/iot/vmp/utils/GitUtil.java @@ -13,7 +13,7 @@ public class GitUtil { @Value("${git.branch:}") private String branch; - @Value("${git.commit.id.abbrev:}") + @Value("${git.commit.id:}") private String gitCommitId; @Value("${git.remote.origin.url:}") private String gitUrl; diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/bean/SystemConfigInfo.java b/src/main/java/com/genersoft/iot/vmp/vmanager/bean/SystemConfigInfo.java new file mode 100644 index 00000000..f5a52b97 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/bean/SystemConfigInfo.java @@ -0,0 +1,47 @@ +package com.genersoft.iot.vmp.vmanager.bean; + +import com.genersoft.iot.vmp.common.VersionPo; +import com.genersoft.iot.vmp.conf.SipConfig; +import com.genersoft.iot.vmp.conf.UserSetting; +import com.genersoft.iot.vmp.conf.VersionInfo; + +public class SystemConfigInfo { + + private int serverPort; + private SipConfig sip; + private UserSetting addOn; + private VersionPo version; + + public int getServerPort() { + return serverPort; + } + + public void setServerPort(int serverPort) { + this.serverPort = serverPort; + } + + public SipConfig getSip() { + return sip; + } + + public void setSip(SipConfig sip) { + this.sip = sip; + } + + public UserSetting getAddOn() { + return addOn; + } + + public void setAddOn(UserSetting addOn) { + this.addOn = addOn; + } + + public VersionPo getVersion() { + return version; + } + + public void setVersion(VersionPo version) { + this.version = version; + } +} + diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java index ed6f44da..0c6ca4b1 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java @@ -19,6 +19,7 @@ import com.genersoft.iot.vmp.utils.SpringBeanFactory; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo; import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo; +import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo; import gov.nist.javax.sip.SipStackImpl; import io.swagger.v3.oas.annotations.Operation; @@ -184,6 +185,18 @@ public class ServerController { }); }; + @Operation(summary = "获取系统信息信息") + @GetMapping(value = "/system/configInfo") + @ResponseBody + public SystemConfigInfo getConfigInfo() { + SystemConfigInfo systemConfigInfo = new SystemConfigInfo(); + systemConfigInfo.setVersion(versionInfo.getVersion()); + systemConfigInfo.setSip(sipConfig); + systemConfigInfo.setAddOn(userSetting); + systemConfigInfo.setServerPort(serverPort); + return systemConfigInfo; + } + @Operation(summary = "获取版本信息") @GetMapping(value = "/version") @ResponseBody diff --git a/web_src/src/components/console.vue b/web_src/src/components/console.vue index 352989f3..6e2dd830 100644 --- a/web_src/src/components/console.vue +++ b/web_src/src/components/console.vue @@ -52,6 +52,7 @@ + @@ -63,6 +64,7 @@ import consoleNet from './console/ConsoleNet.vue' import consoleNodeLoad from './console/ConsoleNodeLoad.vue' import consoleDisk from './console/ConsoleDisk.vue' import consoleResource from './console/ConsoleResource.vue' +import configInfo from './dialog/configInfo.vue' import echarts from 'echarts'; @@ -77,10 +79,11 @@ export default { consoleNodeLoad, consoleDisk, consoleResource, + configInfo, }, data() { return { - timer: null + timer: null, }; }, created() { @@ -143,6 +146,18 @@ export default { }, showInfo: function (){ + this.$axios({ + method: 'get', + url: `/api/server/system/configInfo`, + }).then( (res)=> { + console.log(res) + if (res.data.code === 0) { + console.log(2222) + console.log(this.$refs.configInfo) + this.$refs.configInfo.openDialog(res.data.data) + } + }).catch( (error)=> { + }); } } diff --git a/web_src/src/components/dialog/configInfo.vue b/web_src/src/components/dialog/configInfo.vue new file mode 100644 index 00000000..428d6219 --- /dev/null +++ b/web_src/src/components/dialog/configInfo.vue @@ -0,0 +1,59 @@ + + +