forked from NotHarshhaa/kubernetes-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdashboardindex.html
More file actions
183 lines (157 loc) · 3.8 KB
/
dashboardindex.html
File metadata and controls
183 lines (157 loc) · 3.8 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Kubernetes Dashboard</title>
<link rel="stylesheet" href="styles.css" />
<script src="app.js" defer></script>
<style>
body {
font-family: 'Segoe UI', sans-serif;
background-color: #f4f7fa;
margin: 0;
padding: 0;
}
header {
background-color: #2c3e50;
color: white;
padding: 1rem;
text-align: center;
}
main.dashboard {
padding: 2rem;
max-width: 1000px;
margin: auto;
}
section {
margin-bottom: 2rem;
}
.metric,
.resource-info > div {
display: inline-block;
width: 30%;
margin: 1%;
padding: 1rem;
background: white;
border-radius: 8px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
text-align: center;
}
.percentage,
.count {
font-size: 1.8rem;
font-weight: bold;
display: block;
margin-bottom: 0.5rem;
}
form,
.namespace-selector,
#healthCheckButton {
margin-bottom: 1rem;
}
input[type="text"] {
padding: 0.5rem;
margin-right: 0.5rem;
width: 60%;
}
button {
padding: 0.5rem 1rem;
cursor: pointer;
background-color: #3498db;
color: white;
border: none;
border-radius: 4px;
}
button:hover {
background-color: #2980b9;
}
#healthCheckResult {
margin-top: 0.5rem;
font-weight: bold;
}
#scanResults {
background: #1e1e1e;
color: #00ff90;
padding: 1rem;
border-radius: 8px;
overflow-x: auto;
max-height: 400px;
}
.auto-refresh {
display: flex;
align-items: center;
gap: 10px;
margin-top: 1rem;
}
.auto-refresh input {
transform: scale(1.2);
}
</style>
</head>
<body>
<header>
<h1>Kubernetes Dashboard</h1>
</header>
<main class="dashboard">
<!-- System Metrics Section -->
<section class="top-section">
<h2>System Metrics</h2>
<div class="metric storage-used">
<span class="percentage">--%</span>
<p>Storage Used</p>
</div>
<div class="metric memory-utilization">
<span class="percentage">--%</span>
<p>Memory Used</p>
</div>
<div class="metric cpu-utilization">
<span class="percentage">--%</span>
<p>CPU Used</p>
</div>
<div class="auto-refresh">
<label for="autoRefresh">Auto-refresh every 10s:</label>
<input type="checkbox" id="autoRefresh">
</div>
</section>
<hr>
<!-- Kubernetes Operations Section -->
<section class="bottom-section">
<h2>Kubernetes Cluster Details</h2>
<!-- Namespace Dropdown -->
<div class="namespace-selector">
<label for="namespace-dropdown">Select Namespace:</label>
<select id="namespace-dropdown"></select>
</div>
<!-- Cluster Info -->
<div class="resource-info">
<div class="deployments">
<span class="count">--</span>
<p>Deployments</p>
</div>
<div class="pods-running">
<span class="count">--</span>
<p>Pods Running</p>
</div>
<div class="services-running">
<span class="count">--</span>
<p>Services</p>
</div>
</div>
<!-- Health Check -->
<button id="healthCheckButton">Run Health Check</button>
<div id="healthCheckResult"></div>
<hr>
<!-- Image Scan Form -->
<form id="scanForm">
<label for="imageInput">Docker Image Name:</label><br/>
<input type="text" id="imageInput" name="imageInput" placeholder="e.g. nginx:latest">
<button type="submit">Scan Image</button>
</form>
<!-- Scan Results -->
<h3>Scan Results</h3>
<pre id="scanResults">{}</pre>
</section>
</main>
</body>
</html>