style for error and success messages added

success messages added
This commit is contained in:
lars 2005-07-23 12:59:29 +00:00
parent d31ca1a1bd
commit bf29c216f5
5 changed files with 75 additions and 15 deletions

View File

@ -36,7 +36,7 @@ Lang {
} }
Warning { WarningMessage {
InitNotConfirmed { InitNotConfirmed {
Title = Bestätigung schlug fehl Title = Bestätigung schlug fehl
Text = Der Bestätigungssatz muss exakt eingegeben werden! Text = Der Bestätigungssatz muss exakt eingegeben werden!
@ -89,7 +89,30 @@ Lang {
} }
Error { SuccessMessage {
InitRunning {
Title = Initialisierung läuft
Text = Die Initialisierung der CryptoBox wird im Hintergrund abgeschlossen.
}
ConfigSaved {
Title = Konfiguration gespeichert
Text = Falls du die Netzwerkadresse der CryptoBox geändert hast, wird diese erst beim nächsten Neustart gesetzt.
}
MountDone {
Title = Crypto-Daten aktiviert
Text = Das verschlüsselte Dateisystem ist nun verfügbar.
}
UmountDone {
Title = Crypto-Daten deaktiviert
Text = Das verschlüsselte Dateisystem ist nun vor jedem Zugriff geschützt.
}
}
ErrorMessage {
UnknownAction { UnknownAction {
Title = Unbekannte Aktion Title = Unbekannte Aktion
@ -101,6 +124,11 @@ Lang {
Text = Die CryptoBox akzeptiert nur verschlüsselte Verbindungen (https). So bleibt dein Passwort vor neugierigen Augen geschützt. Text = Die CryptoBox akzeptiert nur verschlüsselte Verbindungen (https). So bleibt dein Passwort vor neugierigen Augen geschützt.
} }
InitFailed {
Title = Initialisierung fehlgeschlagen
Text = Sende bitte den Inhalt des Protokolls (siehe oben) an die Entwickler der CryptoBox.
}
} }
} }

View File

@ -1,5 +1,5 @@
<?cs def:warning(warnname) ?><?cs <?cs def:warning(warnname) ?><?cs
each:item = Lang.Warning ?><?cs each:item = Lang.WarningMessage ?><?cs
if:(name(item) == warnname) if:(name(item) == warnname)
?><div class="warning"> ?><div class="warning">
<h1><?cs var:item.Title ?></h1> <h1><?cs var:item.Title ?></h1>
@ -11,7 +11,7 @@
<?cs def:error(errname) ?><?cs <?cs def:error(errname) ?><?cs
each:item = Lang.Error ?><?cs each:item = Lang.ErrorMessage ?><?cs
if:(name(item) == errname) if:(name(item) == errname)
?><div class="error"> ?><div class="error">
<h1><?cs var:item.Title ?></h1> <h1><?cs var:item.Title ?></h1>
@ -22,6 +22,18 @@
/def ?> /def ?>
<?cs def:success(succname) ?><?cs
each:item = Lang.SuccessMessage ?><?cs
if:(name(item) == succname)
?><div class="success">
<h1><?cs var:item.Title ?></h1>
<p><?cs var:item.Text ?></p>
<?cs
/if ?><?cs
/each ?><?cs
/def ?>
<?cs def:parseTree(root) ?> <?cs def:parseTree(root) ?>
<!-- the output looks quite ugly and is not very helpful as there are only a few values --> <!-- the output looks quite ugly and is not very helpful as there are only a few values -->
<!-- data tree <!-- data tree

View File

@ -7,6 +7,7 @@
<?cs include:TemplateDir + '/error.cs' ?> <?cs include:TemplateDir + '/error.cs' ?>
<?cs else ?> <?cs else ?>
<?cs if:Data.Warning ?><?cs call:warning(Data.Warning) ?><?cs /if ?> <?cs if:Data.Warning ?><?cs call:warning(Data.Warning) ?><?cs /if ?>
<?cs if:Data.Success ?><?cs call:success(Data.Success) ?><?cs /if ?>
<?cs include:TemplateDir + '/' + Data.Action + '.cs' ?> <?cs include:TemplateDir + '/' + Data.Action + '.cs' ?>
<?cs /if ?> <?cs /if ?>

View File

@ -169,11 +169,6 @@ sub umount_vol
# TODO: check if "system" returns output # TODO: check if "system" returns output
my $output = `$CB_SCRIPT crypto-umount`; my $output = `$CB_SCRIPT crypto-umount`;
$pagedata->setValue('Data.ProgOutput',"$output") if ($output); $pagedata->setValue('Data.ProgOutput',"$output") if ($output);
if (!&check_mounted()) {
$pagedata->setValue('Data.Warning', 'UmountFailed');
$pagedata->setValue('Data.Action', 'mount_form');
}
} }
@ -226,6 +221,11 @@ if ( ! &check_ssl()) {
} else { } else {
# unmounten # unmounten
&umount_vol(); &umount_vol();
if (&check_mounted()) {
$pagedata->setValue('Data.Warning', 'UmountFailed');
$pagedata->setValue('Data.Action', 'umount_form');
}
$pagedata->setValue('Data.Success', 'UmountDone');
$pagedata->setValue('Data.Action', 'mount_form'); $pagedata->setValue('Data.Action', 'mount_form');
} }
################ mount_do ######################## ################ mount_do ########################
@ -251,6 +251,7 @@ if ( ! &check_ssl()) {
$pagedata->setValue('Data.Warning', 'MountFailed'); $pagedata->setValue('Data.Warning', 'MountFailed');
$pagedata->setValue('Data.Action', 'mount_form'); $pagedata->setValue('Data.Action', 'mount_form');
} else { } else {
$pagedata->setValue('Data.Success', 'MountDone');
$pagedata->setValue('Data.Action', 'umount_form'); $pagedata->setValue('Data.Action', 'umount_form');
} }
} }
@ -307,7 +308,12 @@ if ( ! &check_ssl()) {
} else { } else {
# do init # do init
&box_init($query->param('password')); &box_init($query->param('password'));
$pagedata->setValue('Data.Action', 'config_form'); if (!&check_init_running()) {
$pagedata->setValue('Data.Error', 'InitFailed');
} else {
$pagedata->setValue('Data.Success', 'InitRunning');
$pagedata->setValue('Data.Action', 'config_form');
}
} }
#################### config_ask ###################### #################### config_ask ######################
} elsif ($action eq 'config_ask') { } elsif ($action eq 'config_ask') {
@ -342,6 +348,8 @@ if ( ! &check_ssl()) {
system("$CB_SCRIPT", "set_config", "language", $query->param('language')); system("$CB_SCRIPT", "set_config", "language", $query->param('language'));
system("$CB_SCRIPT", "set_config", "timeout", $query->param('timeout')); system("$CB_SCRIPT", "set_config", "timeout", $query->param('timeout'));
system("$CB_SCRIPT", "set_config", "ip", $query->param('ip')); system("$CB_SCRIPT", "set_config", "ip", $query->param('ip'));
# TODO: check for success by comparing with new config and report success
$pagedata->setValue('Data.Success', 'ConfigSaved');
$pagedata->setValue('Data.Action', 'intro'); $pagedata->setValue('Data.Action', 'intro');
} }
#################### show_log ######################## #################### show_log ########################

