Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Cleanup and some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed Sep 7, 2015
1 parent 8fdfe74 commit 8f2e459
Show file tree
Hide file tree
Showing 34 changed files with 165 additions and 1,374 deletions.
2 changes: 0 additions & 2 deletions config/application.config.php
Expand Up @@ -36,9 +36,7 @@
'Storage',
'Client',
'Job',
'Log',
'Restore',
'Statistics',
'Install',
'Auth',
);
Expand Down
90 changes: 0 additions & 90 deletions config/autoload/global.php
Expand Up @@ -47,95 +47,6 @@
$config = parse_ini_file($file, true, INI_SCANNER_NORMAL);
}

function read_db_config($config, $file)
{

$arr = array();

foreach($config as $instance) {

if(array_key_exists('enabled', $instance) && isset($instance['enabled']) && strtolower($instance['enabled']) == "yes") {

if(array_key_exists('dbaddress', $instance) && isset($instance['dbaddress'])) {
$arr['adapters'][key($config)] = array();
}
else {
if(array_key_exists('diraddress', $instance) && isset($instance['diraddress'])) {
$arr['adapters'][key($config)] = array();
$instance['dbaddress'] = $instance['diraddress'];
}
else {
echo "Error: Missing parameters 'dbaddress' and 'diraddress' in ".$file.", section ".key($config).".";
exit();
}
}

if(array_key_exists('dbdriver', $instance) && isset($instance['dbdriver'])) {
if(strtolower($instance['dbdriver']) == "postgresql") {
$arr['adapters'][key($config)]['driver'] = "Pdo_Pgsql";
}
elseif(strtolower($instance['dbdriver']) == "mysql") {
$arr['adapters'][key($config)]['driver'] = "Pdo_Mysql";
}
else {
echo "Error: Mispelled value for parameter 'dbdriver' in ".$file.", section ".key($config).".";
exit();
}
}
else {
$arr['adapters'][key($config)]['driver'] = "Pdo_Pgsql";
}

if(array_key_exists('dbname', $instance) && isset($instance['dbname'])) {
$arr['adapters'][key($config)]['dbname'] = $instance['dbname'];
}
else {
$arr['adapters'][key($config)]['dbname'] = "bareos";
}

if(array_key_exists('dbaddress', $instance) && isset($instance['dbaddress'])) {
$arr['adapters'][key($config)]['host'] = $instance['dbaddress'];
}
else {
$arr['adapters'][key($config)]['host'] = "127.0.0.1";
}

if(array_key_exists('dbport', $instance) && isset($instance['dbport'])) {
$arr['adapters'][key($config)]['port'] = $instance['dbport'];
}
else {
if($arr['adapters'][$instance['dbaddress']]['driver'] == "Pdo_Pgsql") {
$arr['adapters'][key($config)]['port'] = 5432;
}
else {
$arr['adapters'][key($config)]['port'] = 3306;
}
}

if(array_key_exists('dbuser', $instance) && isset($instance['dbuser'])) {
$arr['adapters'][key($config)]['username'] = $instance['dbuser'];
}
else {
$arr['adapters'][key($config)]['username'] = "bareos";
}

if(array_key_exists('dbpassword', $instance) && isset($instance['dbpassword'])) {
$arr['adapters'][key($config)]['password'] = $instance['dbpassword'];
}
else {
$arr['adapters'][key($config)]['password'] = "";
}

}

next($config);

}

return $arr;

}

function read_dir_config($config, $file)
{

Expand Down Expand Up @@ -234,7 +145,6 @@ function read_dir_config($config, $file)
}

return array(
'db' => read_db_config($config, $file),
'directors' => read_dir_config($config, $file),
'service_manager' => array(
'factories' => array(
Expand Down
28 changes: 0 additions & 28 deletions module/Application/config/module.config.php
Expand Up @@ -129,12 +129,6 @@
),
'navigation' => array(
'default' => array(
/*
array(
'label' => 'Home',
'route' => 'home',
),
*/
array(
'label' => 'Dashboard',
'route' => 'dashboard',
Expand Down Expand Up @@ -168,32 +162,10 @@
'route' => 'job',
),
/*
array(
'label' => 'Files',
'route' => 'file',
),
array(
'label' => 'Logs',
'route' => 'log',
),
array(
'label' => 'Restore',
'route' => 'restore',
),
array(
'label' => 'Statistics',
'route' => 'statistics',
),
/*
array(
'label' => 'Administration',
'route' => 'admin',
),
array(
'label' => 'Logout',
'route' => 'auth',
'action' => 'logout',
),
*/
),
),
Expand Down
74 changes: 40 additions & 34 deletions module/Client/view/client/client/details.phtml
Expand Up @@ -8,7 +8,7 @@ $this->headTitle($title);

<div class="row">

<div class="col-md-9">
<div class="col-md-12">
<div class="panel panel-default">

<div class="panel-heading">
Expand All @@ -17,56 +17,56 @@ $this->headTitle($title);

<div class="panel-body">

<table class="table table-bordered table-condensed">
<table class="table table-condensed">

<tr><td><strong>Client</strong></td><td><?php echo $this->escapeHtml($this->client['clientid']); ?></td></tr>
<tr><td><strong>Name</strong></td><td><?php echo $this->escapeHtml($this->client['name']); ?></td></tr>
<tr><td><strong>Version</strong></td><td><?php echo $this->escapeHtml($this->client['uname']); ?></td></tr>
<tr><td><strong>Autoprune</strong></td><td><?php echo $this->escapeHtml($this->client['autoprune']); ?></td></tr>
<tr><td><strong>Fileretention</strong></td><td><?php echo $this->printRetention($this->client['fileretention']) . " days"; ?></td></tr>
<tr><td><strong>Jobretention</strong></td><td><?php echo $this->printRetention($this->client['jobretention']) . " days"; ?></td></tr>

</table>

</div>

</div>
</div>
<tr>
<th class="bg-primary">Client</th>
<th class="bg-primary">Name</th>
<th class="bg-primary">Version</th>
<th class="bg-primary">Autoprune</th>
<th class="bg-primary">Fileretention</th>
<th class="bg-primary">Jobretention</th>
<th class="bg-primary"></th>
</tr>

<div class="col-md-3">
<tr>
<td><?php echo $this->escapeHtml($this->client['clientid']); ?></td>
<td><?php echo $this->escapeHtml($this->client['name']); ?></td>
<td><?php echo $this->escapeHtml($this->client['uname']); ?></td>
<td><?php echo $this->escapeHtml($this->client['autoprune']); ?></td>
<td><?php echo $this->printRetention($this->client['fileretention']) . " days"; ?></td>
<td><?php echo $this->printRetention($this->client['jobretention']) . " days"; ?></td>
<td>
<a class="btn btn-default btn-xs" href="<?php echo $this->url(
'restore',
array('action' => 'index'),
array('query' => array(
'type' => 'client',
'client' => $this->client['name'],
'restoreclient' => $this->client['name']
)
)); ?>" role="button" data-toggle="tooltip" data-placement="top" title="restore"><span class="glyphicon glyphicon-import"></span></a>
</td>
</tr>

<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Actions</h3>
</div>
</table>

<div class="panel-body">
<a class="btn btn-primary btn-block" href="<?php echo $this->url(
'restore',
array('action' => 'index'),
array('query' => array(
'type' => 'client',
'client' => $this->client['name'],
'restoreclient' => $this->client['name']
)
)); ?>" role="button"><span class="glyphicon glyphicon-import"></span> Restore</a>
</div>
</div>

