* Sat Apr 19 2025 Brian Read <brianr@koozali.org> 11.0.0-2.sme
- Get the new SM2 code right - calling the old perl. - Update version to 11
This commit is contained in:
34
root/usr/share/smanager/lib/SrvMngr/Controller/Diskusage.pm
Normal file
34
root/usr/share/smanager/lib/SrvMngr/Controller/Diskusage.pm
Normal file
@@ -0,0 +1,34 @@
|
||||
package SrvMngr::Controller::Diskusage;
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# heading : Investigation
|
||||
# description : Disk Usage
|
||||
# navigation : 4000 600
|
||||
#----------------------------------------------------------------------
|
||||
#----------------------------------------------------------------------
|
||||
# name : diskusage, method : get, url : /diskusage, ctlact : Diskusage#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('diskusage_panel');
|
||||
my $diskusage_height = $c->param('height') || '600';
|
||||
my $diskusage_full_html = qx(perl -T /etc/e-smith/web/functions/diskusage);
|
||||
my ($diskusage_html) = $diskusage_full_html =~ m{<body[^>]*>(.*?)</body>}si;
|
||||
# Remove lines starting with the specified phrases
|
||||
$diskusage_html =~ s/^( SME Server|<BR>Copyright \(c\)).*\n//gmi;
|
||||
$c->stash(title => $title, diskusage => $diskusage_html, height => $diskusage_height);
|
||||
#die("$diskusage_html");
|
||||
$c->render(template => 'diskusage');
|
||||
} ## end sub main
|
||||
1;
|
Reference in New Issue
Block a user