xyc
2025-02-21 664db98c9e8595ce4dd636a27f480e3a08b81ff5
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
<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-home">
      <el-row :gutter="20">
        <el-col :span="12" :xs="24">
          <table>
            <tr>
              <th>{{ $t('home.sysInfo.name') }}</th>
              <td>{{ $t('home.sysInfo.nameVal') }}</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.version') }}</th>
              <td>{{ $t('home.sysInfo.versionVal') }}</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.osName') }}</th>
              <td>{{ sysInfo.osName }}</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.osVersion') }}</th>
              <td>{{ sysInfo.osVersion }}</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.osArch') }}</th>
              <td>{{ sysInfo.osArch }}</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.processors') }}</th>
              <td>{{ sysInfo.processors }}</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.totalPhysical') }}</th>
              <td>{{ sysInfo.totalPhysical }}MB</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.freePhysical') }}</th>
              <td>{{ sysInfo.freePhysical }}MB</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.memoryRate') }}</th>
              <td>{{ sysInfo.memoryRate }}%</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.userLanguage') }}</th>
              <td>{{ sysInfo.userLanguage }}</td>
            </tr>
          </table>
        </el-col>
        <el-col :span="12" :xs="24">
          <table>
            <tr>
              <th>{{ $t('home.sysInfo.jvmName') }}</th>
              <td>{{ sysInfo.jvmName }}</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.javaVersion') }}</th>
              <td>{{ sysInfo.javaVersion }}</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.javaHome') }}</th>
              <td>{{ sysInfo.javaHome }}</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.userDir') }}</th>
              <td>{{ sysInfo.userDir }}</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.javaTotalMemory') }}</th>
              <td>{{ sysInfo.javaTotalMemory }}MB</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.javaFreeMemory') }}</th>
              <td>{{ sysInfo.javaFreeMemory }}MB</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.javaMaxMemory') }}</th>
              <td>{{ sysInfo.javaMaxMemory }}MB</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.userName') }}</th>
              <td>{{ sysInfo.userName }}</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.systemCpuLoad') }}</th>
              <td>{{ sysInfo.systemCpuLoad }}%</td>
            </tr>
            <tr>
              <th>{{ $t('home.sysInfo.userTimezone') }}</th>
              <td>{{ sysInfo.userTimezone }}</td>
            </tr>
          </table>
        </el-col>
      </el-row>
    </div>
  </el-card>
</template>
 
<script>
  export default {
    data() {
      return {
        sysInfo: {
          osName: '',
          osVersion: '',
          osArch: '',
          processors: 0,
          totalPhysical: 0,
          freePhysical: 0,
          memoryRate: 0,
          userLanguage: '',
          jvmName: '',
          javaVersion: '',
          javaHome: '',
          userDir: '',
          javaTotalMemory: 0,
          javaFreeMemory: 0,
          javaMaxMemory: 0,
          userName: '',
          systemCpuLoad: 0,
          userTimezone: ''
        }
      }
    },
    created() {
      this.getSysInfo()
    },
    methods: {
      getSysInfo() {
        this.$http.get('/sys/info').then(res => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.sysInfo = res.data
        }).catch(() => {})
      }
    }
  }
</script>