diff -urN smeserver-durep-1.5.0.old/createlinks smeserver-durep-1.5.0/createlinks --- smeserver-durep-1.5.0.old/createlinks 2021-04-27 18:56:17.000000000 +0400 +++ smeserver-durep-1.5.0/createlinks 2021-06-02 23:21:34.742000000 +0400 @@ -13,10 +13,15 @@ event_link("durep-init", $event, "90"); #-------------------------------------------------- -# actions for smeserver-durep-update: +# actions for smeserver-durep-update event: #-------------------------------------------------- $event = "smeserver-durep-update"; event_link("navigation-conf", $event, "50"); event_link("durep-init", $event, "90"); templates2events("/etc/crontab", $event ); + +safe_symlink('restart', "root/etc/e-smith/events/$event/services2adjust/smanager"); +event_link('navigation2-conf', "$event", '80'); +event_link('routes2-conf', "$event", '80'); +event_link('locales2-conf', "$event", '80'); diff -urN smeserver-durep-1.5.0.old/root/usr/share/smanager/lib/SrvMngr/Controller/Durep.pm smeserver-durep-1.5.0/root/usr/share/smanager/lib/SrvMngr/Controller/Durep.pm --- smeserver-durep-1.5.0.old/root/usr/share/smanager/lib/SrvMngr/Controller/Durep.pm 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-durep-1.5.0/root/usr/share/smanager/lib/SrvMngr/Controller/Durep.pm 2021-05-31 23:18:14.000000000 +0400 @@ -0,0 +1,66 @@ +package SrvMngr::Controller::Durep; + +#---------------------------------------------------------------------- +# heading : Administration +# description : Disk usage report +# navigation : 4000 4390 +# menu : A +# +# name : durep, method : get, url : /durep, ctlact : durep#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); + + +sub main { + + my $c = shift; + $c->app->log->info($c->log_req); + + my $modul = get_du( $c ); + + $c->stash( modul => $modul ); + $c->render(template => 'durep'); + +} + + +sub get_du { + + my ($c) = @_; + + my $tx = $c->tx; + my $req = $tx->req; + +# 3 env variables for durep.cgi + $ENV{'SCRIPT_NAME'} = 'durep'; + $ENV{'REQUEST_METHOD'} = $req->method; + $ENV{'QUERY_STRING'} = $req->url->query->to_string; + + my $res = `/etc/e-smith/web/panels/manager/html/durep/durep.cgi`; + + my $step = 0; my $out; + my @lines = split /\n/, $res; +# remove except 'body' + foreach my $line (@lines) { + if ( $line =~ m|| ) { + $step = 1; + } elsif ( $line =~ m|| ) { + $step = 2; + } elsif ( $step == 1 ) { + $out .= $line; + } + } + return $out; +} + + +1; diff -urN smeserver-durep-1.5.0.old/root/usr/share/smanager/lib/SrvMngr/I18N/Module/Durep/durep_en.lex smeserver-durep-1.5.0/root/usr/share/smanager/lib/SrvMngr/I18N/Module/Durep/durep_en.lex --- smeserver-durep-1.5.0.old/root/usr/share/smanager/lib/SrvMngr/I18N/Module/Durep/durep_en.lex 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-durep-1.5.0/root/usr/share/smanager/lib/SrvMngr/I18N/Module/Durep/durep_en.lex 2021-05-31 18:01:36.000000000 +0400 @@ -0,0 +1 @@ +'dur_FORM_TITLE' => 'Disk usage report', \ Pas de fin de ligne à la fin du fichier diff -urN smeserver-durep-1.5.0.old/root/usr/share/smanager/themes/default/public/css/durep.css smeserver-durep-1.5.0/root/usr/share/smanager/themes/default/public/css/durep.css --- smeserver-durep-1.5.0.old/root/usr/share/smanager/themes/default/public/css/durep.css 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-durep-1.5.0/root/usr/share/smanager/themes/default/public/css/durep.css 2021-05-31 19:04:00.000000000 +0400 @@ -0,0 +1,127 @@ +/* +a:hover { + background-color: #DDDDDD; +} + +body { + text-align: center; + background-color: #ffffff; +} +*/ + +div.tbar { + text-align: left; + width: 100%; + background-color: #EEEEEE; + border-top: solid 1px #DDDDDD; + border-bottom: solid 1px #DDDDDD; +} + +div.bbar { + text-align: left; + width: 100%; + background-color: #EEEEEE; + border-top: solid 1px #DDDDDD; + border-bottom: solid 1px #DDDDDD; +} + +div.bbar * { + font-size: 90%; +} + +div.options { + text-align: left; + margin: 2em; + background-color: #EEEEEE; + border: solid 1px #DDDDDD; +} + +.light { + background-color: #ffffff; + } + +.mid { + background-color: #f6f6f6; +} + +.dark { + background-color: #f0f0f0; +} + +.tbar table { + width: 100%; + padding-left: 2pt; + font-weight: bold; +} + +.bbar table { + width: 100%; + padding-left: 2pt; +} + +table.list { + margin: 2em 0px; + border: solid 1px #CCCCCC; + margin-left: auto; + margin-right: auto; +} + +table.list td { + text-align: left; + padding: 2px 5px; +} + +table.list th { + text-align: left; + padding: 2px 5px; + text-align: left; + background-color: #DDDDDD; +} + +table.report { + margin: 2em 0px; + border: solid 1px #CCCCCC; + text-align: left; + margin-left: auto; + margin-right: auto; +} + +table.report td { + padding: 2px 5px; +} + +table.report th { + padding: 2px 5px; + text-align: left; + background-color: #DDDDDD; +} + +.graph { + padding: 0px; + background-color: #eeeeee; + width: 200px; + height: 15px; +} + +th.right { + text-align: right; +} + +td.right { + text-align: right; +} + +span.dir { + font-weight: bold; +} + +span.empty { + color: #006600; + font-weight: bold; +} + +span.coalesced { + color: #880000; + font-weight: bold; +} + diff -urN smeserver-durep-1.5.0.old/root/usr/share/smanager/themes/default/templates/durep.html.ep smeserver-durep-1.5.0/root/usr/share/smanager/themes/default/templates/durep.html.ep --- smeserver-durep-1.5.0.old/root/usr/share/smanager/themes/default/templates/durep.html.ep 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-durep-1.5.0/root/usr/share/smanager/themes/default/templates/durep.html.ep 2021-06-02 22:57:46.064000000 +0400 @@ -0,0 +1,24 @@ +% layout 'default', title => 'Sme server 2 - Durep'; + +% content_for 'head_contrib' => begin + %= stylesheet '/css/durep.css' +%end + +% content_for 'module' => begin + % if ($config->{debug} == 1) { +

+ %= dumper $c->current_route +

+ % } + +
+ % if ( stash 'error' ) { +
+ %= $c->render_to_string(inline => stash 'error') +
+ %} + + %= $c->render_to_string(inline => $modul) + +
+% end