From d311c5888006d960a1f5cd1aa48c42e12eeeeeae Mon Sep 17 00:00:00 2001
From: cfoe <cfoe@ispconfig3>
Date: Tue, 10 Jul 2012 08:04:20 -0400
Subject: [PATCH] changed server_list display to usage of sprite images + reduction of hardcoded <br>-elements + additional support for distro icons in server_list
---
interface/web/monitor/show_sys_state.php | 50 +++++----
interface/web/themes/default/css/screen/content_ispc.css | 196 ++++++++++++++++----------------------
interface/web/themes/default/icons/x16_sprite.png | 0
interface/web/themes/default/icons/device_sprite.png | 0
interface/web/themes/default/icons/x32_sprite.png | 0
5 files changed, 112 insertions(+), 134 deletions(-)
diff --git a/interface/web/monitor/show_sys_state.php b/interface/web/monitor/show_sys_state.php
index 634880c..e504763 100644
--- a/interface/web/monitor/show_sys_state.php
+++ b/interface/web/monitor/show_sys_state.php
@@ -222,45 +222,53 @@
/*
* Info of a VE inside a OpenVz-Host
*/
- $html_ve = '<div class="systemmonitor-state state-' . $serverState . '-ve">';
- $html_ve .= '<div class="systemmonitor-device device-ve">';
- $html_ve .= '<div class="systemmonitor-content icons32 ico-' . $serverState . '">';
- $html_ve .= $serverName . '<br>';
+ $html_ve = '<div class="systemmonitor-ve state-' . $serverState . '-ve">';
+ if ($osData != null) {
+ $html_ve .= '<div class="icoDevice os-' . $osData['name'] . '"><p class="status"></p></div>';
+ }
+ else {
+ $html_ve .= '<div class="icoDevice"><p class="status"></p></div>';
+ }
+ $html_ve .= '<div class="statusDevice"><p>' . $serverName;
if ($osData != null) {
- $html_ve .= $osData['name'] . ' ' . $osData['version'] . '<br>';
+ $html_ve .= ' (' . $osData['name'] . ' ' . $osData['version'] . ') ';
}
if ($ispcData != null) {
- $html_ve .= $ispcData['name'] . ' ' . $ispcData['version'] . '<br>';
+ $html_ve .= $ispcData['name'] . ' ' . $ispcData['version'] . '</p>';
}
- $html_ve .= $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . '<br>';
+ else {
+ $html_ve .= '</p>';
+ }
+ $html_ve .= '<p>' . $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . '</p>';
/*
* Info of a "normal" Server or a OpenVz-Host
*/
- $html_server = '<div class="systemmonitor-state state-' . $serverState . '">';
- $html_server .= '<div class="systemmonitor-device device-server">';
- $html_server .= '<div class="systemmonitor-content icons32 ico-' . $serverState . '">';
- $html_server .= $app->lng("monitor_serverstate_server_txt") . ': ' . $serverName;
+ $html_server = '<div class="systemmonitor-server state-' . $serverState . '">';
if ($osData != null) {
- $html_server .= ' (' . $osData['name'] . ' ' . $osData['version'] . ')<br>';
- }
- else {
- $html_server .= '<br />';
+ $html_server .= '<div class="icoDevice os-' . $osData['name'] . '"><p class="status"></p></div>';
+ }
+ else {
+ $html_server .= '<div class="icoDevice"><p class="status"></p></div>';
+ }
+ $html_server .= '<div class="statusDevice"><p>' . $app->lng("monitor_serverstate_server_txt") . ': ' . $serverName;
+ if ($osData != null) {
+ $html_server .= ' (' . $osData['name'] . ' ' . $osData['version'] . ') ';
}
if ($ispcData != null) {
- $html_server .= $ispcData['name'] . ' ' . $ispcData['version'] . '<br>';
+ $html_server .= $ispcData['name'] . ' ' . $ispcData['version'] . '</p>';
}
- else {
- $html_server .= '<br />';
- }
+ else {
+ $html_server .= '</p>';
+ }
- $html_server .= $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . ' (';
+ $html_server .= '<p>' . $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . ' (';
$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") . ', ';
$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") . ', ';
$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") . ', ';
$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") . ', ';
$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") . '';
- $html_server .= ')<br />';
+ $html_server .= ')</p>';
/*
* Verbose - Info
diff --git a/interface/web/themes/default/css/screen/content_ispc.css b/interface/web/themes/default/css/screen/content_ispc.css
index aec65d6..13ffad9 100644
--- a/interface/web/themes/default/css/screen/content_ispc.css
+++ b/interface/web/themes/default/css/screen/content_ispc.css
@@ -104,137 +104,107 @@
}
/* Systemmonitor */
- .systemmonitor-state {
- margin: 10px 5px;
- font-family: Consolas, "Lucida Console", "Courier New", monospace;
- font-size: 0.9em;
- float: left;
- width: 100%;
+ .systemmonitor-server,
+ .systemmonitor-ve {
+ margin: 10px 5px;
+ font-family: Consolas, "Lucida Console", "Courier New", monospace;
+ font-size: 0.9em;
+ float: left;
+ width: 100%;
}
- .systemmonitor-state.state-no_state {
- border-top: 4px solid #95A19F;
- background-color: #f8f8ff;
+ .systemmonitor-server:hover,
+ .systemmonitor-vm:hover { background-color: #FFFACD; }
+ .state-no_state,
+ .state-no_state-ve {
+ border-top: 4px solid #95A19F;
+ background-color: #f8f8ff;
}
- .systemmonitor-state.state-unknown {
- border-top: 4px solid #30302e;
- background-color: #cecfc5;
+ .state-unknown,
+ .state-unknown-ve {
+ border-top: 4px solid #30302e;
+ background-color: #cecfc5;
}
- .systemmonitor-state.state-ok {
- border-top: 4px solid #23fb00;
- background-color: #adffa2;
+ .state-ok,
+ .state-ok-ve {
+ border-top: 4px solid #23fb00;
+ background-color: #adffa2;
}
- .systemmonitor-state.state-info {
- border-top: 4px solid #183e99;
- background-color: #d4e2ff;
+ .state-info,
+ .state-info-ve {
+ border-top: 4px solid #183e99;
+ background-color: #d4e2ff;
}
- .systemmonitor-state.state-warning {
- border-top: 4px solid #ffa800;
- background-color: #ffda93;
+ .state-warning,
+ .state-warning-ve {
+ border-top: 4px solid #ffa800;
+ background-color: #ffda93;
}
- .systemmonitor-state.state-critical {
- border-top: 4px solid #ff0000;
- background-color: #ffb9b9;
+ .state-critical,
+ .state-critical-ve {
+ border-top: 4px solid #ff0000;
+ background-color: #ffb9b9;
}
- .systemmonitor-state.state-error {
- border-top: 4px solid #ff0000;
- background-color: #ff7f7f;
- }
- .systemmonitor-state.state-no_state-ve {
- float: left;
- width: 213px;
- border-top: 4px solid #95A19F;
- background-color: #f8f8ff;
- }
- .systemmonitor-state.state-unknown-ve {
- float: left;
- width: 213px;
- border-top: 4px solid #30302e;
- background-color: #cecfc5;
- }
- .systemmonitor-state.state-ok-ve {
- float: left;
- width: 213px;
- border-top: 4px solid #23fb00;
- background-color: #adffa2;
- }
- .systemmonitor-state.state-info-ve {
- float: left;
- width: 213px;
- border-top: 4px solid #183e99;
- background-color: #d4e2ff;
- }
- .systemmonitor-state.state-warning-ve {
- float: left;
- width: 213px;
- border-top: 4px solid #ffa800;
- background-color: #ffda93;
- }
- .systemmonitor-state.state-critical-ve {
- float: left;
- width: 213px;
- border-top: 4px solid #ff0000;
- background-color: #ffb9b9;
- }
- .systemmonitor-state.state-error-ve {
- float: left;
- width: 213px;
- border-top: 4px solid #ff0000;
- background-color: #ff7f7f;
- }
- .systemmonitor-state:hover {
- background-color: #FFFACD;
- }
- .systemmonitor-state p {
- float:left;
+ .state-error,
+ .state-error-ve {
+ border-top: 4px solid #ff0000;
+ background-color: #ff7f7f;
+ }
+ div.icoDevice {
+ float: left;
+ width: 64px;
+ height: 64px;
margin: 5px;
+ background: url("../../icons/device_sprite.png") no-repeat transparent;
}
- .systemmonitor-device {
- background-position: -6px 4px;
- background-repeat: no-repeat;
- min-height: 80px;
- }
- .systemmonitor-device.device-system { background-image: url("../../icons/x64/network.png"); }
- .systemmonitor-device.device-server {
- background-image: url("../../icons/x64/server.png");
- }
- .systemmonitor-device.device-ve {
- background-image: url("../../icons/x64/server.png");
- width: 213px;
- float: left;
- border: 1px dashed #aaaaaa;
- border-top: none;
- }
+ .systemmonitor-server div.icoDevice { background-position: 0 0; }
+ .systemmonitor-ve div.icoDevice { background-position: -64px 0; }
+ .systemmonitor-network div.icoDevice { background-position: -128px -0; }
+ div.statusDevice { float: left; }
+
+ p.status {
+ float: right;
+ width: 32px;
+ height: 32px;
+ background: url("../../icons/x32_sprite.png") no-repeat transparent;
+ }
+ .state-no_state p.status,
+ .state-no_state-ve p.status,
+ .state-unknown p.status,
+ .state-unknown-ve p.status { background-position: 0 -207px; }
+
+ .state-ok p.status,
+ .state-ok-ve p.status { background-position: 0 -270px; }
+
+ .state-info p.status,
+ .state-info-ve p.status { background-position: 0 -336px; }
+
+ .state-warning p.status,
+ .state-warning-ve p.status { background-position: 0 -143px; }
+
+ .state-critical p.status,
+ .state-critical-ve p.status { background-position: 0 -463px; }
+
+ .state-error p.status,
+ .state-error-ve p.status { background-position: 0 -400px; }
- .systemmonitor-content.icons32 {
- padding:2px 10px 2px 56px;
- background-repeat: no-repeat;
- background-position: 12px 4px;
- }
- .systemmonitor-content.icons32.ico-no_state { /*background-image:url("../../icons/x32/state_no.png"); */ }
- .systemmonitor-content.icons32.ico-unknown { background-image:url("../../icons/x32/state_unknown.png"); }
- .systemmonitor-content.icons32.ico-ok { background-image:url("../../icons/x32/state_ok.png"); }
- .systemmonitor-content.icons32.ico-info { background-image:url("../../icons/x32/state_info.png"); }
- .systemmonitor-content.icons32.ico-warning { background-image:url("../../icons/x32/state_warning.png"); }
- .systemmonitor-content.icons32.ico-critical { background-image:url("../../icons/x32/state_critical.png"); }
- .systemmonitor-content.icons32.ico-error { background-image:url("../../icons/x32/state_error.png"); }
-
+ /* Usage unknown
.systemmonitor-content table {
- border: none;
- margin-top: 10px;
+ border: none;
+ margin-top: 10px;
}
.systemmonitor-content * .online {
border: 1px solid #ffffff;
- background-color: #E3FFB8;
+ background-color: #E3FFB8;
color: #000000;
- padding:0px 5px;
+ padding:0px 5px;
}
.systemmonitor-content * .offline {
- border: 1px solid #ffffff;
- background-color: #d12f19;
- color:#ffffff;
- padding:0px 5px;
- }
+ border: 1px solid #ffffff;
+ background-color: #d12f19;
+ color:#ffffff;
+ padding:0px 5px;
+ }*/
/* Dashboard */
.dashboard-modules {
diff --git a/interface/web/themes/default/icons/device_sprite.png b/interface/web/themes/default/icons/device_sprite.png
new file mode 100644
index 0000000..af531d7
--- /dev/null
+++ b/interface/web/themes/default/icons/device_sprite.png
Binary files differ
diff --git a/interface/web/themes/default/icons/x16_sprite.png b/interface/web/themes/default/icons/x16_sprite.png
new file mode 100644
index 0000000..f64f7ce
--- /dev/null
+++ b/interface/web/themes/default/icons/x16_sprite.png
Binary files differ
diff --git a/interface/web/themes/default/icons/x32_sprite.png b/interface/web/themes/default/icons/x32_sprite.png
new file mode 100644
index 0000000..5c9f04f
--- /dev/null
+++ b/interface/web/themes/default/icons/x32_sprite.png
Binary files differ
--
Gitblit v1.9.1