diff --git a/emhttp/plugins/dynamix/DashStats.page b/emhttp/plugins/dynamix/DashStats.page index 307177254..35afb0afe 100644 --- a/emhttp/plugins/dynamix/DashStats.page +++ b/emhttp/plugins/dynamix/DashStats.page @@ -183,9 +183,10 @@ div.leftside{float:left;width:66%} div.rightside{float:right;margin:0;text-align:center} div[id$=chart]{margin:-12px 8px -24px -18px} div.template,div#dialogWindow,input#upload{display:none} -span.head_info{width:240px;display:inline-block} -span#head_cpu,span#head_ram,#head_ups,#head_apps,#head_vms{display:none;margin-left:0} -span.head_bar{display:inline-block;width:200px} +span.head_info{width:250px;display:inline-block} +span#head_cpu,span#head_ram,#head_ups,#head_apps,#head_vms,#_ups_status_{display:none;margin-left:0} +span.head_bar{display:inline-block;width:180px} +span.head_gap{padding-left:14px} span.green,span.red,span.orange{padding-left:0} span.ctrl{float:right;margin-top:0;margin-right:10px} span.ctrl span{font-size:2rem!important} @@ -201,6 +202,7 @@ span.wg1{font-size:1.1rem;text-indent:24px} span.wg2{font-size:1.1rem} span[id^=cpu],span[id^=sys]{width:0} span[class^="fa "]{font-size:1.6rem;margin-right:18px} +span.load.resize{font-size:1.1rem} span.fan{width:36%;display:inline-block} span.w18{width:18%;display:inline-block;float:left} span.w26{width:26%;display:inline-block;float:left} @@ -208,7 +210,7 @@ span.w36{width:36%;display:inline-block;float:left} span.w44{width:44%;display:inline-block;float:left} span.w72{width:72%;display:inline-block;float:left} select#cpuline,select#netline{border:none;padding:0 12px 0 0} -select[name=enter_share]{margin-top:0} +select[name=enter_share],select[name=enter_user]{margin-top:0;float:none} img#mycase{width:auto;max-width:128px;height:auto;max-height:128px} i.heat{margin-left:8px} i.ups{margin-right:8px;font-size:1.4rem!important} @@ -234,6 +236,9 @@ input[value=Edit]{margin:12px 0 0 0;padding:5px 10px} .switch-button-background{margin-left:0;margin-top:4px} .switch-button-label{margin-top:3px} .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button[disabled]{cursor:default;color:#808080;background:-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#404040),to(#404040)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#808080),to(#808080)) 100% 100% no-repeat;background:linear-gradient(90deg,#404040 0,#808080) 0 0 no-repeat,linear-gradient(90deg,#404040 0,#808080) 0 100% no-repeat,linear-gradient(0deg,#404040 0,#404040) 0 100% no-repeat,linear-gradient(0deg,#808080 0,#808080) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%} +#current_time{font-size:4rem;margin-left:8px} +#current_date{font-size:1.3rem;margin-left:18px} +span.ampm{font-size:2rem} @@ -260,6 +265,7 @@ input[value=Edit]{margin:12px 0 0 0;padding:5px 10px}
+


_(Model)_


_(Registration)_
Unraid OS