View File

@ -156,7 +156,7 @@ body {
/* --------------------=-=-=- Spezialkram -=-=-=------------------- */ /* --------------------=-=-=- Spezialkram -=-=-=------------------- */
#words div.warning { #words div.warning,div.error,div.success {
margin-top: 20px; margin-top: 20px;
margin-bottom: 20px; margin-bottom: 20px;
padding-top: 10px; padding-top: 10px;
@ -164,8 +164,7 @@ body {
color: #707070; color: #707070;
} }
#words .warning { #words .warning,.error,.success {
background-color: #ffd0d0;
border: 2px dashed #5e5e5e; border: 2px dashed #5e5e5e;
text-align: center; text-align: center;
color: #5e5e5e; color: #5e5e5e;
@ -174,11 +173,23 @@ body {
font-size: 0.9em; font-size: 0.9em;
} }
#words div.warning h1,h2 { #words .warning {
background-color: #ffd0d0;
}
#words .error {
background-color: #ff0000;
}
#words .success {
background-color: #90EE90;
}
#words div.warning,div.error,div.success h1,h2 {
color: #808080; color: #808080;
} }
#words .warning a { #words .warning,.error,.success a {
// WHY line-height??? // WHY line-height???
// line-height: 5em; // line-height: 5em;
color: #5e5e5e; color: #5e5e5e;