/
index.phtml
156 lines (133 loc) · 5.61 KB
/
index.phtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php
/**
*
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui for the canonical source repository
* @copyright Copyright (c) 2013-2015 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
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
$title = _('Clients');
$this->headTitle($title);
?>
<ul class="nav nav-tabs">
<li class="active"><a href="<?php echo $this->url('client', array('action'=>'index')); ?>"><?php echo $this->translate('Show'); ?></a></li>
</ul>
<br />
<div class="row">
<div class="col-md-8">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><?php echo $this->translate('Clients'); ?></h3>
</div>
<div class="panel-body">
<table class="table table-hover" id="clients">
<thead class="bg-primary">
<th><?php echo $this->translate("Name"); ?></th>
<th><?php echo $this->translate("Version"); ?></th>
<th><?php echo $this->translate("Actions"); ?></th>
</thead>
</table>
</div>
</div>
</div>
</div>
<?php
echo $this->headScript()->prependFile($this->basePath() . '/js/datatables.functions.js');
echo $this->headScript()->prependFile($this->basePath() . '/js/datatables.min.js');
echo $this->headLink()->prependStylesheet($this->basePath() . '/css/datatables.min.css');
?>
<!-- modal-001 start -->
<div id="modal-001" class="modal fade modal-001" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">Client status</h4>
</div>
<div class="modal-body">
<p><?php echo str_replace(array("\n","\r"), "<br />", $this->result); ?></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo $this->translate("Close"); ?></button>
</div>
</div>
</div>
</div>
<!-- modal-001 end -->
<script>
$(document).ready(function() {
setDtTextDomain('<?php echo $this->basePath() . '/js/locale'; ?>');
setDtLocale('<?php echo $_SESSION['bareos']['locale']; ?>');
var result = '<?php echo str_replace(array("\n","\r"), "", $this->result); ?>';
if(result.length > 0) {
$("#modal-001").modal();
}
var table= $('#clients').DataTable( {
"ajax": {
"url": "<?php echo $this->url('client', array('action' => 'getData'), null) . '?data=all'; ?>",
"dataSrc": ""
},
"language": {
"url": "<?php echo $this->basePath() . '/js/dataTables/language/'; ?>" + getLocale('<?php echo $_SESSION['bareos']['locale']; ?>')
},
"columns" : [
{
"className": "client-name",
"orderable": true,
"data": "name"
},
{
"className": "client-uname",
"orderable": true,
"data": "uname"
},
{
"className": "actions",
"orderable": false,
"data": "name"
}
],
"paging": true,
"ordering": true,
"info": true,
"pagingType": "full_numbers",
"stateSave": true,
"order": [[0, 'asc']],
"columnDefs": [
{
"targets": 0,
"data": "name",
"render": function(data, type, full, meta) {
return '<a href="<?php echo $this->basePath() . '/client/details/'; ?>'+data+'">'+data+'</a>';
}
},
{
"targets": 2,
"render": function(data, type, full, meta) {
return '<a class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" href="<?php echo $this->basePath() . '/restore/index?type=client&client='; ?>'+data+'" title="<?php echo $this->translate("Restore"); ?>" id="btn-1"><span class="glyphicon glyphicon-import"></span></a> <a class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" href="<?php echo $this->basePath(); ?>/client/status?client='+data+'" title="<?php echo $this->translate("Status"); ?>" id="btn-1"><span class="glyphicon glyphicon-zoom-in"></span></a> <a class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" href="<?php echo $this->basePath(); ?>/client/index?action=enable&client='+data+'" title="<?php echo $this->translate("Enable"); ?>" id="btn-1"><span class="glyphicon glyphicon-ok"></span></a> <a class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" href="<?php echo $this->basePath(); ?>/client/index?action=disable&client='+data+'" title="<?php echo $this->translate("Disable"); ?>" id="btn-1"><span class="glyphicon glyphicon-remove"></span></a>';
}
}
]
} );
$('#clients tbody').on('mouseover', '#btn-1', function () {
$('[data-toggle="tooltip"]').tooltip();
})
} );
</script>