_(Uptime)_
@@ -295,7 +301,7 @@ input[value=Edit]{margin:12px 0 0 0;padding:5px 10px} -_(Overall Load)_:0%
+_(Overall Load)_:0%
_(Show details)_ + + +
@@ -533,14 +539,14 @@ if (!$group) { class="mixed">
_(Users)_ - - +
@@ -791,12 +797,14 @@ jQuery.prototype.mixedView = function(s) { this.find('span#_cpu_').prop('id','cpu'); this.find('span#_sys0_').prop('id','sys0'); this.find('span#_ups_loadpct_').prop('id','ups_loadpct'); + this.find('span#_ups_status_').prop('id','ups_status'); return; } this.find('tr:gt(0)').show(); this.find('span#cpu:first').prop('id','_cpu_'); this.find('span#sys0:first').prop('id','_sys0_'); this.find('span#ups_loadpct:first').prop('id','_ups_loadpct_'); + this.find('span#ups_status:first').prop('id','_ups_status_'); this.find('span[id^="head_"]').hide(); this.find('span[id^="tile_"]').show(); if (this.attr('data')) { @@ -1279,7 +1287,7 @@ function addProperties() { $(this).find('td:first').prepend(""); }); $('div.frame tr').attr('title',''); - $('tr#var0').hover(function(){$.post('/webGui/include/DashboardApps.php',{sys:0},function(val){$('.sys0').not('.fixed').text(val);})}); + $('tr#var0').hover(function(){$.post('/webGui/include/DashboardApps.php',{sys:0},function(val){$('.sys0').not('.head').text(val);})}); $('tr#var1').show().hover(function(){$.post('/webGui/include/DashboardApps.php',{sys:1},function(val){$('.sys1').text(val);})}); @@ -1314,6 +1322,7 @@ function showContent() { tbody.find('span#_cpu_').prop('id','cpu'); tbody.find('span#_sys0_').prop('id','sys0'); tbody.find('span#_ups_loadpct_').prop('id','ups_loadpct'); + tbody.find('span#_ups_status_').prop('id','ups_status'); } } if (count['db-box1']>0) $('div#tile1').show(); @@ -1557,6 +1566,10 @@ dashboard.on('message',function(msg,meta) { $.each(part[1].split('\0'),function(k,v) {$('#main'+k).html(v);}); $.each(part[2].split('\0'),function(k,v) {$('#port'+k).html(v);}); $.each(part[3].split('\0'),function(k,v) {$('#link'+k).html(v);}); + // current date and time + var timedate = part[4].split('\n'); + $('#current_time').html(timedate[0]); + $('#current_date').html(timedate[1]); break; case 4: // wireguard tunnels diff --git a/emhttp/plugins/dynamix/include/DefaultPageLayout.php b/emhttp/plugins/dynamix/include/DefaultPageLayout.php index fe0277879..594e5f490 100644 --- a/emhttp/plugins/dynamix/include/DefaultPageLayout.php +++ b/emhttp/plugins/dynamix/include/DefaultPageLayout.php @@ -738,6 +738,10 @@ foreach ($pages as $page) { // create list of nchan scripts to be started if (isset($page['Nchan'])) nchan_merge($page['root'], $page['Nchan']); annotate($page['file']); + // include page specific stylesheet (if existing) + $css = "/{$page['root']}/pages/".strtolower($page['name']).".css"; + if (is_file($docroot.$css)) echo '',"\n"; + // create page content empty($page['Markdown']) || $page['Markdown']=='true' ? eval('?>'.Markdown(parse_text($page['text']))) : eval('?>'.parse_text($page['text'])); if ($close) echo "
"; } diff --git a/emhttp/plugins/dynamix/nchan/update_3 b/emhttp/plugins/dynamix/nchan/update_3 index c0bddc07e..948a26f3f 100755 --- a/emhttp/plugins/dynamix/nchan/update_3 +++ b/emhttp/plugins/dynamix/nchan/update_3 @@ -19,10 +19,30 @@ $data = []; require_once "$docroot/webGui/include/Helpers.php"; require_once "$docroot/webGui/include/publish.php"; +extract(parse_plugin_cfg('dynamix',true)); -// satisfy translations (not used) -if (!function_exists('_')) { - function _($text) {return $text;} +// add translations +$_SERVER['REQUEST_URI'] = 'dashboard/main'; +$login_locale = _var($display,'locale'); +require_once "$docroot/webGui/include/Translations.php"; + +function update_translation($locale) { + global $docroot,$language; + $language = []; + if ($locale) { + $text = "$docroot/languages/$locale/translations.txt"; + if (file_exists($text)) { + $store = "$docroot/languages/$locale/translations.dot"; + if (!file_exists($store)) file_put_contents($store,serialize(parse_lang_file($text))); + $language = unserialize(file_get_contents($store)); + } + $text = "$docroot/languages/$locale/dashboard.txt"; + if (file_exists($text)) { + $store = "$docroot/languages/$locale/dashboard.dot"; + if (!file_exists($store)) file_put_contents($store,serialize(parse_lang_file($text))); + $language = array_merge($language,unserialize(file_get_contents($store))); + } + } } function ports() { global $net; @@ -42,6 +62,12 @@ foreach (ports() as $port) { } // loop while (true) { + // check for language changes + extract(parse_plugin_cfg('dynamix',true)); + if (_var($display,'locale') != $locale_init) { + $locale_init = _var($display,'locale'); + update_translation($locale_init); + } $echo = $mode = $rxtx = $stat = []; $ts = $time - $time0; foreach (ports() as $port) { @@ -89,8 +115,17 @@ while (true) { $tx_fifo = port_get_contents("$net/$port/statistics/tx_fifo_errors"); $stat[] = "Errors: {$rx_errors}
Drops: {$rx_drops}
Overruns: {$rx_fifo}\0Errors: {$tx_errors}
Drops: {$tx_drops}
Overruns: {$tx_fifo}"; } - - publish('update3',implode("\n",$echo)."\1".implode("\0",$mode)."\1".implode("\0",$rxtx)."\1".implode("\0",$stat)); + // current date and time + $now = time(); + if (_var($display,'time')=='%R') { + // 24 hour format + $clock = date('H:i',$now); $ampm = ''; + } else { + // 12 hour format wih am/pm + $clock = date('h:i',$now); $ampm = ''.date('a',$now).''; + } + $timedate = "$clock $ampm\n"._(date('l, F j, Y',$now),0); + publish('update3',implode("\n",$echo)."\1".implode("\0",$mode)."\1".implode("\0",$rxtx)."\1".implode("\0",$stat)."\1".$timedate); $time0 = $time; sleep(1); $time = microtime(true); diff --git a/emhttp/plugins/dynamix/styles/default-azure.css b/emhttp/plugins/dynamix/styles/default-azure.css index a0d51ddd0..ec6dbc23a 100644 --- a/emhttp/plugins/dynamix/styles/default-azure.css +++ b/emhttp/plugins/dynamix/styles/default-azure.css @@ -154,15 +154,15 @@ table.share_status tbody tr.warn{color:#e68a00} table.share_status.fixed tr>td+td{min-width:39px;font-size:1.1rem;text-align:center;padding:0} table.share_status.table{margin-top:36px} table.share_status.table tr>td{width:50%} -table.share_status.dashboard{margin:0;border:none;background-color:#D7DBDD} -table.share_status.dashboard tbody{border:none} +table.share_status.dashboard{margin:0;border:none;background-color:#d7dbdd} +table.share_status.dashboard tbody{border:1px solid #cacfd2} table.share_status.dashboard tr:first-child td{height:3.6rem;padding-top:12px;font-size:1.6rem;font-weight:bold;letter-spacing:1.8px;text-transform:none;vertical-align:top} table.share_status.dashboard tr:last-child td{padding-bottom:20px} table.share_status.dashboard tr.last td{padding-bottom:20px} table.share_status.dashboard tr.header td{padding-bottom:10px;color:#9794a0} table.share_status.dashboard tr{border:none} table.share_status.dashboard td{line-height:normal;padding:3px 10px;border:none!important} -table.share_status.dashboard td.stopgap{height:10px!important;line-height:10px!important;padding:0!important;background-color:#e4e2e4} +table.share_status.dashboard td.stopgap{height:20px!important;line-height:20px!important;padding:0!important;background-color:#e4e2e4} table.share_status.dashboard td.vpn{font-size:1.1rem;font-weight:bold;text-transform:uppercase;letter-spacing:1px} table.share_status.dashboard td div.section{display:inline-block;vertical-align:top;margin-left:4px;font-size:1.2rem;font-weight:bold;text-transform:uppercase;letter-spacing:1px} table.share_status.dashboard td div.section span{font-weight:normal;text-transform:none;letter-spacing:0;white-space:normal} @@ -170,7 +170,7 @@ table.share_status.dashboard td span.info{float:right;margin-right:20px;font-siz table.share_status.dashboard td span.info.title{font-weight:bold} table.share_status.dashboard td span.load{display:inline-block;width:38px;text-align:right} table.share_status.dashboard td span.finish{float:right;margin-right:24px} -table.share_status.dashboard i.control{float:right;font-size:1.4rem!important;margin:0 3px 0 0;cursor:pointer;background-color:rgba(0,0,0,0.1);padding:2px} +table.share_status.dashboard i.control{float:right;font-size:1.4rem!important;margin:0 3px 0 0;cursor:pointer;color:#d7dbdd;background-color:rgba(0,0,0,0.3);padding:2px;border-radius:5px} table.share_status.dashboard .usage-disk.sys{height:auto} .dashboard-sortable{background-color:#e4e2e4} tr.alert{color:#f0000c;background-color:#ff9e9e} @@ -199,7 +199,7 @@ span.small{font-size:1.1rem} span.score{font-size:1.1rem;color:#ffffff;position:absolute} span#dropbox{background:none;line-height:6rem;margin-right:20px} span.outer{margin-bottom:20px;margin-right:0} -span.outer.solid{background-color:#D7DBDD} +span.outer.solid{background-color:#d7dbdd} span.hand{cursor:pointer} span.outer.started>img,span.outer.started>i.img{opacity:1.0} span.outer.stopped>img,span.outer.stopped>i.img{opacity:0.3} diff --git a/emhttp/plugins/dynamix/styles/default-black.css b/emhttp/plugins/dynamix/styles/default-black.css index eafa6e203..5f2b87035 100644 --- a/emhttp/plugins/dynamix/styles/default-black.css +++ b/emhttp/plugins/dynamix/styles/default-black.css @@ -155,14 +155,14 @@ table.share_status.fixed tr>td+td{min-width:39px;font-size:1.1rem;text-align:cen table.share_status.table{margin-top:36px} table.share_status.table tr>td{width:50%} table.share_status.dashboard{margin:0;border:none;background-color:#262626} -table.share_status.dashboard tbody{border:none} +table.share_status.dashboard tbody{border:1px solid #333333} table.share_status.dashboard tr:first-child td{height:3.6rem;padding-top:12px;font-size:1.6rem;font-weight:bold;letter-spacing:1.8px;text-transform:none;vertical-align:top} table.share_status.dashboard tr:nth-child(even){background-color:transparent} table.share_status.dashboard tr:last-child td{padding-bottom:20px} table.share_status.dashboard tr.last td{padding-bottom:20px} table.share_status.dashboard tr.header td{padding-bottom:10px} table.share_status.dashboard td{padding:3px 10px} -table.share_status.dashboard td.stopgap{height:10px!important;line-height:10px!important;padding:0!important;background-color:#1c1b1b} +table.share_status.dashboard td.stopgap{height:20px!important;line-height:20px!important;padding:0!important;background-color:#1c1b1b} table.share_status.dashboard td.vpn{font-size:1.1rem;font-weight:bold;text-transform:uppercase;letter-spacing:1px} table.share_status.dashboard td div.section{display:inline-block;vertical-align:top;margin-left:4px;font-size:1.2rem;font-weight:bold;text-transform:uppercase;letter-spacing:1px} table.share_status.dashboard td div.section span{font-weight:normal;text-transform:none;letter-spacing:0;white-space:normal} @@ -170,7 +170,7 @@ table.share_status.dashboard td span.info{float:right;margin-right:20px;font-siz table.share_status.dashboard td span.info.title{font-weight:bold} table.share_status.dashboard td span.load{display:inline-block;width:38px;text-align:right} table.share_status.dashboard td span.finish{float:right;margin-right:24px} -table.share_status.dashboard i.control{float:right;font-size:1.4rem!important;margin:0 3px 0 0;cursor:pointer;background-color:rgba(255,255,255,0.1);padding:2px} +table.share_status.dashboard i.control{float:right;font-size:1.4rem!important;margin:0 3px 0 0;cursor:pointer;color:#262626;background-color:rgba(255,255,255,0.3);padding:2px;border-radius:5px} .dashboard-sortable{background-color:#1c1b1b} [name=arrayOps]{margin-top:12px} span.error{color:#f0000c;background-color:#ff9e9e;display:block;width:100%} diff --git a/emhttp/plugins/dynamix/styles/default-gray.css b/emhttp/plugins/dynamix/styles/default-gray.css index 3beb543df..099a70081 100644 --- a/emhttp/plugins/dynamix/styles/default-gray.css +++ b/emhttp/plugins/dynamix/styles/default-gray.css @@ -154,15 +154,15 @@ table.share_status tbody tr.warn{color:#e68a00} table.share_status.fixed tr>td+td{min-width:39px;font-size:1.1rem;text-align:center;padding:0} table.share_status.table{margin-top:36px} table.share_status.table tr>td{width:50%} -table.share_status.dashboard{margin:0;border:none;background-color:#212F3D} -table.share_status.dashboard tbody{border:none} +table.share_status.dashboard{margin:0;border:none;background-color:#212f3d} +table.share_status.dashboard tbody{border:1px solid #566573} table.share_status.dashboard tr:first-child td{height:3.6rem;padding-top:12px;font-size:1.6rem;font-weight:bold;letter-spacing:1.8px;text-transform:none;vertical-align:top} table.share_status.dashboard tr:last-child td{padding-bottom:20px} table.share_status.dashboard tr.last td{padding-bottom:20px} table.share_status.dashboard tr.header td{padding-bottom:10px;color:#82857e} table.share_status.dashboard tr{border:none} table.share_status.dashboard td{line-height:normal;padding:3px 10px;border:none!important} -table.share_status.dashboard td.stopgap{height:10px!important;line-height:10px!important;padding:0!important;background-color:#1b1d1b} +table.share_status.dashboard td.stopgap{height:20px!important;line-height:20px!important;padding:0!important;background-color:#1b1d1b} table.share_status.dashboard td.vpn{font-size:1.1rem;font-weight:bold;text-transform:uppercase;letter-spacing:1px} table.share_status.dashboard td div.section{display:inline-block;vertical-align:top;margin-left:4px;font-size:1.2rem;font-weight:bold;text-transform:uppercase;letter-spacing:1px} table.share_status.dashboard td div.section span{font-weight:normal;text-transform:none;letter-spacing:0;white-space:normal} @@ -170,7 +170,7 @@ table.share_status.dashboard td span.info{float:right;margin-right:20px;font-siz table.share_status.dashboard td span.info.title{font-weight:bold} table.share_status.dashboard td span.load{display:inline-block;width:38px;text-align:right} table.share_status.dashboard td span.finish{float:right;margin-right:24px} -table.share_status.dashboard i.control{float:right;font-size:1.4rem!important;margin:0 3px 0 0;cursor:pointer;background-color:rgba(255,255,255,0.1);padding:2px} +table.share_status.dashboard i.control{float:right;font-size:1.4rem!important;margin:0 3px 0 0;cursor:pointer;color:#212f3d;background-color:rgba(255,255,255,0.3);padding:2px;border-radius:5px} table.share_status.dashboard .usage-disk.sys{height:auto} .dashboard-sortable{background-color:#1b1d1b} tr.alert{color:#f0000c;background-color:#ff9e9e} @@ -198,7 +198,7 @@ span.big{font-size:1.4rem} span.small{font-size:1.1rem} span#dropbox{background:none;line-height:6rem;margin-right:20px} span.outer{margin-bottom:20px;margin-right:0} -span.outer.solid{background-color:#212F3D} +span.outer.solid{background-color:#212f3d} span.hand{cursor:pointer} span.outer.started>img,span.outer.started>i.img{opacity:1.0} span.outer.stopped>img,span.outer.stopped>i.img{opacity:0.3} diff --git a/emhttp/plugins/dynamix/styles/default-white.css b/emhttp/plugins/dynamix/styles/default-white.css index 62ccaaabb..7759a9311 100644 --- a/emhttp/plugins/dynamix/styles/default-white.css +++ b/emhttp/plugins/dynamix/styles/default-white.css @@ -154,15 +154,15 @@ table.share_status tbody tr.warn{color:#e68a00} table.share_status.fixed tr>td+td{min-width:39px;font-size:1.1rem;text-align:center;padding:0} table.share_status.table{margin-top:36px} table.share_status.table tr>td{width:50%} -table.share_status.dashboard{margin:0;border:none;background-color:#F7F9F9} -table.share_status.dashboard tbody{border:none} +table.share_status.dashboard{margin:0;border:none;background-color:#f7f9f9} +table.share_status.dashboard tbody{border:1px solid #dfdfdf} table.share_status.dashboard tr:first-child td{height:3.6rem;padding-top:12px;font-size:1.6rem;font-weight:bold;letter-spacing:1.8px;text-transform:none;vertical-align:top} table.share_status.dashboard tr:nth-child(even){background-color:transparent} table.share_status.dashboard tr:last-child td{padding-bottom:20px} table.share_status.dashboard tr.last td{padding-bottom:20px} table.share_status.dashboard tr.header td{padding-bottom:10px} table.share_status.dashboard td{padding:3px 10px} -table.share_status.dashboard td.stopgap{height:10px!important;line-height:10px!important;padding:0!important;background-color:#f2f2f2} +table.share_status.dashboard td.stopgap{height:20px!important;line-height:20px!important;padding:0!important;background-color:#f2f2f2} table.share_status.dashboard td.vpn{font-size:1.1rem;font-weight:bold;text-transform:uppercase;letter-spacing:1px} table.share_status.dashboard td div.section{display:inline-block;vertical-align:top;margin-left:4px;font-size:1.2rem;font-weight:bold;text-transform:uppercase;letter-spacing:1px} table.share_status.dashboard td div.section span{font-weight:normal;text-transform:none;letter-spacing:0;white-space:normal} @@ -170,7 +170,7 @@ table.share_status.dashboard td span.info{float:right;margin-right:20px;font-siz table.share_status.dashboard td span.info.title{font-weight:bold} table.share_status.dashboard td span.load{display:inline-block;width:38px;text-align:right} table.share_status.dashboard td span.finish{float:right;margin-right:24px} -table.share_status.dashboard i.control{float:right;font-size:1.4rem!important;margin:0 3px 0 0;cursor:pointer;background-color:rgba(0,0,0,0.1);padding:2px} +table.share_status.dashboard i.control{float:right;font-size:1.4rem!important;margin:0 3px 0 0;cursor:pointer;color:#f7f9f9;background-color:rgba(0,0,0,0.3);padding:2px;border-radius:5px} .dashboard-sortable{background-color:#f2f2f2} [name=arrayOps]{margin-top:12px} span.error{color:#f0000c;background-color:#ff9e9e;display:block;width:100%}