Skip to content

Commit d311c58

Browse files
author
cfoe
committed
changed server_list display to usage of sprite images + reduction of hardcoded <br>-elements + additional support for distro icons in server_list
1 parent daf1488 commit d311c58

File tree

5 files changed

+112
-134
lines changed

5 files changed

+112
-134
lines changed

interface/web/monitor/show_sys_state.php

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -222,45 +222,53 @@ function _getServerState($serverId, $serverName) {
222222
/*
223223
* Info of a VE inside a OpenVz-Host
224224
*/
225-
$html_ve = '<div class="systemmonitor-state state-' . $serverState . '-ve">';
226-
$html_ve .= '<div class="systemmonitor-device device-ve">';
227-
$html_ve .= '<div class="systemmonitor-content icons32 ico-' . $serverState . '">';
228-
$html_ve .= $serverName . '<br>';
225+
$html_ve = '<div class="systemmonitor-ve state-' . $serverState . '-ve">';
226+
if ($osData != null) {
227+
$html_ve .= '<div class="icoDevice os-' . $osData['name'] . '"><p class="status"></p></div>';
228+
}
229+
else {
230+
$html_ve .= '<div class="icoDevice"><p class="status"></p></div>';
231+
}
232+
$html_ve .= '<div class="statusDevice"><p>' . $serverName;
229233
if ($osData != null) {
230-
$html_ve .= $osData['name'] . ' ' . $osData['version'] . '<br>';
234+
$html_ve .= ' (' . $osData['name'] . ' ' . $osData['version'] . ') ';
231235
}
232236
if ($ispcData != null) {
233-
$html_ve .= $ispcData['name'] . ' ' . $ispcData['version'] . '<br>';
237+
$html_ve .= $ispcData['name'] . ' ' . $ispcData['version'] . '</p>';
234238
}
235-
$html_ve .= $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . '<br>';
239+
else {
240+
$html_ve .= '</p>';
241+
}
242+
$html_ve .= '<p>' . $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . '</p>';
236243

237244
/*
238245
* Info of a "normal" Server or a OpenVz-Host
239246
*/
240-
$html_server = '<div class="systemmonitor-state state-' . $serverState . '">';
241-
$html_server .= '<div class="systemmonitor-device device-server">';
242-
$html_server .= '<div class="systemmonitor-content icons32 ico-' . $serverState . '">';
243-
$html_server .= $app->lng("monitor_serverstate_server_txt") . ': ' . $serverName;
247+
$html_server = '<div class="systemmonitor-server state-' . $serverState . '">';
244248
if ($osData != null) {
245-
$html_server .= ' (' . $osData['name'] . ' ' . $osData['version'] . ')<br>';
246-
}
247-
else {
248-
$html_server .= '<br />';
249+
$html_server .= '<div class="icoDevice os-' . $osData['name'] . '"><p class="status"></p></div>';
250+
}
251+
else {
252+
$html_server .= '<div class="icoDevice"><p class="status"></p></div>';
253+
}
254+
$html_server .= '<div class="statusDevice"><p>' . $app->lng("monitor_serverstate_server_txt") . ': ' . $serverName;
255+
if ($osData != null) {
256+
$html_server .= ' (' . $osData['name'] . ' ' . $osData['version'] . ') ';
249257
}
250258
if ($ispcData != null) {
251-
$html_server .= $ispcData['name'] . ' ' . $ispcData['version'] . '<br>';
252-
}
253-
else {
254-
$html_server .= '<br />';
259+
$html_server .= $ispcData['name'] . ' ' . $ispcData['version'] . '</p>';
255260
}
261+
else {
262+
$html_server .= '</p>';
263+
}
256264

257-
$html_server .= $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . ' (';
265+
$html_server .= '<p>' . $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . ' (';
258266
$html_server .= sizeof((isset($messages[$app->lng("monitor_serverstate_listunknown_txt")]) ? $messages[$app->lng("monitor_serverstate_listunknown_txt")] : array())) . ' ' . $app->lng("monitor_serverstate_unknown_txt") . ', ';
259267
$html_server .= sizeof((isset($messages[$app->lng("monitor_serverstate_listinfo_txt")]) ? $messages[$app->lng("monitor_serverstate_listinfo_txt")] : array())) . ' ' . $app->lng("monitor_serverstate_info_txt") . ', ';
260268
$html_server .= sizeof((isset($messages[$app->lng("monitor_serverstate_listwarning_txt")]) ? $messages[$app->lng("monitor_serverstate_listwarning_txt")] : array())) . ' ' . $app->lng("monitor_serverstate_warning_txt") . ', ';
261269
$html_server .= sizeof((isset($messages[$app->lng("monitor_serverstate_listcritical_txt")]) ? $messages[$app->lng("monitor_serverstate_listcritical_txt")] : array())) . ' ' . $app->lng("monitor_serverstate_critical_txt") . ', ';
262270
$html_server .= sizeof((isset($messages[$app->lng("monitor_serverstate_listerror_txt")]) ? $messages[$app->lng("monitor_serverstate_listerror_txt")] : array())) . ' ' . $app->lng("monitor_serverstate_error_txt") . '';
263-
$html_server .= ')<br />';
271+
$html_server .= ')</p>';
264272

265273
/*
266274
* Verbose - Info

interface/web/themes/default/css/screen/content_ispc.css

Lines changed: 83 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -104,137 +104,107 @@
104104
}
105105

106106
/* Systemmonitor */
107-
.systemmonitor-state {
108-
margin: 10px 5px;
109-
font-family: Consolas, "Lucida Console", "Courier New", monospace;
110-
font-size: 0.9em;
111-
float: left;
112-
width: 100%;
113-
}
114-
.systemmonitor-state.state-no_state {
115-
border-top: 4px solid #95A19F;
116-
background-color: #f8f8ff;
117-
}
118-
.systemmonitor-state.state-unknown {
119-
border-top: 4px solid #30302e;
120-
background-color: #cecfc5;
121-
}
122-
.systemmonitor-state.state-ok {
123-
border-top: 4px solid #23fb00;
124-
background-color: #adffa2;
125-
}
126-
.systemmonitor-state.state-info {
127-
border-top: 4px solid #183e99;
128-
background-color: #d4e2ff;
129-
}
130-
.systemmonitor-state.state-warning {
131-
border-top: 4px solid #ffa800;
132-
background-color: #ffda93;
133-
}
134-
.systemmonitor-state.state-critical {
135-
border-top: 4px solid #ff0000;
136-
background-color: #ffb9b9;
137-
}
138-
.systemmonitor-state.state-error {
139-
border-top: 4px solid #ff0000;
140-
background-color: #ff7f7f;
141-
}
142-
.systemmonitor-state.state-no_state-ve {
143-
float: left;
144-
width: 213px;
145-
border-top: 4px solid #95A19F;
146-
background-color: #f8f8ff;
147-
}
148-
.systemmonitor-state.state-unknown-ve {
149-
float: left;
150-
width: 213px;
151-
border-top: 4px solid #30302e;
152-
background-color: #cecfc5;
107+
.systemmonitor-server,
108+
.systemmonitor-ve {
109+
margin: 10px 5px;
110+
font-family: Consolas, "Lucida Console", "Courier New", monospace;
111+
font-size: 0.9em;
112+
float: left;
113+
width: 100%;
153114
}
154-
.systemmonitor-state.state-ok-ve {
155-
float: left;
156-
width: 213px;
157-
border-top: 4px solid #23fb00;
158-
background-color: #adffa2;
115+
.systemmonitor-server:hover,
116+
.systemmonitor-vm:hover { background-color: #FFFACD; }
117+
.state-no_state,
118+
.state-no_state-ve {
119+
border-top: 4px solid #95A19F;
120+
background-color: #f8f8ff;
159121
}
160-
.systemmonitor-state.state-info-ve {
161-
float: left;
162-
width: 213px;
163-
border-top: 4px solid #183e99;
164-
background-color: #d4e2ff;
122+
.state-unknown,
123+
.state-unknown-ve {
124+
border-top: 4px solid #30302e;
125+
background-color: #cecfc5;
165126
}
166-
.systemmonitor-state.state-warning-ve {
167-
float: left;
168-
width: 213px;
169-
border-top: 4px solid #ffa800;
170-
background-color: #ffda93;
127+
.state-ok,
128+
.state-ok-ve {
129+
border-top: 4px solid #23fb00;
130+
background-color: #adffa2;
171131
}
172-
.systemmonitor-state.state-critical-ve {
173-
float: left;
174-
width: 213px;
175-
border-top: 4px solid #ff0000;
176-
background-color: #ffb9b9;
132+
.state-info,
133+
.state-info-ve {
134+
border-top: 4px solid #183e99;
135+
background-color: #d4e2ff;
177136
}
178-
.systemmonitor-state.state-error-ve {
179-
float: left;
180-
width: 213px;
181-
border-top: 4px solid #ff0000;
182-
background-color: #ff7f7f;
137+
.state-warning,
138+
.state-warning-ve {
139+
border-top: 4px solid #ffa800;
140+
background-color: #ffda93;
183141
}
184-
.systemmonitor-state:hover {
185-
background-color: #FFFACD;
142+
.state-critical,
143+
.state-critical-ve {
144+
border-top: 4px solid #ff0000;
145+
background-color: #ffb9b9;
186146
}
187-
.systemmonitor-state p {
188-
float:left;
147+
.state-error,
148+
.state-error-ve {
149+
border-top: 4px solid #ff0000;
150+
background-color: #ff7f7f;
151+
}
152+
div.icoDevice {
153+
float: left;
154+
width: 64px;
155+
height: 64px;
189156
margin: 5px;
157+
background: url("../../icons/device_sprite.png") no-repeat transparent;
190158
}
191-
.systemmonitor-device {
192-
background-position: -6px 4px;
193-
background-repeat: no-repeat;
194-
min-height: 80px;
195-
}
196-
.systemmonitor-device.device-system { background-image: url("../../icons/x64/network.png"); }
197-
.systemmonitor-device.device-server {
198-
background-image: url("../../icons/x64/server.png");
199-
}
200-
.systemmonitor-device.device-ve {
201-
background-image: url("../../icons/x64/server.png");
202-
width: 213px;
203-
float: left;
204-
border: 1px dashed #aaaaaa;
205-
border-top: none;
206-
}
207-
208-
.systemmonitor-content.icons32 {
209-
padding:2px 10px 2px 56px;
210-
background-repeat: no-repeat;
211-
background-position: 12px 4px;
212-
}
213-
.systemmonitor-content.icons32.ico-no_state { /*background-image:url("../../icons/x32/state_no.png"); */ }
214-
.systemmonitor-content.icons32.ico-unknown { background-image:url("../../icons/x32/state_unknown.png"); }
215-
.systemmonitor-content.icons32.ico-ok { background-image:url("../../icons/x32/state_ok.png"); }
216-
.systemmonitor-content.icons32.ico-info { background-image:url("../../icons/x32/state_info.png"); }
217-
.systemmonitor-content.icons32.ico-warning { background-image:url("../../icons/x32/state_warning.png"); }
218-
.systemmonitor-content.icons32.ico-critical { background-image:url("../../icons/x32/state_critical.png"); }
219-
.systemmonitor-content.icons32.ico-error { background-image:url("../../icons/x32/state_error.png"); }
159+
.systemmonitor-server div.icoDevice { background-position: 0 0; }
160+
.systemmonitor-ve div.icoDevice { background-position: -64px 0; }
161+
.systemmonitor-network div.icoDevice { background-position: -128px -0; }
162+
div.statusDevice { float: left; }
163+
164+
p.status {
165+
float: right;
166+
width: 32px;
167+
height: 32px;
168+
background: url("../../icons/x32_sprite.png") no-repeat transparent;
169+
}
170+
.state-no_state p.status,
171+
.state-no_state-ve p.status,
172+
.state-unknown p.status,
173+
.state-unknown-ve p.status { background-position: 0 -207px; }
174+
175+
.state-ok p.status,
176+
.state-ok-ve p.status { background-position: 0 -270px; }
177+
178+
.state-info p.status,
179+
.state-info-ve p.status { background-position: 0 -336px; }
180+
181+
.state-warning p.status,
182+
.state-warning-ve p.status { background-position: 0 -143px; }
183+
184+
.state-critical p.status,
185+
.state-critical-ve p.status { background-position: 0 -463px; }
186+
187+
.state-error p.status,
188+
.state-error-ve p.status { background-position: 0 -400px; }
220189

190+
/* Usage unknown
221191
.systemmonitor-content table {
222-
border: none;
223-
margin-top: 10px;
192+
border: none;
193+
margin-top: 10px;
224194
}
225195
226196
.systemmonitor-content * .online {
227197
border: 1px solid #ffffff;
228-
background-color: #E3FFB8;
198+
background-color: #E3FFB8;
229199
color: #000000;
230-
padding:0px 5px;
200+
padding:0px 5px;
231201
}
232202
.systemmonitor-content * .offline {
233-
border: 1px solid #ffffff;
234-
background-color: #d12f19;
235-
color:#ffffff;
236-
padding:0px 5px;
237-
}
203+
border: 1px solid #ffffff;
204+
background-color: #d12f19;
205+
color:#ffffff;
206+
padding:0px 5px;
207+
}*/
238208

239209
/* Dashboard */
240210
.dashboard-modules {
10.3 KB
Loading
8.37 KB
Loading
36.5 KB
Loading

0 commit comments

Comments
 (0)