Skip to content

Commit

Permalink
feat: add volume details
Browse files Browse the repository at this point in the history
Add volume details such as jobs, in changer status, slot, mounts and first written

Add Volume::getInChanger() and Volume::getSlot() methods to Volume entity class

chore(docs): update documentation and screenshot
  • Loading branch information
dfranco committed Jan 7, 2024
1 parent cface17 commit d9b2b6b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
20 changes: 20 additions & 0 deletions application/Entity/Volume.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,31 @@ class Volume
*/
private int $volbytes;

private int $inchanger;

private int $slot;

/**
* @return string
*/
public function getVolbytes(): string
{
return CUtils::Get_Human_Size($this->volbytes);
}

public function getInchanger(): string
{
if ($this->inchanger === 0) {
return '-';
}
return '<i class="fa fa-check" aria-hidden="true"></i>';
}

public function getSlot(): string|int
{
if ($this->inchanger === 0) {
return 'n/a';
}
return $this->slot;
}
}
15 changes: 15 additions & 0 deletions application/views/templates/pages/volume.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,24 @@
<li class="list-group-item">
<b>{{ 'Volume files'|trans }}:</b> {{ volume.volfiles }}
</li>
<li class="list-group-item">
<b>{{ 'Volume jobs'|trans }}:</b> {{ volume.voljobs }}
</li>
<li class="list-group-item">
<b>{{ 'First written'|trans }}:</b> {{ volume.firstwritten }}
</li>
<li class="list-group-item">
<b>{{ 'Last written'|trans }}:</b> {{ volume.lastwritten }}
</li>
<li class="list-group-item">
<b>{{ 'Mounts'|trans }}:</b> {{ volume.volmounts }}
</li>
<li class="list-group-item">
<b>{{ 'Slot'|trans }}:</b> {{ volume.slot }}
</li>
<li class="list-group-item">
<b>{{ 'In changer'|trans }}:</b> {{ volume.inchanger|raw }}
</li>
<li class="list-group-item">
<b>{{ 'Media Type'|trans }}:</b> {{ volume.mediatype }}
</li>
Expand Down
4 changes: 4 additions & 0 deletions docs/source/01_about/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,13 @@ Display volume details such as
* Volume Name
* Volumes Bytes
* Volumes file(s)
* First written date/time
* Last written date/time
* Media Type
* List of backup jobs stored on the volume
* Slot
* In changer status
* Mounts

.. note:: Available since v8.7.0

Expand Down
Binary file modified docs/source/_static/bacula-web-volume-details.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d9b2b6b

Please sign in to comment.