Skip to content

Commit ff7d130

Browse files
committed
updated files for unix compatibility, thank you hjmallon
1 parent 4c74ecd commit ff7d130

File tree

11 files changed

+1902
-1902
lines changed

11 files changed

+1902
-1902
lines changed

config

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
pool_destroy=1
2-
zfs_destroy=1
3-
snap_destroy=1
4-
pool_properties=1
5-
zfs_properties=1
6-
snap_properties=1
7-
show_snap=1
8-
last_send=/root
9-
list_zpool=size,alloc,free,frag,cap,dedup,health
10-
list_zfs=used,avail,refer,mountpoint
11-
list_snap=used,refer
1+
pool_destroy=1
2+
zfs_destroy=1
3+
snap_destroy=1
4+
pool_properties=1
5+
zfs_properties=1
6+
snap_properties=1
7+
show_snap=1
8+
last_send=/root
9+
list_zpool=size,alloc,free,frag,cap,dedup,health
10+
list_zfs=used,avail,refer,mountpoint
11+
list_snap=used,refer

config-vdev.cgi

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
#!/usr/bin/perl
2-
3-
require './zfsmanager-lib.pl';
4-
ReadParse();
5-
use Data::Dumper;
6-
7-
ui_print_header(undef, $text{'vdev_title'}, "", undef, 1, 1);
8-
9-
my %status = zpool_status($in{'pool'});
10-
11-
print ui_columns_start([ "Virtual Device", "State", "Read", "Write", "Cksum" ]);
12-
print ui_columns_row([$status{$in{'dev'}}{name}, $status{$in{'dev'}}{state}, $status{$in{'dev'}}{read}, $status{$in{'dev'}}{write}, $status{$in{'dev'}}{cksum}]);
13-
print ui_columns_end();
14-
15-
$parent = $status{$in{'dev'}}{parent};
16-
if ($status{$in{'dev'}}{parent} =~ 'pool')
17-
{
18-
} else {
19-
print ui_columns_start([ "Parent", "State", "Read", "Write", "Cksum" ]);
20-
print ui_columns_row(["<a href='config-vdev.cgi?pool=$in{'pool'}&dev=$status{$in{'dev'}}{parent}'>$status{$parent}{name}</a>", $status{$parent}{state}, $status{$parent}{read}, $status{$parent}{write}, $status{$parent}{cksum}]);
21-
print ui_columns_end();
22-
}
23-
ui_zpool_list($in{'pool'});
24-
if (($status{$in{'dev'}}{name} =~ "cache") || ($status{$in{'dev'}}{name} =~ "logs") || ($status{$in{'dev'}}{name} =~ "spare") || ($status{$in{'dev'}}{name} =~ /mirror/) || ($status{$in{'dev'}}{name} =~ /raidz/))
25-
{
26-
print "Children: ";
27-
foreach $key (sort(keys %status))
28-
{
29-
if ($status{$key}{parent} =~ $in{'dev'})
30-
{
31-
print "<a href='config-vdev.cgi?pool=$in{pool}&dev=$key'>".$status{$key}{name}."</a> ";
32-
}
33-
}
34-
} elsif ($config{'pool_properties'} =~ /1/) {
35-
print ui_table_start("Tasks", "width=100%", "10", ['align=left'] );
36-
if ($status{$in{'dev'}}{state} =~ "ONLINE") {
37-
print ui_table_row("Offline: ", "<a href='cmd.cgi?cmd=vdev&action=offline&pool=$in{'pool'}&vdev=$status{$in{'dev'}}{name}'>Bring device offline</a><br />");
38-
}
39-
else { #elsif ($status{$in{'dev'}}{state} =~ "OFFLINE") {
40-
print ui_table_row("Online: ", "<a href='cmd.cgi?cmd=vdev&action=online&pool=$in{'pool'}&vdev=$status{$in{'dev'}}{name}'>Bring device online</a><br />");
41-
}
42-
print ui_table_row("Replace: ", "<a href='cmd.cgi?cmd=replace&vdev=$status{$in{'dev'}}{name}&pool=$in{'pool'}'>Replace device</a><br />");
43-
print ui_table_row("Remove: ", "<a href='cmd.cgi?cmd=vdev&action=remove&pool=$in{'pool'}&vdev=$status{$in{'dev'}}{name}'>Remove device</a><br />");
44-
print ui_table_row("Detach: ", "<a href='cmd.cgi?cmd=vdev&action=detach&pool=$in{'pool'}&vdev=$status{$in{'dev'}}{name}'>Detach device</a><br />");
45-
print ui_table_row("Clear: ", "<a href='cmd.cgi?cmd=vdev&action=clear&pool=$in{'pool'}&vdev=$status{$in{'dev'}}{name}'>Clear errors</a><br />");
46-
print ui_table_end();
47-
}
48-
49-
ui_print_footer("status.cgi?pool=$in{'pool'}", $in{'pool'});
1+
#!/usr/bin/perl
2+
3+
require './zfsmanager-lib.pl';
4+
ReadParse();
5+
use Data::Dumper;
6+
7+
ui_print_header(undef, $text{'vdev_title'}, "", undef, 1, 1);
8+
9+
my %status = zpool_status($in{'pool'});
10+
11+
print ui_columns_start([ "Virtual Device", "State", "Read", "Write", "Cksum" ]);
12+
print ui_columns_row([$status{$in{'dev'}}{name}, $status{$in{'dev'}}{state}, $status{$in{'dev'}}{read}, $status{$in{'dev'}}{write}, $status{$in{'dev'}}{cksum}]);
13+
print ui_columns_end();
14+
15+
$parent = $status{$in{'dev'}}{parent};
16+
if ($status{$in{'dev'}}{parent} =~ 'pool')
17+
{
18+
} else {
19+
print ui_columns_start([ "Parent", "State", "Read", "Write", "Cksum" ]);
20+
print ui_columns_row(["<a href='config-vdev.cgi?pool=$in{'pool'}&dev=$status{$in{'dev'}}{parent}'>$status{$parent}{name}</a>", $status{$parent}{state}, $status{$parent}{read}, $status{$parent}{write}, $status{$parent}{cksum}]);
21+
print ui_columns_end();
22+
}
23+
ui_zpool_list($in{'pool'});
24+
if (($status{$in{'dev'}}{name} =~ "cache") || ($status{$in{'dev'}}{name} =~ "logs") || ($status{$in{'dev'}}{name} =~ "spare") || ($status{$in{'dev'}}{name} =~ /mirror/) || ($status{$in{'dev'}}{name} =~ /raidz/))
25+
{
26+
print "Children: ";
27+
foreach $key (sort(keys %status))
28+
{
29+
if ($status{$key}{parent} =~ $in{'dev'})
30+
{
31+
print "<a href='config-vdev.cgi?pool=$in{pool}&dev=$key'>".$status{$key}{name}."</a> ";
32+
}
33+
}
34+
} elsif ($config{'pool_properties'} =~ /1/) {
35+
print ui_table_start("Tasks", "width=100%", "10", ['align=left'] );
36+
if ($status{$in{'dev'}}{state} =~ "ONLINE") {
37+
print ui_table_row("Offline: ", "<a href='cmd.cgi?cmd=vdev&action=offline&pool=$in{'pool'}&vdev=$status{$in{'dev'}}{name}'>Bring device offline</a><br />");
38+
}
39+
else { #elsif ($status{$in{'dev'}}{state} =~ "OFFLINE") {
40+
print ui_table_row("Online: ", "<a href='cmd.cgi?cmd=vdev&action=online&pool=$in{'pool'}&vdev=$status{$in{'dev'}}{name}'>Bring device online</a><br />");
41+
}
42+
print ui_table_row("Replace: ", "<a href='cmd.cgi?cmd=replace&vdev=$status{$in{'dev'}}{name}&pool=$in{'pool'}'>Replace device</a><br />");
43+
print ui_table_row("Remove: ", "<a href='cmd.cgi?cmd=vdev&action=remove&pool=$in{'pool'}&vdev=$status{$in{'dev'}}{name}'>Remove device</a><br />");
44+
print ui_table_row("Detach: ", "<a href='cmd.cgi?cmd=vdev&action=detach&pool=$in{'pool'}&vdev=$status{$in{'dev'}}{name}'>Detach device</a><br />");
45+
print ui_table_row("Clear: ", "<a href='cmd.cgi?cmd=vdev&action=clear&pool=$in{'pool'}&vdev=$status{$in{'dev'}}{name}'>Clear errors</a><br />");
46+
print ui_table_end();
47+
}
48+
49+
ui_print_footer("status.cgi?pool=$in{'pool'}", $in{'pool'});

