[! use strict; use Proxmox::Utils; use Proxmox::ConfigServer; use Proxmox::HTMLTable; use Proxmox::HTMLDropDown; !] [- my $out = ""; my @cellwidth = ( '20px', '10px', '100px', '100px', '100px', '400px'); my @header = ( '1', '20px', ' ', '1', '10px', ' ', '1', '100px', __('Service'), '1', '100px', __('State'), '1', '100px', __('Autostart'), '1', '400px', __('Description') ); my $table = Proxmox::HTMLTable->new (\@cellwidth); $table->add_headline (\@header); my $url = $req_rec->uri; my $ddown = Proxmox::HTMLDropDown->new (); $ddown->add_item("item","$url?action=startservice", __("Start") ); $ddown->add_item("item","$url?action=stopservice", __("Stop") ); $ddown->add_item("item","$url?action=restartservice", __("Restart") ); $ddown->add_item("apache","$url?action=restartservice", __("Restart") ); my $conn = Proxmox::ConfigClient::connect (); if ($udat{action}) { if ($udat{AM} eq 'w') { if ($udat{action} eq 'restartservice') { if ($fdat{service} eq 'apache') { eval { $conn->service_cmd ($fdat{service}, 'restart'); }; } else { $conn->service_cmd ($fdat{service}, 'restart'); } } elsif ($udat{action} eq 'startservice') { $conn->service_cmd ($fdat{service}, 'start'); } elsif ($udat{action} eq 'stopservice') { $conn->service_cmd ($fdat{service}, 'stop'); } } else { $udat{popup_error} = Proxmox::Utils::msg ('nowr'); } } my $apache_state = $conn->service_state ('apache')->result; my $postfix_state = $conn->service_state ('postfix')->result; my $fetchmail_state = $conn->service_state ('fetchmail')->result; my $clamd_state = $conn->service_state ('clamd')->result; my $aveserver_state = $conn->service_state ('aveserver')->result; my $freshclam_state = $conn->service_state ('freshclam')->result; my $ntpd_state = $conn->service_state ('ntpd')->result; my $sshd_state = $conn->service_state ('sshd')->result; my $proxprox_state = $conn->service_state ('proxprox')->result; my $proxpolicy_state = $conn->service_state ('proxpolicy')->result; my $proxtunnel_state = $conn->service_state ('proxtunnel')->result; my $proxmirror_state = $conn->service_state ('proxmirror')->result; my $postgres_state = $conn->service_state ('postgres')->result; $out .= "
"; $out .= "";
$out .= " " . __("Restart Server") . "
";
$out .= " " . __("Shutdown Server") . "";
$out .= "