Skip to content
Permalink
Browse files

webui: PR#173 adjustments

- Changed copyright in file headers where required
- Newline added before EOF in webui/public/css/style.css
- Renamed the following functions to sound more reasonable and precise
   - getRevisions renamed to getFileVersions in webui/module/Restore/src/Restore/Model/RestoreModel.php
   - getRevisions renamed to getFileVersions in webui/module/Restore/view/restore/restore/versions.phtml
   - clearRevisions renamed to clearFileVersions in webui/module/Restore/view/restore/restore/versions.phtml
  • Loading branch information...
fbergkemper committed May 14, 2019
1 parent 97095cb commit 115c86bf00f7892781121c0aeed448384a6308d5
@@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui 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
@@ -707,10 +707,10 @@ public function getDataAction()
$pathid = $this->params()->fromQuery('pathid');
$filename = $this->params()->fromQuery('filename');
if($data == "revisions") {
if($data == "fileversions") {
try {
$this->bsock = $this->getServiceLocator()->get('director');
$result = $this->getRestoreModel()->getRevisions($this->bsock, $clientname, $pathid, $filename);
$result = $this->getRestoreModel()->getFileVersions($this->bsock, $clientname, $pathid, $filename);
$this->bsock->disconnect();
}
catch(Exception $e) {
@@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui 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
@@ -163,7 +163,7 @@ public function getFiles(&$bsock=null, $jobid=null, $pathid=null) {
*
* @return array
*/
public function getRevisions(&$bsock=null, $clientname=null, $pathid=null, $filename=null) {
public function getFileVersions(&$bsock=null, $clientname=null, $pathid=null, $filename=null) {
if(isset($bsock)) {
$cmd = '.bvfs_versions jobid=0 client='.$clientname.' pathid='.$pathid.' fname='.$filename;
$result = $bsock->send_command($cmd, 2, null);
@@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui 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
@@ -218,14 +218,14 @@ $this->headTitle($title);
</style>

<script type="text/javascript">
function clearRevisions() {
function clearFileVersions() {
$('#selectedfile-name').text('');
$('#file-versions-list').empty()
}
function getRevisions(pathid, filename) {
function getFileVersions(pathid, filename) {
$.ajax({
url: '<?php echo $this->url('restore', array('action' => 'getData'), null) . '?data=revisions&clientname=' . $this->restore_params['client']; ?>&pathid=' + pathid + '&filename=' + filename,
url: '<?php echo $this->url('restore', array('action' => 'getData'), null) . '?data=fileversions&clientname=' . $this->restore_params['client']; ?>&pathid=' + pathid + '&filename=' + filename,
dataType: 'json',
timeout: 10000,
success: function(data) {
@@ -303,10 +303,10 @@ $this->headTitle($title);
function treeItemSelectedHandler(event, _data) {
if (!_data.node.id || _data.node.id < 0) {
_data.instance.deselect_node(_data.node);
clearRevisions()
clearFileVersions()
} else {
const node = _data.node;
getRevisions(node.data.pathid, node.data.name)
getFileVersions(node.data.pathid, node.data.name)
}
}
@@ -87,4 +87,5 @@ body {

.code {
font-family: monospace;
}
}

0 comments on commit 115c86b

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