首页改造完成,添加系统信息

pull/698/head^2
648540858 2022-10-24 18:14:31 +08:00
parent ca891f367c
commit 958474c646
7 changed files with 156 additions and 8 deletions

View File

@ -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;
/**
* giturl
*/
@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;
}
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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

View File

@ -52,6 +52,7 @@
</div>
</el-col>
</el-row>
<configInfo ref="configInfo"></configInfo>
</div>
</template>
@ -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)=> {
});
}
}

View File

@ -0,0 +1,59 @@
<template>
<div id="configInfo">
<el-dialog
title="系统信息"
width="=80%"
top="2rem"
:close-on-click-modal="false"
:visible.sync="showDialog"
:destroy-on-close="true"
@close="close()"
>
<div id="shared" style="margin-top: 1rem;margin-right: 100px;">
<el-descriptions title="国标服务信息" v-if="configInfoData.sip" :span="2">
<el-descriptions-item label="编号" >{{configInfoData.sip.id}}</el-descriptions-item>
<el-descriptions-item label="域">{{configInfoData.sip.domain}}</el-descriptions-item>
<el-descriptions-item label="IP">{{configInfoData.sip.ip}}</el-descriptions-item>
<el-descriptions-item label="端口">{{configInfoData.sip.port}}</el-descriptions-item>
<el-descriptions-item label="密码">
<el-tag size="small">{{configInfoData.sip.password}}</el-tag>
</el-descriptions-item>
</el-descriptions>
<el-descriptions title="版本信息"v-if="configInfoData.sip">
<el-descriptions-item label="版本">{{configInfoData.version.version}}</el-descriptions-item>
<el-descriptions-item label="编译时间">{{configInfoData.version.BUILD_DATE}}</el-descriptions-item>
<el-descriptions-item label="GIT版本">{{configInfoData.version.GIT_Revision_SHORT}}</el-descriptions-item>
<el-descriptions-item label="GIT最后提交时间">{{configInfoData.version.GIT_DATE}}</el-descriptions-item>
</el-descriptions>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "configInfo",
props: {},
computed: {},
created() {},
data() {
return {
showDialog: false,
configInfoData: {
sip:{},
}
};
},
methods: {
openDialog: function (data) {
console.log(data)
this.showDialog = true;
this.configInfoData = data;
},
close: function () {
this.showDialog = false;
},
},
};
</script>