mirror of
https://github.com/unraid/webgui.git
synced 2026-05-04 16:59:27 -05:00
Enhancements in page forward/backward movement
This commit is contained in:
@@ -17,7 +17,7 @@ Cond="strpos($disks[$name]['status'],'_NP')===false"
|
||||
?>
|
||||
<script>
|
||||
$(function() {
|
||||
$.post("/webGui/include/SmartInfo.php",{cmd:'attributes',port:'<?=addslashes(htmlspecialchars(isset($disks[$name]['device'])?$disks[$name]['device']:$name))?>',name:'<?=addslashes(htmlspecialchars($name))?>'}, function(data) {
|
||||
$.post("/webGui/include/SmartInfo.php",{cmd:'attributes',port:'<?=addslashes(htmlspecialchars($disks[$name]['device']??$name))?>',name:'<?=addslashes(htmlspecialchars($name))?>'}, function(data) {
|
||||
$('#disk_attributes').html(data);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@ Cond="strpos($disks[$name]['status'],'_NP')===false"
|
||||
?>
|
||||
<script>
|
||||
$(function() {
|
||||
$.post("/webGui/include/SmartInfo.php",{cmd:'capabilities',port:'<?=addslashes(htmlspecialchars(isset($disks[$name]['device'])?$disks[$name]['device']:$name))?>',name:'<?=addslashes(htmlspecialchars($name))?>'}, function(data) {
|
||||
$.post("/webGui/include/SmartInfo.php",{cmd:'capabilities',port:'<?=addslashes(htmlspecialchars($disks[$name]['device']??$name))?>',name:'<?=addslashes(htmlspecialchars($name))?>'}, function(data) {
|
||||
$('#disk_capabilities').html(data);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ function disklog(disk,key,value) {
|
||||
$.post('/webGui/include/DiskLog.php',{disk:disk,key:key,value:value});
|
||||
}
|
||||
$(function() {
|
||||
$.post("/webGui/include/SmartInfo.php",{cmd:'identify',port:'<?=addslashes(htmlspecialchars(isset($disks[$name]['device'])?$disks[$name]['device']:$name))?>',name:'<?=addslashes(htmlspecialchars($name))?>'}, function(data) {
|
||||
$.post("/webGui/include/SmartInfo.php",{cmd:'identify',port:'<?=addslashes(htmlspecialchars($disks[$name]['device']??$name))?>',name:'<?=addslashes(htmlspecialchars($name))?>'}, function(data) {
|
||||
$('#disk_identify').html(data);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -27,6 +27,29 @@ function maintenance_mode() {
|
||||
global $var, $disk;
|
||||
return ($var['fsState']=="Started" && $var['startMode']=="Maintenance" && $disk['luksState']<=1);
|
||||
}
|
||||
$sheets = []; $n = 0;
|
||||
$type = isset($disks[$name]) ? 'Device' : 'New';
|
||||
if ($type=='New') {
|
||||
$dev = $name;
|
||||
foreach ($devs as $sheet) {
|
||||
$sheets[] = $sheet['device'];
|
||||
if ($sheet['device']==$name) {$i = $n; $file = $sheet['id']."-$date.txt";}
|
||||
$n++;
|
||||
}
|
||||
} else {
|
||||
$disk = $disks[$name];
|
||||
$dev = $disk['device'];
|
||||
$file = $disk['id']."-$date.txt";
|
||||
foreach ($disks as $sheet) {
|
||||
if ($sheet['name']=='flash' || strpos($sheet['status'],'_NP')) continue;
|
||||
$sheets[] = $sheet['name'];
|
||||
if ($sheet['name']==$name) { $i = $n; $spindown = "diskSpindownDelay.{$sheet['idx']}"; $delay = $sheet['spindownDelay']; }
|
||||
$n++;
|
||||
}
|
||||
}
|
||||
$end = count($sheets)-1;
|
||||
$prev = $i>0 ? $sheets[$i-1] : $sheets[$end];
|
||||
$next = $i<$end ? $sheets[$i+1] : $sheets[0];
|
||||
?>
|
||||
<style>
|
||||
input.option{display:none;width:40px}
|
||||
@@ -126,6 +149,11 @@ function setGlue(form,reset) {
|
||||
$('#helptext').hide();
|
||||
}
|
||||
}
|
||||
<?if (count($sheets)>1):?>
|
||||
var ctrl = "<span class='status vhshift'><span class='waitmsg' style='display:none;font-size:small;font-style:italic;margin-right:8px'>please wait...</span><a href='/Main/<?=$type?>?name=<?=$prev?>' title='previous device'>";
|
||||
ctrl += "<button type='button' style='margin-right:4px' onclick='this.disabled=true;$(\".waitmsg\").show();'><i class='fa fa-chevron-left'></i></button></a>";
|
||||
ctrl += "<a href='/Main/<?=$type?>?name=<?=$next?>' title='next device'><button type='button' onclick='this.disabled=true;$(\".waitmsg\").show();'><i class='fa fa-chevron-right'></i></button></a></span>";
|
||||
<?endif;?>
|
||||
$(function() {
|
||||
var form = document.smart_settings;
|
||||
<?if (!isset($disk['smType'])):?>
|
||||
|
||||
@@ -56,7 +56,7 @@ $(function() {
|
||||
<?if ($tabbed):?>
|
||||
$('.tabs').append(ctrl);
|
||||
<?else:?>
|
||||
$('div[id=title]:not(".nocontrol")').each(function(){$(this).append(ctrl);});
|
||||
$('div[id=title]:first').append(ctrl);
|
||||
<?endif;?>
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -17,30 +17,7 @@ Cond="strpos($disks[$name]['status'],'_NP')===false"
|
||||
?>
|
||||
<?
|
||||
$date = date('Ymd-Hi');
|
||||
$sheets = []; $n = 0;
|
||||
$type = isset($disks[$name]) ? 'Device' : 'New';
|
||||
if ($type=='New') {
|
||||
$dev = $name;
|
||||
foreach ($devs as $sheet) {
|
||||
$sheets[] = $sheet['device'];
|
||||
if ($sheet['device']==$name) {$i = $n; $file = $sheet['id']."-$date.txt";}
|
||||
$n++;
|
||||
}
|
||||
} else {
|
||||
$disk = $disks[$name];
|
||||
$dev = $disk['device'];
|
||||
$file = $disk['id']."-$date.txt";
|
||||
foreach ($disks as $sheet) {
|
||||
if ($sheet['name']=='flash' || strpos($sheet['status'],'_NP')) continue;
|
||||
$sheets[] = $sheet['name'];
|
||||
if ($sheet['name']==$name) { $i = $n; $spindown = "diskSpindownDelay.{$sheet['idx']}"; $delay = $sheet['spindownDelay']; }
|
||||
$n++;
|
||||
}
|
||||
}
|
||||
$live = exec("hdparm -C ".escapeshellarg("/dev/$dev")."|grep -Pom1 'active|unknown'");
|
||||
$end = count($sheets)-1;
|
||||
$prev = $i>0 ? $sheets[$i-1] : $sheets[$end];
|
||||
$next = $i<$end ? $sheets[$i+1] : $sheets[0];
|
||||
$zip = str_replace(' ','_',strtolower($var['NAME']))."-smart-$date.zip";
|
||||
|
||||
function spindownDelay() {
|
||||
@@ -193,21 +170,14 @@ function startLongTest() {
|
||||
<?endif;?>
|
||||
}
|
||||
}
|
||||
<?if (count($sheets)>1):?>
|
||||
var ctrl = "<span class='status vhshift'><span class='waitmsg' style='display:none;font-size:small;font-style:italic;margin-right:8px'>please wait...</span><a href='/Main/<?=$type?>?name=<?=$prev?>' title='previous device'>";
|
||||
ctrl += "<button type='button' style='margin-right:4px' onclick='this.disabled=true;$(\".waitmsg\").show();'><i class='fa fa-chevron-left'></i></button></a>";
|
||||
ctrl += "<a href='/Main/<?=$type?>?name=<?=$next?>' title='next device'><button type='button' onclick='this.disabled=true;$(\".waitmsg\").show();'><i class='fa fa-chevron-right'></i></button></a></span>";
|
||||
|
||||
$(function() {
|
||||
<?if (count($sheets)>1):?>
|
||||
<?if ($tabbed):?>
|
||||
$('.tabs').append(ctrl);
|
||||
<?else:?>
|
||||
$('div[id=title]:not(".nocontrol")').each(function(){$(this).append(ctrl);});
|
||||
$('div[id=title]:first').append(ctrl);
|
||||
<?endif;?>
|
||||
});
|
||||
<?endif;?>
|
||||
|
||||
$(function() {
|
||||
var smarttest = $.cookie('test.<?=addslashes(htmlspecialchars($dev))?>');
|
||||
testUpdate(smarttest===undefined);
|
||||
if (smarttest !== undefined) $('#'+smarttest+'_test').val('Stop').removeAttr('disabled');
|
||||
@@ -218,4 +188,4 @@ $(function() {
|
||||
$.post('/webGui/include/SmartInfo.php',{cmd:'errorlog',port:'<?=addslashes(htmlspecialchars($dev))?>',name:'<?=addslashes(htmlspecialchars($name))?>'},function(data){$('#errorlog').html(data);});
|
||||
<?endif;?>
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -60,7 +60,7 @@ $(function() {
|
||||
<?if ($tabbed):?>
|
||||
$('.tabs').append(ctrl);
|
||||
<?else:?>
|
||||
$('div[id=title]:not(".nocontrol")').each(function(){$(this).append(ctrl);});
|
||||
$('div[id=title]:first').append(ctrl);
|
||||
<?endif;?>
|
||||
});
|
||||
<?endif;?>
|
||||
|
||||
@@ -209,8 +209,8 @@ span.temp-text{font-size:12px;color:#4F8A10}
|
||||
span.heat-text{font-size:12px;color:#F0000C}
|
||||
span.cpu-speed{display:block;color:#3B5998}
|
||||
span.status{float:right;font-size:15px}
|
||||
span.status.vhshift{margin-top:-22px;margin-right:-30px}
|
||||
span.status.hshift{margin-right:-30px}
|
||||
span.status.vhshift{margin-top:-16px;margin-right:-20px}
|
||||
span.status.hshift{margin-right:-20px}
|
||||
span.diskinfo{float:left;clear:both;margin-top:5px;padding-left:10px}
|
||||
span.bitstream{font-family:bitstream;font-size:11px}
|
||||
span.p0{padding-left:0}
|
||||
|
||||
@@ -18,7 +18,7 @@ i.icon{margin-right:4px}
|
||||
i.title{margin-right:8px}
|
||||
hr{border-color:rgba(255,255,255,0.25)}
|
||||
input[type=text],input[type=password],input[type=number],input[type=url],input[type=email],input[type=date],input[type=file],textarea,.textarea{font-family:arimo;font-size:12px;color:#808080;background-color:#000000;border:1px solid #404040;border-radius:4px;padding:2px 8px;min-height:20px;line-height:20px;outline:none;width:301px;margin:0 10px 0 0;box-shadow:inset 1px 1px 5px #404040}
|
||||
input[type=button],input[type=reset],input[type=submit],button,a.button{font-family:arimo;font-size:12px;border:1px solid #303030;border-radius:6px;margin:7px 14px 0 0;padding:8px 12px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;color:#808080;background:-webkit-radial-gradient(#505050,#181818);background:linear-gradient(#505050,#181818)}
|
||||
input[type=button],input[type=reset],input[type=submit],button,a.button{font-family:arimo;font-size:12px;border:1px solid #303030;border-radius:6px;margin:12px 14px 0 0;padding:5px 12px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;color:#808080;background:-webkit-radial-gradient(#505050,#181818);background:linear-gradient(#505050,#181818)}
|
||||
input[type=checkbox]{vertical-align:middle;margin-right:6px}
|
||||
input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance: none}
|
||||
input[type=number]{-moz-appearance:textfield}
|
||||
|
||||
@@ -209,8 +209,8 @@ span.temp-text{font-size:12px;color:#4F8A10}
|
||||
span.heat-text{font-size:12px;color:#F0000C}
|
||||
span.cpu-speed{display:block;color:#3B5998}
|
||||
span.status{float:right;font-size:15px}
|
||||
span.status.vhshift{margin-top:-22px;margin-right:-30px}
|
||||
span.status.hshift{margin-right:-30px}
|
||||
span.status.vhshift{margin-top:-16px;margin-right:-20px}
|
||||
span.status.hshift{margin-right:-20px}
|
||||
span.diskinfo{float:left;clear:both;margin-top:5px;padding-left:10px}
|
||||
span.bitstream{font-family:bitstream;font-size:11px}
|
||||
span.p0{padding-left:0}
|
||||
|
||||
@@ -18,7 +18,7 @@ i.icon{margin-right:4px}
|
||||
i.title{margin-right:8px}
|
||||
hr{border-color:rgba(255,255,255,0.25)}
|
||||
input[type=text],input[type=password],input[type=number],input[type=url],input[type=email],input[type=date],input[type=file],textarea,.textarea{font-family:arimo;font-size:12px;color:#303030;background-color:#FFFFFF;border:1px solid #E0E0E0;border-radius:4px;padding:2px 8px;min-height:20px;line-height:20px;outline:none;width:301px;margin:0 10px 0 0;box-shadow:inset 1px 1px 5px #F0F0F0}
|
||||
input[type=button],input[type=reset],input[type=submit],button,a.button{font-family:arimo;font-size:12px;border:1px solid #E8E8E8;border-radius:6px;margin:7px 14px 0 0;padding:8px 12px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;color:#303030;background:-webkit-radial-gradient(#F0F0F0,#C8C8C8);background:linear-gradient(#F0F0F0,#C8C8C8)}
|
||||
input[type=button],input[type=reset],input[type=submit],button,a.button{font-family:arimo;font-size:12px;border:1px solid #E8E8E8;border-radius:6px;margin:12px 14px 0 0;padding:5px 12px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;color:#303030;background:-webkit-radial-gradient(#F0F0F0,#C8C8C8);background:linear-gradient(#F0F0F0,#C8C8C8)}
|
||||
input[type=checkbox]{vertical-align:middle;margin-right:6px}
|
||||
input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance: none}
|
||||
input[type=number]{-moz-appearance:textfield}
|
||||
|
||||
Reference in New Issue
Block a user