2024-01-20 01:27:10 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2024-01-20 01:40:55 +02:00
|
|
|
<link rel="stylesheet" href="/static/style.css">
|
|
|
|
<title>Drive Health Dashboard</title>
|
2024-01-20 01:27:10 +02:00
|
|
|
</head>
|
2024-01-21 22:40:32 +02:00
|
|
|
|
|
|
|
{{ $older := .older }}
|
|
|
|
{{ $newer := .newer }}
|
|
|
|
|
2024-01-20 01:27:10 +02:00
|
|
|
<body>
|
2024-01-21 19:12:40 +02:00
|
|
|
<div class="container bordered">
|
2024-01-21 18:25:23 +02:00
|
|
|
|
|
|
|
<div class="container-titlebar">
|
|
|
|
<div class="pad">
|
|
|
|
<h4>Available Disks</h4>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="container-body">
|
|
|
|
<div class="pad">
|
|
|
|
{{ if len .drives }}
|
|
|
|
<table id="disks-table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>ID</td>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Model</td>
|
|
|
|
<td>Serial</td>
|
|
|
|
<td>Temperature</td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody id="disk-table-body">
|
|
|
|
{{ range .drives }}
|
|
|
|
{{ $temp := .GetTemperature }}
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>#{{ .ID }}</td>
|
|
|
|
<td> {{ .Name }}</td>
|
|
|
|
<td> {{ .Model }}</td>
|
|
|
|
<td> {{ .Serial }}</td>
|
|
|
|
|
|
|
|
{{ if gt $temp 50 }} <!-- Temperature greater than 50°C -->
|
|
|
|
<td style="color: red;">{{ $temp }}°C</td>
|
|
|
|
{{ else if gt $temp 30 }} <!-- Temperature between 31°C and 50°C -->
|
|
|
|
<td style="color: orange;">{{ $temp }}°C</td>
|
|
|
|
{{ else }} <!-- Temperature 30°C or below -->
|
|
|
|
<td style="color: lime;">{{ $temp }}°C</td>
|
|
|
|
{{ end }}
|
|
|
|
</tr>
|
|
|
|
{{ end }}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{{ else }}
|
|
|
|
<p>No hard drives found.</p>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2024-01-21 19:12:40 +02:00
|
|
|
<div class="container bordered">
|
2024-01-21 18:25:23 +02:00
|
|
|
|
|
|
|
<div class="container-titlebar">
|
|
|
|
<div class="pad">
|
|
|
|
<h4>Temperature Graph</h4>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="container-body">
|
|
|
|
<div class="pad">
|
2024-01-21 22:40:32 +02:00
|
|
|
|
|
|
|
<!-- Controls -->
|
|
|
|
<div class="controls-panel">
|
|
|
|
<div class="graph-controls">
|
|
|
|
<span id="inp-older" style="display: none !important" hidden="true">{{ .older }}</span>
|
|
|
|
<span id="inp-newer" style="display: none !important" hidden="true">{{ .newer }}</span>
|
|
|
|
|
2024-01-21 22:44:50 +02:00
|
|
|
<div class="input-grp" style="margin-right: 1rem;">
|
2024-01-21 22:40:32 +02:00
|
|
|
<label for="olderThan">From Date</label>
|
|
|
|
<input id="olderThan" type="datetime-local" class="date-change-inp">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="input-grp">
|
|
|
|
<label for="newerThan">To Date</label>
|
|
|
|
<input id="newerThan" type="datetime-local" class="date-change-inp">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="btn-group">
|
|
|
|
<button type="button" class="btn" onclick="applyDateInterval()" style="margin-top: 1rem;">
|
|
|
|
Filter
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Drives -->
|
2024-01-21 18:25:23 +02:00
|
|
|
{{ if len .drives }}
|
|
|
|
{{ range .drives }}
|
2024-01-22 00:28:07 +02:00
|
|
|
<div class="disk-graph-entry bordered" id="disk-temp-{{ .ID }}" style="position: relative;">
|
|
|
|
<div class="badge" type="{{.Type}}" style="position: absolute; top: 1rem; right: 1rem;">/dev/{{.Name}}</div>
|
|
|
|
<h4>{{.Model}}:{{.HWID}} <span class="grooved">{{.Size}}</span></h4>
|
2024-01-21 18:25:23 +02:00
|
|
|
<a href="/api/v1/disks/{{.ID}}/chart" target="_blank">
|
2024-01-21 22:40:32 +02:00
|
|
|
<img class="graph-image" src="/api/v1/disks/{{.ID}}/chart?older={{ $older }}&newer={{ $newer }}" alt="{{ .Model }} Image">
|
2024-01-21 18:25:23 +02:00
|
|
|
</a>
|
|
|
|
</div>
|
2024-01-21 19:12:40 +02:00
|
|
|
<br>
|
2024-01-21 18:25:23 +02:00
|
|
|
{{ end }}
|
|
|
|
{{ else }}
|
|
|
|
<p>No hard drives found.</p>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-20 02:06:27 +02:00
|
|
|
|
2024-01-20 01:40:55 +02:00
|
|
|
</div>
|
2024-01-20 02:06:27 +02:00
|
|
|
|
|
|
|
<script src="/static/main.js"></script>
|
2024-01-20 01:27:10 +02:00
|
|
|
</body>
|
2024-01-20 01:40:55 +02:00
|
|
|
</html>
|