[! use strict; use PVE::I18N; use PVE::ConfigServer; use PVE::Utils; use PVE::HTMLUtils; !] [- use strict; my $out = ''; my $conn = PVE::ConfigClient::connect ($udat{auth_cookie}); if ($udat{action} eq 'reboot') { eval { check_write_mode ($udat{AM}); $conn->restart_server ($fdat{poweroff}); }; if ($@) { $udat{popup_error} = $@; $udat{redirect} = 'index.htm'; return; } } if ($fdat{state} eq 'confirm') { my $ptoken = PVE::Utils::get_page_token(); my $ref = "reboot.htm?m3=0&action=reboot&ptoken=$ptoken"; if ($fdat{poweroff}) { $ref .= "&poweroff=1"; my $msg = __("Do you really want to shutdown the Server?"); $out .= PVE::HTMLUtils::create_confirmframe ($msg, __("Shutdown"), $ref, 'index.htm'); } else { my $msg = __("Do you really want to restart the Server?"); $out .= PVE::HTMLUtils::create_confirmframe ($msg, __("Restart"), $ref, 'index.htm'); } } else { $out .= "
"; if ($fdat{poweroff}) { $out .= __("Server shutdown in progress."); } else { $out .= __("Server restart in progress. Please try to reconnect after the restart."); } $out .= "
"; } print OUT $out; -]