From bd2373a93c7721902e34f7c50b7fb73b30c6c70b Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Thu, 3 May 2012 18:20:15 -0700 Subject: [PATCH] Fix buttons at end of mount form --- mount/edit_mount.cgi | 30 ++++++++++++++---------------- mount/save_mount.cgi | 6 ++++++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/mount/edit_mount.cgi b/mount/edit_mount.cgi index b216ae688..6d5ea6b63 100755 --- a/mount/edit_mount.cgi +++ b/mount/edit_mount.cgi @@ -70,12 +70,15 @@ print &ui_table_row(&hlink($text{'edit_dir'}, "edit_dir"), $mfield); # Total and free space -if (!$newm && (($size,$free) = &disk_space($type, $minfo[0]))) { - print &ui_table_row($text{'edit_usage'}, - "$text{'edit_size'} ", - &nice_size($size*1024)," ", - "$text{'edit_free'} ", - &nice_size($free*1024)); +if (!$newm) { + ($size,$free) = &disk_space($type, $minfo[0]); + if ($size) { + print &ui_table_row($text{'edit_usage'}, + "$text{'edit_size'} ". + &nice_size($size*1024)." ". + "$text{'edit_free'} ". + &nice_size($free*1024)); + } } # Show save mount options @@ -133,22 +136,17 @@ if (!defined($access{'opts'}) || $access{'opts'} =~ /$type/) { } # Save and other buttons -print "\n"; if ($newm) { - print ""; + print &ui_form_end([ [ undef, $text{'create'} ] ]); } elsif ($mnow && $minfo[2] ne "swap") { - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; + print &ui_hidden("lsoffs", $minfo[0]); + print &ui_form_end([ [ undef, $text{'save'} ], + [ 'lsof', $text{'edit_list'} ] ]); } else { - print ""; + print &ui_form_end([ [ undef, $text{'save'} ] ]); } -print "
\n"; &ui_print_footer($in{'return'}, $text{'index_return'}); diff --git a/mount/save_mount.cgi b/mount/save_mount.cgi index 9569e70aa..779f6dcc6 100755 --- a/mount/save_mount.cgi +++ b/mount/save_mount.cgi @@ -8,6 +8,12 @@ require './mount-lib.pl'; &ReadParse(); $| = 1; +# Check for redirect to proc module to list processes on the FS +if ($in{'lsof'}) { + &redirect("../proc/index_search.cgi?mode=3&fs=".&urlize($in{'lsoffs'})); + return; + } + # check inputs if ($in{type} ne "swap") { if ($in{directory} !~ /^\//) {