Added 'preset current configuration' with New Config utility [3]

This commit is contained in:
bergware
2016-06-26 00:07:40 +02:00
parent 48eb01eca5
commit 6e200616b0
+3 -6
View File
@@ -13,8 +13,8 @@ Title="New Config"
* all copies or substantial portions of the Software.
*/
?>
<script>
<?if (file_exists('/var/tmp/disks.ini')):?>
<script>
function assign(id,value) {
var pairs = {changeDevice:'Apply'};
pairs['slotId.'+id] = value;
@@ -25,11 +25,8 @@ $disks = parse_ini_file('/var/tmp/disks.ini',true);
foreach ($disks as $disk) if ($disk['type']!='Flash') echo "assign('{$disk['idx']}','{$disk['id']}');";
unlink('/var/tmp/disks.ini');
?>
<?endif;?>
function prepareDisks(preset) {
$.post('/webGui/include/PrepareDisks.php',{preset:preset});
}
</script>
<?endif;?>
This is a utility to reset the array disk configuration so that all disks appear as "New" disks, as
if it were a fresh new server.
@@ -46,6 +43,6 @@ effect of making it ***impossible*** to rebuild an existing failed drive - you h
<input type="submit" name="cmdInit" value="Apply" disabled><input type="button" value="Done" onclick="done()"><?if ($super):?>Array must be <strong><big>stopped</big></strong><?else:?>Array has been <strong><big>reset</big></strong> (please configure)<?endif;?>
<?else:?>
<span style="display:inline-block;width:160px" class="orange-text">Preset current configuration:</span><input name="preset" type="checkbox" checked><br>
<span style="display:inline-block;width:160px"><input type="submit" name="cmdInit" value="Apply" onclick="prepareDisks(preset.checked)" disabled><input type="button" value="Done" onclick="done()"></span><input type="checkbox" onClick="cmdInit.disabled=!this.checked"><small>Yes I want to do this</small>
<span style="display:inline-block;width:160px"><input type="submit" name="cmdInit" value="Apply" onclick="$.post('/webGui/include/PrepareDisks.php',{preset:preset.checked})" disabled><input type="button" value="Done" onclick="done()"></span><input type="checkbox" onClick="cmdInit.disabled=!this.checked"><small>Yes I want to do this</small>
<?endif;?>
</form>