From ec8c2780c39b0871c7270c8249d75575396abe0c Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sun, 26 Aug 2007 04:28:27 +0000 Subject: [PATCH] Auto-loader slot field --- bacula-backup/CHANGELOG | 1 + bacula-backup/lang/en | 5 +++++ bacula-backup/mount.cgi | 11 +++++++++-- bacula-backup/mount_form.cgi | 5 +++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/bacula-backup/CHANGELOG b/bacula-backup/CHANGELOG index c4020d8ed..5185682d5 100644 --- a/bacula-backup/CHANGELOG +++ b/bacula-backup/CHANGELOG @@ -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. diff --git a/bacula-backup/lang/en b/bacula-backup/lang/en index 0da2d7853..b1f19d8a9 100644 --- a/bacula-backup/lang/en +++ b/bacula-backup/lang/en @@ -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 diff --git a/bacula-backup/mount.cgi b/bacula-backup/mount.cgi index fd5448521..985239139 100755 --- a/bacula-backup/mount.cgi +++ b/bacula-backup/mount.cgi @@ -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 "",&text($mode.'_run', "$in{'storage'}"),"\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 ""; diff --git a/bacula-backup/mount_form.cgi b/bacula-backup/mount_form.cgi index 9605d3870..009abc0bd 100755 --- a/bacula-backup/mount_form.cgi +++ b/bacula-backup/mount_form.cgi @@ -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'} ] ]);