Fixes for ZFS subpools

This commit is contained in:
bergware
2023-11-01 19:51:40 +01:00
parent 304be089ee
commit eef112fbd2
2 changed files with 4 additions and 2 deletions

View File

@@ -15,12 +15,14 @@ Tag="database"
*/
?>
<script>
String.prototype.no_tilde = function(){return this.replace('~','_-_');}
function toggle_state(device,name,action) {
var button = null;
if (name) {
var group = name.replace(/(\d+|\*)$/,'');
if (name.slice(-1)!='*') {
$('#dev-'+name.replace('~','_-_')).removeClass('fa-circle fa-square fa-warning fa-times').addClass('fa-refresh fa-spin');
$('#dev-'+name.no_tilde()).removeClass('fa-circle fa-square fa-warning fa-times').addClass('fa-refresh fa-spin');
} else {
if (group=='array') {
$('[id^="dev-parity"]').removeClass('fa-circle fa-square fa-warning fa-times').addClass('fa-refresh fa-spin');

View File

@@ -322,7 +322,7 @@ if ($saved) {
$text = '';
foreach ($saved as $item => $block) {
if ($block) $text .= "[$item]\n";
foreach ($block as $key => $value) $text .= str_replace('~','_-_',$key)."=\"$value\"\n";
foreach ($block as $key => $value) $text .= no_tilde($key)."=\"$value\"\n";
}
if ($text) {
if ($text != @file_get_contents($ram)) file_put_contents($ram, $text);