Add link to entropy page and show if there is hardware support available.

This commit is contained in:
Michael Tremer
2014-03-13 15:27:14 +01:00
parent c6df357fd4
commit 84004f0538
4 changed files with 52 additions and 0 deletions

View File

@@ -46,6 +46,12 @@
'title' => "$Lang::tr{'hardware graphs'}",
'enabled' => 1,
};
$substatus->{'61.entropy'} = {
'caption' => "$Lang::tr{'entropy'}",
'uri' => '/cgi-bin/entropy.cgi',
'title' => "$Lang::tr{'entropy graphs'}",
'enabled' => 1,
};
$substatus->{'71.connections'} = {
'caption' => $Lang::tr{'connections'},
'uri' => '/cgi-bin/connections.cgi',

View File

@@ -48,6 +48,42 @@ if ( $querry[0] ne~ "") {
&Graphs::makegraphbox("entropy.cgi", "day", '', 350);
&Header::closebox();
# Check for hardware support.
my $message;
my $message_colour = $Header::colourred;
if (&has_hwrng()) {
$message = $Lang::tr{'system has hwrng'};
$message_colour = $Header::colourgreen;
} elsif (&has_rdrand()) {
$message = $Lang::tr{'system has rdrand'};
$message_colour = $Header::colourgreen;
} else {
$message = $Lang::tr{'no hardware random number generator'};
}
&Header::openbox('100%', 'center', $Lang::tr{'hardware support'});
print <<EOF;
<p style="color: $message_colour; text-align: center;">$message</p>
EOF
&Header::closebox();
&Header::closebigbox();
&Header::closepage();
}
sub has_hwrng() {
return (-c "/dev/hwrng");
}
sub has_rdrand() {
open(FILE, "/proc/cpuinfo") or return 0;
my @cpuinfo = <FILE>;
close(FILE);
my @result = grep(/rdrand/, @cpuinfo);
if (@result) {
return 1;
}
return 0;
}

View File

@@ -813,6 +813,7 @@
'enter ack class' => 'Legen Sie hier die ACK-Klasse fest <br /> und klicken Sie danach auf <i>Speichern</i>.',
'enter data' => 'Geben Sie die Daten ein <br /> und klicken Sie danach auf <i>Speichern</i>.',
'entropy' => 'Entropie',
'entropy graphs' => 'Entropiegraphen',
'err bk 1' => 'Fehler beim Erzeugen des Archivs',
'err bk 10 password' => 'Fehler beim Datensicherungs-Passwort',
'err bk 2 key' => 'Fehler beim Erzeugen der Schlüsseldatei',
@@ -1131,6 +1132,7 @@
'harddisk temperature' => 'Festplattentemperatur',
'harddisk temperature graphs' => 'HDD-Diagramme',
'hardware graphs' => 'Hardware-Diagramme',
'hardware support' => 'Hardware-Unterstützung',
'hdd temperature in' => 'Festplattentemperatur in',
'help' => 'Hilfe',
'high' => 'Hoch',
@@ -1506,6 +1508,7 @@
'no eciadsl synch.bin file' => 'Keine ECI ADSL Datei synch.bin vorhanden. Bitte hochladen.',
'no filter pass' => 'Legen Sie hier die Standardklassen fest durch die nicht-gefilterte Pakete gehen.',
'no fritzdsl driver' => 'Kein Fritz!DSL-Treiber vorhanden. Bitte hochladen.',
'no hardware random number generator' => 'Dieses System hat keine Entropiequelle.',
'no information available' => 'Keine Informationen verfügbar.',
'no log selected' => 'kein Log ausgewählt',
'no modem selected' => 'Kein Modem ausgewählt',
@@ -1976,6 +1979,8 @@
'swap usage per' => 'Nutzung von Auslagerungsspeicher (Swap) pro',
'system' => 'System',
'system graphs' => 'System-Diagramme',
'system has hwrng' => 'Dieses System hat einen Hardware-Zufallszahlengenerator.',
'system has rdrand' => 'Dieses System unterstützt Intel(R) RDRAND.',
'system information' => 'Systeminformationen',
'system log viewer' => 'Betrachter der System-Logdateien',
'system logs' => 'System-Logdateien',

View File

@@ -839,6 +839,7 @@
'enter ack class' => 'Enter the ACK- Class <br /> and then press <i>Save</i>.',
'enter data' => 'Enter your settings <br /> and then press <i>Save</i>.',
'entropy' => 'Entropy',
'entropy graphs' => 'Entropy Graphs',
'err bk 1' => 'Error creating archive',
'err bk 10 password' => 'Error with backup password',
'err bk 2 key' => 'Error creating key file',
@@ -1159,6 +1160,7 @@
'harddisk temperature' => 'Harddisk Temperature',
'harddisk temperature graphs' => 'HDD Graphs',
'hardware graphs' => 'Hardware Graphs',
'hardware support' => 'Hardware Support',
'hdd temperature in' => 'Harddisk temperature in',
'help' => 'Help',
'high' => 'High',
@@ -1535,6 +1537,7 @@
'no eciadsl synch.bin file' => 'No ECI ADSL synch.bin file. Please upload.',
'no filter pass' => 'Enter the standard class for non-filtered packets.',
'no fritzdsl driver' => 'No Fritz!DSL driver. Please upload.',
'no hardware random number generator' => 'This system has no source for entropy.',
'no information available' => 'No information available.',
'no log selected' => 'No log selected',
'no modem selected' => 'No modem selected',
@@ -2011,6 +2014,8 @@
'swap usage per' => 'Swap usage per',
'system' => 'System',
'system graphs' => 'System Graphs',
'system has hwrng' => 'This system has got a hardware random number generator.',
'system has rdrand' => 'This system has got support for Intel(R) RDRAND.',
'system information' => 'System Information',
'system log viewer' => 'System Log Viewer',
'system logs' => 'System Logs',