-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathindex.html
More file actions
471 lines (435 loc) · 21.2 KB
/
index.html
File metadata and controls
471 lines (435 loc) · 21.2 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
<!--
# File: index.html #
# Author: Rodrigue Chakode <rodrigue.chakode @ gmail dot com> #
# #
# Copyright © 2019 Rodrigue Chakode and contributors. #
# #
# This file is part of KubeLedger software. #
# #
# KubeLedger is licensed under the Business Source License 1.1 (the "License"); #
# you may not use this file except in compliance with the License. You may obtain #
# a copy of the License at: https://raw.githubusercontent.com/realopslabs/kubeledger/refs/heads/main/LICENSE #
# #
# Unless required by applicable law or agreed to in writing, software distributed #
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR #
# CONDITIONS OF ANY KIND, either express or implied. See the License for the #
# specific language governing permissions and limitations under the License. #
-->
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<title>KubeLedger | The System of Record for Kubernetes accounting. Tracks CPU, RAM and GPU usage and costs per
namespace. Reveals hidden overhead.
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link rel="shortcut icon" href="{{ url_for('static', filename='images/favicon.ico') }}">
<link rel="stylesheet" href="css/bootstrap.min.css" media="screen">
<link rel="stylesheet" href="css/bootswatch.min.css">
<link type="text/css" rel="stylesheet" href="css/britecharts/britecharts.min.css" />
<link rel="stylesheet" href="css/frontend.css">
<style>
/* Light theme (default) */
:root[data-theme="light"] {
--bg-primary: #ffffff;
--bg-secondary: #f8f9fa;
--text-primary: #212529;
--text-secondary: #6c757d;
--border-color: #dee2e6;
--chart-bg: #ffffff;
}
/* Dark theme */
:root[data-theme="dark"] {
--bg-primary: #0d1117;
--bg-secondary: #161b22;
--text-primary: #c9d1d9;
--text-secondary: #8b949e;
--border-color: #30363d;
--chart-bg: #161b22;
}
body {
background-color: var(--bg-primary);
color: var(--text-primary);
transition: background-color 0.3s, color 0.3s;
}
.page-header {
background-color: var(--bg-primary);
}
.navbar {
background-color: var(--bg-secondary) !important;
border-color: var(--border-color) !important;
}
.chart-container {
background-color: var(--chart-bg);
transition: background-color 0.3s;
}
legend,
h4 {
color: var(--text-primary) !important;
}
.control-label {
color: var(--text-secondary);
}
footer {
background-color: var(--bg-secondary);
color: var(--text-primary);
}
/* Theme toggle button */
.theme-toggle {
cursor: pointer;
padding: 8px 15px;
background: none;
border: 1px solid var(--border-color);
border-radius: 4px;
color: var(--text-primary);
transition: all 0.3s;
}
.theme-toggle:hover {
background-color: var(--bg-secondary);
}
</style>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="../bower_components/html5shiv/dist/html5shiv.js"></script>
<script src="../bower_components/respond/dest/respond.min.js"></script>
<![endif]-->
<script type='text/javascript'>
var FrontendApi = {};
const UsageTypes = Object.freeze(
{
"CPU": "cpu-pods",
"MEM": "memory-pods",
{% if koa_dcgm_enabled %}
"GPU_COMPUTE": "gpu-compute-pods",
"GPU_MEMORY": "gpu-memory-pods",
{% endif %}
"CONSOLIDATED": "consolidated-pods",
});
FrontendApi.DATA_DIR = '{{ koa_frontend_data_location }}';
// Theme toggle functionality
function toggleTheme() {
const html = document.documentElement;
const currentTheme = html.getAttribute('data-theme');
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
html.setAttribute('data-theme', newTheme);
localStorage.setItem('theme', newTheme);
// Update button text
const btn = document.getElementById('theme-toggle-btn');
btn.textContent = newTheme === 'light' ? '🌙 Dark Mode' : '☀️ Light Mode';
}
// Load saved theme on page load
document.addEventListener('DOMContentLoaded', function () {
const savedTheme = localStorage.getItem('theme') || 'light';
document.documentElement.setAttribute('data-theme', savedTheme);
const btn = document.getElementById('theme-toggle-btn');
if (btn) {
btn.textContent = savedTheme === 'light' ? '🌙 Dark Mode' : '☀️ Light Mode';
}
});
</script>
<script data-main="js/frontend.js" src="js/require-v2.3.6.min.js"> </script>
<script>
require(['frontend']);
</script>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a href="/" class="navbar-brand"><img src="static/images/kubeledger-logo.png" alt="Kubeledger logo"
height="50px" /></a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="navbar-main">
<ul class="nav navbar-nav navbar-right">
<li><button class="theme-toggle" onclick="toggleTheme()" id="theme-toggle-btn">🌙 Dark Mode</button>
</li>
<li><a href="#" data-toggle="modal" data-target="#myModal">About</a></li>
</ul>
</div>
</div>
</div>
<div class="container page-header">
<div class="row">
<div class="col-md-12">
<div id="error-message-container">
<div class="alert alert-danger alert-dismissible">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
Processing error:
<ul id="error-message"></ul>
</div>
</div>
<script type="javascript">
$("#error-message-container").hide();
</script>
</div>
</div>
<div class="row">
<div class="col-md-5">
<legend>
Usage Trends (% per namespace) - 7 days
<select id="selected-usage-trend-type" onchange="FrontendApi.showSelectedUsageTrendType()">
<option value="default" disabled selected style="display:none;">Hourly Usage</option>
<option value="hourly-usage">Hourly Usage</option>
<option value="usage-efficiency">Usage/Request Efficiency</option>
</select>
</legend>
</div>
<div class="col-md-5">
<span class="control-label">Date Filter:</span>
<input type="datetime-local" id="filter-start-date" name="filter-start-date">
<input type="datetime-local" id="filter-end-date" name="filter-end-date">
</div>
<div class="col-md-2">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle menu-export" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<a class="chart-download"> export</a>
</button>
<ul class="dropdown-menu">
<li class="disabled"><a id="trends-cpu-png" class="dropdown-item" href="#">Export CPU Chart
(PNG)</a></li>
<li class="disabled"><a id="trends-cpu-json" class="dropdown-item" href="#">Export CPU Data
(JSON)</a></li>
<li class="disabled"><a id="trends-cpu-csv" class="dropdown-item" href="#">Export CPU Data
(CSV)</a></li>
<li class="disabled"><a id="trends-memory-png" class="dropdown-item" href="#">Export Memory
Chart (PNG)</a></li>
<li class="disabled"><a id="trends-memory-json" class="dropdown-item" href="#">Export Memory
Data (JSON)</a></li>
<li class="disabled"><a id="trends-memory-csv" class="dropdown-item" href="#">Export Memory Data
(CSV)</a></li>
</ul>
</div>
</div>
</div>
<div class="row chart-container">
<div id="chart-block-trends-rf">
<div class="col-md-6">
<div class="js-chart-trends-cpu-rf"></div>
</div>
<div class="col-md-6">
<div class="js-chart-trends-memory-rf"></div>
</div>
</div>
<div id="chart-block-trends-hourly-usage">
<div class="col-md-6">
<h4>CPU Usage</h4>
<div class="js-chart-trends-cpu-usage"></div>
</div>
<div class="col-md-6">
<h4>Memory Usage</h4>
<div class="js-chart-trends-memory-usage"></div>
</div>
{% if koa_dcgm_enabled %}
<div class="col-md-6">
<h4>GPU CPU Usage</h4>
<div class="js-chart-trends-gpu-cpu-usage"></div>
</div>
<div class="col-md-6">
<h4>GPU Memory Usage</h4>
<div class="js-chart-trends-gpu-mem-usage"></div>
</div>
{% endif %}
</div>
</div>
<div class="row chart-container">
<div class="col-md-9">
<legend>Usage Accounting <span class="accounting-cost-model"></span>
<select id="selected-cumulative-usage-type" onchange="FrontendApi.showCumulativeUsageByType()">
<option value="default" disabled selected style="display:none;">Daily Usage</option>
<option value="daily-usage">Daily Usage</option>
<option value="daily-requests">Daily Requests</option>
<option value="monthly-usage">Monthly Usage</option>
<option value="monthly-requests">Monthly Requests</option>
</select>
</legend>
</div>
<div class="col-md-1">
</div>
<div class="col-md-2">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle menu-export" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<a class="chart-download"> export</a>
</button>
<ul class="dropdown-menu">
<li class="disabled"><a id="consolidated-cpu-usage-png" class="dropdown-item" href="#">Export
CPU Chart (PNG)</a></li>
<li class="disabled"><a id="consolidated-cpu-usage-json" class="dropdown-item" href="#">Export
CPU Data (JSON)</a></li>
<li class="disabled"><a id="consolidated-cpu-usage-csv" class="dropdown-item" href="#">Export
CPU Data (CSV)</a></li>
<li class="disabled"><a id="consolidated-memory-usage-png" class="dropdown-item" href="#">Export
Memory Chart (PNG)</a></li>
<li class="disabled"><a id="consolidated-memory-usage-json" class="dropdown-item"
href="#">Export Memory Data (JSON)</a></li>
<li class="disabled"><a id="consolidated-memory-usage-csv" class="dropdown-item" href="#">Export
Memory Data (CSV)</a></li>
</ul>
</div>
</div>
<div id="chart-block-daily">
<div class="col-md-6">
<h4>CPU Usage</h4>
<div class="js-chart-daily-cpu-usage"></div>
</div>
<div class="col-md-6">
<h4>Memory Usage</h4>
<div class="js-chart-daily-memory-usage"></div>
</div>
{% if koa_dcgm_enabled %}
<div class="col-md-6">
<h4>GPU CPU Usage</h4>
<div class="js-chart-daily-gpu-cpu-usage"></div>
</div>
<div class="col-md-6">
<h4>GPU Memory Usage</h4>
<div class="js-chart-daily-gpu-mem-usage"></div>
</div>
{% endif %}
</div>
<div id="chart-block-monthly">
<div class="col-md-6">
<h4>CPU Usage</h4>
<div class="js-chart-monthly-cpu-usage"></div>
</div>
<div class="col-md-6">
<h4>Memory Usage</h4>
<div class="js-chart-monthly-memory-usage"></div>
</div>
{% if koa_dcgm_enabled %}
<div class="col-md-6">
<h4>GPU CPU Usage</h4>
<div class="js-chart-monthly-gpu-cpu-usage"></div>
</div>
<div class="col-md-6">
<h4>GPU Memory Usage</h4>
<div class="js-chart-monthly-gpu-mem-usage"></div>
</div>
{% endif %}
</div>
</div>
<div class="row chart-container">
<div class="col-md-9">
<legend>Nodes Usage
<span>
<select id="js-node-usage-type" onchange="FrontendApi.updateNodeUsage()">
<option value="cpu-pods" disabled selected style="display:none;">CPU / Pods usage</option>
<option value="cpu-pods">CPU / Pods usage</option>
<option value="cpu-heatmap">CPU / Load heatmap</option>
<option value="memory-pods">Memory / Pods usage</option>
<option value="memory-heatmap">Memory / Load heatmap</option>
{% if koa_dcgm_enabled %}
<option value="gpu-compute-pods">GPU Compute / Pods usage</option>
<option value="gpu-compute-heatmap">GPU Compute / Load heatmap</option>
<option value="gpu-memory-pods">GPU Memory / Pods usage</option>
<option value="gpu-memory-heatmap">GPU Memory / Load heatmap</option>
{% endif %}
</select>
</span>
</legend>
<div id="js-nodes-load-container">
<div id="js-nodes-heatmap-container" style="display: none;">
<div class="heatmap-legend">
<span class="legend-title">Usage Level:</span>
<span class="legend-item"><span class="legend-color"
style="background-color: #2ecc71;"></span>Low (0-50%)</span>
<span class="legend-item"><span class="legend-color"
style="background-color: #f39c12;"></span>Medium (50-80%)</span>
<span class="legend-item"><span class="legend-color"
style="background-color: #e74c3c;"></span>High (80-100%)</span>
<span class="legend-item"><span class="legend-color"
style="background-color: #95a5a6;"></span>No Data</span>
</div>
<div id="js-node-heatmap-chart"></div>
</div>
<div id="js-nodes-pods-container"></div>
</div>
</div>
<div class="col-md-3">
<legend>List of nodes</legend>
<div id="host-list-container"></div>
</div>
</div>
</div>
<!-- Host popup container -->
<div id="popup-container"></div>
<!-- About Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">About KubeLedger</h4>
</div>
<div class="modal-body">
<p>
KubeLedger, Version {{ koa_version }}.
</p>
<p>
Copyright © 2019 Rodrigue Chakode and contributors.
</p>
<p>
KubeLedger is an open source project developed and made available by the
<a href="https://realopslabs.com" target="_blank">RealOps Labs</a>.
</p>
<p>
The software is licensed under the Business Source License 1.1,
Version 2.0 (the "License"); you may not use this software except
in compliance with the License. You may obtain a copy of the
License at: <a
href="https://raw.githubusercontent.com/realopslabs/kubeledger/refs/heads/main/LICENSE">
https://raw.githubusercontent.com/realopslabs/kubeledger/refs/heads/main/LICENSE
</a>
</p>
<p>
Unless required by applicable law or agreed to in writing, the software
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</p>
<p>
This software uses third-party components released under their own license terms.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<footer>
<div class="container pos-rel z1">
<div class="flex-row gt20 mb20">
<div class="col-md-4">
</div>
<div class="col-md-3">
<ul class="nav flex-column">
<li class="nav-item">
<legend>KubeLedger v{{ koa_version }}</legend>
<a class="nav-link active"
href="https://raw.githubusercontent.com/realopslabs/kubeledger/refs/heads/main/CHANGELOG.md">Release
Notes</a>
<a class="nav-link"
href="https://raw.githubusercontent.com/realopslabs/kubeledger/refs/heads/main/LICENSE">License
Terms</a>
<a class="nav-link" href="https://github.com/realopslabs/kubeledger">Issues &
Contributions (Github)</a>
</li>
</ul>
</div>
<div class="col-md-2">
</div>
</div>
</div>
</footer>
</body>
</html>