mirror of
https://github.com/unraid/webgui.git
synced 2026-04-24 11:19:25 -05:00
Dashboard: fix header summary when hide/close tile
This commit is contained in:
@@ -191,7 +191,7 @@ switch ($theme) {
|
||||
<table id='db-box1' class='dashboard'>
|
||||
<tbody class='system'>
|
||||
<tr><td><i class='icon-performance f32'></i><div class='section'><?=_var($var,'NAME')?><br>
|
||||
<span><?=_var($var,'COMMENT')?></span><span id="_current_time_" class="head_time"></span><br></div>
|
||||
<span><?=_var($var,'COMMENT')?></span><span class="switch"><span id="current_time_" class="head_time"></span></span><br></div>
|
||||
<a href='/Dashboard/Settings/Identification'><i class='fa fa-fw fa-cog control' title="_(Go to identification settings)_"></i></a><i class='fa fa-fw fa-wrench control tile' onclick='contentMgmt()' title="_(Tile Management)_"></i>
|
||||
<span class='ctrl'>
|
||||
<?if ($parity||$mover||$btrfs):?>
|
||||
@@ -237,7 +237,7 @@ switch ($theme) {
|
||||
<tbody title="_(Processor Information)_" data="toggleCPU(true)">
|
||||
<tr><td><i class='icon-cpu f32'></i><div class='section'>_(Processor)_<br>
|
||||
<span class="head_info"><span id='cpu-temp'></span></span>
|
||||
<span id="head_cpu">_(Load)_:<span class="head_bar"><span class='cpu load'>0%</span><div class='usage-disk sys'><span id='_cpu_'></span><span></span></div></span></span><br></div>
|
||||
<span class="switch">_(Load)_:<span class="head_bar"><span class='cpu_ load'>0%</span><div class='usage-disk sys'><span id='cpu_'></span><span></span></div></span></span><br></div>
|
||||
<a href='/Dashboard/Settings/CPUset' title="_(Go to CPU pinning settings)_"><i class='fa fa-fw fa-cog control'></i></a>
|
||||
</td></tr>
|
||||
<tr><td><?=$cpumodel?></td></tr>
|
||||
@@ -267,7 +267,7 @@ foreach ($cpus as $pair) {
|
||||
<tbody title="_(Memory Utilization)_">
|
||||
<tr><td><i class='icon-ram f32'></i><div class='section'>_(System)_<br>
|
||||
<span class="head_info"><span><i class='ups fa fa-line-chart'></i>_(Memory)_: <?="$memory_installed $unit $memory_type $ecc"?></span></span>
|
||||
<span id="head_ram">_(RAM)_:<span class="head_bar"><span class='_sys0_ load'>0%</span><div class='usage-disk sys'><span id='_sys0_'></span><span></span></div></span></span><br></div>
|
||||
<span class="switch">_(RAM)_:<span class="head_bar"><span class='sys0_ load'>0%</span><div class='usage-disk sys'><span id='sys0_'></span><span></span></div></span></span><br></div>
|
||||
<a href='/Dashboard/Tools/Processes' title="_(View Running Processes)_"><i class='fa fa-fw fa-info-circle control'></i></a>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
@@ -353,9 +353,9 @@ foreach ($ports as $port) {
|
||||
|
||||
<?if ($apcupsd):?>
|
||||
<tbody title="_(Power Status)_">
|
||||
<tr><td><i class='icon-ups f32'></i><div class='section'>_(Power)_<span class='head_gap' id='_ups_status_'></span><br>
|
||||
<tr><td><i class='icon-ups f32'></i><div class='section'>_(Power)_<span class="switch"><span class='head_gap' id='ups_status_'></span></span><br>
|
||||
<span class="head_info"><span><i class='ups fa fa-bar-chart'></i>_(UPS Model)_: </span><span id='ups_model'></span></span>
|
||||
<span id="head_ups"><span>_(Load)_:</span><span class="head_gap" id='_ups_loadpct_'></span></span></span><br></div>
|
||||
<span class="switch"><span>_(Load)_:</span><span class="head_gap" id='ups_loadpct_'></span></span></span><br></div>
|
||||
<a href='/Dashboard/Settings/UPSsettings' title="_(Go to UPS settings)_"><i class='fa fa-fw fa-cog control'></i></a>
|
||||
</td></tr>
|
||||
<tr><td><span class='w36'><i class='ups fa fa-fw fa-plug'></i>_(UPS status)_:</span><span id='ups_status'></span></td></tr>
|
||||
@@ -744,15 +744,13 @@ jQuery.prototype.hideMe = function() {
|
||||
jQuery.prototype.mixedView = function(s) {
|
||||
if (s==0) {
|
||||
this.find('tr:gt(0)').hide();
|
||||
this.find('span[id^="head_"]').show();
|
||||
this.find('span.switch').show();
|
||||
this.find('span[id^="tile_"]').hide();
|
||||
changeSpan(this,0)
|
||||
return;
|
||||
}
|
||||
this.find('tr:gt(0)').show();
|
||||
this.find('span[id^="head_"]').hide();
|
||||
this.find('span.switch').hide();
|
||||
this.find('span[id^="tile_"]').show();
|
||||
changeSpan(this,1)
|
||||
if (this.attr('data')) {
|
||||
setTimeout(this.attr('data'));
|
||||
}
|
||||
@@ -979,13 +977,6 @@ function changeMode(item) {
|
||||
<?endif;?>
|
||||
$('select[name="enter_user"]').val(item);
|
||||
}
|
||||
function changeSpan(span,dir) {
|
||||
const spans = ['cpu','ups_loadpct','ups_status','current_time'];
|
||||
switch (dir) {
|
||||
case 0: for (var i=0,id; id=spans[i]; i++) span.find('span#_'+id+'_').prop('id',id); break;
|
||||
case 1: for (var i=0,id; id=spans[i]; i++) span.find('span#'+id+':first').prop('id','_'+id+'_'); break;
|
||||
}
|
||||
}
|
||||
function changeView(item) {
|
||||
if (item==0) $.removeCookie('enter_view'); else $.cookie('enter_view',item,{expires:3650});
|
||||
if (item==0) $('.view1').show(); else $('.view1').hide();
|
||||
@@ -1234,9 +1225,8 @@ function showContent() {
|
||||
var tbody = $('div.frame tbody[sort="'+md5+'"]');
|
||||
tbody.find('.openclose').removeClass('fa-chevron-up fa-chevron-down').addClass('fa-chevron-down');
|
||||
tbody.find('tr:gt(0)').hide();
|
||||
tbody.find('span[id^="head_"]').show();
|
||||
tbody.find('span.switch').show();
|
||||
tbody.find('span[id^="tile_"]').hide();
|
||||
changeSpan(tbody,0);
|
||||
}
|
||||
}
|
||||
if (count['db-box1']>0) $('div#tile1').show();
|
||||
@@ -1495,7 +1485,9 @@ dashboard.on('message',function(msg,meta) {
|
||||
cpuchart.updateSeries([{data:cpu}]);
|
||||
}
|
||||
$('.'+k).text(load+'%');
|
||||
$('.'+k+'_').text(load+'%');
|
||||
$('#'+k).finish().animate({width:load+'%'},{step:function(){$('#'+k).css({'overflow':'visible'}).removeClass().addClass(color);}});
|
||||
$('#'+k+'_').finish().animate({width:load+'%'},{step:function(){$('#'+k).css({'overflow':'visible'}).removeClass().addClass(color);}});
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
@@ -1513,8 +1505,8 @@ dashboard.on('message',function(msg,meta) {
|
||||
$('#zfs').text(v[6]);
|
||||
<?endif;?>
|
||||
var color = setColor(load,<?=$display['critical']?>,<?=$display['warning']?>);
|
||||
$('._sys0_').text(v[0]);
|
||||
$('#_sys0_').finish().animate({width:v[0]},{step:function(){$('#_sys0_').css('overflow','visible').removeClass().addClass(color);}});
|
||||
$('.sys0_').text(v[0]);
|
||||
$('#sys0_').finish().animate({width:v[0]},{step:function(){$('#sys0_').css('overflow','visible').removeClass().addClass(color);}});
|
||||
$('#sys0').css({'background':'conic-gradient(<?=$c1?> 0% '+v[2]+',<?=$c2?> '+v[2]+' '+v[0]+',<?=$c0?> '+v[0]+' 100%'});
|
||||
} else {
|
||||
$('#sys'+k).css({'background':'conic-gradient(<?=$c1?> 0% '+v[0]+',<?=$c0?> '+v[0]+' 100%'});
|
||||
@@ -1590,6 +1582,7 @@ dashboard.on('message',function(msg,meta) {
|
||||
// current date and time
|
||||
var timedate = part[4].split('\n');
|
||||
$('#current_time').html(timedate[0]);
|
||||
$('#current_time_').html(timedate[0]);
|
||||
$('#current_date').html(timedate[1]);
|
||||
break;
|
||||
case 4:
|
||||
@@ -1623,10 +1616,12 @@ apcups.on('message',function(data) {
|
||||
data = data.split(';');
|
||||
$('#ups_model').html(data[0]);
|
||||
$('#ups_status').html(data[1]);
|
||||
$('#ups_status_').html(data[1]);
|
||||
$('#ups_bcharge').html(data[2]);
|
||||
$('#ups_timeleft').html(data[3]);
|
||||
$('#ups_nompower').html(data[4]);
|
||||
$('#ups_loadpct').html(data[5]);
|
||||
$('#ups_loadpct_').html(data[5]);
|
||||
$('#ups_outputv').html(data[6]);
|
||||
});
|
||||
<?endif;?>
|
||||
|
||||
@@ -7,7 +7,8 @@ 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:250px;display:inline-block}
|
||||
span#head_cpu,span#head_ram,#head_ups,#head_apps,#head_vms,#_ups_status_,#_current_time_{display:none;margin-left:0}
|
||||
span.switch{display:none}
|
||||
span#head_apps,#head_vms{display:none;margin-left:0}
|
||||
span.head_bar{display:inline-block;width:180px}
|
||||
span.head_gap{padding-left:14px}
|
||||
span.head_time{padding-left:40px;font-size:inherit!important;font-weight:bold!important}
|
||||
|
||||
Reference in New Issue
Block a user