} elsif ($action eq 'location_del') {
$bweb->location_del();
+} elsif ($action eq 'cmd_storage') {
+ $bweb->cmd_storage();
+
} elsif ($action eq 'media') {
$bweb->can_do('r_view_media');
<li><a href="bweb.pl?action=intern_media">Load Media</a> </li>
</ul>
</li>
-<TMPL_IF achs>
- <li style="padding: 0.25em 2em;">Autochanger
+ <li style="padding: 0.25em 2em;">Storages
<ul>
+ <li><a href="bweb.pl?action=cmd_storage">Manage Device</a><TMPL_IF achs><hr></TMPL_IF></li>
<TMPL_LOOP achs>
<li><a href="bweb.pl?action=ach_view;ach=<TMPL_VAR name>"><TMPL_VAR name></a></li>
</TMPL_LOOP>
</ul>
</li>
-</TMPL_IF>
- <li><a href="bweb.pl?action=graph"> Statistics </a></li>
+ <li><a href="bweb.pl?action=graph"> Statistics </a>
+ <ul>
+ <li><a href="bweb.pl?action=graph"> Statistics </a>
+ <li><a href="btime.pl"> Backup Timing </a>
+ <!-- <li><a href="bperf.pl"> Perfs </a> -->
+ </ul>
+ </li>
<li> <a href="bweb.pl?action=view_conf"> Configuration </a>
<TMPL_IF enable_security>
<ul> <li> <a href="bweb.pl?action=view_conf"> Configuration </a>
--- /dev/null
+
+<div class='titlediv'>
+ <h1 class='newstitle'> Manage Storage device</h1>
+</div>
+<div class='bodydiv'>
+ <form action="?" method='get'>
+ <input type='hidden' name='action' value='cmd_storage'>
+ <table>
+ <tr><td>Storage device:</td>
+ <td>
+ <select name='storage' size='5' class='formulaire'>
+ <TMPL_LOOP storage>
+ <option><TMPL_VAR name></option>
+ </TMPL_LOOP>
+ </select>
+ </td>
+ </tr>
+ <tr><td>Drive number (if any):</td>
+ <td><input size='3' type='text' name='drive' value='0' class='formulaire'></td>
+ </tr>
+ <tr><td>Action:</td>
+ <td>
+<button type="submit" class="bp" name='storage_cmd' value='mount'
+ title='mount drive'> <img src='/bweb/load.png' alt=''>Mount</button>
+<button type="submit" class="bp" name='storage_cmd' value='umount'
+ title='umount drive'> <img src='/bweb/unload.png' alt=''>Umount</button>
+<button type="submit" class="bp" name='storage_cmd' value='release'
+ title='release drive'> <img src='/bweb/unload.png' alt=''>Release</button>
+<button type="submit" class="bp" name='storage_cmd' value='status'
+ title='status drive'> <img src='/bweb/zoom.png' alt=''>Status</button>
+ </td>
+ </tr>
+ </table>
+ </form>
+</div>
+
<li><a href="bweb.pl?action=intern_media">Cargar Medio</a> </li>
</ul>
</li>
-<TMPL_IF achs>
- <li style="padding: 0.25em 2em;">Autochanger
+ <li style="padding: 0.25em 2em;">Storage
<ul>
+ <li><a href="bweb.pl?action=cmd_storage">Manage Device</a></li>
+<TMPL_IF achs>
+<li><hr></li>
+</TMPL_IF>
<TMPL_LOOP achs>
<li><a href="bweb.pl?action=ach_view;ach=<TMPL_VAR name>"><TMPL_VAR name></a></li>
</TMPL_LOOP>
</ul>
</li>
</TMPL_IF>
- <li><a href="bweb.pl?action=graph"> Estadísticas </a></li>
+ <li><a href="bweb.pl?action=graph"> Estadísticas </a>
+ <ul>
+ <li><a href="bweb.pl?action=graph"> Estadísticas </a>
+ <li><a href="btime.pl"> Backup Timing </a>
+ <!-- <li><a href="bperf.pl"> Perfs </a> -->
+ </ul>
+ </li>
<li> <a href="bweb.pl?action=view_conf"> Configuración </a>
<TMPL_IF enable_security>
<ul> <li> <a href="bweb.pl?action=view_conf"> Configuración </a>
--- /dev/null
+
+<div class='titlediv'>
+ <h1 class='newstitle'> Manage Storage device</h1>
+</div>
+<div class='bodydiv'>
+ <form action="?" method='get'>
+ <input type='hidden' name='action' value='cmd_storage'>
+ <table>
+ <tr><td>Storage device:</td>
+ <td>
+ <select name='storage' size='5' class='formulaire'>
+ <TMPL_LOOP storage>
+ <option><TMPL_VAR name></option>
+ </TMPL_LOOP>
+ </select>
+ </td>
+ </tr>
+ <tr><td>Drive number (if any):</td>
+ <td><input size='3' type='text' name='drive' value='0' class='formulaire'></td>
+ </tr>
+ <tr><td>Action:</td>
+ <td>
+<button type="submit" class="bp" name='storage_cmd' value='mount'
+ title='mount drive'> <img src='/bweb/load.png' alt=''>Mount</button>
+<button type="submit" class="bp" name='storage_cmd' value='umount'
+ title='umount drive'> <img src='/bweb/unload.png' alt=''>Umount</button>
+<button type="submit" class="bp" name='storage_cmd' value='release'
+ title='release drive'> <img src='/bweb/unload.png' alt=''>Release</button>
+<button type="submit" class="bp" name='storage_cmd' value='status'
+ title='status drive'> <img src='/bweb/zoom.png' alt=''>Estado</button>
+ </td>
+ </tr>
+ </table>
+ </form>
+</div>
+
<li><a href="bweb.pl?action=intern_media">Internaliser</a> </li>
</ul>
</li>
-<TMPL_IF achs>
- <li style="padding: 0.25em 2em;">Autochanger
+ <li style="padding: 0.25em 2em;">Storage
<ul>
+ <li><a href="bweb.pl?action=cmd_storage">Manage Device</a></li>
+<TMPL_IF achs>
+<li><hr></li>
+</TMPL_IF>
<TMPL_LOOP achs>
<li><a href="bweb.pl?action=ach_view;ach=<TMPL_VAR name>"><TMPL_VAR name></a></li>
</TMPL_LOOP>
</ul>
</li>
</TMPL_IF>
- <li><a href="bweb.pl?action=graph"> Statistiques </a></li>
+ <li><a href="bweb.pl?action=graph"> Statistiques </a>
+ <ul>
+ <li><a href="bweb.pl?action=graph"> Statistiques </a>
+ <li><a href="btime.pl"> Backup Timing </a>
+ <!-- <li><a href="bperf.pl"> Perfs </a> -->
+ </ul>
+ </li>
<li> <a href="bweb.pl?action=view_conf"> Configuration </a>
<TMPL_IF enable_security>
<ul> <li> <a href="bweb.pl?action=view_conf"> Configuration </a>
--- /dev/null
+
+<div class='titlediv'>
+ <h1 class='newstitle'> Manage Storage device</h1>
+</div>
+<div class='bodydiv'>
+ <form action="?" method='get'>
+ <input type='hidden' name='action' value='cmd_storage'>
+ <table>
+ <tr><td>Storage device:</td>
+ <td>
+ <select name='storage' size='5' class='formulaire'>
+ <TMPL_LOOP storage>
+ <option><TMPL_VAR name></option>
+ </TMPL_LOOP>
+ </select>
+ </td>
+ </tr>
+ <tr><td>Drive number (if any):</td>
+ <td><input size='3' type='text' name='drive' value='0' class='formulaire'></td>
+ </tr>
+ <tr><td>Action:</td>
+ <td>
+<button type="submit" class="bp" name='storage_cmd' value='mount'
+ title='Charger un lecteur'> <img src='/bweb/load.png' alt=''>Mount</button>
+<button type="submit" class="bp" name='storage_cmd' value='umount'
+ title='Décharger un lecteur'> <img src='/bweb/unload.png' alt=''>Umount</button>
+<button type="submit" class="bp" name='storage_cmd' value='release'
+ title='release drive'> <img src='/bweb/unload.png' alt=''>Release</button>
+<button type="submit" class="bp" name='storage_cmd' value='status'
+ title='status drive'> <img src='/bweb/zoom.png' alt=''>Statut</button>
+ </td>
+ </tr>
+ </table>
+ </form>
+</div>
+
enabled => 1,
username => 1,
rolename => 1,
+ storage_cmd => 1,
);
my %opt_p = ( # option with path
fileset=> 1,
}
}
+ if ($what{storage_cmd}) {
+ if (!grep {/^$ret{storage_cmd}$/} ('mount', 'umount', 'release','status')) {
+ delete $ret{storage_cmd};
+ }
+ }
+
if ($what{slots}) {
foreach my $s (CGI::param('slot')) {
if ($s =~ /^(\d+)$/) {
return new Bconsole(pref => $self->{info});
}
+sub cmd_storage
+{
+ my ($self) = @_;
+ $self->can_do('r_storage_mgnt');
+ my $arg = $self->get_form(qw/storage storage_cmd drive/);
+ my $b = $self->get_bconsole();
+
+ if ($arg->{storage} and $arg->{storage_cmd}) {
+ my $cmd = "$arg->{storage_cmd} storage=\"$arg->{storage}\" drive=$arg->{drive}";
+ my $ret = $b->send_cmd($cmd);
+
+ $self->display({
+ content => $ret,
+ title => "Storage ",
+ name => $cmd,
+ }, "command.tpl");
+ } else {
+ my $storages= [ map { { name => $_ } } $b->list_storage()];
+ $self->display({ storage => $storages}, "cmd_storage.tpl");
+ }
+}
+
sub run_job_select
{
my ($self) = @_;
+05Jan08
+ebl Add basic Device managment (mount, umount, release, status)
+
02Jan08
ebl Fix a couple of bug in btime module
ebl Keep level param between overview pages
Bweb - A Bacula web interface
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
The main author of Bweb is Eric Bollengier.
The main author of Bacula is Kern Sibbald, with contributions from
<li><a href="bweb.pl?action=intern_media">__Load Media__</a> </li>
</ul>
</li>
-<TMPL_IF achs>
- <li style="padding: 0.25em 2em;">__Autochanger__
+ <li style="padding: 0.25em 2em;">__Storages__
<ul>
+ <li><a href="bweb.pl?action=cmd_storage">__Manage Device__</a><TMPL_IF achs><hr></TMPL_IF></li>
<TMPL_LOOP achs>
<li><a href="bweb.pl?action=ach_view;ach=<TMPL_VAR name>"><TMPL_VAR name></a></li>
</TMPL_LOOP>
</ul>
</li>
-</TMPL_IF>
<li><a href="bweb.pl?action=graph"> __Statistics__ </a>
<ul>
<li><a href="bweb.pl?action=graph"> __Statistics__ </a>
--- /dev/null
+
+<div class='titlediv'>
+ <h1 class='newstitle'> __Manage Storage device__</h1>
+</div>
+<div class='bodydiv'>
+ <form action="?" method='get'>
+ <input type='hidden' name='action' value='cmd_storage'>
+ <table>
+ <tr><td>__Storage device:__</td>
+ <td>
+ <select name='storage' size='5' class='formulaire'>
+ <TMPL_LOOP storage>
+ <option><TMPL_VAR name></option>
+ </TMPL_LOOP>
+ </select>
+ </td>
+ </tr>
+ <tr><td>__Drive number (if any):__</td>
+ <td><input size='3' type='text' name='drive' value='0' class='formulaire'></td>
+ </tr>
+ <tr><td>__Action:__</td>
+ <td>
+<button type="submit" class="bp" name='storage_cmd' value='mount'
+ title='__mount drive__'> <img src='/bweb/load.png' alt=''>__Mount__</button>
+<button type="submit" class="bp" name='storage_cmd' value='umount'
+ title='__umount drive__'> <img src='/bweb/unload.png' alt=''>__Umount__</button>
+<button type="submit" class="bp" name='storage_cmd' value='release'
+ title='__release drive__'> <img src='/bweb/unload.png' alt=''>__Release__</button>
+<button type="submit" class="bp" name='storage_cmd' value='status'
+ title='__status drive__'> <img src='/bweb/zoom.png' alt=''>__Status__</button>
+ </td>
+ </tr>
+ </table>
+ </form>
+</div>
+