Merge pull request #1113 from bergware/master

Fixed: regression in syslog display
This commit is contained in:
tom mortensen
2022-06-14 08:40:59 -07:00
committed by GitHub
4 changed files with 15 additions and 27 deletions

View File

@@ -4,8 +4,8 @@ Icon="icon-diagnostics"
Tag="tv"
---
<?PHP
/* Copyright 2005-2021, Lime Technology
* Copyright 2012-2021, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, 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,31 +22,35 @@ $zip = htmlspecialchars(str_replace(' ','_',strtolower($var['NAME'])));
ul,li{margin:0;padding-top:0;padding-bottom:0}
pre.pre{margin:30px 0}
pre>p{margin:0;padding:0}
tt{display:inline-block;text-align:left;position:absolute;left:30px;margin-bottom:30px}
#command{white-space:normal;border:none}
.sweet-alert{width:900px;height:600px}
button.confirm{margin-top:70px}
</style>
<script>
var diagnosticsFile = "";
var file = "";
var diagnostic = new NchanSubscriber('/sub/diagnostic',{subscriber:'websocket'});
diagnostic.on('message', function(data) {
if (data) {
if (data == diagnosticsFile.replace("/","")+"FINISHED") {
diagnostic.stop();
swal.close();
location = diagnosticsFile;
setTimeout(function(){cleanUp(file);},4000);
setTimeout(cleanUp,4000);
} else {
$("#command").html(data);
}
}
});
function cleanUp(file) {
function cleanUp() {
if (document.hasFocus()) {
$.post('/webGui/include/Download.php',{cmd:'delete',file:file});
$.post('/webGui/include/Download.php',{cmd:'delete',file:diagnosticsFile});
$("#download").attr("disabled",false);
} else {
setTimeout(function(){cleanUp(file);},2000);
setTimeout(cleanUp,2000);
}
}
@@ -61,19 +65,10 @@ function diagnostics(file) {
$.post('/webGui/include/Download.php',{cmd:'diag',file:file,anonymize:anonymize},function(zip) {
diagnosticsFile = zip;
diagnostic.start();
swal({
title: "_(Downloading)_...",
text: "/boot/logs"+zip+"<br><br><tt style='display:inline-block;text-align:left'><span id='command'></span></tt>",
allowOutsideClick: false,
showConfirmButton: false,
showCancelButton: false,
type: "info",
html: true
});
swal({title:"_(Downloading)_...",text:"/boot/logs"+zip+"<br><br><tt><pre id='command'></pre></tt>",html:true,type:"info",confirmButtonText:"_(Close)_"});
});
}
</script>
<div id="pleaseWait" style="display:none;font-weight:bold;color:red;text-align:center;margin:0">_(Please wait)_... _(collecting diagnostic information (this may take several minutes))_</div>
:diagnostics_1_plug:
This utility is used for troubleshooting purposes. It will collect all of the system information and configuration files, and package these files in a single ZIP file which can be saved locally.
Subsequently, this file can be included in your correspondence with Limetech or the Unraid forum.

View File

@@ -34,13 +34,6 @@ if (file_exists($cfg)) {
$select = implode($select);
?>
<style>
span.text{display:block}
span.error{display:block}
span.warn{display:block}
span.system{display:block}
span.array{display:block}
span.login{display:block}
span.label{display:inline}
input#max{border:none;width:60px;margin:0;padding:0}
</style>
<script>

View File

@@ -28,7 +28,7 @@ foreach ($logs as $log) {
$span = '<span class="'.$type['class'].'">';
break 2;
}
echo $span,htmlspecialchars(rtrim($line,"\n")),"</span>";
echo $span,htmlspecialchars($line),"</span>";
}
fclose($fh);
}

View File

@@ -25,13 +25,13 @@ if (mdstat('mdResyncPos')>0 && substr(mdstat('mdResyncAction'),0,7)=='check P')
if (mdstat('mdResync')>0) {
if (!file_exists($stamps)) file_put_contents($stamps,mdstat('sbSynced'));
file_put_contents($stamps,','.time(),FILE_APPEND);
exec("$mdcmd nocheck pause");
exec("$mdcmd cmdCheckPause");
}
break;
case 'resume':
if (mdstat('mdResync')==0) {
file_put_contents($stamps,','.time(),FILE_APPEND);
exec("$mdcmd check resume");
exec("$mdcmd cmdCheckResume");
}
break;
}