Edit template for controller - Refine params copy and bring DB opens up to spec with UTF8
This commit is contained in:
78
output/Reboot/Reboot.new.pm
Normal file
78
output/Reboot/Reboot.new.pm
Normal file
@@ -0,0 +1,78 @@
|
||||
package SrvMngr::Controller::Reboot;
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# heading : System
|
||||
# description : Reboot or shutdown
|
||||
# navigation : 4000 700
|
||||
#
|
||||
# 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 $title = $c->l("rbo_FORM_TITLE");
|
||||
my $modul = "";
|
||||
$c->stash(title => $title, modul => $modul);
|
||||
$c->render(template => "reboot");
|
||||
} ## end sub main
|
||||
|
||||
sub do_action {
|
||||
my $c = shift;
|
||||
$c->app->log->info($c->log_req);
|
||||
my $title = $c->l("rbo_FORM_TITLE");
|
||||
my $result = "";
|
||||
my $function = $c->param("function");
|
||||
my $debug = $c->param("debug");
|
||||
|
||||
if ($function eq "reboot") {
|
||||
$result = $c->l("Reboot_SUCCEEDED") . "<br>" . $c->l("rbo_DESC_REBOOT");
|
||||
|
||||
unless ($debug) {
|
||||
esmith::util::backgroundCommand(1, "/sbin/e-smith/signal-event", "reboot");
|
||||
|
||||
# system( "/sbin/e-smith/signal-event", "reboot" ) == 0
|
||||
# or die ("Error occurred while rebooting.\n");
|
||||
} ## end unless ($debug)
|
||||
} elsif ($function eq "shutdown") {
|
||||
$result = $c->l("rbo_SHUTDOWN_SUCCEEDED") . "<br>" . $c->l("rbo_DESC_SHUTDOWN");
|
||||
|
||||
unless ($debug) {
|
||||
esmith::util::backgroundCommand(1, "/sbin/e-smith/signal-event", "halt");
|
||||
|
||||
# system( "/sbin/e-smith/signal-event", "halt" ) == 0
|
||||
# or die ("Error occurred while halting.\n");
|
||||
} ## end unless ($debug)
|
||||
} elsif ($function eq "reconfigure") {
|
||||
$result = $c->l("rbo_RECONFIGURE_SUCCEEDED") . "<br>" . $c->l("rbo_DESC_RECONFIGURE");
|
||||
|
||||
unless ($debug) {
|
||||
|
||||
# esmith::util::backgroundCommand( 1, "/sbin/e-smith/signal-event", "post-upgrade",
|
||||
# "; ", "/sbin/e-smith/signal-event", "reboot" );
|
||||
esmith::util::backgroundCommand( 1, "/sbin/e-smith/signal-event", "post-upgrade-and-reboot");
|
||||
#system("/sbin/e-smith/signal-event", "post-upgrade") == 0
|
||||
#or die("Error occurred while running post-upgrade.\n");
|
||||
#system("/sbin/e-smith/signal-event", "reboot") == 0
|
||||
#or die("Error occurred while rebooting.\n");
|
||||
} ## end unless ($debug)
|
||||
} ## end elsif ($function eq "reconfigure")
|
||||
$c->stash(title => $title, modul => $result);
|
||||
$c->render(template => "module");
|
||||
} ## end sub do_action
|
||||
|
||||
sub rebootFunction_list {
|
||||
my $c = shift;
|
||||
return [
|
||||
[ $c->l("Reboot") => "reboot" ],
|
||||
[ $c->l("RECONFIGURE") => "reconfigure" ],
|
||||
[ $c->l("SHUTDOWN") => "shutdown" ]
|
||||
];
|
||||
} ## end sub rebootFunction_list
|
||||
1;
|
1
output/Reboot/reboot_en.lex.diff
Normal file
1
output/Reboot/reboot_en.lex.diff
Normal file
@@ -0,0 +1 @@
|
||||
'Reboot or shutdown' => 'Reboot or shutdown',
|
19
output/Reboot/reboot_en.lex.new1
Normal file
19
output/Reboot/reboot_en.lex.new1
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# Lex file for Reboot generated on 2025-07-17 09:52:33
|
||||
#
|
||||
'rbo_DESC_REBOOT' => 'Your server has initiated the reboot process.',
|
||||
'rbo_DESC_RECONFIGURE' => 'Your server has initiated a full system reconfiguration and reboot.',
|
||||
'rbo_DESC_SHUTDOWN' => 'Your server has initiated the shutdown process.
|
||||
The process will take several minutes to complete, after which
|
||||
you can switch off the power.',
|
||||
'rbo_DESCRIPTION' => 'You can reboot, shut down your server or perform a full system
|
||||
reconfiguration from this screen. You must perform a shutdown
|
||||
before switching the power off. All of these functions take
|
||||
several minutes to complete.
|
||||
When you click <b>perform</b> the operation will be initiated immediately, so be ready!',
|
||||
'rbo_FORM_TITLE' => 'Shutdown or reboot',
|
||||
'rbo_LABEL_REBOOT' => 'Select Shutdown, Reboot or Reconfigure',
|
||||
'rbo_REBOOT_SUCCEEDED' => 'Reboot request initiated successfully.',
|
||||
'rbo_RECONFIGURE_SUCCEEDED' => 'Reconfiguration request initiated successfully.',
|
||||
'rbo_SHUTDOWN_SUCCEEDED' => 'Shutdown request initiated successfully.',
|
||||
'Reboot or shutdown' => 'Reboot or shutdown',
|
Reference in New Issue
Block a user