Merge branch 'master' of github.com:limetech/webgui

This commit is contained in:
Tom Mortensen
2022-01-17 15:35:47 -08:00
6 changed files with 19 additions and 12 deletions
@@ -160,7 +160,7 @@ dockerload.on('message', function(msg){
}
});
dockerload.on('error', function(code,error) {
swal({title:"Docker Nchan execution error", text:code+'<br>'+error, type:"warning", html:true, confirmButtonText:"_(Ok)_"});
swal({title:"_(Nchan communication error)_", text:"_(Please reload page)_", type:"warning", html:true, confirmButtonText:"_(Ok)_"});
});
$(function() {
$('.advancedview').switchButton({labels_placement:'left', on_label:"_(Advanced View)_", off_label:"_(Basic View)_", checked:$.cookie('docker_listview_mode')=='advanced'});
+5 -4
View File
@@ -20,6 +20,7 @@ $keyfile = file_exists($var['luksKeyfile']);
$missing = file_exists('/var/tmp/missing.tmp');
$encrypt = false;
$activeP = $var['mdResyncPos']>0;
/* only one of $present, $missing, or $wrong will be true, or all will be false */
$forced = $present = $wrong = false;
foreach ($disks as $disk) {
@@ -261,7 +262,7 @@ $parity = $activeP ? "<br><small>_(Disabled)_ -- _(Parity operation is running)_
$mover = file_exists('/var/run/mover.pid') ? "<br><small>_(Disabled)_ -- _(Mover is running)_</small>" : "";
$btrfs = exec('pgrep -cf /sbin/btrfs') ? "<br><small>_(Disabled)_ -- _(BTRFS operation is running)_</small>" : "";
?>
var devices = new NchanSubscriber('/sub/devices<?=$activeP?",parity":""?>',{subscriber:'websocket',reconnect:'persist'});
var devices = new NchanSubscriber('/sub/devices<?=$activeP?",parity":""?>',{subscriber:'websocket'});
devices.on('message', function(msg,meta) {
switch (<?if ($activeP):?>meta.id.channel()<?else:?>0<?endif;?>) {
case 0:
@@ -295,7 +296,7 @@ devices.on('message', function(msg,meta) {
}
});
devices.on('error', function(code,error) {
swal({title:"Devices Nchan execution error", text:code+'<br>'+error, type:"warning", html:true, confirmButtonText:"_(Ok)_"});
swal({title:"_(Nchan communication error)_", text:"_(Please reload page)_", type:"warning", html:true, confirmButtonText:"_(Ok)_"});
});
<?if ($var['fsState']=='Stopped'):?>
devices.on('connect', function(e) {
@@ -306,12 +307,12 @@ devices.start();
<?if ($activeP):?>
setTimeout(function(){$('#pauseButton').prop('disabled',false);$('#cancelButton').prop('disabled',false);},250);
<?else:?>
var monitor = new NchanSubscriber('/sub/monitor',{subscriber:'websocket',reconnect:'persist'});
var monitor = new NchanSubscriber('/sub/monitor',{subscriber:'websocket'});
monitor.on('message', function(msg) {
if (msg > 0) refresh();
});
monitor.on('error', function(code,error) {
swal({title:"Monitor Nchan execution error", text:code+'<br>'+error, type:"warning", html:true, confirmButtonText:"_(Ok)_"});
swal({title:"_(Nchan communication error)_", text:"_(Please reload page)_", type:"warning", html:true, confirmButtonText:"_(Ok)_"});
});
setTimeout(function(){monitor.start();},2500);
<?endif;?>
+4 -4
View File
@@ -1009,7 +1009,7 @@ function setColor(l, t1, t2) {
default: return '';}
}
var dashboard = new NchanSubscriber('/sub/cpuload,update1,update2,update3<?=$wireguard?",wireguard":""?>',{subscriber:'websocket',reconnect:'persist'});
var dashboard = new NchanSubscriber('/sub/cpuload,update1,update2,update3<?=$wireguard?",wireguard":""?>',{subscriber:'websocket'});
dashboard.on('message',function(msg,meta) {
switch (meta.id.channel()) {
case 0:
@@ -1126,11 +1126,11 @@ dashboard.on('message',function(msg,meta) {
}
});
dashboard.on('error', function(code,error) {
swal({title:"Dashboard Nchan execution error", text:code+'<br>'+error, type:"warning", html:true, confirmButtonText:"_(Ok)_"});
swal({title:"_(Nchan communication error)_", text:"_(Please reload page)_", type:"warning", html:true, confirmButtonText:"_(Ok)_"});
});
<?if ($apcupsd):?>
var apcups = new NchanSubscriber('/sub/apcups',{subscriber:'websocket',reconnect:'persist'});
var apcups = new NchanSubscriber('/sub/apcups',{subscriber:'websocket'});
apcups.on('message',function(d) {
var data = d.replace(/<\/?tr>/g,'').replace(/<td/g,'<span').replace(/td>/g,'span>;').split(';');
$('#ups_status').html(data[0]);
@@ -1140,7 +1140,7 @@ apcups.on('message',function(d) {
$('#ups_loadpct').html(data[5].replace('Percent','%')+' - '+data[4]);
});
apcups.on('error', function(code,error) {
swal({title:"APC-UPS Nchan execution error", text:code+'<br>'+error, type:"warning", html:true, confirmButtonText:"_(Ok)_"});
swal({title:"_(Nchan communication error)_", text:"_(Please reload page)_", type:"warning", html:true, confirmButtonText:"_(Ok)_"});
});
<?endif;?>
+3
View File
@@ -395,6 +395,9 @@ watchDHCP.on('message', function(data) {
}
}
});
watchDHCP.on('error', function(code,error) {
swal({title:"_(Nchan communication error)_", text:"_(Please reload page)_", type:"warning", html:true, confirmButtonText:"_(Ok)_"});
});
$(function() {
var ctrl = "<span id='wait_eth0' class='status vshift red-text' style='display:none;font-size:1.2rem;font-style:italic'><i class='fa fa-spinner fa-spin'></i> _(Please wait)_... _(configuring interface)_</span>";
var form = document.eth0_settings;
+3
View File
@@ -1081,6 +1081,9 @@ statistics.on('message', function(data) {
$('span[class^="rx-'+vtun+'"]').text('---');
}
});
statistics.on('error', function(code,error) {
swal({title:"_(Nchan communication error)_", text:"_(Please reload page)_", type:"warning", html:true, confirmButtonText:"_(Ok)_"});
});
$(function(){
var form = $(document.wg0);
@@ -597,7 +597,7 @@ function parseINI(data){
// unraid animated logo
var unraid_logo = '<?readfile("$docroot/webGui/images/animated-logo.svg")?>';
var defaultPage = new NchanSubscriber('/sub/session,var<?=$entity?",notify":""?>',{subscriber:'websocket',reconnect:'persist'});
var defaultPage = new NchanSubscriber('/sub/session,var<?=$entity?",notify":""?>',{subscriber:'websocket'});
defaultPage.on('message', function(msg,meta) {
switch (meta.id.channel()) {
case 0:
@@ -627,7 +627,7 @@ defaultPage.on('message', function(msg,meta) {
else if (ini['mdResyncAction'].indexOf("check")>=0) action = "<?=_('Parity-Check')?>";
action += " "+(ini['mdResyncPos']/(ini['mdResyncSize']/100+1)).toFixed(1)+" %";
status += "&bullet;<span class='orange strong'>"+action.replace('.','<?=$display['number'][0]?>');
if (ini['mdResync']==0) status += " &bullet; <?=_('Paused')?>";
if (ini['mdResyncDt']==0) status += " &bullet; <?=_('Paused')?>";
status += "</span>";
}
if (progress) status += "&bullet;<span class='blue strong'>"+_(progress)+"</span>";
@@ -668,7 +668,7 @@ defaultPage.on('message', function(msg,meta) {
}
});
defaultPage.on('error', function(code,error) {
swal({title:"Default Page Nchan execution error", text:code+'<br>'+error, type:"warning", html:true, confirmButtonText:"_(Ok)_"});
swal({title:"<?=_('Nchan communication error')?>", text:"<?=_('Please reload page')?>", type:"warning", html:true, confirmButtonText:"<?=_('Ok')?>"});
});
var backtotopoffset = 250;