Skip to content

Commit

Permalink
Merge pull request #355 from fbergkemper/dev/fbergkemper/master/story…
Browse files Browse the repository at this point in the history
…-3464-jobmedia-listing

Avoid listing duplicate volume records
  • Loading branch information
fbergkemper committed Dec 3, 2019
2 parents cfeb49c + 1e1fff5 commit 406d1c2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 32 deletions.
2 changes: 1 addition & 1 deletion core/src/cats/sql_list.cc
Expand Up @@ -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));
Expand Down
6 changes: 3 additions & 3 deletions webui/module/Job/src/Job/Model/JobModel.php
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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'];
}
}

Expand Down
29 changes: 1 addition & 28 deletions webui/module/Job/view/job/job/details.phtml
Expand Up @@ -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
Expand Down Expand Up @@ -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']); ?>',
Expand Down Expand Up @@ -345,8 +320,6 @@ $this->headTitle($title);
search: true,
sortName: 'volumename',
sortOrder: 'asc',
detailView: true,
detailFormatter: 'detailFormatterJobMedia',
columns: [
{
field: 'volumename',
Expand Down

0 comments on commit 406d1c2

Please sign in to comment.