diff --git a/.gitignore b/.gitignore index cbb3a13..e594810 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *.rpm *.log *spec-20* -*.tar.gz +*.tar.xz diff --git a/root/usr/share/smanager/lib/SrvMngr/Controller/Hwinfo.pm b/root/usr/share/smanager/lib/SrvMngr/Controller/Hwinfo.pm new file mode 100644 index 0000000..8af4147 --- /dev/null +++ b/root/usr/share/smanager/lib/SrvMngr/Controller/Hwinfo.pm @@ -0,0 +1,41 @@ +package SrvMngr::Controller::Hwinfo; + +#---------------------------------------------------------------------- +# heading : Investigation +# description : Hardware Info +# navigation : 4000 800 +#---------------------------------------------------------------------- +#---------------------------------------------------------------------- +# name : hwinfo, method : get, url : /hwinfo, ctlact : Hwinfo#main +# +# routes : end +#---------------------------------------------------------------------- +use strict; +use warnings; +use Mojo::Base 'Mojolicious::Controller'; +use Locale::gettext; +use SrvMngr::I18N; +use SrvMngr qw(theme_list init_session); + +#use SrvMngr::Model::Main; +sub main { + my $c = shift; + $c->app->log->info($c->log_req); + my $title = $c->l('hwinfo_panel'); + my $hwinfo_height = $c->param('height') || '600'; + my $hwinfo_full_html = qx(perl -T /etc/e-smith/web/functions/hwinfo); + my ($hwinfo_html) = $hwinfo_full_html =~ m{]*>(.*?)}si; + $hwinfo_html = ''.$hwinfo_html; + $hwinfo_html =~ s/
|<\/div>//g; + # Remove lines starting with the specified phrases + $hwinfo_html =~ s/^( SME Server|
Copyright \(c\)).*\n//gmi; + +open(my $fh, '>', '/root/hwinfo.txt') or die $!; +print $fh $hwinfo_html; +close($fh); + + $c->stash(title => $title, hwinfo => $hwinfo_html, height => $hwinfo_height); + #die("$hwinfo_html"); + $c->render(template => 'hwinfo'); +} ## end sub main +1; diff --git a/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Hwinfo/hwinfo_en.lex b/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Hwinfo/hwinfo_en.lex new file mode 100644 index 0000000..7a780d4 --- /dev/null +++ b/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Hwinfo/hwinfo_en.lex @@ -0,0 +1,2 @@ +'hwi_FUll_description' => 'Full description', +'hwi_hwinfo' => 'Hardware Information' diff --git a/root/usr/share/smanager/themes/default/public/css/hwinfo.css b/root/usr/share/smanager/themes/default/public/css/hwinfo.css new file mode 100644 index 0000000..7bc8bde --- /dev/null +++ b/root/usr/share/smanager/themes/default/public/css/hwinfo.css @@ -0,0 +1,181 @@ +/* + * Koozali SME Server Table Styling + * + * This CSS makes tables look good with colors matching the Koozali SME Server interface. + * Compatible with all modern browsers and IE9+. + */ + +/* Basic table styling */ +table.node { + border-collapse: collapse; + width: 100%; + margin: 20px 0; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + border: 1px solid #d5e5c0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; + background-color: white; + max-width: 700px; +} + +/* Table header styling */ +table.node thead { + background-color: #e6f2d5; + border-bottom: 1px solid #d5e5c0; +} + +/* Table header cells */ +table.node thead td { + padding: 12px 15px; + font-weight: bold; + color: #006600; +} + +/* Table data cells */ +table.node td { + padding: 10px 15px; + border-bottom: 1px solid #e6f2d5; + line-height: 1.4; + word-wrap: break-word; + -ms-word-break: break-word; + word-break: break-word; + -webkit-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; +} + +/* First column styling (labels) */ +table.node td.first { + width: 25%; + font-weight: bold; + color: #333; + background-color: #e8f3e1; +} + +/* Second column styling (values) */ +table.node td.second { + width: 75%; +} + +/* Zebra striping for better readability */ +table.node tbody tr:nth-child(even) { + background-color: #fafdf7; +} + +/* Hover effect for rows */ +table.node tbody tr:hover { + background-color: #edf5e2; +} + +/* Nested tables styling */ +table.node table { + width: 100%; + border: none; + -webkit-box-shadow: none; + box-shadow: none; + margin: 0; +} + +table.node table td { + padding: 4px 6px; + border: none; + background-color: transparent !important; +} + +/* ID styling */ +.id { + font-family: monospace; + background-color: #f5f9ef; + padding: 2px 4px; + border: 1px solid #d5e5c0; + border-radius: 3px; + font-size: 0.9em; +} + +/* Help styling for dfn elements */ +dfn { + cursor: help; + border-bottom: 1px dotted #006600; + font-style: normal; +} + +/* Add some spacing between tables */ +table.node + table.node { + margin-top: 30px; +} + +/* Fix for older browsers */ +@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { + /* IE10+ specific styles */ + table.node td { + word-break: break-all; + } + + table.node td.first { + word-break: normal; + } +} + +/* Make sure tables don't overflow on small screens */ +@media (max-width: 768px) { + table.node { + font-size: 14px; + } + + table.node td { + padding: 8px 10px; + } + + table.node td.first { + width: 35%; + } + + table.node td.second { + width: 65%; + } +} + +/* Very small screens */ +@media (max-width: 480px) { + table.node { + font-size: 13px; + } + + table.node td { + padding: 6px 8px; + } + + table.node td.first { + width: 40%; + } + + table.node td.second { + width: 60%; + } +} + +/* Print styles */ +@media print { + table.node { + -webkit-box-shadow: none; + box-shadow: none; + border: 1px solid #999; + page-break-inside: avoid; + } + + table.node + table.node { + margin-top: 20px; + } + + table.node thead { + background-color: #f5f9ef !important; + -webkit-print-color-adjust: exact; + color-adjust: exact; + } + + table.node td.first { + background-color: #f9fcf5 !important; + -webkit-print-color-adjust: exact; + color-adjust: exact; + } +} diff --git a/root/usr/share/smanager/themes/default/public/js/hwinfo.js b/root/usr/share/smanager/themes/default/public/js/hwinfo.js new file mode 100644 index 0000000..058829f --- /dev/null +++ b/root/usr/share/smanager/themes/default/public/js/hwinfo.js @@ -0,0 +1,194 @@ +/** + * Table Navigation Dropdown - JavaScript Only Solution for Mojolicious Sites + * + * This script automatically creates a dropdown menu to navigate between tables + * on a page without requiring any HTML modifications. + * + * Compatible with all modern browsers and IE11+. + * + * How to use: + * 1. Add this script to your Mojolicious site using a