zjjk.vue
6.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-05-17 10:42:27
-->
<template>
<div>
<el-row :gutter="20">
<el-col :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span class="font-border">CPU</span>
</div>
<div class="flex-display">
<div class="width-50 font-border">属性</div>
<div class="font-border">值</div>
</div>
<div class="flex-display">
<div class="width-50">核心数</div>
<div>{{serverData.xtjkCpu.cpuNum}}</div>
</div>
<div class="flex-display">
<div class="width-50">用户使用率</div>
<div>{{serverData.xtjkCpu.used}}%</div>
</div>
<div class="flex-display">
<div class="width-50">系统使用率</div>
<div>{{serverData.xtjkCpu.sys}}%</div>
</div>
<div class="flex-display">
<div class="width-50">当前空闲率</div>
<div>{{serverData.xtjkCpu.free}}%</div>
</div>
</el-card>
</el-col>
<el-col :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span class="font-border">内存</span>
</div>
<div class="flex-display">
<div class="width-33 font-border">属性</div>
<div class="width-33 font-border">内存</div>
<div class="font-border">JVM</div>
</div>
<div class="flex-display">
<div class="width-33">总内存</div>
<div class="width-33">{{serverData.xtjkMem.total}}G</div>
<div>{{serverData.xtjkJvm.total}}M</div>
</div>
<div class="flex-display">
<div class="width-33">已用内存</div>
<div class="width-33">{{serverData.xtjkMem.used}}G</div>
<div>{{serverData.xtjkJvm.used}}M</div>
</div>
<div class="flex-display">
<div class="width-33">剩余内存</div>
<div class="width-33">{{serverData.xtjkMem.free}}G</div>
<div>{{serverData.xtjkJvm.free}}M</div>
</div>
<div class="flex-display">
<div class="width-33">使用率</div>
<div class="width-33" v-if="serverData.xtjkMem.usage > 80" style="color:red">{{serverData.xtjkMem.usage}}%</div>
<div class="width-33" v-else>{{serverData.xtjkMem.usage}}%</div>
<div>{{serverData.xtjkJvm.usage}}%</div>
</div>
</el-card>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span class=" font-border">服务器信息</span>
</div>
<div class="flex-display">
<div class="width-25 font-border">服务器名称</div>
<div class="width-25">{{serverData.xtjkSys.computerName}}</div>
<div class="width-25 font-border">操作系统</div>
<div>{{serverData.xtjkSys.osName}}</div>
</div>
<div class="flex-display">
<div class="width-25 font-border">服务器IP</div>
<div class="width-25">{{serverData.xtjkSys.computerIp}}</div>
<div class="width-25 font-border">系统架构</div>
<div>{{serverData.xtjkSys.osArch}}</div>
</div>
</el-card>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span class=" font-border">Java虚拟机信息</span>
</div>
<div class="flex-display">
<div class="width-25 font-border">Java名称</div>
<div class="width-25">{{serverData.xtjkJvm.name}}</div>
<div class="width-25 font-border">Java版本</div>
<div>{{serverData.xtjkJvm.version}}</div>
</div>
<div class="flex-display">
<div class="width-25 font-border">启动时间</div>
<div class="width-25">{{serverData.xtjkJvm.startTime}}</div>
<div class="width-25 font-border">运行时长</div>
<div>{{serverData.xtjkJvm.runTime}}</div>
</div>
<div class="flex-display">
<div class="width-25 font-border">安装路径</div>
<div>{{serverData.xtjkJvm.home}}</div>
</div>
<div class="flex-display">
<div class="width-25 font-border">项目路径</div>
<div>{{serverData.xtjkSys.userDir}}</div>
</div>
</el-card>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span class=" font-border">磁盘信息</span>
</div>
<div>
<el-table :data="serverData.sysFiles" stripe style="width: 100%">
<el-table-column prop="dirName" label="盘符路径" width="180"></el-table-column>
<el-table-column prop="sysTypeName" label="文件系统" width="180"></el-table-column>
<el-table-column prop="typeName" label="盘符类型"></el-table-column>
<el-table-column prop="total" label="总大小"></el-table-column>
<el-table-column label="可用大小">
<template slot-scope="scope">
<div v-if="scope.row.free < '20 GB'" style="color:red">{{scope.row.free}}</div>
<div v-else>{{scope.row.free}}</div>
</template>
</el-table-column>
<el-table-column prop="used" label="已用大小"></el-table-column>
<el-table-column prop="usage" label="已用百分比"></el-table-column>
</el-table>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import table from "@/utils/mixin/table"
import { getServerInfo } from "@/api/view.js"
export default {
name: "zjjk",
components: {},
mixins: [table],
mounted () {
//sendThis(this);
},
computed: {
},
data () {
return {
serverData: {}
};
},
methods: {
// 列表渲染接口
queryClick () {
getServerInfo().then(res => {
if (res.code === 200) {
this.serverData = res.result
}
})
},
}
};
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
.box-card {
margin: 5px 10px 10px 5px;
}
.flex-display {
display: flex;
margin-bottom: 10px;
border-bottom: 1px solid #e6ebf5;
}
.width-50 {
width: 50%;
padding-bottom: 10px;
}
.width-33 {
width: 33%;
padding-bottom: 10px;
}
.width-25 {
width: 25%;
padding-bottom: 10px;
}
.font-border {
font-weight: bolder;
}
</style>