Skip to content

Commit

Permalink
another update
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Aug 13, 2014
1 parent e73a903 commit a3434df
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
11 changes: 7 additions & 4 deletions cmd.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -301,31 +301,34 @@ if (($in{'export'}) && ($conf{'pool_properties'} =~ /1/))
if (!$in{'confirm'})
{
print "<h3>Would you lke to continue?</h3>";
print "<a href='cmd.cgi?export=$in{'export'}&confirm=yes'>Yes</a> | <a onClick=\"\window.close('cmd')\"\ href=''>No</a>";
print "<a href='cmd.cgi?export=$in{'export'}&confirm=yes'>Yes</a>";
#print "<a href='cmd.cgi?export=$in{'export'}&confirm=yes'>Yes</a> | <a onClick=\"\window.close('cmd')\"\ href=''>No</a>";
} else {
if (($result[1] == //))
{
print "Success! <br />";
print "<a onClick=\"\window.close('cmd')\"\ href=''>Close</a>";
#print "<a onClick=\"\window.close('cmd')\"\ href=''>Close</a>";
} else
{
print "error: ", $result[1], "<br />";
}
}
#ui_print_footer("index.cgi?mode=snapshot", $text{'snapshot_return'});
popup_footer();
ui_print_footer("index.cgi?mode=pools", $text{'index_return'});
#popup_footer();
}

#start a scrub
if (($in{'scrub'}) && ($conf{'pool_properties'} =~ /1/))
{
print ui_cmd_zpool("scrub pool", $in{'scrub'}, ($in{'scrub'}, 'scrub', undef, undef, $in{'confirm'}));
ui_print_footer("status.cgi?pool=".$in{'scrub'}, $in{'scrub'});
}

#stop a scrub
if (($in{'scrubstop'}) && ($conf{'pool_properties'} =~ /1/))
{
print ui_cmd_zpool("stop scrub pool", $in{'scrubstop'}, ($in{'scrubstop'}, 'scrub', '-s', undef, $in{'confirm'}));
ui_print_footer("status.cgi?pool=".$in{'scrubstop'}, $in{'srubstop'});
}

#clone a snapshot
Expand Down
16 changes: 9 additions & 7 deletions zfsmanager-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ sub list_snapshots
sub get_alerts
{
my $alerts = `zpool status -x`;
my $alerts = `zpool status -x`;
my %status = ();
my $pool = ();
if ($alerts =~ /all pools are healthy/)
Expand Down Expand Up @@ -162,9 +161,9 @@ sub get_alerts
my $out = "<b>";
foreach $key (sort(keys %status))
{
if (true) { $out = $out."pool \'".$key."\' is ".$status{$key}{state}." with ".$status{$key}{errors}."<br />";}
if (true) { $out .= "pool \'".$key."\' is ".$status{$key}{state}." with ".$status{$key}{errors}."<br />";}
}
$out = $out."</b>";
$out .= "</b>";
return $out;
}
}
Expand Down Expand Up @@ -358,6 +357,7 @@ sub list_disk_ids

#cmd_online($pool, $vdev)
sub cmd_online
#deprecated
{
my ($pool, $vdev) = @_;
my $cmd = "zpool online $pool $vdev";
Expand All @@ -367,6 +367,7 @@ sub cmd_online

#cmd_offline($pool, $vdev)
sub cmd_offline
#deprecated
{
my ($pool, $vdev) = @_;
my $cmd = "zpool offline $pool $vdev";
Expand All @@ -376,6 +377,7 @@ sub cmd_offline

#cmd_remove($pool, $vdev)
sub cmd_remove
#deprecated
{
my ($pool, $vdev) = @_;
my $cmd="zpool remove $pool $vdev";
Expand Down Expand Up @@ -478,7 +480,7 @@ sub cmd_destroy_zfs
if ($confirm =~ /yes/)
{
#$out = backquote_logged($cmd);
chomp $out;
#chomp $out;
@result = ( $cmd, `$cmd 2>&1` );
} else
{
Expand Down Expand Up @@ -514,7 +516,6 @@ sub cmd_zfs
return $result;
}


sub ui_zpool_status
{
my ($pool, $action) = @_;
Expand Down Expand Up @@ -649,12 +650,13 @@ sub ui_cmd_zpool
if (!$in{'confirm'})
{
$rv .= "<h3>Would you lke to continue?</h3>\n";
$rv .= "<a href='$ENV{REQUEST_URI}&confirm=yes'>Yes</a> | <a onClick=\"\window.close('cmd')\"\ href=''>No</a>\n";
$rv .= "<a href='$ENV{REQUEST_URI}&confirm=yes'>Yes</a>\n";
#$rv .= "<a href='$ENV{REQUEST_URI}&confirm=yes'>Yes</a> | <a onClick=\"\window.close('cmd')\"\ href=''>No</a>\n";
} else {
if (($result[1] == //))
{
$rv .= "Success! <br />\n";
$rv .= "<a onClick=\"\window.close('cmd')\"\ href=''>Close</a>\n";
#$rv .= "<a onClick=\"\window.close('cmd')\"\ href=''>Close</a>\n";
} else
{
$rv .= "error: ".$result[1]."<br />\n";
Expand Down

0 comments on commit a3434df

Please sign in to comment.