Fix next/prev buttons for emulated disks

This commit is contained in:
bergware
2017-11-12 10:24:37 +01:00
parent 571da34fb4
commit 5e003af7d3
2 changed files with 11 additions and 13 deletions

View File

@@ -41,7 +41,7 @@ if ($type=='New') {
$dev = $disk['device'];
$file = $disk['id']."-$date.txt";
foreach ($disks as $sheet) {
if ($sheet['name']=='flash' || strpos($sheet['status'],'_NP')) continue;
if ($sheet['type']=='Flash' || ($sheet['type']=='Parity' && $sheet['status']=='DISK_NP_DSBL')) continue;
$sheets[] = $sheet['name'];
if ($sheet['name']==$name) { $i = $n; $spindown = "diskSpindownDelay.{$sheet['idx']}"; $delay = $sheet['spindownDelay']; }
$n++;
@@ -149,12 +149,17 @@ 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() {
<?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>";
<?if ($tabbed):?>
$('.tabs').append(ctrl);
<?else:?>
$('div[id=title]:first').append(ctrl);
<?endif;?>
<?endif;?>
var form = document.smart_settings;
<?if (!isset($disk['smType'])):?>
form.smType.selectedIndex = 0;

View File

@@ -171,13 +171,6 @@ function startLongTest() {
}
}
$(function() {
<?if (count($sheets)>1):?>
<?if ($tabbed):?>
$('.tabs').append(ctrl);
<?else:?>
$('div[id=title]:first').append(ctrl);
<?endif;?>
<?endif;?>
var smarttest = $.cookie('test.<?=addslashes(htmlspecialchars($dev))?>');
testUpdate(smarttest===undefined);
if (smarttest !== undefined) $('#'+smarttest+'_test').val('Stop').removeAttr('disabled');