feat: suppot show system env info in developer mode.

pull/59/head
ruibaby 5 years ago
parent 06961849dc
commit 1b9b3a7abf

@ -1,6 +1,119 @@
<template> <template>
<div> <div>
运行环境 {{ env }} <a-row :gutter="12">
<a-col
:xl="24"
:lg="24"
:md="24"
:sm="24"
:xs="24"
:style="{ marginBottom: '12px' }"
>
<a-card
title="服务器"
:bordered="false"
hoverable
:bodyStyle="{ padding: 0 }"
>
<table style="width:100%">
<tbody class="ant-table-tbody">
<tr>
<td>系统</td>
<td>{{ systemProperties.properties['os.name'].value }} {{ systemProperties.properties['os.version'].value }}</td>
</tr>
<tr>
<td>平台</td>
<td>{{ systemProperties.properties['os.arch'].value }}</td>
</tr>
<tr>
<td>语言</td>
<td>{{ systemProperties.properties['user.language'].value }}</td>
</tr>
<tr>
<td>时区</td>
<td>{{ systemProperties.properties['user.timezone'].value }}</td>
</tr>
<tr>
<td>当前用户</td>
<td>{{ systemProperties.properties['user.name'].value }}</td>
</tr>
<tr>
<td>用户目录</td>
<td>{{ systemProperties.properties['user.home'].value }}</td>
</tr>
</tbody>
</table>
</a-card>
</a-col>
<a-col
:xl="24"
:lg="24"
:md="24"
:sm="24"
:xs="24"
:style="{ marginBottom: '12px' }"
>
<a-card
title="环境"
:bordered="false"
hoverable
:bodyStyle="{ padding: 0 }"
>
<table style="width:100%">
<tbody class="ant-table-tbody">
<tr>
<td>Java 名称</td>
<td>{{ systemProperties.properties['java.vm.name'].value }}</td>
</tr>
<tr>
<td>Java 版本</td>
<td>{{ systemProperties.properties['java.version'].value }}</td>
</tr>
<tr>
<td>Java Home</td>
<td>{{ systemProperties.properties['java.home'].value }}</td>
</tr>
</tbody>
</table>
</a-card>
</a-col>
<a-col
:xl="24"
:lg="24"
:md="24"
:sm="24"
:xs="24"
:style="{ marginBottom: '12px' }"
>
<a-card
title="应用"
:bordered="false"
hoverable
:bodyStyle="{ padding: 0 }"
>
<table style="width:100%">
<tbody class="ant-table-tbody">
<tr>
<td>PID</td>
<td>{{ systemProperties.properties['PID'].value }}</td>
</tr>
<tr>
<td>启动目录</td>
<td>{{ systemProperties.properties['user.dir'].value }}</td>
</tr>
<tr>
<td>启动模式</td>
<td>{{ systemProperties.properties['spring.profiles.active'].value }}</td>
</tr>
<tr>
<td>日志目录</td>
<td>{{ systemProperties.properties['LOG_FILE'].value }}</td>
</tr>
</tbody>
</table>
</a-card>
</a-col>
</a-row>
</div> </div>
</template> </template>
<script> <script>
@ -9,7 +122,7 @@ export default {
name: 'Environment', name: 'Environment',
data() { data() {
return { return {
env: {} systemProperties: {}
} }
}, },
created() { created() {
@ -18,7 +131,7 @@ export default {
methods: { methods: {
loadEnv() { loadEnv() {
actuatorApi.env().then(response => { actuatorApi.env().then(response => {
this.env = response.data this.systemProperties = response.data.propertySources[2]
}) })
} }
} }

@ -13,7 +13,10 @@
</a-skeleton> </a-skeleton>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-button type="primary" style="margin-right: 8px;">下载</a-button> <a-button
type="primary"
style="margin-right: 8px;"
>下载</a-button>
<a-button <a-button
type="dash" type="dash"
@click="()=>this.loadLogs()" @click="()=>this.loadLogs()"

Loading…
Cancel
Save