diff --git a/plugins/dynamix/ArrayDevices.page b/plugins/dynamix/ArrayDevices.page
index a91db041a..306552862 100644
--- a/plugins/dynamix/ArrayDevices.page
+++ b/plugins/dynamix/ArrayDevices.page
@@ -2,8 +2,8 @@ Menu="Main:1"
Title="Array Devices"
---
',device:'array'},function(data) {
if (data) $('#array_devices').html(data);
-0 || ($display['refresh']<0 && $var['mdResync']==0)) && $var['fsState']=='Started'):?>
+
if ($('#tab1').is(':checked')) timer = setTimeout(array_status,=abs($display['refresh'])?>);
@@ -28,7 +28,7 @@ function array_status() {
});
}
-0 || ($display['refresh']<0 && $var['mdResync']==0)) && $var['fsState']=='Started' && $display['tabs']==0):?>
+
$('#tab1').bind({click:function() {clearTimeout(timer); array_status();}});
diff --git a/plugins/dynamix/ArrayOperation.page b/plugins/dynamix/ArrayOperation.page
index 93c46a68f..81fec2b41 100644
--- a/plugins/dynamix/ArrayOperation.page
+++ b/plugins/dynamix/ArrayOperation.page
@@ -2,8 +2,8 @@ Menu="Main:5"
Title="Array Operation"
---
-
function maintenance_mode() {
echo "
";
@@ -42,7 +41,7 @@ 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);});}
-0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
+
if ($('#tab'+$('input[name$="tabs"]').length).is(':checked')) timer = setTimeout(parity_status,=abs($display['refresh'])?>);
@@ -58,7 +57,7 @@ function parity_status() {
}
parity_status();
-0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
+
$('#tab'+$('input[name$="tabs"]').length).bind({click:function() {clearTimeout(timer); parity_status(); tab0();}});
diff --git a/plugins/dynamix/BootDevice.page b/plugins/dynamix/BootDevice.page
index 804e967b9..1d65439de 100644
--- a/plugins/dynamix/BootDevice.page
+++ b/plugins/dynamix/BootDevice.page
@@ -2,8 +2,8 @@ Menu="Main:3"
Title="Boot Device"
---
',device:'flash'},function(data) {
if (data) $('#boot_device').html(data);
-0 || ($display['refresh']<0 && $var['mdResync']==0)) && $var['fsState']=='Started'):?>
+
if ($('#tab3').is(':checked')) timer = setTimeout(boot_status,=abs($display['refresh'])?>);
@@ -26,7 +26,7 @@ function boot_status() {
});
}
-0 || ($display['refresh']<0 && $var['mdResync']==0)) && $var['fsState']=='Started' && $display['tabs']==0):?>
+
$('#tab3').bind({click:function() {clearTimeout(timer); boot_status();}});
diff --git a/plugins/dynamix/CacheDevices.page b/plugins/dynamix/CacheDevices.page
index 1e779d057..440023c05 100644
--- a/plugins/dynamix/CacheDevices.page
+++ b/plugins/dynamix/CacheDevices.page
@@ -3,8 +3,8 @@ Title="Cache Devices"
Cond="($var['fsState']=='Stopped' || $var['cacheSbNumDisks'])"
---
',device:'cache'},function(data) {
if (data) $('#cache_device').html(data);
-0 || ($display['refresh']<0 && $var['mdResync']==0)) && $var['fsState']=='Started'):?>
+
if ($('#tab2').is(':checked')) timer = setTimeout(cache_status,=abs($display['refresh'])?>);
@@ -27,7 +27,7 @@ function cache_status() {
});
}
-0 || ($display['refresh']<0 && $var['mdResync']==0)) && $var['fsState']=='Started' && $display['tabs']==0):?>
+
$('#tab2').bind({click:function() {clearTimeout(timer); cache_status();}});
diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page
index 1e11ad88d..87a0528d8 100644
--- a/plugins/dynamix/DashStats.page
+++ b/plugins/dynamix/DashStats.page
@@ -13,7 +13,6 @@ Title="Statistics"
* all copies or substantial portions of the Software.
*/
?>
-
exec('cat /sys/devices/system/cpu/*/topology/thread_siblings_list|sort -nu', $cores);
$fans = exec("sensors -uA 2>/dev/null|grep -c 'fan[0-9]_input'");
@@ -391,7 +390,7 @@ function update3() {
$.post('=$url?>',{cmd:'cpu'},function(data) {
if (data) $.each(data.split('#'),function(k,v) {$('#cpu'+k).html(v);});
-0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
+
setTimeout(update3,=max(abs($display['refresh']),3000)?>);
});
@@ -417,7 +416,7 @@ function update30() {
if (view == 'alert') opts.push({text:'Acknowledge',icon:'fa-check-square-o',action:function(e){e.preventDefault();acknowledge(disk);}});
context.attach(id,opts);
});
-0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
+
timer30 = setTimeout(update30,=max(abs($display['refresh']),30000)?>);
});
@@ -426,7 +425,7 @@ function update60() {
0):?>
$.post('=$url?>',{cmd:'parity'},function(data) {
if (data) $('#parity').html(data);
-0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
+
setTimeout(update60,=max(abs($display['refresh']),60000)?>);
});
diff --git a/plugins/dynamix/NotificationsArchive.page b/plugins/dynamix/NotificationsArchive.page
index b9903b26d..613c8187a 100644
--- a/plugins/dynamix/NotificationsArchive.page
+++ b/plugins/dynamix/NotificationsArchive.page
@@ -3,8 +3,8 @@ Title="Archived Notifications"
---
-
$files = count(glob("{$notify['path']}/archive/*.notify", GLOB_NOSORT));
?>
@@ -54,7 +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();
-0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
+
setTimeout(archiveList,=max(abs($display['refresh']),30000)?>);
});
diff --git a/plugins/dynamix/OpenDevices.page b/plugins/dynamix/OpenDevices.page
index 4f33081e4..f9f9eaf31 100644
--- a/plugins/dynamix/OpenDevices.page
+++ b/plugins/dynamix/OpenDevices.page
@@ -3,8 +3,8 @@ Title="Unassigned Devices"
Cond="((count($devs)>0)&&($var['fsState']=='Started'))"
---
0)&&($var['fsState']=='Started'))"
* all copies or substantial portions of the Software.
*/
?>
-
$tabX = '#tab'.($var['fsState']=='Stopped'||is_dir('/mnt/cache') ? '4' : '3');
?>
@@ -22,7 +21,7 @@ $tabX = '#tab'.($var['fsState']=='Stopped'||is_dir('/mnt/cache') ? '4' : '3');
function open_status() {
$.post('/webGui/include/DeviceList.php',{path:'=$path?>',device:'open'},function(data) {
if (data) $('#open_devices').html(data);
-0 || ($display['refresh']<0 && $var['mdResync']==0)) && $var['fsState']=='Started'):?>
+
if ($('=$tabX?>').is(':checked')) timer = setTimeout(open_status,=abs($display['refresh'])?>);
@@ -31,7 +30,7 @@ function open_status() {
});
}
-0 || ($display['refresh']<0 && $var['mdResync']==0)) && $var['fsState']=='Started' && $display['tabs']==0):?>
+
$('=$tabX?>').bind({click:function() {clearTimeout(timer); open_status();}});
diff --git a/plugins/dynamix/include/DefaultPageLayout.php b/plugins/dynamix/include/DefaultPageLayout.php
index 0f3044ae4..072570fe4 100644
--- a/plugins/dynamix/include/DefaultPageLayout.php
+++ b/plugins/dynamix/include/DefaultPageLayout.php
@@ -68,9 +68,9 @@ function plus(value, label, last) {
}
function updateTime() {
var now = new Date();
- days = parseInt(uptime/86400);
- hour = parseInt(uptime/3600%24);
- mins = parseInt(uptime/60%60);
+ var days = parseInt(uptime/86400);
+ var hour = parseInt(uptime/3600%24);
+ var mins = parseInt(uptime/60%60);
$('#uptime').html(((days|hour|mins)?plus(days,'day',(hour|mins)==0)+plus(hour,'hour',mins==0)+plus(mins,'minute',true):'less than a minute'));
uptime += Math.round((now.getTime() - before.getTime())/1000);
before = now;
@@ -172,7 +172,7 @@ function notifier() {
close: function(e,m,o) {$.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file}); return(false);}
});
});
-0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
+
timers.notifier = setTimeout(notifier,=max(5000,abs($display['refresh']))?>);
}
@@ -182,7 +182,7 @@ function watchdog() {
$.post('/webGui/include/Watchdog.php',{mode:=$display['refresh']?>,dot:'=$display['number'][0]?>'},function(data) {
if (data) {
$.each(data.split('#'),function(k,v) {
-0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
+
if (v!='stop') $('#statusbar').html(v); else setTimeout(refresh,0);
});
timers.watchdog = setTimeout(watchdog,=abs($display['refresh'])?>);
@@ -204,7 +204,7 @@ $(function() {
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);
-0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
+
if (update>1) timers.countDown = setTimeout(countDown,1000);
updateTime();
diff --git a/plugins/dynamix/template.php b/plugins/dynamix/template.php
index 27c0c0ac6..2d2fc78a3 100644
--- a/plugins/dynamix/template.php
+++ b/plugins/dynamix/template.php
@@ -52,6 +52,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);
// Giddyup
require_once 'include/DefaultPageLayout.php';