</div>
</div>

<div class="row">
<div class="col-md-9">
<div class="col-md-12">

<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Last backups</h3>
<h3 class="panel-title">Last 10 successful backups</h3>
</div>

<div class="panel-body">

<table class="table table-bordered table-condensed">
<table class="table table-condensed">

<tr>
<th class="bg-primary"><?php echo $this->translate("Job"); ?></th>
Expand Down Expand Up @@ -102,3 +102,9 @@ $this->headTitle($title);
</div>

</div>

<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
23 changes: 16 additions & 7 deletions module/Client/view/client/client/index.phtml
Expand Up @@ -31,6 +31,13 @@ $this->headTitle($title);
<div class="row">

<div class="col-md-12">
<div class="panel panel-default">

<div class="panel-heading">
<h3 class="panel-title">Clients</h3>
</div>

<div class="panel-body">

<p>
Clients per page:
Expand All @@ -43,13 +50,13 @@ Clients per page:
<table class="table table-condensed">

<tr class="panel panel-default">
<th>Client</th>
<th>Name</th>
<th>Version</th>
<th>Autoprune</th>
<th>Fileretention</th>
<th>Jobretention</th>
<th></th>
<th class="bg-primary">Client</th>
<th class="bg-primary">Name</th>
<th class="bg-primary">Version</th>
<th class="bg-primary">Autoprune</th>
<th class="bg-primary">Fileretention</th>
<th class="bg-primary">Jobretention</th>
<th class="bg-primary"></th>
</tr>

<?php foreach($this->paginator as $client) : ?>
Expand Down Expand Up @@ -89,6 +96,8 @@ echo $this->paginationControl(

?>

</div>
</div>
</div>
</div>

Expand Down
15 changes: 15 additions & 0 deletions module/Fileset/view/fileset/fileset/details.phtml
Expand Up @@ -28,6 +28,17 @@ $this->headTitle($title);

?>

<div class="row">

<div class="col-md-12">
<div class="panel panel-default">

<div class="panel-heading">
<h3 class="panel-title">Fileset</h3>
</div>

<div class="panel-body">

<div class="panel-body">
<pre>
<code>
Expand All @@ -36,3 +47,7 @@ $this->headTitle($title);
</pre>
</div>

</div>
</div>
</div>
</div>
21 changes: 18 additions & 3 deletions module/Fileset/view/fileset/fileset/index.phtml
Expand Up @@ -28,6 +28,17 @@ $this->headTitle($title);

?>

<div class="row">

<div class="col-md-12">
<div class="panel panel-default">

<div class="panel-heading">
<h3 class="panel-title">Filesets</h3>
</div>

<div class="panel-body">

<p>
Filesets per page:
<a href="<?php echo $this->url('fileset', array('limit' => '10', null, null, true)); ?>">10</a> |
Expand All @@ -36,11 +47,11 @@ Filesets per page:
<a href="<?php echo $this->url('fileset', array('limit' => '100', null, null, true)); ?>">100</a>
</p>

<table class="table">
<table class="table table-condensed">

<tr>
<th><?php echo $this->translate("Fileset"); ?></th>
<th><?php echo $this->translate("Modified"); ?></th>
<th class="bg-primary"><?php echo $this->translate("Fileset"); ?></th>
<th class="bg-primary"><?php echo $this->translate("Modified"); ?></th>
</tr>

<?php foreach($this->paginator as $fileset) : ?>
Expand All @@ -67,3 +78,7 @@ echo $this->paginationControl(

?>

</div>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions module/Install/view/install/install/index.phtml
Expand Up @@ -3,9 +3,9 @@
/**
*
* bareos-webui - Bareos Web-Frontend
*
*
* @link https://github.com/bareos/bareos-webui for the canonical source repository
* @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @copyright Copyright (c) 2013-2015 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
* @author Frank Bergkemper
*
Expand Down

0 comments on commit 8f2e459

Please sign in to comment.