Commit 958474c64691557a3348cbbe7c33a42272f09639
1 parent
ca891f36
首页改造完成,添加系统信息
Showing
7 changed files
with
156 additions
and
8 deletions
src/main/java/com/genersoft/iot/vmp/common/VersionPo.java
| @@ -6,29 +6,34 @@ public class VersionPo { | @@ -6,29 +6,34 @@ public class VersionPo { | ||
| 6 | /** | 6 | /** |
| 7 | * git的全版本号 | 7 | * git的全版本号 |
| 8 | */ | 8 | */ |
| 9 | - @JSONField(name="GIT-Revision") | 9 | + @JSONField(name="GIT_Revision") |
| 10 | private String GIT_Revision; | 10 | private String GIT_Revision; |
| 11 | /** | 11 | /** |
| 12 | * maven版本 | 12 | * maven版本 |
| 13 | */ | 13 | */ |
| 14 | - @JSONField(name = "Create-By") | 14 | + @JSONField(name = "Create_By") |
| 15 | private String Create_By; | 15 | private String Create_By; |
| 16 | /** | 16 | /** |
| 17 | * git的分支 | 17 | * git的分支 |
| 18 | */ | 18 | */ |
| 19 | - @JSONField(name = "GIT-BRANCH") | 19 | + @JSONField(name = "GIT_BRANCH") |
| 20 | private String GIT_BRANCH; | 20 | private String GIT_BRANCH; |
| 21 | /** | 21 | /** |
| 22 | * git的url | 22 | * git的url |
| 23 | */ | 23 | */ |
| 24 | - @JSONField(name = "GIT-URL") | 24 | + @JSONField(name = "GIT_URL") |
| 25 | private String GIT_URL; | 25 | private String GIT_URL; |
| 26 | /** | 26 | /** |
| 27 | * 构建日期 | 27 | * 构建日期 |
| 28 | */ | 28 | */ |
| 29 | - @JSONField(name = "BUILD-DATE") | 29 | + @JSONField(name = "BUILD_DATE") |
| 30 | private String BUILD_DATE; | 30 | private String BUILD_DATE; |
| 31 | /** | 31 | /** |
| 32 | + * 构建日期 | ||
| 33 | + */ | ||
| 34 | + @JSONField(name = "GIT_DATE") | ||
| 35 | + private String GIT_DATE; | ||
| 36 | + /** | ||
| 32 | * 项目名称 配合pom使用 | 37 | * 项目名称 配合pom使用 |
| 33 | */ | 38 | */ |
| 34 | @JSONField(name = "artifactId") | 39 | @JSONField(name = "artifactId") |
| @@ -36,7 +41,7 @@ public class VersionPo { | @@ -36,7 +41,7 @@ public class VersionPo { | ||
| 36 | /** | 41 | /** |
| 37 | * git局部版本号 | 42 | * git局部版本号 |
| 38 | */ | 43 | */ |
| 39 | - @JSONField(name = "GIT-Revision-SHORT") | 44 | + @JSONField(name = "GIT_Revision_SHORT") |
| 40 | private String GIT_Revision_SHORT; | 45 | private String GIT_Revision_SHORT; |
| 41 | /** | 46 | /** |
| 42 | * 项目的版本如2.0.1.0 配合pom使用 | 47 | * 项目的版本如2.0.1.0 配合pom使用 |
| @@ -133,4 +138,12 @@ public class VersionPo { | @@ -133,4 +138,12 @@ public class VersionPo { | ||
| 133 | public String getBuild_Jdk() { | 138 | public String getBuild_Jdk() { |
| 134 | return Build_Jdk; | 139 | return Build_Jdk; |
| 135 | } | 140 | } |
| 141 | + | ||
| 142 | + public String getGIT_DATE() { | ||
| 143 | + return GIT_DATE; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + public void setGIT_DATE(String GIT_DATE) { | ||
| 147 | + this.GIT_DATE = GIT_DATE; | ||
| 148 | + } | ||
| 136 | } | 149 | } |
src/main/java/com/genersoft/iot/vmp/conf/VersionInfo.java
| @@ -19,6 +19,7 @@ public class VersionInfo { | @@ -19,6 +19,7 @@ public class VersionInfo { | ||
| 19 | versionPo.setBUILD_DATE(gitUtil.getBuildDate()); | 19 | versionPo.setBUILD_DATE(gitUtil.getBuildDate()); |
| 20 | versionPo.setGIT_Revision_SHORT(gitUtil.getCommitIdShort()); | 20 | versionPo.setGIT_Revision_SHORT(gitUtil.getCommitIdShort()); |
| 21 | versionPo.setVersion(gitUtil.getBuildVersion()); | 21 | versionPo.setVersion(gitUtil.getBuildVersion()); |
| 22 | + versionPo.setGIT_DATE(gitUtil.getCommitTime()); | ||
| 22 | 23 | ||
| 23 | return versionPo; | 24 | return versionPo; |
| 24 | } | 25 | } |
src/main/java/com/genersoft/iot/vmp/utils/GitUtil.java
| @@ -13,7 +13,7 @@ public class GitUtil { | @@ -13,7 +13,7 @@ public class GitUtil { | ||
| 13 | 13 | ||
| 14 | @Value("${git.branch:}") | 14 | @Value("${git.branch:}") |
| 15 | private String branch; | 15 | private String branch; |
| 16 | - @Value("${git.commit.id.abbrev:}") | 16 | + @Value("${git.commit.id:}") |
| 17 | private String gitCommitId; | 17 | private String gitCommitId; |
| 18 | @Value("${git.remote.origin.url:}") | 18 | @Value("${git.remote.origin.url:}") |
| 19 | private String gitUrl; | 19 | private String gitUrl; |
src/main/java/com/genersoft/iot/vmp/vmanager/bean/SystemConfigInfo.java
0 → 100644
| 1 | +package com.genersoft.iot.vmp.vmanager.bean; | ||
| 2 | + | ||
| 3 | +import com.genersoft.iot.vmp.common.VersionPo; | ||
| 4 | +import com.genersoft.iot.vmp.conf.SipConfig; | ||
| 5 | +import com.genersoft.iot.vmp.conf.UserSetting; | ||
| 6 | +import com.genersoft.iot.vmp.conf.VersionInfo; | ||
| 7 | + | ||
| 8 | +public class SystemConfigInfo { | ||
| 9 | + | ||
| 10 | + private int serverPort; | ||
| 11 | + private SipConfig sip; | ||
| 12 | + private UserSetting addOn; | ||
| 13 | + private VersionPo version; | ||
| 14 | + | ||
| 15 | + public int getServerPort() { | ||
| 16 | + return serverPort; | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + public void setServerPort(int serverPort) { | ||
| 20 | + this.serverPort = serverPort; | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + public SipConfig getSip() { | ||
| 24 | + return sip; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + public void setSip(SipConfig sip) { | ||
| 28 | + this.sip = sip; | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + public UserSetting getAddOn() { | ||
| 32 | + return addOn; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + public void setAddOn(UserSetting addOn) { | ||
| 36 | + this.addOn = addOn; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + public VersionPo getVersion() { | ||
| 40 | + return version; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + public void setVersion(VersionPo version) { | ||
| 44 | + this.version = version; | ||
| 45 | + } | ||
| 46 | +} | ||
| 47 | + |
src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
| @@ -19,6 +19,7 @@ import com.genersoft.iot.vmp.utils.SpringBeanFactory; | @@ -19,6 +19,7 @@ import com.genersoft.iot.vmp.utils.SpringBeanFactory; | ||
| 19 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | 19 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| 20 | import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo; | 20 | import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo; |
| 21 | import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo; | 21 | import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo; |
| 22 | +import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo; | ||
| 22 | import gov.nist.javax.sip.SipStackImpl; | 23 | import gov.nist.javax.sip.SipStackImpl; |
| 23 | 24 | ||
| 24 | import io.swagger.v3.oas.annotations.Operation; | 25 | import io.swagger.v3.oas.annotations.Operation; |
| @@ -184,6 +185,18 @@ public class ServerController { | @@ -184,6 +185,18 @@ public class ServerController { | ||
| 184 | }); | 185 | }); |
| 185 | }; | 186 | }; |
| 186 | 187 | ||
| 188 | + @Operation(summary = "获取系统信息信息") | ||
| 189 | + @GetMapping(value = "/system/configInfo") | ||
| 190 | + @ResponseBody | ||
| 191 | + public SystemConfigInfo getConfigInfo() { | ||
| 192 | + SystemConfigInfo systemConfigInfo = new SystemConfigInfo(); | ||
| 193 | + systemConfigInfo.setVersion(versionInfo.getVersion()); | ||
| 194 | + systemConfigInfo.setSip(sipConfig); | ||
| 195 | + systemConfigInfo.setAddOn(userSetting); | ||
| 196 | + systemConfigInfo.setServerPort(serverPort); | ||
| 197 | + return systemConfigInfo; | ||
| 198 | + } | ||
| 199 | + | ||
| 187 | @Operation(summary = "获取版本信息") | 200 | @Operation(summary = "获取版本信息") |
| 188 | @GetMapping(value = "/version") | 201 | @GetMapping(value = "/version") |
| 189 | @ResponseBody | 202 | @ResponseBody |
web_src/src/components/console.vue
| @@ -52,6 +52,7 @@ | @@ -52,6 +52,7 @@ | ||
| 52 | </div> | 52 | </div> |
| 53 | </el-col> | 53 | </el-col> |
| 54 | </el-row> | 54 | </el-row> |
| 55 | + <configInfo ref="configInfo"></configInfo> | ||
| 55 | </div> | 56 | </div> |
| 56 | </template> | 57 | </template> |
| 57 | 58 | ||
| @@ -63,6 +64,7 @@ import consoleNet from './console/ConsoleNet.vue' | @@ -63,6 +64,7 @@ import consoleNet from './console/ConsoleNet.vue' | ||
| 63 | import consoleNodeLoad from './console/ConsoleNodeLoad.vue' | 64 | import consoleNodeLoad from './console/ConsoleNodeLoad.vue' |
| 64 | import consoleDisk from './console/ConsoleDisk.vue' | 65 | import consoleDisk from './console/ConsoleDisk.vue' |
| 65 | import consoleResource from './console/ConsoleResource.vue' | 66 | import consoleResource from './console/ConsoleResource.vue' |
| 67 | +import configInfo from './dialog/configInfo.vue' | ||
| 66 | 68 | ||
| 67 | import echarts from 'echarts'; | 69 | import echarts from 'echarts'; |
| 68 | 70 | ||
| @@ -77,10 +79,11 @@ export default { | @@ -77,10 +79,11 @@ export default { | ||
| 77 | consoleNodeLoad, | 79 | consoleNodeLoad, |
| 78 | consoleDisk, | 80 | consoleDisk, |
| 79 | consoleResource, | 81 | consoleResource, |
| 82 | + configInfo, | ||
| 80 | }, | 83 | }, |
| 81 | data() { | 84 | data() { |
| 82 | return { | 85 | return { |
| 83 | - timer: null | 86 | + timer: null, |
| 84 | }; | 87 | }; |
| 85 | }, | 88 | }, |
| 86 | created() { | 89 | created() { |
| @@ -143,6 +146,18 @@ export default { | @@ -143,6 +146,18 @@ export default { | ||
| 143 | }, | 146 | }, |
| 144 | showInfo: function (){ | 147 | showInfo: function (){ |
| 145 | 148 | ||
| 149 | + this.$axios({ | ||
| 150 | + method: 'get', | ||
| 151 | + url: `/api/server/system/configInfo`, | ||
| 152 | + }).then( (res)=> { | ||
| 153 | + console.log(res) | ||
| 154 | + if (res.data.code === 0) { | ||
| 155 | + console.log(2222) | ||
| 156 | + console.log(this.$refs.configInfo) | ||
| 157 | + this.$refs.configInfo.openDialog(res.data.data) | ||
| 158 | + } | ||
| 159 | + }).catch( (error)=> { | ||
| 160 | + }); | ||
| 146 | } | 161 | } |
| 147 | 162 | ||
| 148 | } | 163 | } |
web_src/src/components/dialog/configInfo.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div id="configInfo"> | ||
| 3 | + <el-dialog | ||
| 4 | + title="系统信息" | ||
| 5 | + width="=80%" | ||
| 6 | + top="2rem" | ||
| 7 | + :close-on-click-modal="false" | ||
| 8 | + :visible.sync="showDialog" | ||
| 9 | + :destroy-on-close="true" | ||
| 10 | + @close="close()" | ||
| 11 | + > | ||
| 12 | + <div id="shared" style="margin-top: 1rem;margin-right: 100px;"> | ||
| 13 | + <el-descriptions title="国标服务信息" v-if="configInfoData.sip" :span="2"> | ||
| 14 | + <el-descriptions-item label="编号" >{{configInfoData.sip.id}}</el-descriptions-item> | ||
| 15 | + <el-descriptions-item label="域">{{configInfoData.sip.domain}}</el-descriptions-item> | ||
| 16 | + <el-descriptions-item label="IP">{{configInfoData.sip.ip}}</el-descriptions-item> | ||
| 17 | + <el-descriptions-item label="端口">{{configInfoData.sip.port}}</el-descriptions-item> | ||
| 18 | + <el-descriptions-item label="密码"> | ||
| 19 | + <el-tag size="small">{{configInfoData.sip.password}}</el-tag> | ||
| 20 | + </el-descriptions-item> | ||
| 21 | + </el-descriptions> | ||
| 22 | + <el-descriptions title="版本信息"v-if="configInfoData.sip"> | ||
| 23 | + <el-descriptions-item label="版本">{{configInfoData.version.version}}</el-descriptions-item> | ||
| 24 | + <el-descriptions-item label="编译时间">{{configInfoData.version.BUILD_DATE}}</el-descriptions-item> | ||
| 25 | + <el-descriptions-item label="GIT版本">{{configInfoData.version.GIT_Revision_SHORT}}</el-descriptions-item> | ||
| 26 | + <el-descriptions-item label="GIT最后提交时间">{{configInfoData.version.GIT_DATE}}</el-descriptions-item> | ||
| 27 | + </el-descriptions> | ||
| 28 | + </div> | ||
| 29 | + </el-dialog> | ||
| 30 | + </div> | ||
| 31 | +</template> | ||
| 32 | + | ||
| 33 | +<script> | ||
| 34 | +export default { | ||
| 35 | + name: "configInfo", | ||
| 36 | + props: {}, | ||
| 37 | + computed: {}, | ||
| 38 | + created() {}, | ||
| 39 | + data() { | ||
| 40 | + return { | ||
| 41 | + showDialog: false, | ||
| 42 | + configInfoData: { | ||
| 43 | + sip:{}, | ||
| 44 | + | ||
| 45 | + } | ||
| 46 | + }; | ||
| 47 | + }, | ||
| 48 | + methods: { | ||
| 49 | + openDialog: function (data) { | ||
| 50 | + console.log(data) | ||
| 51 | + this.showDialog = true; | ||
| 52 | + this.configInfoData = data; | ||
| 53 | + }, | ||
| 54 | + close: function () { | ||
| 55 | + this.showDialog = false; | ||
| 56 | + }, | ||
| 57 | + }, | ||
| 58 | +}; | ||
| 59 | +</script> |