-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_interface.html
136 lines (131 loc) · 6.4 KB
/
admin_interface.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Monitoring System Admin Portal</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-4">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="/admin">Admin Panel</a>
<div class="navbar-nav">
<a class="nav-link" href="/dashboard">Monitoring Dashboard</a>
<a class="nav-link" href="/logout" onclick="return confirm('Are you sure you want to logout?');">Logout</a>
</div>
</div>
</nav>
<div class="row">
<div class="col-md-6">
<h2>Update Client Configuration</h2>
<form id="updateClientForm">
<div class="mb-3">
<label for="hostname" class="form-label">Hostname:</label>
<select id="hostname" class="form-select" required>
{% for host in hosts %}
<option value="{{ host }}">{{ host }}</option>
{% end %}
</select>
</div>
<div class="mb-3">
<label for="clientId" class="form-label">Client ID:</label>
<select id="clientId" class="form-select" required>
<!-- Client ID options will be populated dynamically -->
</select>
</div>
<div class="mb-3">
<label for="configJson" class="form-label">Configuration JSON:</label>
<textarea id="configJson" class="form-control" rows="5" required></textarea>
</div>
<button type="submit" class="btn btn-primary">Update Client</button>
</form>
</div>
<div class="col-md-6">
<h2>Upload New Metric</h2>
<form id="uploadMetricForm">
<div class="mb-3">
<label for="metricName" class="form-label">Metric Name:</label>
<input type="text" id="metricName" class="form-control" required>
</div>
<div class="mb-3">
<label for="metricCode" class="form-label">Metric Code:</label>
<textarea id="metricCode" class="form-control" rows="5" required></textarea>
</div>
<div class="mb-3">
<label for="targetTags" class="form-label">Target Tags (JSON):</label>
<textarea id="targetTags" class="form-control" rows="3"></textarea>
</div>
<button type="submit" class="btn btn-primary">Upload Metric</button>
</form>
</div>
</div>
<div class="row mt-5">
<div class="col-md-6">
<h2>Update Host Tags</h2>
<form id="updateTagsForm">
<div class="mb-3">
<label for="tagHostname" class="form-label">Hostname:</label>
<select id="tagHostname" class="form-select" required>
{% for host in hosts %}
<option value="{{ host }}">{{ host }}</option>
{% end %}
</select>
</div>
<div class="mb-3">
<label for="newTags" class="form-label">New Tags (JSON):</label>
<textarea id="newTags" class="form-control" rows="3" required></textarea>
</div>
<button type="submit" class="btn btn-primary">Update Tags</button>
</form>
</div>
<div class="col-md-6">
<h2>Remove Host</h2>
<form id="removeHostForm">
<div class="mb-3">
<label for="removeHostname" class="form-label">Hostname:</label>
<select id="removeHostname" class="form-select" required>
{% for host in hosts %}
<option value="{{ host }}">{{ host }}</option>
{% end %}
</select>
</div>
<button type="submit" class="btn btn-danger">Remove Host</button>
</form>
</div>
</div>
<div class="col-md-6">
<h2>Delete Metrics</h2>
<form id="deleteMetricsForm">
<div class="mb-3">
<label for="deleteHostname" class="form-label">Hostname:</label>
<select id="deleteHostname" class="form-select" required>
{% for host in hosts %}
<option value="{{ host }}">{{ host }}</option>
{% end %}
</select>
</div>
<div class="mb-3">
<label for="deleteMetricName" class="form-label">Metric Name:</label>
<select id="deleteMetricName" class="form-select" required>
<option value="all">All Metrics</option>
<!-- Metric options will be populated dynamically -->
</select>
</div>
<div class="mb-3">
<label for="deleteStartTime" class="form-label">Start Time (optional):</label>
<input type="datetime-local" id="deleteStartTime" class="form-control">
</div>
<div class="mb-3">
<label for="deleteEndTime" class="form-label">End Time (optional):</label>
<input type="datetime-local" id="deleteEndTime" class="form-control">
</div>
<button type="submit" class="btn btn-danger">Delete Metrics</button>
</form>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="/admin.js"></script>
</body>
</html>