diff --git a/plugins/dynamix/DisplaySettings.page b/plugins/dynamix/DisplaySettings.page index 0edd5bc77..ec372964e 100644 --- a/plugins/dynamix/DisplaySettings.page +++ b/plugins/dynamix/DisplaySettings.page @@ -244,8 +244,10 @@ Show Dashboard apps: Dynamix color theme: : Used / Free columns: diff --git a/plugins/dynamix/UserList.page b/plugins/dynamix/UserList.page index 4f9b6f16c..79f0fb5f3 100644 --- a/plugins/dynamix/UserList.page +++ b/plugins/dynamix/UserList.page @@ -19,7 +19,7 @@ if ($submenu) $path = './Users'; ?> -

+

diff --git a/plugins/dynamix/include/DashUpdate.php b/plugins/dynamix/include/DashUpdate.php index 0a7d91eff..e7a3e01ac 100644 --- a/plugins/dynamix/include/DashUpdate.php +++ b/plugins/dynamix/include/DashUpdate.php @@ -11,6 +11,8 @@ */ ?> 7{print $1,$2,$4,$6,$9,$10}' $file 2>/dev/null", $codes); @@ -37,11 +40,13 @@ function my_smart(&$source,$name,$page) { list($id,$class,$value,$thres,$when,$raw) = explode(' ',$code); $fail = strpos($when,'FAILING_NOW')!==false; if (!$fail && !in_array($id,$events)) continue; - if ($fail || ($select ? $thres>0 && $value<=$thres*$level : $raw>0)) {$thumb = 'alert'; break;}; + if ($fail || ($select ? $thres>0 && $value<=$thres*$level : $raw>0)) $title .= normalize($class,$fail?$when:$raw); } + if ($title) $thumb = 'alert'; else $title = "No errors reported\n"; } } - my_insert($source, ""); + $title .= "Click for context menu"; + my_insert($source, ""); } function my_usage(&$source,$used) { my_insert($source, $used ? "
$used
" : "-"); @@ -71,8 +76,8 @@ case 'disk': $disks = @array_filter(parse_ini_file('state/disks.ini',true),'active_disks'); $devs = @parse_ini_file('state/devs.ini',true); $saved = @parse_ini_file('state/monitor.ini',true); - require_once 'CustomMerge.php'; - require_once 'Preselect.php'; + require_once "$docroot/webGui/include/CustomMerge.php"; + require_once "$docroot/webGui/include/Preselect.php"; $slots = $_POST['slots']; $row1 = array_fill(0,31,''); my_insert($row1[0],'Active'); $row2 = array_fill(0,31,''); my_insert($row2[0],'Inactive'); @@ -103,8 +108,11 @@ case 'disk': $temp = $disk['temp']; $hot = strlen($disk['hotTemp']) ? $disk['hotTemp'] : $_POST['hot']; $max = strlen($disk['maxTemp']) ? $disk['maxTemp'] : $_POST['max']; - $beep = $temp>=$max && $max>0 ? 'max' : ($temp>=$hot && $hot>0 ? 'hot' : ''); - if ($beep) my_insert($row5[$n],""); + $heat = $temp>=$max && $max>0 ? 'max' : ($temp>=$hot && $hot>0 ? 'hot' : ''); + if ($heat) + my_insert($row5[$n],""); + else + if (!strpos($state,'blink') && $temp>0) my_insert($row5[$n],"".my_temp($temp,$_POST['unit']).""); if ($disk['device'] && !strpos($state,'blink')) my_smart($row6[$n],$disk['name'],'Device'); my_usage($row7[$n],($disk['type']!='Parity' && $disk['fsStatus']=='Mounted')?(round((1-$disk['fsFree']/$disk['fsSize'])*100).'%'):''); } diff --git a/plugins/dynamix/include/DefaultPageLayout.php b/plugins/dynamix/include/DefaultPageLayout.php index e7e69e3ed..cfc37cc29 100644 --- a/plugins/dynamix/include/DefaultPageLayout.php +++ b/plugins/dynamix/include/DefaultPageLayout.php @@ -20,7 +20,8 @@ - + + "> "> @@ -157,27 +158,77 @@ function showNotice(data,plugin) { if (timers.countDown) {clearTimeout(timers.countDown);$('#countdown').html('');} } function notifier() { - $.post('/webGui/include/Notify.php',{cmd:'get'},function(data) { - if (data) { - var json = $.parseJSON(data); - $.each(json, function(i, object) { - var notify = $.parseJSON(object); - $.jGrowl(notify.subject+'
'+notify.description, { - sticky: true, - position: '', - header: notify.event+': '+notify.timestamp, - theme: notify.importance+' '+notify.file, - themeState: '', - beforeOpen: function(e,m,o) {if ($('.jGrowl-notify').hasClass(notify.file)) {return(false);}}, - close: function(e,m,o) {$.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file}); return(false);} - }); + var tub1 = 0, tub2 = 0, tub3 = 0; + $.post('/webGui/include/Notify.php',{cmd:'get'},function(json) { + var data = $.parseJSON(json); + $.each(data, function(i, object) { + var notify = $.parseJSON(object); + + switch (notify.importance) { + case 'alert' : tub1++; break; + case 'warning': tub2++; break; + case 'normal' : tub3++; break; + } + + $.jGrowl(notify.subject+'
'+notify.description, { + group: notify.importance, + header: notify.event+': '+notify.timestamp, + theme: notify.file, + beforeOpen: function(e,m,o){if ($('div.jGrowl-notify').hasClass(notify.file)) return(false);}, + beforeClose: function(e,m,o){$.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file});} }); - - timers.notifier = setTimeout(notifier,); - } + }); + + $('#txt-tub1').removeClass('one two three').addClass(digits(tub1)).text(tub1); + $('#txt-tub2').removeClass('one two three').addClass(digits(tub2)).text(tub2); + $('#txt-tub3').removeClass('one two three').addClass(digits(tub3)).text(tub3); + if (tub1) $('#box-tub1').removeClass('grey-text').addClass('red-text'); else $('#box-tub1').removeClass('red-text').addClass('grey-text'); + 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'); + + + timers.notifier = setTimeout(notifier,5000); + }); } +function digits(number) { + if (number < 10) return 'one'; + if (number < 100) return 'two'; + return 'three'; +} +function openNotifier(filter) { + $.post('/webGui/include/Notify.php',{cmd:'get'},function(json) { + var data = $.parseJSON(json); + $.each(data, function(i, object) { + var notify = $.parseJSON(object); + if (notify.importance == filter) { + $.jGrowl(notify.subject+'
'+notify.description, { + group: notify.importance, + header: notify.event+': '+notify.timestamp, + theme: notify.file, + beforeOpen: function(e,m,o){if ($('div.jGrowl-notify').hasClass(notify.file)) return(false);}, + beforeClose: function(e,m,o){$.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file});} + }); + } + }); + }); +} +function closeNotifier(filter) { + clearTimeout(timers.notifier); + $.post('/webGui/include/Notify.php',{cmd:'get'},function(json) { + var data = $.parseJSON(json); + $.each(data, function(i, object) { + var notify = $.parseJSON(object); + if (notify.importance == filter) $.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file}); + }); + $('div.jGrowl').find('.'+filter).find('div.jGrowl-close').trigger('click'); + setTimeout(notifier,100); + }); +} +function viewHistory(filter) { + location.replace('/Tools/NotificationsArchive?filter='+filter); +} function watchdog() { $.post('/webGui/include/Watchdog.php',{mode:,dot:''},function(data) { if (data) { @@ -208,7 +259,12 @@ $(function() { if (update>3) timers.countDown = setTimeout(countDown,1000); updateTime(); - $.jGrowl.defaults.closer = false; + $.jGrowl.defaults.closeTemplate = ''; + $.jGrowl.defaults.closerTemplate = '':'
'?>[ close all notifications ]
'; + $.jGrowl.defaults.sticky = true; + $.jGrowl.defaults.check = 100; + $.jGrowl.defaults.position = ''; + $.jGrowl.defaults.themeState = ''; Shadowbox.setup('a.sb-enable', {modal:true}); }); var mobiles=['ipad','iphone','ipod','android']; @@ -218,7 +274,7 @@ for (var i=0,mobile; mobile=mobiles[i]; i++) { } - +
"; // Build page content echo "
"; $tab = 1; $view = $myPage['name']; -$pages = array(); +$pages = []; if ($myPage['text']) $pages[$view] = $myPage; if ($myPage['Type']=='xmenu') $pages = array_merge($pages, find_pages($view)); if (isset($myPage['Tabs'])) $display['tabs'] = strtolower($myPage['Tabs'])=='true' ? 0 : 1; @@ -308,16 +369,16 @@ foreach ($pages as $page) { echo '"; -
RebootBringing system down... 0
+
RebootSystem is going down... 0
diff --git a/shutdown.htm b/shutdown.htm index 51ba28826..3b827fe8b 100644 --- a/shutdown.htm +++ b/shutdown.htm @@ -15,14 +15,14 @@ function timer() { return Math.round((now.getTime()-start.getTime())/1000); } function online() { - $.ajax({url:'/webGui/include/ProcessStatus.php',type:'POST',data:{name:'emhttp'},timeout:5000}) - .done(function(){$('div.notice').html('ShutdownBringing system down... '+timer()); setTimeout(online,5000);}) - .fail(function(){$('div.notice').html('ShutdownSystem goes offline... 0'); start=new Date(); setTimeout(offline,5000);}); + $.ajax({url:'/webGui/include/ProcessStatus.php',type:'POST',data:{name:'emhttp',update:true},timeout:5000}) + .done(function(){$('div.notice').html('ShutdownSystem is going down... '+timer()); setTimeout(online,5000);}) + .fail(function(){$('div.notice').html('ShutdownSystem is offline... 0'); start=new Date(); setTimeout(offline,5000);}); } function offline() { var time = timer(); if (time < 30) { - $('div.notice').html('ShutdownSystem goes offline... '+time); + $('div.notice').html('ShutdownSystem is offline... '+time); setTimeout(offline,5000); } else { $('div.notice').html('ShutdownSystem is powered off...'); @@ -30,5 +30,5 @@ function offline() { } -
ShutdownBringing system down... 0
+
ShutdownSystem is going down... 0