Auto-loader slot field
authorJamie Cameron <jcameron@webmin.com>
Sun, 26 Aug 2007 04:28:27 +0000 (04:28 +0000)
committerJamie Cameron <jcameron@webmin.com>
Sun, 26 Aug 2007 04:28:27 +0000 (04:28 +0000)
bacula-backup/CHANGELOG
bacula-backup/lang/en
bacula-backup/mount.cgi
bacula-backup/mount_form.cgi

index c4020d8..5185682 100644 (file)
@@ -2,3 +2,4 @@
 First version of this module, which allows Bacula to be configured and both backups and restores to be executed.
 ---- Changes since 1.360 ----
 Removed the requirement for the /etc/bacula/bacula command to be installed, if /etc/init.d/bacula-* scripts exist.
+Added a field to the mount/un-mount page for entering an auto-loader slot number.
index 0da2d78..b1f19d8 100644 (file)
@@ -363,6 +363,9 @@ dvolumes_ebacula=Bacula error : $1
 mount_title=Mount or Unmount
 mount_header=Storage mount or un-mount options
 mount_storage=Storge device
+mount_slot=Auto-loader slot
+mount_noslot=None
+mount_slotno=Slot number
 mount_mount=Mount Storage
 mount_unmount=Un-Mount Storage
 mount_run=Mounting volume on storage device $1 ..
@@ -372,6 +375,8 @@ unmount_done=.. un-mounted successfully.
 mount_failed=.. mount failed! See the error message above for the reason why.
 unmount_failed=.. un-mount failed! See the error message above for the reason why.
 mount_return=mount form
+mount_err=Failed to mount storage device
+mount_eslot=Missing or invalid slot number
 
 cancel_err=Failed to cancel jobs
 cancel_enone=None selected
index fd54485..9852391 100755 (executable)
@@ -2,8 +2,14 @@
 # Actually execute a backup
 
 require './bacula-backup-lib.pl';
-&ui_print_unbuffered_header(undef,  $text{'mount_title'}, "");
 &ReadParse();
+&error_setup($text{'mount_err'});
+
+# Validate inputs
+$in{'slot_def'} || $in{'slot'} =~ /^[1-9][0-9]*$/ ||
+       &error($text{'mount_eslot'});
+
+&ui_print_unbuffered_header(undef,  $text{'mount_title'}, "");
 $mode = $in{'mount'} ? "mount" : "unmount";
 
 print "<b>",&text($mode.'_run', "<tt>$in{'storage'}</tt>"),"</b>\n";
@@ -12,7 +18,8 @@ $h = &open_console();
 &console_cmd($h, "messages");
 
 # Run the command
-$out = &console_cmd($h, "$mode storage=$in{'storage'}");
+$out = &console_cmd($h, "$mode storage=$in{'storage'}".
+                       ($in{'slot_def'} ? "" : " slot=$in{'slot'}"));
 print $out;
 
 print "</pre>";
index 9605d38..009abc0 100755 (executable)
@@ -16,6 +16,11 @@ print &ui_table_row($text{'mount_storage'},
                   &text('clientstatus_on', $_->{'name'}, $_->{'address'}) ] }
           @storages ]));
 
+# Autoloader slot
+print &ui_table_row($text{'mount_slot'},
+       &ui_opt_textbox("slot", undef, 5, $text{'mount_noslot'},
+                       $text{'mount_slotno'}));
+
 print &ui_table_end();
 print &ui_form_end([ [ 'mount', $text{'mount_mount'} ],
                     [ 'unmount', $text{'mount_unmount'} ] ]);