From 8964829c1c9116a7676908d005dcb6415b3eddca Mon Sep 17 00:00:00 2001 From: Brian Read Date: Sat, 27 Sep 2025 10:06:35 +0100 Subject: [PATCH] * Sat Sep 27 2025 Brian Read 11.0.0-2.sme - Add css to make embedded static version look a bit better [SME: 13195] --- .../lib/SrvMngr/Controller/Phpsysinfo.pm | 12 +- .../themes/default/public/css/phpsysinfo.css | 202 ++++++++++++++++++ .../default/templates/phpsysinfo.html.ep | 6 +- smeserver-phpsysinfo.spec | 5 +- 4 files changed, 214 insertions(+), 11 deletions(-) create mode 100644 root/usr/share/smanager/themes/default/public/css/phpsysinfo.css diff --git a/root/usr/share/smanager/lib/SrvMngr/Controller/Phpsysinfo.pm b/root/usr/share/smanager/lib/SrvMngr/Controller/Phpsysinfo.pm index 6cf310d..0d9c280 100644 --- a/root/usr/share/smanager/lib/SrvMngr/Controller/Phpsysinfo.pm +++ b/root/usr/share/smanager/lib/SrvMngr/Controller/Phpsysinfo.pm @@ -1,7 +1,7 @@ package SrvMngr::Controller::Phpsysinfo; #---------------------------------------------------------------------- -# heading : Legacy +# heading : Investigation # description : System Information # navigation : 4000 600 #---------------------------------------------------------------------- @@ -22,18 +22,16 @@ $ua->insecure(1); sub main { my $c = shift; my $title = $c->l('psi_phpsysinfo_panel'); - my $php_url = 'https://sme11.thereadclan.me.uk/phpsysinfo/index.php?disp=static'; - #my $first_line = q{}; - #my $second_line = q{}; + my $host = $c->req->url->to_abs->host; + my $php_url = "https://".$host."/phpsysinfo/index.php?disp=static"; + my $php_url2 = "https://".$host."/phpsysinfo/index.php?disp=bootstrap"; $ua->get($php_url => sub { my ($ua, $tx) = @_; if ($tx->res->is_success) { my $php_content = $tx->res->body; my ($phpsysinfo_html) = $php_content =~ m{]*>(.*?)}si; $phpsysinfo_html =~ s/^( SME Server|
Copyright \(c\)).*\n//gmi; - # Insert $first_line before $second_line - supressing CSP - #$phpsysinfo_html =~ s/(\Q$second_line\E)/$first_line\n$1/; - $c->stash(title => $title, phpsysinfo => $phpsysinfo_html, php_url => $php_url); + $c->stash(title => $title, phpsysinfo => $phpsysinfo_html, php_url => $php_url, php_url2 => $php_url2); $c->render(template => 'phpsysinfo'); } else { my $code = $tx->res->code // 'No code'; diff --git a/root/usr/share/smanager/themes/default/public/css/phpsysinfo.css b/root/usr/share/smanager/themes/default/public/css/phpsysinfo.css new file mode 100644 index 0000000..3de61ff --- /dev/null +++ b/root/usr/share/smanager/themes/default/public/css/phpsysinfo.css @@ -0,0 +1,202 @@ +/* Overall page wrapper */ +#page-wrapper { + display: flex; + flex-wrap: wrap; + gap: 30px; + max-width: 1200px; + margin: auto; + padding: 20px; + box-sizing: border-box; + font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; + background: #fafafa; + color: #333; +} + +/* Title spans full width */ +#title { + width: 100%; + margin-bottom: 20px; + color: #555555; /* grey for main title */ +} + +/* Vitals and hardware side by side */ +#vitals, #hardware { + background: #fff; + border-radius: 6px; + box-shadow: 0 4px 8px rgba(0,0,0,0.05); + flex: 1 1 45%; + min-width: 320px; + display: flex; + flex-direction: column; + overflow: hidden; + padding: 7px 7px 7px 0; +} + +/* Outer box - your existing hardware box */ +#hardware { + background: #fff; + border-radius: 8px; + box-shadow: 0 6px 12px rgb(0 0 0 / 0.08); + padding: 0; + margin: 0; + display: flex; + flex-direction: column; + overflow: hidden; +} + +/* Inner boxes for PCI, SCSI, USB, I2C Devices sections */ + +#hardware ul { + background: #f7fcf7; /* subtle pale green */ + border: 1.5px solid #cde7cd; + border-radius: 8px; + padding: 12px 16px; + margin: 12px 16px 24px 16px; + box-shadow: inset 0 2px 5px rgb(0 0 0 / 0.04); +} + +/* Smaller heading style for each nested box (optional) */ +#hardware h3 { + margin: 20px 16px 0 16px; + color: #317a2a; + font-weight: 600; + font-size: 1.05rem; + background: transparent; + padding: 0; + border: none; + text-shadow: none; +} + + +/* Other sections full width */ +#memory, #filesystem, #network, #footer { + width: 100%; + background: #fff; + border-radius: 6px; + box-shadow: 0 4px 8px rgba(0,0,0,0.05); + margin-top: 20px; + padding: 0; +} + +/* Uniform green header bars on all section headings */ +#page-wrapper h1#title, +#vitals > h2, +#hardware > h2, +#memory > h2, +#filesystem > h2, +#network > h2, +#footer > span { + background-color: #56b358; + color: white; + font-weight: 600; + padding: 12px 20px; + margin: 0; + border-bottom: 1px solid #2d8d44; + border-radius: 0; +} + +/* Table styling */ +table { + width: 100%; + border-collapse: separate; + border-spacing: 0; + font-size: 0.9rem; + color: #222; + background: transparent; + margin: 0; +} + +th, td { + padding: 12px 15px; + border-bottom: 1px solid #e2e8ec; + text-align: left; +} + +th { + font-weight: 700; + color: #1b4d1b; + background-color: #e4f1e6; +} + +tr:last-child td { + border-bottom: none; +} + +tr:nth-child(even) { + background-color: #f6fcf7; +} + +td:first-child { + font-weight: 600; + white-space: nowrap; + width: 160px; +} + +/* Progress bars in green */ +.bar { + display: inline-block; + height: 14px; + background: linear-gradient(90deg, #256d35 0%, #a5ead0 100%); + border-radius: 5px; + margin-right: 8px; + vertical-align: middle; +} + +.right { + text-align: right; +} + +/* Footer styling */ +#footer { + text-align: center; + font-size: 0.85rem; + color: #777; + margin-top: 40px; + background: #fff; + border-radius: 6px; + box-shadow: 0 4px 8px rgba(0,0,0,0.05); + padding: 10px 0; +} + +/* Responsive stacking */ +@media (max-width: 900px) { + #vitals, #hardware { + width: 100% !important; + margin-bottom: 20px; + } +} + +/* Basic button look for links */ +a.button-like { + display: inline-block; + padding: 8px 16px; + font-family: Verdana, Tahoma, sans-serif; + font-size: 12px; + font-weight: bold; + color: #fff; /* white text */ + background-color: #39a854; /* green button background */ + border: 1px solid #2f7c34; + border-radius: 6px; + text-decoration: none; + cursor: pointer; + box-shadow: 0 3px 0 #2f7c34; + transition: background-color 0.3s, box-shadow 0.2s, transform 0.1s; +} + +/* Hover effect */ +a.button-like:hover, +a.button-like:focus { + background-color: #2f7c34; + box-shadow: 0 4px 6px #276a2e; + transform: translateY(-1px); + text-decoration: none; + color: #fff; +} + +/* Active effect when clicked */ +a.button-like:active { + box-shadow: 0 1px 1px #276a2e; + transform: translateY(1px); + background-color: #276a2e; + color: #e8f3e1; /* lighter text on active */ +} \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/phpsysinfo.html.ep b/root/usr/share/smanager/themes/default/templates/phpsysinfo.html.ep index 15052e3..72c1034 100644 --- a/root/usr/share/smanager/themes/default/templates/phpsysinfo.html.ep +++ b/root/usr/share/smanager/themes/default/templates/phpsysinfo.html.ep @@ -15,10 +15,10 @@ %} - <%= link_to 'Visit External Website' => $c->stash('php_url'), target => '_blank', rel => 'noopener noreferrer' %> + <%= link_to 'Full Screen' => $c->stash('php_url2'), class => 'button-like', target => '_blank', rel => 'noopener noreferrer' %> -

Legacy-<%=$c->l('psi_phpsysinfo') %>


+

<%= $c->l('psi_phpsysinfo')%>


- %== $c->stash('phpsysinfo'); + %== "
".$c->stash('phpsysinfo')."
"; %end \ No newline at end of file diff --git a/smeserver-phpsysinfo.spec b/smeserver-phpsysinfo.spec index 10faa06..f0ea5e5 100644 --- a/smeserver-phpsysinfo.spec +++ b/smeserver-phpsysinfo.spec @@ -6,7 +6,7 @@ Summary: phpSysInfo for SME Server %define name smeserver-phpsysinfo Name: %{name} %define version 11.0.0 -%define release 1 +%define release 2 Version: %{version} Release: %{release}%{?dist} License: GPL @@ -27,6 +27,9 @@ AutoReqProv: no Access with admin login credentials via https://yourdomain/phpsysinfo %changelog +* Sat Sep 27 2025 Brian Read 11.0.0-2.sme +- Add css to make embedded static version look a bit better [SME: 13195] + * Mon May 12 2025 Brian Read 11.0.0-1.sme - Adding SM2 panel [SME: 13004] - Upgrade to phpsysinfo 3.4.4