mirror of
https://github.com/unraid/webgui.git
synced 2026-04-27 13:29:42 -05:00
52 lines
2.3 KiB
Plaintext
52 lines
2.3 KiB
Plaintext
Menu="UNRAID-OS"
|
|
Title="New Config"
|
|
---
|
|
<?PHP
|
|
/* Copyright 2005-2016, Lime Technology
|
|
* Copyright 2015-2016, Bergware International.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License version 2,
|
|
* as published by the Free Software Foundation.
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*/
|
|
?>
|
|
<script>
|
|
<?if (file_exists('/var/tmp/disks.ini')):?>
|
|
function assign(id,value) {
|
|
var pairs = {changeDevice:'Apply'};
|
|
pairs['slotId.'+id] = value;
|
|
$.post('/update.htm',pairs);
|
|
}
|
|
<?
|
|
$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>
|
|
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.
|
|
|
|
This is useful when you have added or removed multiple drives and wish to rebuild parity based on
|
|
the new configuration.
|
|
|
|
**DO NOT USE THIS UTILITY THINKING IT WILL REBUILD A FAILED DRIVE** - it will have the opposite
|
|
effect of making it ***impossible*** to rebuild an existing failed drive - you have been warned!
|
|
|
|
<hr>
|
|
<?$super = file_exists('/boot/config/super.dat')?>
|
|
<form name="newConfig" method="POST" action="/update.htm" target="progressFrame">
|
|
<?if ($var['fsState']=="Started" || !$super):?>
|
|
<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>
|
|
<?endif;?>
|
|
</form>
|