config.info

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
pool_destroy=Destructive pool tasks (zpool destroy),1,1-Enabled,0-Disabled
2-
zfs_destroy=Destructive file system tasks (zfs destroy),1,1-Enabled,0-Disabled
3-
snap_destroy=Destructive snapshot tasks (destroy snapshot),1,1-Enabled,0-Disabled
4-
pool_properties=Pool administration tasks (create | set properties | configure vdevs),1,1-Enabled,0-Disabled
5-
zfs_properties=File system administration tasks (create | set properties | mount),1,1-Enabled,0-Disabled
6-
snap_properties=Snapshot administration tasks (create | send),1,1-Enabled,0-Disabled
7-
show_snap=Show snapshots tab on index page,1,1-Enabled,0-Disabled
8-
#list_zpool=Comma delimited list of zpool properties to display,0
9-
#list_zfs=Comma delimited list of zfs properties to display,0
10-
#list_snap=Comma delimited list of snapshot properties to display,0
1+
pool_destroy=Destructive pool tasks (zpool destroy),1,1-Enabled,0-Disabled
2+
zfs_destroy=Destructive file system tasks (zfs destroy),1,1-Enabled,0-Disabled
3+
snap_destroy=Destructive snapshot tasks (destroy snapshot),1,1-Enabled,0-Disabled
4+
pool_properties=Pool administration tasks (create | set properties | configure vdevs),1,1-Enabled,0-Disabled
5+
zfs_properties=File system administration tasks (create | set properties | mount),1,1-Enabled,0-Disabled
6+
snap_properties=Snapshot administration tasks (create | send),1,1-Enabled,0-Disabled
7+
show_snap=Show snapshots tab on index page,1,1-Enabled,0-Disabled
8+
#list_zpool=Comma delimited list of zpool properties to display,0
9+
#list_zfs=Comma delimited list of zfs properties to display,0
10+
#list_snap=Comma delimited list of snapshot properties to display,0

0 commit comments

Comments
 (0)