Nchan: simplified error reporting

This commit is contained in:
bergware
2022-01-18 13:37:37 +01:00
parent a7774d5b82
commit 65af74e84f
6 changed files with 1 additions and 23 deletions
@@ -159,9 +159,6 @@ dockerload.on('message', function(msg){
$('#cpu-'+id[0]).css('width',w1);
}
});
dockerload.on('error', function(code,error) {
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'});
$('.advancedview').change(function(){
-6
View File
@@ -295,9 +295,6 @@ devices.on('message', function(msg,meta) {
break;
}
});
devices.on('error', function(code,error) {
swal({title:"_(Nchan communication error)_", text:"_(Please reload page)_", type:"warning", html:true, confirmButtonText:"_(Ok)_"});
});
<?if ($var['fsState']=='Stopped'):?>
devices.on('connect', function(e) {
setTimeout(function(){devices.stop();},1000);
@@ -311,9 +308,6 @@ 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:"_(Nchan communication error)_", text:"_(Please reload page)_", type:"warning", html:true, confirmButtonText:"_(Ok)_"});
});
setTimeout(function(){monitor.start();},2500);
<?endif;?>
-7
View File
@@ -1125,10 +1125,6 @@ dashboard.on('message',function(msg,meta) {
break;
}
});
dashboard.on('error', function(code,error) {
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'});
apcups.on('message',function(d) {
@@ -1139,9 +1135,6 @@ apcups.on('message',function(d) {
$('#ups_nompower').html(data[3]);
$('#ups_loadpct').html(data[5].replace('Percent','%')+' - '+data[4]);
});
apcups.on('error', function(code,error) {
swal({title:"_(Nchan communication error)_", text:"_(Please reload page)_", type:"warning", html:true, confirmButtonText:"_(Ok)_"});
});
<?endif;?>
var sortableHelper = function(e,ui){
-3
View File
@@ -395,9 +395,6 @@ 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,9 +1081,6 @@ 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);
@@ -668,7 +668,7 @@ defaultPage.on('message', function(msg,meta) {
}
});
defaultPage.on('error', function(code,error) {
swal({title:"<?=_('Nchan communication error')?>", text:"<?=_('Please reload page')?>", type:"warning", html:true, confirmButtonText:"<?=_('Ok')?>"});
swal({title:"<?=_('Nchan communication error')?>", text:"<?=_('Page will be reloaded')?>", type:"warning", html:true, confirmButtonText:"<?=_('Ok')?>"},function(){setTimeout(refresh,50);});
});
var backtotopoffset = 250;