Skip to content

Commit b8bb861

Browse files
garrettmvollmer
authored andcommitted
systemd: Change graph layout & colors (cockpit-project#10282)
Closes cockpit-project#10282
1 parent 33b2ad2 commit b8bb861

File tree

4 files changed

+56
-34
lines changed

4 files changed

+56
-34
lines changed

pkg/lib/plot.es6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ export class Plot {
689689

690690
export function plot_simple_template() {
691691
var plot_colors = [
692-
'#006bb4',
692+
'#39a5dc',
693693
'#008ff0',
694694
'#2daaff',
695695
'#69c2ff',
@@ -706,7 +706,7 @@ export function plot_simple_template() {
706706
shadowSize: 0,
707707
lines: {
708708
lineWidth: 2.0,
709-
fill: 0.4
709+
fill: 1
710710
}
711711
},
712712
xaxis: {

pkg/systemd/host.css

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,47 +111,69 @@ a.disabled {
111111
height: 120px;
112112
}
113113

114+
.server-graph-container {
115+
display: grid;
116+
grid-template: "title title" "graph legend";
117+
grid-template-columns: 1fr max-content;
118+
}
119+
120+
.server-graph-title {
121+
grid-area: title;
122+
}
123+
124+
.server-graph-graph {
125+
grid-area: graph;
126+
}
127+
114128
.server-graph-legend {
115-
list-style-type: none;
116-
padding: 30px 40px;
129+
grid-area: legend;
117130
float: right;
131+
line-height: 24px;
132+
list-style-type: none;
133+
padding: 30px 40px 0 0;
134+
}
135+
136+
.server-graph-legend li {
137+
align-items: center;
138+
display: flex;
118139
}
119140

120141
.server-graph-legend i {
121-
padding-right: 3px;
122-
font-size: 14px;
142+
font-size: 16px;
143+
margin-right: 0.5rem;
144+
padding: 0;
123145
}
124146

125147
.server-graph-legend .cpu-io-wait i {
126-
color: #e41a1c;
148+
color: #cc0000; /* pf-red-100 */
127149
}
128150

129151
.server-graph-legend .cpu-kernel i {
130-
color: #ff7f00;
152+
color: #f5c12e; /* pf-orange-300 */
131153
}
132154

133155
.server-graph-legend .cpu-user i {
134-
color: #377eb8;
156+
color: #8461f2; /* pf-purple-300 */
135157
}
136158

137159
.server-graph-legend .cpu-nice i {
138-
color: #4daf4a;
160+
color: #6eb664; /* pf-green-300 */
139161
}
140162

141163
.server-graph-legend .memory-swap i {
142-
color: #e41a1c;
164+
color: #cc0000; /* pf-red-100 */
143165
}
144166

145167
.server-graph-legend .memory-cached i {
146-
color: #ff7f00;
168+
color: #c8eb79; /* pf-light-green-200 */
147169
}
148170

149171
.server-graph-legend .memory-used i {
150-
color: #377eb8;
172+
color: #0088ce; /* pf-blue-400 */
151173
}
152174

153175
.server-graph-legend .memory-free i {
154-
color: #4daf4a;
176+
color: #3f9c35; /* pf-green-400 */
155177
}
156178

157179
#cpu_status_title {

pkg/systemd/host.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ PageCpuStatus.prototype = {
14481448

14491449
var options = {
14501450
series: {shadowSize: 0,
1451-
lines: {lineWidth: 0, fill: true}
1451+
lines: {lineWidth: 0, fill: 1}
14521452
},
14531453
yaxis: {min: 0,
14541454
max: n_cpus * 1000,
@@ -1472,10 +1472,10 @@ PageCpuStatus.prototype = {
14721472
];
14731473

14741474
var series = [
1475-
{ color: "#e41a1c", label: _("I/O Wait") },
1476-
{ color: "#ff7f00", label: _("Kernel") },
1477-
{ color: "#377eb8", label: _("User") },
1478-
{ color: "#4daf4a", label: _("Nice") },
1475+
{ color: "#cc0000", label: _("I/O Wait") },
1476+
{ color: "#f5c12e", label: _("Kernel") },
1477+
{ color: "#8461f7", label: _("User") },
1478+
{ color: "#6eb664", label: _("Nice") },
14791479
];
14801480

14811481
self.channel = cockpit.metrics(1000, {
@@ -1543,7 +1543,7 @@ PageMemoryStatus.prototype = {
15431543
var options = {
15441544
series: {
15451545
shadowSize: 0, // drawing is faster without shadows
1546-
lines: {lineWidth: 0.0, fill: true}
1546+
lines: {lineWidth: 0.0, fill: 1}
15471547
},
15481548
yaxis: {
15491549
min: 0,
@@ -1569,7 +1569,7 @@ PageMemoryStatus.prototype = {
15691569
];
15701570
var series = [
15711571
{ color: "#0088ce", label: _("Used") },
1572-
{ color: "#ff7f00", label: _("Cached") },
1572+
{ color: "#e4f5bc", label: _("Cached") },
15731573
];
15741574

15751575
if (info.swap) {

pkg/systemd/index.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -245,30 +245,30 @@
245245
</div>
246246
</div>
247247

248-
<div id="cpu_status" hidden>
249-
<div id="cpu_status_title">Yo!</div>
248+
<div class="server-graph-container" id="cpu_status" hidden>
249+
<div class="server-graph-title" id="cpu_status_title">&nbsp;</div>
250250
<ul class="server-graph-legend">
251-
<li class="cpu-io-wait">
252-
<i class="fa fa-square"></i>
253-
<span translatable="yes">I/O Wait</span>
254-
</li>
255-
<li class="cpu-kernel">
251+
<li class="cpu-nice">
256252
<i class="fa fa-square"></i>
257-
<span translatable="yes">Kernel</span>
253+
<span translatable="yes">Nice</span>
258254
</li>
259255
<li class="cpu-user">
260256
<i class="fa fa-square"></i>
261257
<span translatable="yes">User</span>
262258
</li>
263-
<li class="cpu-nice">
259+
<li class="cpu-kernel">
264260
<i class="fa fa-square"></i>
265-
<span translatable="yes">Nice</span>
261+
<span translatable="yes">Kernel</span>
262+
</li>
263+
<li class="cpu-io-wait">
264+
<i class="fa fa-square"></i>
265+
<span translatable="yes">I/O Wait</span>
266266
</li>
267267
</ul>
268-
<div id="cpu_status_graph"></div>
268+
<div class="server-graph-graph" id="cpu_status_graph"></div>
269269
</div>
270270

271-
<div id="memory_status" hidden>
271+
<div class="server-graph-container" id="memory_status" hidden>
272272
<ul class="server-graph-legend">
273273
<li class="memory-swap">
274274
<i class="fa fa-square"></i>
@@ -283,7 +283,7 @@
283283
<span translatable="yes">Used</span>
284284
</li>
285285
</ul>
286-
<div id="memory_status_graph"></div>
286+
<div class="server-graph-graph" id="memory_status_graph"></div>
287287
</div>
288288

289289
<div class="modal" id="system_information_ssh_keys" tabindex="-1"

0 commit comments

Comments
 (0)