Skip to content
Permalink
Browse files

Merge pull request #355 from fbergkemper/dev/fbergkemper/master/story…

…-3464-jobmedia-listing

Avoid listing duplicate volume records
  • Loading branch information
fbergkemper committed Dec 3, 2019
2 parents cfeb49c + 1e1fff5 commit 406d1c22dafa18921cb9ef65982ec82b481e25ea
@@ -343,7 +343,7 @@ void BareosDb::ListVolumesOfJobid(JobControlRecord* jcr,
edit_int64(JobId, ed1));
} else {
Mmsg(cmd,
"SELECT Media.VolumeName "
"SELECT DISTINCT Media.VolumeName "
"FROM JobMedia,Media WHERE Media.MediaId=JobMedia.MediaId "
"AND JobMedia.JobId=%s",
edit_int64(JobId, ed1));
@@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos for the canonical source repository
* @copyright Copyright (c) 2013-2017 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @copyright Copyright (c) 2013-2019 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
*
* This program is free software: you can redistribute it and/or modify
@@ -210,7 +210,7 @@ public function getJobLog(&$bsock=null, $id=null)
*/
public function getJobMedia(&$bsock=null, $jobid=null)
{
$cmd = 'llist jobmedia jobid='.$jobid;
$cmd = 'list volumes jobid='.$jobid;
$result = $bsock->send_command($cmd, 2);
if(preg_match('/Failed to send result as json. Maybe result message to long?/', $result)) {
//return false;
@@ -219,7 +219,7 @@ public function getJobMedia(&$bsock=null, $jobid=null)
}
else {
$jobmedia = \Zend\Json\Json::decode($result, \Zend\Json\Json::TYPE_ARRAY);
return $jobmedia['result']['jobmedia'];
return $jobmedia['result']['volumes'];
}
}
@@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos for the canonical source repository
* @copyright Copyright (c) 2013-2017 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @copyright Copyright (c) 2013-2019 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
*
* This program is free software: you can redistribute it and/or modify
@@ -172,31 +172,6 @@ $this->headTitle($title);
return html.join('');
}
function detailFormatterJobMedia(index, row) {
var html = [];
html.push('<div class="container-fluid">');
html.push('<table class="table table-bordered">');
html.push('<tr>');
html.push('<th><?php echo $this->translate("First Index"); ?></th>');
html.push('<td>' + row.firstindex + '</td>');
html.push('</tr>');
html.push('<tr>');
html.push('<th><?php echo $this->translate("Last Index"); ?></th>');
html.push('<td>' + row.lastindex + '</td>');
html.push('</tr>');
html.push('<tr>');
html.push('<th><?php echo $this->translate("Start Block"); ?></th>');
html.push('<td>' + row.startblock + '</td>');
html.push('</tr>');
html.push('<tr>');
html.push('<th><?php echo $this->translate("End Block"); ?></th>');
html.push('<td>' + row.endblock + '</td>');
html.push('</tr>');
html.push('</table>');
html.push('</div>');
return html.join('');
}
function getJobDetails() {
jobdetails = $('#jobdetails').bootstrapTable({
locale: '<?php echo str_replace('_','-', $_SESSION['bareos']['locale']); ?>',
@@ -345,8 +320,6 @@ $this->headTitle($title);
search: true,
sortName: 'volumename',
sortOrder: 'asc',
detailView: true,
detailFormatter: 'detailFormatterJobMedia',
columns: [
{
field: 'volumename',

0 comments on commit 406d1c2

Please sign in to comment.
You can’t perform that action at this time.