付延余
2022-12-16 f0f8ee8c4a945adbc742d9bab69382b28ad311fb
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
<!DOCTYPE html>
<html>
<head>
  <div  th:replace="common/header.html"></div>
 
</head>
<body th:class="${application.sidebarCollapse}">
<div th:replace="common/chart.html"></div>
 
<div class="wrapper">
 
  <div th:replace="common/navbar.html"></div>
 
  <div th:replace="common/aside.html"></div>
 
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper"  style="font-size:0.90rem">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1></h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item active"></li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>
 
    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <div class="row">
 
  <div class="col-md-12">
    <div class="card card-primary">
      <div class="card-header">
        <h3 class="card-title" ><span th:text="${systemInfo.hostname}"></span>
            <th:block th:if="${systemInfo.remark ne '' && systemInfo.remark ne null}">
                (备注:<span th:text="${systemInfo.remark}"></span>)
            </th:block></h3>
          <div class=" float-sm-right">
              <a href="javascript:history.back()">返回</a>
          </div>
      </div>
      <!-- /.card-header -->
      <!-- form start -->
      <form role="form">
        <div class="card-body">
          <div class="form-group">
            <label>系统信息</label>
              <div><strong>主机名:</strong><span th:text="${systemInfo.hostnameExt}"></span>,<strong>系统描述:</strong><span th:text="${systemInfo.platForm}"></span>,<strong>版本:</strong><span th:text="${systemInfo.platformVersion}"></span>,<strong>cpu核数:</strong><span th:text="${systemInfo.cpuCoreNum}"></span>
                  ,<strong>cpu型号:</strong><span th:text="${systemInfo.cpuXh}"></span> ,<strong>运行进程数量:</strong><span th:text="${systemInfo.procs}"></span>,<strong>物理总内存:</strong><span th:text="${systemInfo.totalMem}"></span>
                  ,<strong>交换区总内存:</strong><span th:text="${systemInfo.totalSwapMem}"></span>,<strong>交换区内存已使用:</strong><span th:text="${systemInfo.swapMemPer}"></span>%
                  ,<strong>启动时间:</strong><span th:text="${systemInfo.bootTimeStr}"></span>,<strong>运行时间:</strong><span th:text="${systemInfo.uptimeStr}"></span>,<strong>备注:</strong><span th:text="${systemInfo.remark}"></span>
                  ,<strong>累计接收流量:</strong><span th:text="${systemInfo.bytesRecv}+'G'"></span>,<strong>累计发送流量:</strong><span th:text="${systemInfo.bytesSent}+'G'"></span>
                  ,<strong>agent版本:</strong><span th:text="${systemInfo.agentVer}"></span>,<strong>agent上报时间(秒):</strong><span th:text="${systemInfo.submitSeconds}"></span>
                  ,<strong th:if="${systemInfo.account ne '' && systemInfo.account ne null}">用户账号:</strong><span th:text="${systemInfo.account}"></span></div>
          </div>
        </div>
        <!-- /.card-body -->
      </form>
      <!-- /.card-body -->
 
        <div th:replace="common/cpuTemperatures.html"></div>
 
 
        <label style="margin-left: .9rem">磁盘空间信息</label>
        <div class="row">
            <div class="col-12 table-responsive">
                <div th:replace="common/disk.html"></div>
            </div>
            <!-- /.col -->
        </div>
 
        <div th:if="${not #lists.isEmpty(deskIoList)}">
            <label style="margin-left: .9rem">磁盘IO信息</label>
            <div class="row">
                <div class="col-12 table-responsive">
                    <div th:replace="common/deskio.html"></div>
                </div>
                <!-- /.col -->
            </div>
        </div>
 
        <div th:if="${not #lists.isEmpty(diskSmartList)}">
            <label style="margin-left: .9rem">磁盘SMART信息<span class="text-muted">(此功能需要在监控主机安装smartmontools,不支持虚拟机)</span></label>
            <div class="row">
                <div class="col-12 table-responsive">
                    <div th:replace="common/disksmart.html"></div>
                </div>
                <!-- /.col -->
            </div>
        </div>
 
        <label style="margin-left: .9rem">磁盘空间总使用率%<span class="text-muted">(统计时间截至到昨天)</span>
            <span style="margin-left:20px">最高</span><span class="description-percentage text-danger" style="margin-left:10px;margin-right:10px;"><i class="fas fa-caret-down"></i> <span th:text="${hostDiskPerSubtitleDto.maxValue}">18</span></span>
            平均<span class="description-percentage text-warning" style="margin-left:5px;margin-right:10px;"><i class="fas fa-caret-left"></i> <span th:text="${hostDiskPerSubtitleDto.avgValue}">0</span></span>
            最低<span class="description-percentage text-success" style="margin-left:5px;margin-right:30px;"><i class="fas fa-caret-up"></i> <span th:text="${hostDiskPerSubtitleDto.minValue}">17</span></span></label>
        <div id="hostDiskPerJson"></div>
 
 
    </div>
    <!-- /.card -->
 
 
  </div>
 
        </div>
      </div>
    </section>
  </div>
 
 
  <div th:replace="common/footer.html"></div>
 
</div>
<!-- ./wrapper -->
 
<script th:src="@{'/static/js/host.js'}"></script>
<script th:inline="javascript">
    var hostDiskPerJson =[[${hostDiskPerList}]];
    $(function() {
        var chart = new G2.Chart({
            container: 'hostDiskPerJson',
            forceFit: true,
            height: 400,
            padding: [30, 40, 70, 40]
        });
 
        chart.axis('dateStr', {
            label: {
                textStyle: {
                    fill: '#aaaaaa'
                }
            }
        });
        chart.tooltip({
            crosshairs: false
        });
        chart.legend({
            position: 'top-center'
        });
 
        chart.source(hostDiskPerJson, {
            diskSumPer: {
                alias: '使用率%'
            }
        });
        chart.scale('dateStr', {tickCount: 12, alias: '时间'});
        chart.area().position('dateStr*diskSumPer').color('#1890ff');
        // chart.line().position('dateStr*diskSumPer').color('#1890ff');
        chart.render();
    });
</script>
 
</body>
</html>