Remove refresh button and refresh timer (force real-time)

This commit is contained in:
bergware
2017-05-27 12:07:21 +02:00
parent cb116c0dbf
commit 55cb5ce9c6
13 changed files with 53 additions and 91 deletions
+3 -5
View File
@@ -2,9 +2,9 @@ Menu="UPSsettings"
Title="UPS Details"
---
<?PHP
/* Copyright 2005-2016, Lime Technology
/* Copyright 2005-2017, Lime Technology
* Copyright 2012-2017, Bergware International.
* Copyright 2015, Dan Landon.
* Copyright 2015, 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,9 +22,7 @@ function getUPSstatus() {
$('#ups_summary').html(data[0]);
$('#ups_status').html(data[1]);
}
<?if ($update):?>
setTimeout(getUPSstatus,<?=max(abs($display['refresh']),15000)?>);
<?endif;?>
setTimeout(getUPSstatus,15000);
});
}
$(getUPSstatus);
+3 -5
View File
@@ -3,9 +3,9 @@ Title="UPS Summary"
Cond="file_exists('/var/run/apcupsd.pid')"
---
<?PHP
/* Copyright 2005-2016, Lime Technology
/* Copyright 2005-2017, Lime Technology
* Copyright 2012-2017, Bergware International.
* Copyright 2015, Dan Landon.
* Copyright 2015, 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,
@@ -23,9 +23,7 @@ table.ups tbody tr td{padding-left:10px;font-weight:bold;}
function getUPSstatus() {
$.get('/plugins/dynamix.apcupsd/include/UPSstatus.php',{all:'false'},function(data) {
if (data) $('#ups_summary').html(data);
<?if ($update):?>
setTimeout(getUPSstatus, <?=max(abs($display['refresh']),15000)?>);
<?endif;?>
setTimeout(getUPSstatus,15000);
});
}
$(getUPSstatus);
+7 -7
View File
@@ -2,8 +2,8 @@ Menu="Main:1"
Title="Array Devices"
---
<?PHP
/* Copyright 2005-2016, Lime Technology
* Copyright 2012-2016, Bergware International.
/* Copyright 2005-2017, Lime Technology
* Copyright 2012-2017, 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,
@@ -38,16 +38,16 @@ function array_status() {
var diskio = $.cookie('diskio')===undefined ? 0 : 1;
$.post('/webGui/include/DeviceList.php',{path:'<?=$path?>',device:'array'},function(data) {
if (data) {$('#array_devices').html(data); display_diskio();}
<?if ($update && $var['fsState']=='Started'):?>
<?if ($var['fsState']=='Started'):?>
<?if ($tabbed):?>
if ($('#tab1').is(':checked')) timer = setTimeout(array_status,<?=abs($display['refresh'])?>);
if ($('#tab1').is(':checked')) timer = setTimeout(array_status,3000);
<?else:?>
setTimeout(array_status,<?=abs($display['refresh'])?>);
setTimeout(array_status,3000);
<?endif;?>
<?endif;?>
});
}
<?if ($update && $var['fsState']=='Started' && $tabbed):?>
<?if ($var['fsState']=='Started' && $tabbed):?>
$('#tab1').bind({click:function() {clearTimeout(timer); array_status(); $('i.toggle').show('slow');}});
<?else:?>
$('#tab1').bind({click:function() {$('i.toggle').show('slow');}});
@@ -56,7 +56,7 @@ $('#tab1').bind({click:function() {$('i.toggle').show('slow');}});
array_status();
</script>
<table class="disk_status <?=($var['fsState']=='Stopped'?'small':$display['view']).' '.$display['align']?>">
<table class="disk_status">
<thead><tr><td>Device</td><td>Identification</td><td>Temp.</td><td>Reads</td><td>Writes</td><td>Errors</td><td>FS</td><td>Size</td><td>Used</td><td>Free</td><td>View</td></tr></thead>
<tbody id="array_devices">
<?
+7 -15
View File
@@ -2,8 +2,8 @@ Menu="Main:5"
Title="Array Operation"
---
<?PHP
/* Copyright 2005-2016, Lime Technology
* Copyright 2012-2016, Bergware International.
/* Copyright 2005-2017, Lime Technology
* Copyright 2012-2017, 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,
@@ -45,18 +45,16 @@ function tab0() {
function parity_status() {
$.post('/webGui/include/DeviceList.php',{path:'<?=$path?>',device:'parity'},function(data) {
if (data) {$.each(data.split(';'),function(k,v) {if ($('#line'+k).length>0) $('#line'+k).html(v);});}
<?if ($update):?>
<?if ($tabbed):?>
if ($('#tab'+$('input[name$="tabs"]').length).is(':checked')) timer = setTimeout(parity_status,<?=abs($display['refresh'])?>);
if ($('#tab'+$('input[name$="tabs"]').length).is(':checked')) timer = setTimeout(parity_status,3000);
<?else:?>
setTimeout(parity_status,<?=abs($display['refresh'])?>);
setTimeout(parity_status,3000);
<?endif;?>
if (!data && $('#cancelButton').length>0 && $('#cancelButton').val()=='Cancel') {
$('#cancelButton').val('Done').unbind().bind({click:function(){refresh();}});
$('#cancelText').html('');
$('#line4').html('completed');
}
<?endif;?>
});
}
function parity_warning(form) {
@@ -100,13 +98,10 @@ parity_status();
<?if ($tabbed):?>
$('.tabs').append(ctrl);
<?else:?>
$('div[id=title]:not(":last, .disable_diskio")').each(function(){$(this).append(ctrl);});
<?endif;?>
<?if ($update):?>
<?if ($tabbed):?>
if ($.cookie('tab')=='tab0') $('i.toggle').hide();
$('#tab'+$('input[name$="tabs"]').length).bind({click:function() {clearTimeout(timer); parity_status(); tab0(); $('i.toggle').hide('slow');}});
<?else:?>
$('div[id=title]:not(":last, .disable_diskio")').each(function(){$(this).append(ctrl);});
<?endif;?>
<?if (substr($var['fsState'],-3)=='ing'):?>
function reload_page() {
@@ -120,16 +115,13 @@ function reload_page() {
break;
default:
if (data) $('#fsState').html(data);
setTimeout(reload_page,<?=abs($display['refresh'])?>);
setTimeout(reload_page,3000);
break;
}
});
}
reload_page();
<?endif;?>
<?else:?>
$('#tab'+$('input[name$="tabs"]').length).bind({click:function() {tab0(); $('i.toggle').hide('slow');}});
<?endif;?>
$('.tooltip_diskio').tooltipster({delay:100, trigger:'custom', triggerOpen:{mouseenter: true}, triggerClose:{click:false,scroll:true,mouseleave:true}});
toggle_diskio(true);
</script>
+7 -7
View File
@@ -2,8 +2,8 @@ Menu="Main:3"
Title="Boot Device"
---
<?PHP
/* Copyright 2005-2016, Lime Technology
* Copyright 2012-2016, Bergware International.
/* Copyright 2005-2017, Lime Technology
* Copyright 2012-2017, 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,
@@ -17,16 +17,16 @@ Title="Boot Device"
function boot_status() {
$.post('/webGui/include/DeviceList.php',{path:'<?=$path?>',device:'flash'},function(data) {
if (data) {$('#boot_device').html(data); display_diskio();}
<?if ($update && $var['fsState']=='Started'):?>
<?if ($var['fsState']=='Started'):?>
<?if ($tabbed):?>
if ($('#tab3').is(':checked')) timer = setTimeout(boot_status,<?=abs($display['refresh'])?>);
if ($('#tab3').is(':checked')) timer = setTimeout(boot_status,3000);
<?else:?>
setTimeout(boot_status,<?=abs($display['refresh'])?>);
setTimeout(boot_status,3000);
<?endif;?>
<?endif;?>
});
}
<?if ($update && $var['fsState']=='Started' && $tabbed):?>
<?if ($var['fsState']=='Started' && $tabbed):?>
$('#tab3').bind({click:function() {clearTimeout(timer); boot_status(); $('i.toggle').show('slow');}});
<?else:?>
$('#tab3').bind({click:function() {$('i.toggle').show('slow');}});
@@ -35,7 +35,7 @@ $('#tab3').bind({click:function() {$('i.toggle').show('slow');}});
boot_status();
</script>
<table class="disk_status <?=($var['fsState']=='Stopped'?'small':$display['view']).' '.$display['align']?>">
<table class="disk_status">
<thead><tr><td>Device</td><td>Identification</td><td>Temp.</td><td>Reads</td><td>Writes</td><td>Errors</td><td>FS</td><td>Size</td><td>Used</td><td>Free</td><td>View</td></tr></thead>
<tbody id="boot_device">
<?if (isset($disks['flash'])) echo "<tr><td colspan='11'>&nbsp;</td></tr>";?>
+7 -7
View File
@@ -3,8 +3,8 @@ Title="Cache Devices"
Cond="($var['fsState']=='Stopped' || $var['cacheSbNumDisks'])"
---
<?PHP
/* Copyright 2005-2016, Lime Technology
* Copyright 2012-2016, Bergware International.
/* Copyright 2005-2017, Lime Technology
* Copyright 2012-2017, 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,
@@ -18,16 +18,16 @@ Cond="($var['fsState']=='Stopped' || $var['cacheSbNumDisks'])"
function cache_status() {
$.post('/webGui/include/DeviceList.php',{path:'<?=$path?>',device:'cache'},function(data) {
if (data) {$('#cache_device').html(data); display_diskio();}
<?if ($update && $var['fsState']=='Started'):?>
<?if ($var['fsState']=='Started'):?>
<?if ($tabbed):?>
if ($('#tab2').is(':checked')) timer = setTimeout(cache_status,<?=abs($display['refresh'])?>);
if ($('#tab2').is(':checked')) timer = setTimeout(cache_status,3000);
<?else:?>
setTimeout(cache_status,<?=abs($display['refresh'])?>);
setTimeout(cache_status,3000);
<?endif;?>
<?endif;?>
});
}
<?if ($update && $var['fsState']=='Started' && $tabbed):?>
<?if ($var['fsState']=='Started' && $tabbed):?>
$('#tab2').bind({click:function() {clearTimeout(timer); cache_status(); $('i.toggle').show('slow');}});
<?else:?>
$('#tab2').bind({click:function() {$('i.toggle').show('slow');}});
@@ -36,7 +36,7 @@ $('#tab2').bind({click:function() {$('i.toggle').show('slow');}});
cache_status();
</script>
<table class="disk_status <?=($var['fsState']=='Stopped'?'small':$display['view']).' '.$display['align']?>">
<table class="disk_status">
<thead><tr><td>Device</td><td>Identification</td><td>Temp.</td><td>Reads</td><td>Writes</td><td>Errors</td><td>FS</td><td>Size</td><td>Used</td><td>Free</td><td>View</td></tr></thead>
<tbody id="cache_device">
<?
+2 -5
View File
@@ -2,8 +2,8 @@ Menu="Dashboard"
Title="Statistics"
---
<?PHP
/* Copyright 2005-2016, Lime Technology
* Copyright 2012-2016, Bergware International.
/* Copyright 2005-2017, Lime Technology
* Copyright 2012-2017, 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,
@@ -546,9 +546,6 @@ $(function() {
update60();
update30();
update15();
<?if ($display['refresh']==0 || ($display['refresh']<0 && $var['mdResync']>0)):?>
$('.tabs').append("<span class='status vhshift'><input type='button' value='Refresh' onclick='refresh()'></span>");
<?endif;?>
context.init({preventDoubleContext:false});
var cpuload_sub = new NchanSubscriber('/sub/cpuload');
+4 -6
View File
@@ -2,9 +2,9 @@ Menu="UNRAID-OS"
Title="Archived Notifications"
---
<?PHP
/* Copyright 2012, Andrew Hamer-Adams, http://www.pixeleyes.co.nz.
* Copyright 2005-2016, Lime Technology
* Copyright 2012-2016, Bergware International.
/* Copyright 2005-2017, Lime Technology
* Copyright 2012-2017, Bergware International.
* Copyright 2012, Andrew Hamer-Adams, http://www.pixeleyes.co.nz.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -53,9 +53,7 @@ function archiveList(init) {
}
$('#archive_list .expand-child td').hide();
for (var i = 0; i < rows.length; i++) $('#archive_list .expand-child.row'+rows[i]+' td').show();
<?if ($update):?>
setTimeout(archiveList,<?=max(abs($display['refresh']),30000)?>);
<?endif;?>
setTimeout(archiveList,30000);
});
}
function askConfirmation() {
+7 -7
View File
@@ -3,8 +3,8 @@ Title="Unassigned Devices"
Cond="((count($devs)>0)&&($var['fsState']=='Started'))"
---
<?PHP
/* Copyright 2012-2016, Bergware International.
* Copyright 2005-2016, Lime Technology
/* Copyright 2005-2017, Lime Technology
* Copyright 2012-2017, 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,
@@ -21,16 +21,16 @@ $tabX = '#tab'.($var['fsState']=='Stopped'||is_dir('/mnt/cache') ? '4' : '3');
function open_status() {
$.post('/webGui/include/DeviceList.php',{path:'<?=addslashes(htmlspecialchars($path))?>',device:'open'},function(data) {
if (data) {$('#open_devices').html(data); display_diskio();}
<?if ($update && $var['fsState']=='Started'):?>
<?if ($var['fsState']=='Started'):?>
<?if ($tabbed):?>
if ($('<?=$tabX?>').is(':checked')) timer = setTimeout(open_status,<?=abs($display['refresh'])?>);
if ($('<?=$tabX?>').is(':checked')) timer = setTimeout(open_status,3000);
<?else:?>
setTimeout(open_status,<?=abs($display['refresh'])?>);
setTimeout(open_status,3000);
<?endif;?>
<?endif;?>
});
}
<?if ($update && $var['fsState']=='Started' && $tabbed):?>
<?if ($var['fsState']=='Started' && $tabbed):?>
$('<?=$tabX?>').bind({click:function() {clearTimeout(timer); open_status(); $('i.toggle').show('slow');}});
<?else:?>
$('<?=$tabX?>').bind({click:function() {$('i.toggle').show('slow');}});
@@ -39,7 +39,7 @@ $('<?=$tabX?>').bind({click:function() {$('i.toggle').show('slow');}});
open_status();
</script>
<table class="disk_status <?=($var['fsState']=='Stopped'?'small':$display['view']).' '.$display['align']?>">
<table class="disk_status">
<thead><tr><td>Device</td><td>Identification</td><td>Temp.</td><td>Reads</td><td>Writes</td><td>Errors</td><td>FS</td><td>Size</td><td>Used</td><td>Free</td><td>View</td></tr></thead>
<tbody id="open_devices">
<?
+1 -3
View File
@@ -29,9 +29,7 @@ function deleteRoute(button,gateway,route) {
function routeTable() {
$.post('/webGui/include/RoutingTable.php',{task:'update'},function(data){
if (data) $('#route_list').html(data);
<?if ($update):?>
timers.routeTable = setTimeout(routeTable,<?=max(abs($display['refresh']),10000)?>);
<?endif;?>
timers.routeTable = setTimeout(routeTable,10000);
});
}
function resetTable() {
-3
View File
@@ -7,8 +7,6 @@ time="%R"
number=".,"
unit="C"
scale="-1"
align="right"
view=""
resize="0"
wwn="0"
total="1"
@@ -23,7 +21,6 @@ critical="90"
hot="45"
max="55"
theme="white"
refresh="3000"
[parity]
mode="0"
hour="0 0"
+2 -18
View File
@@ -1,6 +1,6 @@
<?PHP
/* Copyright 2005-2016, Lime Technology
* Copyright 2012-2016, Bergware International.
/* Copyright 2005-2017, Lime Technology
* Copyright 2012-2017, 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,
@@ -46,10 +46,6 @@ var uptime = <?=strtok(exec("cat /proc/uptime"),' ')?>;
var expiretime = <?=$var['regTy']=='Trial'||strstr($var['regTy'],'expired')?$var['regTm2']:0?>;
var before = new Date();
// Page refresh timer
var update = <?=abs($display['refresh'])/1000?>;
var counting = update;
// page timer events
var timers = {};
@@ -172,7 +168,6 @@ function showNotice(data,plugin) {
else
var href = "href=\"/Plugins\"";
$('#user-notice').html(data.replace(/<a>(.*?)<\/a>/,"<a "+href+">$1</a>"));
if (timers.countDown) {clearTimeout(timers.countDown);$('#countdown').html('');}
}
function notifier() {
var tub1 = 0, tub2 = 0, tub3 = 0;
@@ -204,9 +199,7 @@ function notifier() {
if (tub2) $('#box-tub2').removeClass('grey-text').addClass('orange-text'); else $('#box-tub2').removeClass('orange-text').addClass('grey-text');
if (tub3) $('#box-tub3').removeClass('grey-text').addClass('green-text'); else $('#box-tub3').removeClass('green-text').addClass('grey-text');
<?endif;?>
<?if ($update):?>
timers.notifier = setTimeout(notifier,5000);
<?endif;?>
});
}
function digits(number) {
@@ -246,20 +239,11 @@ function closeNotifier(filter) {
function viewHistory(filter) {
location.replace('/Tools/NotificationsArchive?filter='+filter);
}
function countDown() {
counting--;
if (counting==0) counting = update;
$('#countdown').html('<small>Page refresh in '+counting+' sec</small>');
timers.countDown = setTimeout(countDown,1000);
}
$(function() {
var tab = $.cookie('one')||$.cookie('tab')||'tab1';
if (tab=='tab0') tab = 'tab'+$('input[name$="tabs"]').length; else if ($('#'+tab).length==0) {initab(); tab = 'tab1';}
if ($.cookie('help')=='help') {$('.inline_help').show(); $('#nav-item.HelpButton').addClass('active');}
$('#'+tab).attr('checked', true);
<?if ($update):?>
if (update>3) timers.countDown = setTimeout(countDown,1000);
<?endif;?>
updateTime();
$.jGrowl.defaults.closeTemplate = '<i class="fa fa-share"></i>';
$.jGrowl.defaults.closerTemplate = '<?=$notify['position'][0]=='b' ? '<div>':'<div class="top">'?>[ close all notifications ]</div>';
+3 -3
View File
@@ -1,6 +1,6 @@
<?PHP
/* Copyright 2005-2016, Lime Technology
* Copyright 2012-2016, Bergware International.
/* Copyright 2005-2017, Lime Technology
* Copyright 2012-2017, 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,
@@ -67,7 +67,7 @@ foreach (glob('plugins/*', GLOB_ONLYDIR) as $plugin) {
// Here's the page we're rendering
$myPage = $site[basename($path)];
$pageroot = $docroot.'/'.dirname($myPage['file']);
$update = $display['refresh']>0 || ($display['refresh']<0 && $var['mdResync']==0);
$update = true; // set for legacy
// Giddyup
require_once "$docroot/webGui/include/DefaultPageLayout.php";