Added messages into the webif to tell the user a reboot is required

This commit is contained in:
Jan Paul Tuecking
2010-12-04 19:44:11 +01:00
parent dfa59dbd1f
commit 337305ef81
6 changed files with 27 additions and 1 deletions

12
html/cgi-bin/index.cgi Normal file → Executable file
View File

@@ -39,6 +39,7 @@ my $warnmessage = '';
my $refresh = "";
my $ipaddr='';
&Header::showhttpheaders();
$cgiparams{'ACTION'} = '';
@@ -57,6 +58,12 @@ my %mainsettings = ();
my $connstate = &Header::connectionstatus();
# check if reboot is necessary
my $reboot = 0;
if (`find /var/run/need_reboot 2>/dev/null`) {
$reboot = 1;
}
if ($cgiparams{'ACTION'} eq $Lang::tr{'shutdown'} || $cgiparams{'ACTION'} eq $Lang::tr{'reboot'}) {
$refresh = "<meta http-equiv='refresh' content='300;'>";
} elsif ($connstate =~ /$Lang::tr{'connecting'}/ || /$Lang::tr{'connection closed'}/ ){
@@ -428,6 +435,7 @@ foreach my $file (@files) {
}
}
if ($warnmessage) {
print "<tr><td align='center' bgcolor=$Header::colourred colspan='3'><font color='white'>$warnmessage</font></table>";
}
@@ -437,8 +445,10 @@ END
;
&Pakfire::dblist("upgrade", "notice");
print <<END;
END
if ($reboot == 0) {
print "<br /><font color='red'>$Lang::tr{'needreboot'}!</font>";
}
} else {
my $message='';
if ($death) {

View File

@@ -57,6 +57,12 @@ sub refreshpage{&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' cont
&Header::openpage($Lang::tr{'pakfire configuration'}, 1);
&Header::openbigbox('100%', 'left', '', $errormessage);
# check if reboot is necessary
my $reboot = 0;
if (`find /var/run/need_reboot 2>/dev/null`) {
$reboot = 1;
}
if ($pakfiresettings{'ACTION'} eq 'install'){
$pakfiresettings{'INSPAKS'} =~ s/\|/\ /g;
if ("$pakfiresettings{'FORCE'}" eq "on") {
@@ -229,6 +235,12 @@ my $packages_update_age = &General::age("/opt/pakfire/db/lists/packages_list.db"
print <<END;
<table width='95%' cellpadding='5' >
END
if ($reboot == 1) {
print "<tr><td align='center' colspan='2'><font color='red'>$Lang::tr{'needreboot'}!</font></td></tr>";
print "<tr><td colspan='2'>&nbsp;</font></td></tr>"
}
print <<END;
<tr><td width="50%" bgcolor='$color{'color20'}' align="center"><b>$Lang::tr{'pakfire system state'}:</b>
<td width="50%">
<tr><td align="center">$Lang::tr{'pakfire core update level'}: $core_release<hr />

View File

@@ -1170,6 +1170,7 @@
'name must only contain characters' => 'Name darf nur Buchstaben enthalten.',
'name too long' => 'Der volle Benutzername oder der System Hostname ist zu lang',
'nat-traversal' => 'Nat Traversal:',
'needreboot' => 'Ein Update benötigt einen Neustart',
'net' => 'Netz',
'net address' => 'Netzadresse',
'net config' => 'Netzwerk-Konfiguration',

View File

@@ -1197,6 +1197,7 @@
'name must only contain characters' => 'Name must only contain characters.',
'name too long' => 'User\'s full name or system hostname is too long',
'nat-traversal' => 'Nat Traversal:',
'needreboot' => 'An update requires a restart',
'net' => 'Net',
'net address' => 'net address',
'net config' => 'Network configuration',

View File

@@ -1195,6 +1195,7 @@
'name must only contain characters' => 'El nombre solo puede contener caracteres',
'name too long' => 'Nombre de usuario o de host es demasiado largo',
'nat-traversal' => 'NAT Transversal:',
'needreboot' => 'An update requires a restart',
'net' => 'Red',
'net address' => 'dirección de red',
'net config' => 'Configuración de red',

View File

@@ -1196,6 +1196,7 @@
'name must only contain characters' => 'Le nom ne doit contenir que des caractères.',
'name too long' => 'Le nom d\'utilisateur ou du système hôte est trop long',
'nat-traversal' => 'Nat Traversal :',
'needreboot' => 'An update requires a restart',
'net' => 'Réseau',
'net address' => 'adresse net',
'net config' => 'Configuration réseau',