Merge pull request #1607 from bergware/master

Feedback form: enable/disable SUBMIT button automatically
This commit is contained in:
tom mortensen
2024-02-05 14:25:51 -08:00
committed by GitHub
21 changed files with 374 additions and 345 deletions

View File

@@ -8,6 +8,7 @@
$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
require_once "$docroot/webGui/include/Wrappers.php";
$logger = 'language-manager';
$usage = <<<EOF
Process language files.
@@ -311,7 +312,7 @@ if ($method == 'install') {
copy($xml_file, $lang_file);
symlink($lang_file, $link_file);
write("language: $lang language pack installed\n");
my_logger("$lang language pack installed", 'language-manager');
my_logger("$lang language pack installed", $logger);
// run hook scripts for post processing
post_hooks();
done(0);
@@ -393,7 +394,7 @@ if ($method == 'update') {
copy($xml_file, $lang_file);
symlink($lang_file, $link_file);
write("language: $lang language pack updated\n");
my_logger("$lang language pack updated", 'language-manager');
my_logger("$lang language pack updated", $logger);
// run hook scripts for post processing
post_hooks();
done(0);
@@ -420,7 +421,7 @@ if ($method == 'remove') {
done(1);
}
write("language: $lang language pack removed\n");
my_logger("$lang language pack removed", 'language-manager');
my_logger("$lang language pack removed", $logger);
// run hook scripts for post processing
post_hooks();
done(0);

View File

@@ -6,6 +6,10 @@
// Program updates made by Bergware International (April 2020)
// Program updates made by Bergware International (June 2022)
$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
require_once "$docroot/webGui/include/Wrappers.php";
$logger = 'plugin-manager';
$usage = <<<EOF
Process plugin files.
@@ -275,18 +279,12 @@ function filter_url($url) {
if (strpos($url, '.cdn') !== false) {
$new_url = str_replace('"', '', $url);
$new_url = str_replace('.cdn', '', $new_url);
} else {
} else {
$new_url = "";
}
return($new_url);
}
// Deal with logging message.
//
function logger($message) {
exec("logger -t 'plugin-manager' -- ".escapeshellarg($message));
}
// Interpret a plugin file
// Returns TRUE if success, else FALSE and fills in error string.
//
@@ -295,7 +293,7 @@ function logger($message) {
// is processed for any of those methods.
//
function plugin($method, $plugin_file, &$error) {
global $unraid;
global $unraid, $logger;
$methods = ['install', 'remove'];
// parse plugin definition XML file
@@ -382,12 +380,12 @@ function plugin($method, $plugin_file, &$error) {
// If file already exists, check the SHA256/MD5 (if supplied)
if (file_exists($name)) {
if ($file->SHA256) {
logger("checking: $name - SHA256");
my_logger("checking: $name - SHA256", $logger);
if (hash_file('sha256', $name) != $file->SHA256) {
unlink($name);
}
} elseif ($file->MD5) {
logger("checking: $name - MD5");
my_logger("checking: $name - MD5", $logger);
if (md5_file($name) != $file->MD5) {
unlink($name);
}
@@ -396,12 +394,12 @@ function plugin($method, $plugin_file, &$error) {
// If file already exists, do not overwrite
//
if (file_exists($name)) {
logger("skipping: $name already exists");
my_logger("skipping: $name already exists", $logger);
} elseif ($file->LOCAL) {
// Create the file
//
// for local file, just copy it
logger("creating: $name - copying LOCAL file $file->LOCAL");
my_logger("creating: $name - copying LOCAL file $file->LOCAL", $logger);
if (!copy($file->LOCAL, $name)) {
$error = "unable to copy LOCAL file: $name";
@unlink($name);
@@ -409,10 +407,10 @@ function plugin($method, $plugin_file, &$error) {
}
} elseif ($file->INLINE) {
// for inline file, create with inline contents
logger("creating: $name - from INLINE content");
my_logger("creating: $name - from INLINE content", $logger);
$contents = trim($file->INLINE).PHP_EOL;
if ($file->attributes()->Type == 'base64') {
logger("decoding: $name as base64");
my_logger("decoding: $name as base64", $logger);
$contents = base64_decode($contents);
if ($contents === false) {
$error = "unable to decode inline base64: $name";
@@ -426,20 +424,20 @@ function plugin($method, $plugin_file, &$error) {
}
} elseif ($file->URL) {
// for download file, download and maybe verify the file MD5
logger("creating: $name - downloading from URL $file->URL");
my_logger("creating: $name - downloading from URL $file->URL", $logger);
if ( (download($file->URL, $name, $error) === false) && (download(filter_url($file->URL), $name, $error) === false) ) {
@unlink($name);
return false;
}
if ($file->SHA256) {
logger("checking: $name - SHA256");
my_logger("checking: $name - SHA256", $logger);
if (hash_file('sha256', $name) != $file->SHA256) {
$error = "bad file SHA256: $name";
unlink($name);
return false;
}
} elseif ($file->MD5) {
logger("checking: $name - MD5");
my_logger("checking: $name - MD5", $logger);
if (md5_file($name) != $file->MD5) {
$error = "bad file MD5: $name";
unlink($name);
@@ -452,7 +450,7 @@ function plugin($method, $plugin_file, &$error) {
if ($file->attributes()->Mode) {
// if file has 'Mode' attribute, apply it
$mode = $file->attributes()->Mode;
logger("setting: $name - mode to $mode");
my_logger("setting: $name - mode to $mode", $logger);
if (!chmod($name, octdec($mode))) {
$error = "chmod failure: $name";
return false;
@@ -464,13 +462,13 @@ function plugin($method, $plugin_file, &$error) {
if ($file->attributes()->Run) {
$command = $file->attributes()->Run;
if ($name) {
logger("running: $command $name");
my_logger("running: $command $name", $logger);
$retval = run("$command $name");
} elseif ($file->LOCAL) {
logger("running: $command $file->LOCAL");
my_logger("running: $command $file->LOCAL", $logger);
$retval = run("$command $file->LOCAL");
} elseif ($file->INLINE) {
logger("running: 'anonymous'");
my_logger("running: 'anonymous'", $logger);
$name = '/tmp/inline.sh';
file_put_contents($name, $file->INLINE);
$retval = run("$command $name");
@@ -718,10 +716,10 @@ if ($method == 'install') {
if ($target != $plugin_file) copy($plugin_file, $target);
symlink($target, $symlink);
write("plugin: $plugin installed\n");
logger("$plugin installed");
my_logger("$plugin installed", $logger);
} else {
write("script: $plugin executed\n");
logger("script: $plugin executed");
my_logger("script: $plugin executed", $logger);
}
// run hook scripts for post processing
post_hooks();
@@ -835,7 +833,7 @@ if ($method == 'update') {
copy($plugin_file, $target);
symlink($target, $symlink);
write("plugin: $plugin updated\n");
logger("$plugin updated");
my_logger("$plugin updated", $logger);
// run hook scripts for post processing
post_hooks();
done(0);
@@ -867,7 +865,7 @@ if ($method == 'remove') {
// remove the plugin file
move($installed_plugin_file, "$boot-removed");
write("plugin: $plugin removed\n");
logger("$plugin removed");
my_logger("$plugin removed", $logger);
exec("/usr/local/sbin/update_cron");
// run hook scripts for post processing
post_hooks();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

View File

@@ -388,7 +388,7 @@ function openChanges(cmd,title,nchan,button=0) {
$('div.spinner.fixed').hide();
swal({title:title,text:"<pre id='swalbody'></pre><hr>",html:true,animation:'none',showConfirmButton:button!=0,confirmButtonText:"<?=_('Close')?>"},function(close){
$('.sweet-alert').hide('fast').removeClass('nchan');
if ($('#submit-button').length > 0) $('#submit-button').remove();
if ($('#submit_button').length > 0) $('#submit_button').remove();
});
$('.sweet-alert').addClass('nchan');
$('pre#swalbody').html(data);
@@ -679,7 +679,7 @@ foreach ($buttons as $button) {
if (isset($button['Nchan'])) nchan_merge($button['root'], $button['Nchan']);
}
echo "<div class='nav-user show'><a id='board' href='#'><b id='bell' class='icon-u-bell system'></b></a></div>";
echo "<div class='nav-user show'><a id='board' href='#' class='hand'><b id='bell' class='icon-u-bell system'></b></a></div>";
if ($themes2) echo "</div>";
echo "</div></div>";

View File

@@ -146,7 +146,7 @@ function my_date($fmt, $time) {
return date(strtr($fmt,$legacy), $time);
}
// ensure params passed to logger are properly escaped
function my_logger($message, $tag="webgui") {
exec('logger -t '.escapeshellarg($tag).' -- '.escapeshellarg($message));
function my_logger($message, $logger='webgui') {
exec('logger -t '.escapeshellarg($logger).' -- '.escapeshellarg($message));
}
?>

View File

@@ -1,7 +1,7 @@
#!/usr/bin/php -q
<?PHP
/* Copyright 2005-2023, Lime Technology
* Copyright 2012-2023, Bergware International.
/* Copyright 2005-2024, Lime Technology
* Copyright 2012-2024, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -13,7 +13,7 @@
$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
require_once "$docroot/webGui/include/Helpers.php";
extract(parse_plugin_cfg('dynamix', true));
extract(parse_plugin_cfg('dynamix',true));
// add translations
$_SERVER['REQUEST_URI'] = '';
@@ -22,191 +22,229 @@ require_once "$docroot/webGui/include/Translations.php";
$var = parse_ini_file('state/var.ini');
$unraid = parse_ini_file('/etc/unraid-version');
$keyfile = !empty(_var($var, 'regFILE')) ? trim(base64_encode(@file_get_contents($var['regFILE']))) : '';
$width = in_array($display['theme'], ['azure', 'gray']) ? '98.4%' : '100%';
$keyfile = !empty(_var($var,'regFILE')) ? trim(base64_encode(@file_get_contents($var['regFILE']))) : '';
$width = in_array($display['theme'], ['azure','gray']) ? '98.8%' : '100%';
$feedback = '/webGui/images/feedback_';
$diagn = _('Unable to generate system diagnostics');
$sorry = _('Sorry, an error occurred');
$again = _('Please try again later');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Feedback Form</title>
<style>
div.spinner.fixed{z-index:100000}
div#control_panel{position:absolute;left:0;right:0;top:0;padding-top:8px;line-height:24px;white-space:nowrap}
div.divide{text-align:center;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}
div.divide label:first-child{margin-left:0}
div.divide label{margin-left:2%;cursor:pointer}
div.allpanels{display:none;position:absolute;left:0;right:0;top:40px;bottom:0;overflow:auto}
div#footer_panel{position:absolute;left:0;right:0;bottom:0;height:30px;line-height:30px;text-align:center}
textarea.feedback{width:<?=$width?>;height:530px;margin:0;resize:none}
@media (max-width:960px){textarea.feedback{height:330px}}
@media (max-height:768px){textarea.feedback{height:330px}}
input.submit[type=email]{margin-top:10px;float:left;position:relative;z-index:1}
p.note, label.note{font-size:1.1rem !important;display:block;position:relative;z-index:0}
p.success{text-align:center!important;margin-top:20px}
span.spacer{margin:0 4px}
</style>
</head>
<body>
<div>
<div id="control_panel" class="divide">
<label for="optFeatureRequest"><input type="radio" name="mode" id="optFeatureRequest" value="featurerequest" checked="checked"/><?=_('Product Suggestion')?></label>
<label for="optBugReport"><input type="radio" name="mode" id="optBugReport" value="bugreport"/><?=_('Bug Report')?></label>
<label for="optTroubleshoot"><input type="radio" name="mode" id="optTroubleshoot" value="troubleshoot"/><?=_('Troubleshoot')?></label>
<label for="optComment"><input type="radio" name="mode" id="optComment" value="comment"/><?=_('Other Comment')?></label>
<hr>
</div>
<div id="thanks_panel" class="allpanels"></div>
<div id="featurerequest_panel" class="allpanels">
<textarea id="featureDescription" class="feedback" placeholder="<?=_('Please summarize your suggestion here')?>."></textarea>
<br>
<input type="email" id="featureEmail" class="submit" autocomplete="off" spellcheck="false" placeholder="<?=_('Contact Email Address')?> (<?=_('optional')?>)">
</div>
<div id="bugreport_panel" class="allpanels">
<textarea id="bugDescription" class="feedback"></textarea>
<input type="email" id="bugEmail" class="submit" autocomplete="off" spellcheck="false" placeholder="<?=_('Contact Email Address')?>. (<?=_('optional')?>)">
<label class="note" for="anonymize_bugReport"><input type="checkbox" id="anonymize_bugReport" class="anonymize" value="1" /> <?=_('Anonymize diagnostics (may make troubleshooting more difficult)')?></label>
<p class="note"><b><?=_('NOTE')?>:</b> <i><?=_('Submission of this bug report will automatically send your system diagnostics to Lime Technology')?>.</i></p>
</div>
<div id="troubleshoot_panel" class="allpanels">
<textarea id="troubleshootDescription" class="feedback"></textarea>
<textarea id="troubleshootDetails" style="display: none;"></textarea>
<input type="email" id="troubleshootEmail" class="submit" autocomplete="off" spellcheck="false" placeholder="<?=_('Contact Email Address')?>">
<label class="note" for="anonymize_troubleshoot"><input type="checkbox" id="anonymize_troubleshoot" class="anonymize" value="1" /> <?=_('Anonymize diagnostics (may make troubleshooting more difficult)')?></label>
<p class="note"><b><?=_('NOTE')?>:</b> <i><?=_('Submission of this troubleshooting request will automatically send your system diagnostics to Lime Technology')?>.</i></p>
</div>
<div id="comment_panel" class="allpanels">
<textarea id="commentDescription" class="feedback" placeholder="<?=_('Type your question or comment to Lime Technology here')?>."></textarea>
<br>
<input type="email" id="commentEmail" class="submit" autocomplete="off" spellcheck="false" placeholder="<?=_('Contact Email Address')?> (<?=_('optional')?>)">
</div>
<div id="footer_panel">
<a href="https://unraid.net" target="_blank"><?=_('Website')?></a><span class="spacer blue-text">|</span>
<a href="https://forums.unraid.net" target="_blank"><?=_('Forum')?></a><span class="spacer blue-text">|</span>
<a href="https://docs.unraid.net/" target="_blank"><?=_('Docs')?></a>
</div>
</div>
<script>
var inkeyfile = '<?=$keyfile?>' ?? '';
var unraid_osversion = '<?=$unraid['version']?>';
var unraid_timestamp = <?=time()?>;
var inpageurl = window.top.location.href;
<style>
div.spinner.fixed{z-index:100000}
div#control_panel{position:absolute;left:0;right:0;top:0;padding-top:8px;line-height:24px;white-space:nowrap}
div.divide{text-align:center;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}
div.divide label{margin-right:30px}
div.allpanels{display:none;position:absolute;left:0;right:0;top:40px;bottom:0;overflow:auto}
div#footer_panel{position:absolute;left:0;right:0;bottom:0;text-align:right}
textarea.feedback{width:<?=$width?>;height:530px;margin:0;resize:none}
@media(max-width:960px){textarea.feedback{height:330px}}
@media(max-height:768px){textarea.feedback{height:330px}}
input#email{float:left;padding-left:4px}
p.note,label.note{font-size:1.1rem!important}
span.spacer{margin:0 4px}
img{display:inline-block;margin-bottom:30px}
.center{text-align:center!important}
.green-text{color:#4f8a10!important}
.red-text{color:#f0000c!important}
</style>
function featurerequest_reset() {
$('#featureDescription').val('');
$('#featureEmail').val('');
}
<div>
<div id="control_panel" class="divide">
<label for="opt_featurerequest"><input type="radio" name="mode" id="opt_featurerequest" value="featurerequest" checked="checked"><?=_('Product Suggestion')?></label>
<label for="opt_bugreport"><input type="radio" name="mode" id="opt_bugreport" value="bugreport"><?=_('Bug Report')?></label>
<label for="opt_troubleshoot"><input type="radio" name="mode" id="opt_troubleshoot" value="troubleshoot"><?=_('Troubleshoot')?></label>
<label for="opt_comment"><input type="radio" name="mode" id="opt_comment" value="comment"><?=_('Other Comment')?></label>
<hr>
</div>
function bugreport_reset() {
$('#bugDescription').val("<?=_('Bug Description')?>: \n\n\n\n<?=_('How to reproduce')?>: \n\n\n\n<?=_('Expected results')?>: \n\n\n\n<?=_('Actual results')?>: \n\n\n\n<?=_('Other information')?>: \n");
$('#bugEmail').val('');
}
<div id="result_panel" class="allpanels"></div>
function troubleshoot_reset() {
$('#troubleshootDescription').val("<?=_('Description')?>: \n\n\n\n<?=_('How to reproduce')?>: \n\n\n\n<?=_('Expected results')?>: \n\n\n\n<?=_('Actual results')?>: \n\n\n\n<?=_('Other information')?>: \n");
$('#troubleshootEmail').val('');
}
<div id="featurerequest_panel" class="allpanels">
<textarea id="featurerequest" class="feedback"></textarea>
</div>
function comment_reset() {
$('#commentDescription').val('');
$('#commentEmail').val('');
}
<div id="bugreport_panel" class="allpanels">
<textarea id="bugreport" class="feedback"></textarea>
<label class="note" for="anonymize_bugreport"><input type="checkbox" id="anonymize_bugreport" class="anonymize" value="1"> <?=_('Anonymize diagnostics (may make troubleshooting more difficult)')?></label>
<p class="note"><b><?=_('NOTE')?>:</b> <i><?=_('Submission of this bug report will automatically send your system diagnostics to Lime Technology')?>.</i></p>
</div>
function form_submit(url, params, panel, diagnostics) {
panel.find('textarea,input').prop('disabled', true);
$('div.spinner.fixed').show();
if (diagnostics) {
var anonymize = $('#anonymize').is(':checked') ? '1' : '';
$.get('/webGui/include/Feedback.php',{getdiagnostics: 1, anonymize: anonymize}, function(data) {
params.diagnostics = data;
form_submit(url, params, panel);
}).fail(function() {
$('div.spinner.fixed').hide();
panel.fadeOut('fast').find('textarea,input').prop('disabled', false);
var failure_message = "<p class='red-text' style='text-align:center;'><?=_('Sorry, an error occurred')?> (<?=_('Unable to generate system diagnostics')?> <?=_('Please try again later')?>).</p>";
$('#thanks_panel').html(failure_message).fadeIn('fast');
});
return;
}
params.timestamp = unraid_timestamp;
params.osversion = unraid_osversion;
params.keyfile = inkeyfile;
params.pageurl = inpageurl;
$.post(url, params, function(data) {
$('div.spinner.fixed').hide();
if (data.error) {
var failure_message = "<p class='red-text' style='text-align:center;'><?=_('Sorry, an error occurred')?>. <?=_('Please try again later')?>.</p>";
$('#thanks_panel').html(failure_message).fadeIn('fast');
} else {
data.message = data.message || '';
var url_parts = url.split('/');
var success_message = '<div style="text-align:center"><h2 style="color:#4f8a10!important"><?=_("Thank You")?>!</h2><img src="/webGui/images/feedback_' + url_parts[4] + '.png"/><p class="success">' + data.message + '</p></div>';
$('#thanks_panel').html(success_message).fadeIn('fast', function() {
var resetfunction = window[url_parts[4] + '_reset'];
if (typeof resetfunction !== 'undefined' && $.isFunction(resetfunction)) {
resetfunction();
}
});
}
}).fail(function(jqXHR, textStatus, errorThrown) {
if (jqXHR.responseJSON && jqXHR.responseJSON.error) {
errorThrown = jqXHR.responseJSON.error;
}
var failure_message = "<p class='red-text' style='text-align:center;'><?=_('Sorry, an error occurred')?>. <?=_('Please try again later')?>.</p>";
$('#thanks_panel').html(failure_message).fadeIn('fast');
}).always(function() {
$('#spinner_image').fadeOut('fast');
panel.fadeOut('fast').find('textarea,input').prop('disabled', false);
});
$('#submit-button').prop('disabled',true);
}
<div id="troubleshoot_panel" class="allpanels">
<textarea id="troubleshoot" class="feedback"></textarea>
<label class="note" for="anonymize_troubleshoot"><input type="checkbox" id="anonymize_troubleshoot" class="anonymize" value="1"><?=_('Anonymize diagnostics (may make troubleshooting more difficult)')?></label>
<p class="note"><b><?=_('NOTE')?>:</b> <i><?=_('Submission of this troubleshooting request will automatically send your system diagnostics to Lime Technology')?>.</i></p>
</div>
$(function() {
$('#control_panel input[type=radio]').click(function() {
var showPanel = '#' + $('#control_panel input[type=radio]:checked').val() + '_panel';
$('.allpanels').not(showPanel).fadeOut('fast');
var loadfunction = window[$('#control_panel input[type=radio]:checked').val() + '_load'];
if (typeof loadfunction !== 'undefined' && $.isFunction(loadfunction)) {
loadfunction();
} else {
$(showPanel).fadeIn('fast');
}
});
<div id="comment_panel" class="allpanels">
<textarea id="comment" class="feedback"></textarea>
</div>
$('button.confirm').text("<?=_('Cancel')?>");
if ($('#submit-button').length == 0) $('button.confirm').before('<input type="button" id="submit-button" value="<?=_('Submit')?>">');
<div id="footer_panel">
<input type="email" id="email" autocomplete="off" spellcheck="false">
<a href="https://unraid.net" target="_blank"><?=_('Website')?></a><span class="spacer blue-text">|</span>
<a href="https://forums.unraid.net" target="_blank"><?=_('Forum')?></a><span class="spacer blue-text">|</span>
<a href="https://docs.unraid.net/" target="_blank"><?=_('Docs')?></a>
</div>
</div>
$('input[name=mode]').click(function(){$('#submit-button').prop('disabled',false);});
<script>
var md5 = {};
String.prototype.md5 = function(){
// Original copyright (c) Paul Johnston & Greg Holt.
var hc = '0123456789abcdef';
function rh(n){var j,s='';for (j=0;j<=3;j++) s+=hc.charAt((n>>(j*8+4))&0x0F)+hc.charAt((n>>(j*8))&0x0F);return s;}
function ad(x,y){var l=(x&0xFFFF)+(y&0xFFFF);var m=(x>>16)+(y>>16)+(l>>16);return (m<<16)|(l&0xFFFF);}
function rl(n,c){return (n<<c)|(n>>>(32-c));}
function cm(q,a,b,x,s,t){return ad(rl(ad(ad(a,q),ad(x,t)),s),b);}
function ff(a,b,c,d,x,s,t){return cm((b&c)|((~b)&d),a,b,x,s,t);}
function gg(a,b,c,d,x,s,t){return cm((b&d)|(c&(~d)),a,b,x,s,t);}
function hh(a,b,c,d,x,s,t){return cm(b^c^d,a,b,x,s,t);}
function ii(a,b,c,d,x,s,t){return cm(c^(b|(~d)),a,b,x,s,t);}
function sb(x) {
var i;var nblk=((x.length+8)>>6)+1;var blks=new Array(nblk*16);for (i=0;i<nblk*16;i++) blks[i]=0;
for (i=0;i<x.length;i++) blks[i>>2]|=x.charCodeAt(i)<<((i%4)*8);
blks[i>>2]|=0x80<<((i%4)*8);blks[nblk*16-2]=x.length*8;return blks;
}
var i,x=sb(''+this),a=1732584193,b=-271733879,c=-1732584194,d=271733878,olda,oldb,oldc,oldd;
for (i=0;i<x.length;i+=16) {olda=a;oldb=b;oldc=c;oldd=d;
a=ff(a,b,c,d,x[i+ 0], 7, -680876936);d=ff(d,a,b,c,x[i+ 1],12, -389564586);c=ff(c,d,a,b,x[i+ 2],17, 606105819);
b=ff(b,c,d,a,x[i+ 3],22,-1044525330);a=ff(a,b,c,d,x[i+ 4], 7, -176418897);d=ff(d,a,b,c,x[i+ 5],12, 1200080426);
c=ff(c,d,a,b,x[i+ 6],17,-1473231341);b=ff(b,c,d,a,x[i+ 7],22, -45705983);a=ff(a,b,c,d,x[i+ 8], 7, 1770035416);
d=ff(d,a,b,c,x[i+ 9],12,-1958414417);c=ff(c,d,a,b,x[i+10],17, -42063);b=ff(b,c,d,a,x[i+11],22,-1990404162);
a=ff(a,b,c,d,x[i+12], 7, 1804603682);d=ff(d,a,b,c,x[i+13],12, -40341101);c=ff(c,d,a,b,x[i+14],17,-1502002290);
b=ff(b,c,d,a,x[i+15],22, 1236535329);a=gg(a,b,c,d,x[i+ 1], 5, -165796510);d=gg(d,a,b,c,x[i+ 6], 9,-1069501632);
c=gg(c,d,a,b,x[i+11],14, 643717713);b=gg(b,c,d,a,x[i+ 0],20, -373897302);a=gg(a,b,c,d,x[i+ 5], 5, -701558691);
d=gg(d,a,b,c,x[i+10], 9, 38016083);c=gg(c,d,a,b,x[i+15],14, -660478335);b=gg(b,c,d,a,x[i+ 4],20, -405537848);
a=gg(a,b,c,d,x[i+ 9], 5, 568446438);d=gg(d,a,b,c,x[i+14], 9,-1019803690);c=gg(c,d,a,b,x[i+ 3],14, -187363961);
b=gg(b,c,d,a,x[i+ 8],20, 1163531501);a=gg(a,b,c,d,x[i+13], 5,-1444681467);d=gg(d,a,b,c,x[i+ 2], 9, -51403784);
c=gg(c,d,a,b,x[i+ 7],14, 1735328473);b=gg(b,c,d,a,x[i+12],20,-1926607734);a=hh(a,b,c,d,x[i+ 5], 4, -378558);
d=hh(d,a,b,c,x[i+ 8],11,-2022574463);c=hh(c,d,a,b,x[i+11],16, 1839030562);b=hh(b,c,d,a,x[i+14],23, -35309556);
a=hh(a,b,c,d,x[i+ 1], 4,-1530992060);d=hh(d,a,b,c,x[i+ 4],11, 1272893353);c=hh(c,d,a,b,x[i+ 7],16, -155497632);
b=hh(b,c,d,a,x[i+10],23,-1094730640);a=hh(a,b,c,d,x[i+13], 4, 681279174);d=hh(d,a,b,c,x[i+ 0],11, -358537222);
c=hh(c,d,a,b,x[i+ 3],16, -722521979);b=hh(b,c,d,a,x[i+ 6],23, 76029189);a=hh(a,b,c,d,x[i+ 9], 4, -640364487);
d=hh(d,a,b,c,x[i+12],11, -421815835);c=hh(c,d,a,b,x[i+15],16, 530742520);b=hh(b,c,d,a,x[i+ 2],23, -995338651);
a=ii(a,b,c,d,x[i+ 0], 6, -198630844);d=ii(d,a,b,c,x[i+ 7],10, 1126891415);c=ii(c,d,a,b,x[i+14],15,-1416354905);
b=ii(b,c,d,a,x[i+ 5],21, -57434055);a=ii(a,b,c,d,x[i+12], 6, 1700485571);d=ii(d,a,b,c,x[i+ 3],10,-1894986606);
c=ii(c,d,a,b,x[i+10],15, -1051523);b=ii(b,c,d,a,x[i+ 1],21,-2054922799);a=ii(a,b,c,d,x[i+ 8], 6, 1873313359);
d=ii(d,a,b,c,x[i+15],10, -30611744);c=ii(c,d,a,b,x[i+ 6],15,-1560198380);b=ii(b,c,d,a,x[i+13],21, 1309151649);
a=ii(a,b,c,d,x[i+ 4], 6, -145523070);d=ii(d,a,b,c,x[i+11],10,-1120210379);c=ii(c,d,a,b,x[i+ 2],15, 718787259);
b=ii(b,c,d,a,x[i+ 9],21, -343485551);a=ad(a,olda);b=ad(b,oldb);c=ad(c,oldc);d=ad(d,oldd);
}
return rh(a)+rh(b)+rh(c)+rh(d);
}
$('#submit-button').click(function() {
switch ($('input[name=mode]:checked').val()) {
case 'featurerequest':
if ($('#featureDescription').val() === '') return;
form_submit('https://keys.lime-technology.com/feedback/featurerequest',{description: $('#featureDescription').val(), email: $('#featureEmail').val()}, $('#featurerequest_panel'));
break;
case 'bugreport':
if ($('#bugDescription').val() === '') return;
form_submit('https://keys.lime-technology.com/feedback/bugreport',{description: $('#bugDescription').val(), email: $('#bugEmail').val()}, $('#bugreport_panel'), true);
break;
case 'troubleshoot':
if ($('#troubleshootDescription').val() === '') return;
if ($('#troubleshootEmail').val() === '') return alert('Email is required for troubleshooting requests');
// @todo - update this to use a new troubleshoot endpoint
form_submit('https://keys.lime-technology.com/feedback/bugreport',{description: $('#troubleshootDescription').val()+'\n\n'+$('#troubleshootDetails').val(), email: $('#troubleshootEmail').val()}, $('#troubleshoot_panel'), true);
break;
case 'comment':
if ($('#commentDescription').val() === '') return;
form_submit('https://keys.lime-technology.com/feedback/comment',{description: $('#commentDescription').val(), email: $('#commentEmail').val()}, $('#comment_panel'));
break;
}
});
function validInput(input) {
var validRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
var email = $('input#email');
return input.val().md5() == md5[input.prop('id')] || !(email.prop('required')===false || email.val().match(validRegex));
}
featurerequest_reset();
bugreport_reset();
troubleshoot_reset();
comment_reset();
$('#optFeatureRequest').click();
function feedback_reset() {
$('#featurerequest').val("").prop('placeholder',"<?=_('Please summarize your suggestion here')?>.");
md5.featurerequest = $('#featurerequest').val().md5();
$('#bugreport').val("<?=_('Bug Description')?>:\n\n\n\n<?=_('How to reproduce')?>:\n\n\n\n<?=_('Expected results')?>:\n\n\n\n<?=_('Actual results')?>:\n\n\n\n<?=_('Other information')?>:\n");
md5.bugreport = $('#bugreport').val().md5();
$('#troubleshoot').val("<?=_('Description')?>:\n\n\n\n<?=_('How to reproduce')?>:\n\n\n\n<?=_('Expected results')?>:\n\n\n\n<?=_('Actual results')?>:\n\n\n\n<?=_('Other information')?>:\n");
md5.troubleshoot = $('#troubleshoot').val().md5();
$('#comment').val("").prop('placeholder',"<?=_('Type your question or comment to Lime Technology here')?>.");
md5.comment = $('#comment').val().md5();
}
function form_submit(url, params, tab, diagnostics) {
var panel = $(tab+'_panel');
$('#submit_button').prop('disabled',true);
panel.find('textarea').prop('disabled',true);
$('div.spinner.fixed').show();
if (diagnostics) {
var anonymize = $('#anonymize').is(':checked') ? '1' : '';
$.get('/webGui/include/Feedback.php',{getdiagnostics:1, anonymize:anonymize}, function(data){
params.diagnostics = data;
form_submit(url, params, tab);
}).fail(function(){
$('div.spinner.fixed').hide();
panel.fadeOut('fast').find('textarea').prop('disabled',false);
var reply = "<h2 class='center red-text'><?=_('Error')?></h2><p class='center'><img src='<?=$feedback?>error.png'><br><?="$diagn. $again"?>.</p>";
$('#result_panel').html(reply).fadeIn('fast');
});
</script>
</body>
</html>
return;
}
params.description = $(tab).val();
params.email = $('input#email').val();
params.timestamp = "<?=time()?>";
params.osversion = "<?=$unraid['version']?>";
params.keyfile = "<?=$keyfile?>";
params.pageurl = window.top.location.href;
$.post(url, params, function(data){
$('div.spinner.fixed').hide();
if (data.error) {
var reply = "<h2 class='center red-text'><?=_('Error')?></h2><p class='center'><img src='<?=$feedback?>error.png'><br><?="$sorry. $again"?>.</p>";
$('#result_panel').html(reply).fadeIn('fast');
} else {
var name = tab.substr(1).toLowerCase();
var reply = "<h2 class='center green-text'><?=_('Thank You')?></h2><p class='center'><img src='<?=$feedback?>"+name+".png'><br>"+(data.message||'')+"</p>";
$('#result_panel').html(reply).fadeIn('fast');
}
}).fail(function(jqXHR, textStatus, errorThrown){
if (jqXHR.responseJSON && jqXHR.responseJSON.error) {
errorThrown = jqXHR.responseJSON.error;
}
var reply = "<h2 class='center red-text'><?=_('Error')?></h2><p class='center'><img src='<?=$feedback?>error.png'><br><?="$sorry. $again"?>.</p>";
$('#result_panel').html(reply).fadeIn('fast');
}).always(function(){
$('#spinner_image').fadeOut('fast');
panel.fadeOut('fast').find('textarea').prop('disabled',false);
});
}
$(function(){
$('button.confirm').text("<?=_('Cancel')?>");
if ($('#submit_button').length == 0) $('button.confirm').before('<input type="button" id="submit_button" value="<?=_('Submit')?>" disabled>');
$('input[name=mode]').click(function(){
var tab = '#'+$('input[name=mode]:checked').val();
var panel = tab+'_panel';
var enter = ['#troubleshoot'].includes(tab);
var email = "<?=_('Contact Email Address')?> ("+(enter ? "<?=_('required')?>" : "<?=_('optional')?>")+")";
$('input#email').prop('placeholder',email).prop('required',enter);
$('#submit_button').prop('disabled',validInput($(tab)));
$('.allpanels').not(panel).fadeOut('fast');
$(panel).fadeIn('fast');
});
$('textarea').on('input change',function(){
$('#submit_button').prop('disabled',validInput($(this)));
});
$('input#email').on('input change',function(){
var tab = '#'+$('input[name=mode]:checked').val();
$('#submit_button').prop('disabled',validInput($(tab)));
});
$('#submit_button').click(function(){
var url = 'https://keys.lime-technology.com/feedback/';
var tab = '#'+$('input[name=mode]:checked').val();
switch (tab) {
case '#featurerequest':
form_submit(url+'featurerequest',{},tab);
break;
case '#bugreport':
form_submit(url+'bugreport',{},tab,1);
break;
case '#troubleshoot':
// @todo - update this to use a new troubleshoot endpoint
form_submit(url+'bugreport',{},tab,1);
break;
case '#comment':
form_submit(url+'comment',{},tab);
break;
}
});
feedback_reset();
$('#opt_featurerequest').click();
});
</script>

View File

@@ -1,7 +1,7 @@
#!/usr/bin/php -q
<?PHP
/* Copyright 2005-2023, Lime Technology
* Copyright 2012-2023, Bergware International.
/* Copyright 2005-2024, Lime Technology
* Copyright 2012-2024, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -22,6 +22,8 @@ $login_locale = _var($display,'locale');
require_once "$docroot/webGui/include/Translations.php";
$month = [' Jan '=>'-01-',' Feb '=>'-02-',' Mar '=>'-03-',' Apr '=>'-04-',' May '=>'-05-',' Jun '=>'-06-',' Jul '=>'-07-',' Aug '=>'-08-',' Sep '=>'-09-',' Oct '=>'-10-',' Nov '=>'-11-',' Dec '=>'-12-'];
$log = "/boot/config/parity-checks.log";
$list = [];
function this_plus($val, $word, $last) {
return $val>0 ? (($val||$last)?($val.' '.$word.($last?'':', ')):'') : '';
@@ -35,10 +37,10 @@ function this_duration($time) {
$secs = $hmss%60;
return this_plus($days,_('day'),($hour|$mins|$secs)==0).this_plus($hour,_('hr'),($mins|$secs)==0).this_plus($mins,_('min'),$secs==0).this_plus($secs,_('sec'),true);
}
$log = "/boot/config/parity-checks.log";
$head = "<table style='margin-top:10px;background-color:inherit'><tr style='font-weight:bold'><td>"._('Action')."</td><td>"._('Date')."</td><td>"._('Size')."</td><td>"._('Duration')."</td><td>"._('Speed')."</td><td>"._('Status')."</td><td>"._('Errors')."</td></tr>";
$list = [];
?>
<table style='margin-top:10px;background-color:inherit'>
<tr style='font-weight:bold'><td><?=_('Action')?></td><td><?=_('Date')?></td><td><?=_('Size')?></td><td><?=_('Duration')?></td><td><?=_('Speed')?></td><td><?=_('Status')?></td><td><?=_('Errors')?></td></tr>
<?
if (file_exists($log)) {
$handle = fopen($log, 'r');
while (($row = fgets($handle))!==false) {
@@ -57,14 +59,10 @@ if (file_exists($log)) {
// handle both old and new speed notation
$speed = $speed ? (is_numeric($speed) ? my_scale($speed,$unit,1)." $unit/s" : $speed) : _('Unavailable');
$status = $status==0 ? _('OK') : ($status==-4 ? _('Canceled') : $status);
$list[] = "<tr><td>$action</td><td>$date</td><td>$size</td><td>$duration</td><td>$speed</td><td>$status</td><td>$error</td></tr>";
array_unshift($list, "<tr><td>$action</td><td>$date</td><td>$size</td><td>$duration</td><td>$speed</td><td>$status</td><td>$error</td></tr>");
}
fclose($handle);
}
if ($list) {
$list = array_reverse($list);
} else {
$list[] = "<tr><td colspan='7' style='text-align:center;padding-top:12px'>"._('No parity check history present')."!</td></tr>";
}
echo $head,implode($list),"</table>";
echo $list ? implode($list) : "<tr><td colspan='7' style='text-align:center;padding-top:12px'>"._('No parity check history present')."!</td></tr>";
?>
</table>

View File

@@ -1,7 +1,7 @@
#!/usr/bin/php -q
<?PHP
/* Copyright 2005-2023, Lime Technology
* Copyright 2012-2023, Bergware International.
/* Copyright 2005-2024, Lime Technology
* Copyright 2012-2024, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -24,34 +24,36 @@ require_once "$docroot/webGui/include/Translations.php";
$boot = "/boot/config/plugins/dynamix";
$file = $argv[1];
$cmodel = is_file("$boot/$file") ? file_get_contents("$boot/$file") : '';
?>
<style>
div.case-list{float:left;padding:10px;margin:0 45px 64px 0;height:128px;width:128px;text-align:center;cursor:pointer}
div.case-list span{position:relative;top:64px;width:auto;max-width:128px;height:128px;font-size:128px}
div.case-list span.fa{top:24px;max-width:80px;font-size:80px}
div.case-list:hover{color:#f0000c}
div.case-name{position:relative;top:74px;font-family:clear-sans!important}
div.custom-name{position:relative;top:10px;font-family:clear-sans!important}
input#file{display:none}
</style>
$style = ["<style>"];
$style[] = "div.case-list{float:left;padding:10px;margin:0 45px 64px 0;height:128px;width:128px;text-align:center;cursor:pointer}";
$style[] = "div.case-list span{position:relative;top:64px;width:auto;max-width:128px;height:128px;font-size:128px}";
$style[] = "div.case-list span.fa{top:24px;max-width:80px;font-size:80px}";
$style[] = "div.case-list:hover{color:#f0000c}";
$style[] = "div.case-name{position:relative;top:74px;font-family:clear-sans!important}";
$style[] = "div.custom-name{position:relative;top:10px;font-family:clear-sans!important}";
$style[] = "</style>";
<script>
function selectDone() {
$('.sweet-alert').hide('fast').removeClass('nchan');
swal.close();
getCase();
}
function setCase(model) {
$.post('/webGui/include/SelectCase.php',{mode:'set',file:'<?=$file?>',model:model},function(){selectDone();});
}
function importFile(file) {
if (file.name.split('.').pop().toLowerCase() != 'png') return;
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function(e){$.post('/webGui/include/SelectCase.php',{mode:'file',file:'<?=$file?>',data:e.target.result},function(){selectDone();})};
}
</script>
$script = ["<script>"];
$script[] = "function selectDone() {";
$script[] = " \$('.sweet-alert').hide('fast').removeClass('nchan');";
$script[] = " swal.close();";
$script[] = " getCase();";
$script[] = "}";
$script[] = "function setCase(model) {";
$script[] = " \$.post('/webGui/include/SelectCase.php',{mode:'set',file:'$file',model:model},function(){selectDone();});";
$script[] = "}";
$script[] = "function importFile(file) {";
$script[] = " if (file.name.split('.').pop().toLowerCase() != 'png') return;";
$script[] = " var reader = new FileReader();";
$script[] = " reader.readAsDataURL(file);";
$script[] = " reader.onload = function(e){\$.post('/webGui/include/SelectCase.php',{mode:'file',file:'$file',data:e.target.result},function(){selectDone();})};";
$script[] = "}";
$script[] = "</script>";
$html = ["<div>"];
<div>
<?
$cases = file("$docroot/webGui/styles/default-cases.css",FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
foreach ($cases as $case) if (substr($case,0,6)=='.case-') $models[] = substr($case,1,strpos($case,':')-1);
natsort($models);
@@ -60,13 +62,11 @@ for ($i=0; $i < count($models); $i++) {
$name = substr($model,5);
$title = str_replace('3u-avs-10-4','3u-avs-10/4',$name);
$select = $name==$cmodel ? 'color:#e68a00' : '';
$html[] = "<div id='$name' class='case-list' style='$select' onclick='setCase(\"$name\")'><span class='$model'></span><div class='case-name'>$title</div></div>";
echo "<div id='$name' class='case-list' style='$select' onclick='setCase(\"$name\")'><span class='$model'></span><div class='case-name'>$title</div></div>\n";
}
$select = $cmodel=='case-model.png' ? 'color:#e68a00' : '';
$html[] = "<div id='Custom' class='case-list' style='$select' onclick='$(\"input#file\").trigger(\"click\")'><span class='fa fa-file-image-o'></span><div class='custom-name'>"._('custom image')."</div></div>";
$html[] = "</div></div>";
$html[] = "<input type='file' id='file' accept='.png' onchange='importFile(this.files[0])' style='display:none'>";
$html[] = "</div>";
echo implode($style),implode($script),implode($html);
?>
<div id='Custom' class='case-list' style='<?=$select?>' onclick='$("input#file").trigger("click")'><span class='fa fa-file-image-o'></span><div class='custom-name'><?=_('custom image')?></div></div>
</div></div>
<input type='file' id='file' accept='.png' onchange='importFile(this.files[0])'>
</div>

View File

@@ -1,7 +1,7 @@
#!/usr/bin/php -q
<?PHP
/* Copyright 2005-2023, Lime Technology
* Copyright 2012-2023, Bergware International.
/* Copyright 2005-2024, Lime Technology
* Copyright 2012-2024, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -136,23 +136,28 @@ if ($memory_installed >= 1024) {
// If maximum < installed then roundup maximum to the next power of 2 size of installed. E.g. 6 -> 8 or 12 -> 16
$low = $memory_maximum < $memory_installed;
if ($low) $memory_maximum = pow(2,ceil(log($memory_installed)/log(2)));
?>
<style>
table.info{margin-top:10px;background-color:inherit}
table.info td:first-child{width:20%;font-weight:bold;padding-left:10px}
tr.ram,tr.port{display:none}
span.link{text-decoration:underline;cursor:pointer}
</style>
$style = "<style>table.info{margin-top:10px;background-color:inherit} table.info td:first-child{width:20%;font-weight:bold;padding-left:10px} tr.ram,tr.port{display:none} span.link{text-decoration:underline;cursor:pointer}</style>";
$list = [];
$list[] = "<table class='info'><tr><td>"._('Model').":</td><td>$model</td></tr>";
$list[] = "<tr><td>".('M/B').":</td><td>{$board['Manufacturer']} {$board['Product Name']} {$board['Version']} {$board['Serial Number']}</td></tr>";
$list[] = "<tr><td>"._('BIOS').":</td><td>{$bios['Vendor']} {$bios['Version']} {$bios['Release Date']}</td></tr>";
$list[] = "<tr><td>"._('CPU').":</td><td>$cpumodel {$cpu['Current Speed']}</td></tr>";
$list[] = "<tr><td>"._('HVM').":</td><td>$hvm</td></tr>";
$list[] = "<tr><td>"._('IOMMU').":</td><td>$iommu</td></tr>";
$list[] = "<tr><td>"._('Cache').":</td><td>".implode(', ',$cache_installed)."</td></tr>";
$list[] = "<tr><td>$memory</td><td>$memory_installed $unit $memory_type $ecc("._('max. installable capacity')." $memory_maximum $unit".($low?'*':'').")</td></tr>";
<table class='info'>
<tr><td><?=_('Model')?>:</td><td><?=$model?></td></tr>
<tr><td><?=('M/B')?>:</td><td><?="{$board['Manufacturer']} {$board['Product Name']} {$board['Version']} {$board['Serial Number']}"?></td></tr>
<tr><td><?=_('BIOS')?>:</td><td><?="{$bios['Vendor']} {$bios['Version']} {$bios['Release Date']}"?></td></tr>
<tr><td><?=_('CPU')?>:</td><td><?="$cpumodel {$cpu['Current Speed']}"?></td></tr>
<tr><td><?=_('HVM')?>:</td><td><?=$hvm?></td></tr>
<tr><td><?=_('IOMMU')?>:</td><td><?=$iommu?></td></tr>
<tr><td><?=_('Cache')?>:</td><td><?=implode(', ',$cache_installed)?></td></tr>
<tr><td><?=$memory?></td><td><?="$memory_installed $unit $memory_type $ecc("._('max. installable capacity')." $memory_maximum $unit".($low?'*':'')?>)</td></tr>
<?
foreach ($memory_devices as $device) {
if (empty($device['Type']) || $device['Type']=='Unknown') continue;
$size = preg_replace('/( .)B$/','$1iB',_var($device,'Size',0));
$list[] = "<tr class='ram'><td></td><td>".$device['Locator'].": "._var($device,'Manufacturer')." "._var($device,'Part Number').", $size "._var($device,'Type')." @ "._var($device,'Configured Memory Speed')."</td></tr>";
echo "<tr class='ram'><td></td><td>",$device['Locator'],": ",_var($device,'Manufacturer')," ",_var($device,'Part Number'),", $size ",_var($device,'Type')," @ ",_var($device,'Configured Memory Speed'),"</td></tr>";
}
exec("ls --indicator-style=none /sys/class/net|grep -Po '^(bond|eth)\d+$'",$sPorts);
@@ -167,24 +172,22 @@ foreach ($sPorts as $port) {
if (substr($port,0,4)=='bond') {
if ($link) {
$bond_mode = str_replace('Bonding Mode: ','',file("/proc/net/bonding/$port",FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES)[1]);
$list[] = "<tr class='$more'><td>$name</td><td>$port: $bond_mode, mtu $mtu</td></tr>";
echo "<tr class='$more'><td>$name</td><td>$port: $bond_mode, mtu $mtu</td></tr>";
} else {
$list[] = "<tr class='$more'><td>$name</td><td>$port: "._("bond down")."</td></tr>";
echo "<tr class='$more'><td>$name</td><td>$port: ",_('bond down'),"</td></tr>";
}
} else {
if ($link) {
$speed = file_get_contents("$int/speed");
$duplex = file_get_contents("$int/duplex");
$list[] = "<tr class='$more'><td>$name</td><td>$port: $speed Mbps, $duplex duplex, mtu $mtu</td></tr>";
echo "<tr class='$more'><td>$name</td><td>$port: $speed Mbps, $duplex duplex, mtu $mtu</td></tr>";
} else {
$list[] = "<tr class='$more'><td>$name</td><td>$port: "._("interface down")."</td></tr>";
echo "<tr class='$more'><td>$name</td><td>$port: ",_('interface down'),"</td></tr>";
}
}
}
$list[] = "<tr><td>"._('Kernel').":</td><td>$kernel</td></tr>";
$list[] = "<tr><td>"._('OpenSSL').":</td><td>$openssl</td></tr>";
$list[] = "<tr><td>"._('Uptime').":</td><td><span class='uptime'></span></td></tr></table>";
echo $style,implode($list);
?>
<tr><td><?=_('Kernel')?>:</td><td><?=$kernel?></td></tr>
<tr><td><?=_('OpenSSL')?>:</td><td><?=$openssl?></td></tr>
<tr><td><?=_('Uptime')?>:</td><td><span class='uptime'></span></td></tr>
</table>

View File

@@ -1,7 +1,7 @@
#!/usr/bin/php -q
<?PHP
/* Copyright 2005-2023, Lime Technology
* Copyright 2012-2023, Bergware International.
/* Copyright 2005-2024, Lime Technology
* Copyright 2012-2024, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -24,47 +24,42 @@ require_once "$docroot/webGui/include/Translations.php";
$file = $argv[1];
$path = realpath('/etc/wireguard'.($argv[2]??''));
$root = '/boot/config/wireguard';
?>
<style>
pre h2{text-decoration:underline}
input#download{margin:0 0 10px 0}
pre.config{font-family:bitstream;margin:0;border:none}
img{display:block;margin:20px 0}
img:hover{transform:scale(1.1)}
</style>
$style = ["<style>"];
$style[] = "pre h2{text-decoration:underline}";
$style[] = "input#download{margin:0 0 10px 0}";
$style[] = "pre.config{font-family:bitstream;margin:0;border:none}";
$style[] = "img{display:block;margin:20px 0}";
$style[] = "img:hover{transform:scale(1.1)}";
$style[] = "</style>";
<script>
function config_cleanUp(id,file) {
if (document.hasFocus()) {
$('#'+id).val("<?=_('Download')?>").prop('disabled',false);
$.post('/webGui/include/Download.php',{cmd:'delete',file:file});
} else {
setTimeout(function(){config_cleanUp(id,file);},1000);
}
}
function config_download(id,source,file) {
$('#'+id).val("<?=_('Downloading')?>...").prop('disabled',true);
$.post('/webGui/include/Download.php',{cmd:'save',source:source+'.conf',file:file,opts:'qj'},function(){
$.post('/webGui/include/Download.php',{cmd:'save',source:source+'.png',file:file,opts:'qj'},function(zip){
location = zip;
setTimeout(function(){config_cleanUp(id,file);},1000);
});
});
}
</script>
$script = ["<script>"];
$script[] = "function config_cleanUp(id,file) {";
$script[] = " if (document.hasFocus()) {";
$script[] = " $('#'+id).val(\""._('Download')."\").prop('disabled',false);";
$script[] = " $.post('/webGui/include/Download.php',{cmd:'delete',file:file});";
$script[] = " } else {";
$script[] = " setTimeout(function(){config_cleanUp(id,file);},1000);";
$script[] = " }";
$script[] = "}";
$script[] = "function config_download(id,source,file) {";
$script[] = " $('#'+id).val(\""._('Downloading')."...\").prop('disabled',true);";
$script[] = " $.post('/webGui/include/Download.php',{cmd:'save',source:source+'.conf',file:file,opts:'qj'},function(){";
$script[] = " $.post('/webGui/include/Download.php',{cmd:'save',source:source+'.png',file:file,opts:'qj'},function(zip){";
$script[] = " location = zip;";
$script[] = " setTimeout(function(){config_cleanUp(id,file);},1000);";
$script[] = " });";
$script[] = " });";
$script[] = "}";
$script[] = "</script>";
$html = [];
$html[] = "<h2>".($argv[2] ? _('Remote peer configuration') : _('Local server configuration'))."</h2>";
$html[] = "<div><input type='button' id='download' value=\""._('Download')."\" onclick=\"config_download(this.id,'$path/$file','$file.zip')\"></div>";
$html[] = "<pre class='config'>";
$html[] = @file_get_contents("$path/$file.conf");
$html[] = "\n";
$html[] = "</pre>";
<h2><?=$argv[2] ? _('Remote peer configuration') : _('Local server configuration')?></h2>
<div><input type='button' id='download' value="<?=_('Download')?>" onclick="config_download(this.id,'<?="$path/$file"?>','<?=$file?>.zip')"></div>
<pre class='config'><?=@file_get_contents("$path/$file.conf")?></pre>
<?
if (is_file("$path/$file.png")) {
@unlink("$docroot/$file.png");
symlink("$path/$file.png", "$docroot/$file.png");
$html[] = "<img src=\"/$file.png?v=".filemtime("$path/$file.png")."\">";
echo "<img src=\"/$file.png?v=",filemtime("$path/$file.png"),"\">";
}
echo implode($style),implode($script),implode($html);
?>

View File

@@ -25,14 +25,14 @@ pre li{margin:0;padding-top:0;padding-bottom:0;padding-left:18px}
big{font-size:1.4rem;font-weight:bold;text-transform:uppercase}
hr{border:none;height:1px!important;color:#606e7f;background-color:#606e7f}
input[type=text],input[type=password],input[type=number],input[type=url],input[type=email],input[type=date],input[type=file],textarea,.textarea{font-family:clear-sans;font-size:1.3rem;background-color:transparent;border:1px solid #606e7f;padding:5px 6px;min-height:2rem;line-height:2rem;outline:none;width:300px;margin:0 20px 0 0;box-shadow:none;border-radius:0;color:#606e7f}
input[type=button],input[type=reset],input[type=submit],button,button[type=button],a.button{font-family:clear-sans;font-size:1.2rem;border:1px solid #9f9180;border-radius:5px;min-width:76px;margin:10px 12px 10px 0;padding:8px;text-align:center;cursor:pointer;outline:none;color:#9f9180;background-color:#edeaef}
input[type=button],input[type=reset],input[type=submit],button,button[type=button],a.button,.sweet-alert button{font-family:clear-sans;font-size:1.2rem;border:1px solid #9f9180;border-radius:5px;min-width:76px;margin:10px 12px 10px 0;padding:8px;text-align:center;cursor:pointer;outline:none;color:#9f9180;background-color:#edeaef}
input[type=checkbox]{vertical-align:middle;margin-right:6px}
input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none}
input[type=number]{-moz-appearance:textfield}
input:focus[type=text],input:focus[type=password],input:focus[type=number],input:focus[type=url],input:focus[type=email],input:focus[type=file],textarea:focus{background-color:#edeaef;border-color:#0072c6}
input:hover[type=button],input:hover[type=reset],input:hover[type=submit],button:hover,button:hover[type=button],a.button:hover{border-color:#0072c6;color:#4f4f4f}
input:active[type=button],input:active[type=reset],input:active[type=submit],button:active,button:active[type=button],a.button:active{border-color:#0072c6;box-shadow:none}
input[disabled],button[disabled],input:hover[type=button][disabled],input:hover[type=reset][disabled],input:hover[type=submit][disabled],button:hover[disabled],button:hover[type=button][disabled],input:active[type=button][disabled],input:active[type=reset][disabled],input:active[type=submit][disabled],button:active[disabled],button:active[type=button][disabled],textarea[disabled]{color:#808080;border-color:#808080;background-color:#c7c5cb;opacity:0.5;cursor:default}
input:focus[type=text],input:focus[type=password],input:focus[type=number],input:focus[type=url],input:focus[type=email],input:focus[type=file],textarea:focus,.sweet-alert button:focus{background-color:#edeaef;border-color:#0072c6}
input:hover[type=button],input:hover[type=reset],input:hover[type=submit],button:hover,button:hover[type=button],a.button:hover,.sweet-alert button:hover{border-color:#0072c6;color:#4f4f4f;background-color:#edeaef!important}
input:active[type=button],input:active[type=reset],input:active[type=submit],button:active,button:active[type=button],a.button:active,.sweet-alert button:active{border-color:#0072c6;box-shadow:none}
input[disabled],button[disabled],input:hover[type=button][disabled],input:hover[type=reset][disabled],input:hover[type=submit][disabled],button:hover[disabled],button:hover[type=button][disabled],input:active[type=button][disabled],input:active[type=reset][disabled],input:active[type=submit][disabled],button:active[disabled],button:active[type=button][disabled],textarea[disabled],.sweet-alert button[disabled]{color:#808080;border-color:#808080;background-color:#c7c5cb;opacity:0.5;cursor:default}
input::-webkit-input-placeholder{color:#00529b}
select{-webkit-appearance:none;font-family:clear-sans;font-size:1.3rem;min-width:188px;max-width:314px;padding:6px 14px 6px 6px;margin:0 10px 0 0;border:1px solid #606e7f;box-shadow:none;border-radius:0;color:#606e7f;background-color:transparent;background-image:linear-gradient(66.6deg, transparent 60%, #606e7f 40%),linear-gradient(113.4deg, #606e7f 40%, transparent 60%);background-position:calc(100% - 8px),calc(100% - 4px);background-size:4px 6px,4px 6px;background-repeat:no-repeat;outline:none;display:inline-block;cursor:pointer}
select option{color:#606e7f;background-color:#edeaef}

View File

@@ -22,16 +22,16 @@ i.control{cursor:pointer;color:#606060;font-size:1.8rem}
i.favo{display:none;font-size:1.8rem;position:absolute;margin-left:12px}
hr{border:none;height:1px!important;color:#2b2b2b;background-color:#2b2b2b}
input[type=text],input[type=password],input[type=number],input[type=url],input[type=email],input[type=date],input[type=file],textarea,.textarea{font-family:clear-sans;font-size:1.3rem;background-color:transparent;border:none;border-bottom:1px solid #e5e5e5;padding:4px 0;text-indent:0;min-height:2rem;line-height:2rem;outline:none;width:300px;margin:0 20px 0 0;box-shadow:none;border-radius:0;color:#f2f2f2}
input[type=button],input[type=reset],input[type=submit],button,button[type=button],a.button{font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:1.8px;text-transform:uppercase;min-width:86px;margin:10px 12px 10px 0;padding:8px;text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:none;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
input[type=button],input[type=reset],input[type=submit],button,button[type=button],a.button,.sweet-alert button{font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:1.8px;text-transform:uppercase;min-width:86px;margin:10px 12px 10px 0;padding:8px;text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:none;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
input[type=checkbox]{vertical-align:middle;margin-right:6px}
input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance: none}
input[type=number]{-moz-appearance:textfield}
input:focus[type=text],input:focus[type=password],input:focus[type=number],input:focus[type=url],input:focus[type=email],input:focus[type=file],textarea:focus{background-color:#262626;outline:0}
input:hover[type=button],input:hover[type=reset],input:hover[type=submit],button:hover,button:hover[type=button],a.button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
input:focus[type=text],input:focus[type=password],input:focus[type=number],input:focus[type=url],input:focus[type=email],input:focus[type=file],textarea:focus,.sweet-alert button:focus{background-color:#262626;outline:0}
input:hover[type=button],input:hover[type=reset],input:hover[type=submit],button:hover,button:hover[type=button],a.button:hover,.sweet-alert button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
input[disabled],textarea[disabled]{color:#f2f2f2;border-bottom-color:#6c6c6c;opacity:0.5;cursor:default}
input[type=button][disabled],input[type=reset][disabled],input[type=submit][disabled],button[disabled],button[type=button][disabled],a.button[disabled]
input:hover[type=button][disabled],input:hover[type=reset][disabled],input:hover[type=submit][disabled],button:hover[disabled],button:hover[type=button][disabled],a.button:hover[disabled]
input:active[type=button][disabled],input:active[type=reset][disabled],input:active[type=submit][disabled],button:active[disabled],button:active[type=button][disabled],a.button:active[disabled]{opacity:0.5;cursor:default;color:#808080;background:-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#404040),to(#404040)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#808080),to(#808080)) 100% 100% no-repeat;background:linear-gradient(90deg,#404040 0,#808080) 0 0 no-repeat,linear-gradient(90deg,#404040 0,#808080) 0 100% no-repeat,linear-gradient(0deg,#404040 0,#404040) 0 100% no-repeat,linear-gradient(0deg,#808080 0,#808080) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
input:active[type=button][disabled],input:active[type=reset][disabled],input:active[type=submit][disabled],button:active[disabled],button:active[type=button][disabled],a.button:active[disabled],.sweet-alert button[disabled]{opacity:0.5;cursor:default;color:#808080;background:-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#404040),to(#404040)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#808080),to(#808080)) 100% 100% no-repeat;background:linear-gradient(90deg,#404040 0,#808080) 0 0 no-repeat,linear-gradient(90deg,#404040 0,#808080) 0 100% no-repeat,linear-gradient(0deg,#404040 0,#404040) 0 100% no-repeat,linear-gradient(0deg,#808080 0,#808080) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
input::-webkit-input-placeholder{color:#486dba}
select{-webkit-appearance:none;font-family:clear-sans;font-size:1.3rem;min-width:166px;max-width:300px;padding:5px 8px 5px 0;text-indent:0;margin:0 10px 0 0;border:none;border-bottom:1px solid #e5e5e5;box-shadow:none;border-radius:0;color:#f2f2f2;background-color:transparent;background-image:linear-gradient(66.6deg, transparent 60%, #f2f2f2 40%),linear-gradient(113.4deg, #f2f2f2 40%, transparent 60%);background-position:calc(100% - 4px),100%;background-size:4px 6px,4px 6px;background-repeat:no-repeat;outline:none;display:inline-block;cursor:pointer}
select option{color:#f2f2f2;background-color:#262626}

View File

@@ -25,14 +25,14 @@ pre li{margin:0;padding-top:0;padding-bottom:0;padding-left:18px}
big{font-size:1.4rem;font-weight:bold;text-transform:uppercase}
hr{border:none;height:1px!important;color:#606e7f;background-color:#606e7f}
input[type=text],input[type=password],input[type=number],input[type=url],input[type=email],input[type=date],input[type=file],textarea,.textarea{font-family:clear-sans;font-size:1.3rem;background-color:transparent;border:1px solid #606e7f;padding:5px 6px;min-height:2rem;line-height:2rem;outline:none;width:300px;margin:0 20px 0 0;box-shadow:none;border-radius:0;color:#606e7f}
input[type=button],input[type=reset],input[type=submit],button,button[type=button],a.button{font-family:clear-sans;font-size:1.2rem;border:1px solid #606e7f;border-radius:5px;min-width:76px;margin:10px 12px 10px 0;padding:8px;text-align:center;cursor:pointer;outline:none;color:#606e7f;background-color:#121510}
input[type=button],input[type=reset],input[type=submit],button,button[type=button],a.button,.sweet-alert button{font-family:clear-sans;font-size:1.2rem;border:1px solid #606e7f;border-radius:5px;min-width:76px;margin:10px 12px 10px 0;padding:8px;text-align:center;cursor:pointer;outline:none;color:#606e7f;background-color:#121510}
input[type=checkbox]{vertical-align:middle;margin-right:6px}
input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none}
input[type=number]{-moz-appearance:textfield}
input:focus[type=text],input:focus[type=password],input:focus[type=number],input:focus[type=url],input:focus[type=email],input:focus[type=file],textarea:focus{background-color:#121510;border-color:#0072c6}
input:hover[type=button],input:hover[type=reset],input:hover[type=submit],button:hover,button:hover[type=button],a.button:hover{border-color:#0072c6;color:#b0b0b0}
input:active[type=button],input:active[type=reset],input:active[type=submit],button:active,button:active[type=button],a.button:active{border-color:#0072c6;box-shadow:none}
input[disabled],button[disabled],input:hover[type=button][disabled],input:hover[type=reset][disabled],input:hover[type=submit][disabled],button:hover[disabled],button:hover[type=button][disabled],input:active[type=button][disabled],input:active[type=reset][disabled],input:active[type=submit][disabled],button:active[disabled],button:active[type=button][disabled],textarea[disabled]{color:#808080;border-color:#808080;background-color:#383a34;opacity:0.5;cursor:default}
input:focus[type=text],input:focus[type=password],input:focus[type=number],input:focus[type=url],input:focus[type=email],input:focus[type=file],textarea:focus,.sweet-alert button:focus{background-color:#121510;border-color:#0072c6}
input:hover[type=button],input:hover[type=reset],input:hover[type=submit],button:hover,button:hover[type=button],a.button:hover,.sweet-alert button:hover{border-color:#0072c6;color:#b0b0b0;background-color:#121510!important}
input:active[type=button],input:active[type=reset],input:active[type=submit],button:active,button:active[type=button],a.button:active,.sweet-alert button:active{border-color:#0072c6;box-shadow:none}
input[disabled],button[disabled],input:hover[type=button][disabled],input:hover[type=reset][disabled],input:hover[type=submit][disabled],button:hover[disabled],button:hover[type=button][disabled],input:active[type=button][disabled],input:active[type=reset][disabled],input:active[type=submit][disabled],button:active[disabled],button:active[type=button][disabled],textarea[disabled],.sweet-alert button[disabled]{color:#808080;border-color:#808080;background-color:#383a34;opacity:0.5;cursor:default}
input::-webkit-input-placeholder{color:#00529b}
select{-webkit-appearance:none;font-family:clear-sans;font-size:1.3rem;min-width:188px;max-width:314px;padding:6px 14px 6px 6px;margin:0 10px 0 0;border:1px solid #606e7f;box-shadow:none;border-radius:0;color:#606e7f;background-color:transparent;background-image:linear-gradient(66.6deg, transparent 60%, #606e7f 40%),linear-gradient(113.4deg, #606e7f 40%, transparent 60%);background-position:calc(100% - 8px),calc(100% - 4px);background-size:4px 6px,4px 6px;background-repeat:no-repeat;outline:none;display:inline-block;cursor:pointer}
select option{color:#606e7f;background-color:#121510}

View File

@@ -22,16 +22,16 @@ i.control{cursor:pointer;color:#909090;font-size:1.8rem}
i.favo{display:none;font-size:1.8rem;position:absolute;margin-left:12px}
hr{border:none;height:1px!important;color:#e3e3e3;background-color:#e3e3e3}
input[type=text],input[type=password],input[type=number],input[type=url],input[type=email],input[type=date],input[type=file],textarea,.textarea{font-family:clear-sans;font-size:1.3rem;background-color:transparent;border:none;border-bottom:1px solid #1c1b1b;padding:4px 0;text-indent:0;min-height:2rem;line-height:2rem;outline:none;width:300px;margin:0 20px 0 0;box-shadow:none;border-radius:0;color:#1c1b1b}
input[type=button],input[type=reset],input[type=submit],button,button[type=button],a.button{font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:1.8px;text-transform:uppercase;min-width:86px;margin:10px 12px 10px 0;padding:8px;text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:none;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
input[type=button],input[type=reset],input[type=submit],button,button[type=button],a.button,.sweet-alert button{font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:1.8px;text-transform:uppercase;min-width:86px;margin:10px 12px 10px 0;padding:8px;text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:none;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
input[type=checkbox]{vertical-align:middle;margin-right:6px}
input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance: none}
input[type=number]{-moz-appearance:textfield}
input:focus[type=text],input:focus[type=password],input:focus[type=number],input:focus[type=url],input:focus[type=email],input:focus[type=file],textarea:focus{background-color:#e8e8e8;outline:0}
input:hover[type=button],input:hover[type=reset],input:hover[type=submit],button:hover,button:hover[type=button],a.button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
input:focus[type=text],input:focus[type=password],input:focus[type=number],input:focus[type=url],input:focus[type=email],input:focus[type=file],textarea:focus,.sweet-alert button:focus{background-color:#e8e8e8;outline:0}
input:hover[type=button],input:hover[type=reset],input:hover[type=submit],button:hover,button:hover[type=button],a.button:hover,.sweet-alert button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
input[disabled],textarea[disabled]{color:#1c1b1b;border-bottom-color:#a2a2a2;opacity:0.5;cursor:default}
input[type=button][disabled],input[type=reset][disabled],input[type=submit][disabled],button[disabled],button[type=button][disabled],a.button[disabled]
input:hover[type=button][disabled],input:hover[type=reset][disabled],input:hover[type=submit][disabled],button:hover[disabled],button:hover[type=button][disabled],a.button:hover[disabled]
input:active[type=button][disabled],input:active[type=reset][disabled],input:active[type=submit][disabled],button:active[disabled],button:active[type=button][disabled],a.button:active[disabled]{opacity:0.5;cursor:default;color:#808080;background:-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#404040),to(#404040)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#808080),to(#808080)) 100% 100% no-repeat;background:linear-gradient(90deg,#404040 0,#808080) 0 0 no-repeat,linear-gradient(90deg,#404040 0,#808080) 0 100% no-repeat,linear-gradient(0deg,#404040 0,#404040) 0 100% no-repeat,linear-gradient(0deg,#808080 0,#808080) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
input:active[type=button][disabled],input:active[type=reset][disabled],input:active[type=submit][disabled],button:active[disabled],button:active[type=button][disabled],a.button:active[disabled],.sweet-alert button[disabled]{opacity:0.5;cursor:default;color:#808080;background:-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#404040),to(#404040)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#808080),to(#808080)) 100% 100% no-repeat;background:linear-gradient(90deg,#404040 0,#808080) 0 0 no-repeat,linear-gradient(90deg,#404040 0,#808080) 0 100% no-repeat,linear-gradient(0deg,#404040 0,#404040) 0 100% no-repeat,linear-gradient(0deg,#808080 0,#808080) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
input::-webkit-input-placeholder{color:#486dba}
select{-webkit-appearance:none;font-family:clear-sans;font-size:1.3rem;min-width:166px;max-width:300px;padding:5px 8px 5px 0;text-indent:0;margin:0 10px 0 0;border:none;border-bottom:1px solid #1c1b1b;box-shadow:none;border-radius:0;color:#1c1b1b;background-color:transparent;background-image:linear-gradient(66.6deg, transparent 60%, #1c1b1b 40%),linear-gradient(113.4deg, #1c1b1b 40%, transparent 60%);background-position:calc(100% - 4px),100%;background-size:4px 6px,4px 6px;background-repeat:no-repeat;outline:none;display:inline-block;cursor:pointer}
select option{color:#1c1b1b;background-color:#e8e8e8}

View File

@@ -37,15 +37,11 @@ pre#swaltext{text-align:left;margin:0;padding:0;height:650px;white-space:normal;
.sweet-alert.show-input input{display:block}
.sweet-alert .sa-confirm-button-container{display:inline-block;position:relative}
.sweet-alert .la-ball-fall{position:absolute;left:50%;top:50%;margin-left:-27px;margin-top:4px;opacity:0;visibility:hidden}
.sweet-alert button{font-family:clear-sans;font-size:1.2rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;min-width:86px;margin:20px 12px 10px 0;padding:8px;text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
.sweet-alert button:focus{}
.sweet-alert button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
.sweet-alert button:active{}
.sweet-alert button.cancel{}
.sweet-alert button.cancel:hover{}
.sweet-alert button.cancel:active{}
.sweet-alert button.cancel:focus{box-shadow:rgba(197, 205, 211, 0.8) 0px 0px 2px, rgba(0, 0, 0, 0.0470588) 0px 0px 0px 1px inset !important}
.sweet-alert button[disabled]{cursor:default;color:#808080;background:-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#404040),to(#404040)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#808080),to(#808080)) 100% 100% no-repeat;background:linear-gradient(90deg,#404040 0,#808080) 0 0 no-repeat,linear-gradient(90deg,#404040 0,#808080) 0 100% no-repeat,linear-gradient(0deg,#404040 0,#404040) 0 100% no-repeat,linear-gradient(0deg,#808080 0,#808080) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
.sweet-alert button.confirm[disabled]{}
.sweet-alert button.confirm[disabled] ~ .la-ball-fall{opacity:1;visibility:visible;transition-delay:0s}
.sweet-alert button::-moz-focus-inner{border:0}