mirror of
https://github.com/unraid/webgui.git
synced 2026-04-23 18:48:49 -05:00
Move DELETE button to separate section at end
This commit is contained in:
@@ -16,22 +16,23 @@ Tag="snowflake-o"
|
||||
?>
|
||||
<?
|
||||
$keyfile = file_exists($var['luksKeyfile']);
|
||||
$fsLuks = strpos($var['defaultFsType'],'luks:')!==false;
|
||||
$encrypt = false;
|
||||
foreach ($disks as $disk)
|
||||
$encrypt |= strpos((($disk['fsType'] == "auto") ? $var['defaultFsType'] : $disk['fsType']),'luks:')!==false;
|
||||
|
||||
/* only one of $forced, $missing, or $wrong will be true, or all will be false */
|
||||
$forced = false;
|
||||
$forced = false;
|
||||
$missing = false;
|
||||
$wrong = false;
|
||||
if ($encrypt) {
|
||||
if (!$keyfile) {
|
||||
$forced = $var['fsEncryption']=='no';
|
||||
$missing = !$forced;
|
||||
} else {
|
||||
$wrong = $var['fsEncryption']=='wrong';
|
||||
$wrong = false;
|
||||
foreach ($disks as $disk) {
|
||||
if (($disk['fsType']=='auto' && ($fsLuks || $disk['luksState']==2 || $disk['luksState']==3)) || (strpos($disk['fsType'],'luks:')!==false)) {
|
||||
$encrypt = true;
|
||||
if (!$keyfile) {
|
||||
if ($disk['luksState']==0) $forced = true; else $missing = true;
|
||||
} else {
|
||||
if ($disk['luksState']==3) $wrong = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($forced && $missing) $forced = false;
|
||||
|
||||
function check_encryption() {
|
||||
global $forced, $missing, $wrong;
|
||||
@@ -52,11 +53,6 @@ function check_encryption() {
|
||||
?>
|
||||
<script>
|
||||
function selectInput(form) {
|
||||
<?if ($missing && $var['luksRestricted']!='yes'):?>
|
||||
var strict = false;
|
||||
<?else:?>
|
||||
var strict = true;
|
||||
<?endif;?>
|
||||
if (form.input.value == 'text') {
|
||||
form.file.value = '';
|
||||
form.local.value = '';
|
||||
@@ -77,7 +73,7 @@ function selectInput(form) {
|
||||
<?endif;?>
|
||||
$('#file').hide();
|
||||
$('input[name="text"],input[name="copy"]').attr('type',$('input[name="showPass"]').prop('checked')?'text':'password');
|
||||
$('#cmdStart').prop('disabled',strict && ($('#copy').is(':visible') ? (form.text.value!=form.copy.value || form.text.value=='') : form.text.value==''));
|
||||
$('#cmdStart').prop('disabled',$('#copy').is(':visible') ? (form.text.value!=form.copy.value || form.text.value=='') : form.text.value=='');
|
||||
} else {
|
||||
form.text.value = '';
|
||||
form.copy.value = '';
|
||||
@@ -85,7 +81,7 @@ function selectInput(form) {
|
||||
$('#copy').hide();
|
||||
$('#perm').hide();
|
||||
$('#file').show();
|
||||
$('#cmdStart').prop('disabled',strict && !form.file.value);
|
||||
$('#cmdStart').prop('disabled',!form.file.value);
|
||||
}
|
||||
}
|
||||
function getFileContent(event,form) {
|
||||
@@ -461,6 +457,13 @@ toggle_diskio(true);
|
||||
</form>
|
||||
<?endif;?>
|
||||
<?endif;?>
|
||||
<form name="shutdownOps" method="POST" action="/webGui/include/Boot.php">
|
||||
<table class="array_status">
|
||||
<tr><td></td><td><input type="button" name="reboot" value="Reboot" onclick="shutdown_now(this.form,'reboot')"><input type="button" name="shutdown" value="Power down" onclick="shutdown_now(this.form,'shutdown')"></td>
|
||||
<td><strong>Reboot</strong> will activate a <em>clean</em> system reset.<br><strong>Power down</strong> will activate a <em>clean</em> power down.</td></tr>
|
||||
<tr><td></td><td class="line" colspan="2"></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?if ($keyfile):?>
|
||||
<form name="delete_keyfile" method="POST" action="/update.php" target="progressFrame">
|
||||
<input type="hidden" name="#file" value="unused">
|
||||
@@ -471,12 +474,6 @@ toggle_diskio(true);
|
||||
</table>
|
||||
</form>
|
||||
<?endif;?>
|
||||
<form name="shutdownOps" method="POST" action="/webGui/include/Boot.php">
|
||||
<table class="array_status">
|
||||
<tr><td></td><td><input type="button" name="reboot" value="Reboot" onclick="shutdown_now(this.form,'reboot')"><input type="button" name="shutdown" value="Power down" onclick="shutdown_now(this.form,'shutdown')"></td>
|
||||
<td><strong>Reboot</strong> will activate a <em>clean</em> system reset.<br><strong>Power down</strong> will activate a <em>clean</em> power down.</td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?
|
||||
if (isset($display['sleep'])) @include $display['sleep'];
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user