This repository has been archived by the owner on Mar 19, 2021. It is now read-only.
/
successful.phtml
183 lines (147 loc) · 8.61 KB
/
successful.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?php
/**
*
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui for the canonical source repository
* @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
* @author Frank Bergkemper
*
* 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 = 'Jobs';
$this->headTitle($title);
if($order_by == 'JobId')
$url_order = $order == 'ASC' ? 'DESC' : 'ASC';
elseif($order_by == 'Name')
$url_order = $order == 'ASC' ? 'DESC' : 'ASC';
elseif($order_by == 'ClientName')
$url_order = $order == 'ASC' ? 'DESC' : 'ASC';
elseif($order_by == 'Type')
$url_order = $order == 'ASC' ? 'DESC' : 'ASC';
elseif($order_by == 'Level')
$url_order = $order == 'ASC' ? 'DESC' : 'ASC';
elseif($order_by == 'StartTime')
$url_order = $order == 'ASC' ? 'DESC' : 'ASC';
elseif($order_by == 'EndTime')
$url_order = $order == 'ASC' ? 'DESC' : 'ASC';
elseif($order_by == 'JobBytes')
$url_order = $order == 'ASC' ? 'DESC' : 'ASC';
elseif($order_by == 'duration')
$url_order = $order == 'ASC' ? 'DESC' : 'ASC';
?>
<h3 class="text-muted"><?php echo $title; ?></h3>
<hr />
<?php
$flash = $this->flashMessenger();
$flash->setMessageOpenFormat('
<div%s>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">
×
</button>
<ul><li>')
->setMessageSeparatorString('</li><li>')
->setMessageCloseString('</li></ul></div>');
echo $flash->render('error', array('alert', 'alert-dismissable', 'alert-danger'));
echo $flash->render('info', array('alert', 'alert-dismissable', 'alert-info'));
echo $flash->render('default', array('alert', 'alert-dismissable', 'alert-warning'));
echo $flash->render('success', array('alert', 'alert-dismissable', 'alert-success'));
?>
<ul class="nav nav-tabs">
<li><a href="<?php echo $this->url('job', array('action'=>'index')); ?>"><?php echo $this->translate('History'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'running')); ?>"><?php echo $this->translate('Running'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'waiting')); ?>"><?php echo $this->translate('Waiting'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'unsuccessful')); ?>"><?php echo $this->translate('Unsuccessful (past 24 hours)'); ?></a></li>
<li class="active"><a href="<?php echo $this->url('job', array('action'=>'successful')); ?>"><?php echo $this->translate('Successful (past 24 hours)'); ?></a></li>
<!-- <li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Timeline'); ?></a></li> -->
</ul>
<br />
<?php if(count($this->lastSuccessfulJobs) > 0) : ?>
<p>
Jobs per page:
<a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => $this->order_by, 'order' => $this->order, 'limit' => '10', null, null, true)); ?>">10</a> |
<a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => $this->order_by, 'order' => $this->order, 'limit' => '25', null, null, true)); ?>">25</a> |
<a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => $this->order_by, 'order' => $this->order, 'limit' => '50', null, null, true)); ?>">50</a> |
<a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => $this->order_by, 'order' => $this->order, 'limit' => '100', null, null, true)); ?>">100</a>
</p>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body">
<table class="table table-striped table-hover" style="font-size: 9pt;">
<tr>
<th><a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => 'JobId', 'order' => $url_order, 'limit' => $this->limit)); ?>"><?php echo $this->translate("Job"); ?></a></th>
<th><a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => 'Name', 'order' => $url_order, 'limit' => $this->limit)); ?>"><?php echo $this->translate("Name"); ?></a></th>
<th><a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => 'ClientName', 'order' => $url_order, 'limit' => $this->limit)); ?>"><?php echo $this->translate("Client"); ?></a></th>
<th><a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => 'Type', 'order' => $url_order, 'limit' => $this->limit)); ?>"><?php echo $this->translate("Type"); ?></a></th>
<th><a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => 'Level', 'order' => $url_order, 'limit' => $this->limit)); ?>"><?php echo $this->translate("Level"); ?></a></th>
<th><a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => 'StartTime', 'order' => $url_order, 'limit' => $this->limit)); ?>"><?php echo $this->translate("Start"); ?></a></th>
<th><a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => 'EndTime', 'order' => $url_order, 'limit' => $this->limit)); ?>"><?php echo $this->translate("End"); ?></a></th>
<th><a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => 'duration', 'order' => $url_order, 'limit' => $this->limit)); ?>"><?php echo $this->translate("Duration"); ?></a></th>
<th><a href="<?php echo $this->url('job', array('action' => 'successful', 'order_by' => 'JobBytes', 'order' => $url_order, 'limit' => $this->limit)); ?>"><?php echo $this->translate("Bytes"); ?></a></th>
<th><?php echo $this->translate("Status"); ?></th>
<th><?php echo $this->translate("Action"); ?></th>
</tr>
<?php foreach ($this->paginator as $job) : ?>
<tr>
<td><a href="<?php echo $this->url('job', array('action' => 'details', 'id' => $job->jobid)); ?>"><?php echo $this->escapeHtml($job->jobid); ?></a></td>
<td><?php echo $this->escapeHtml($job->jobname); ?></td>
<td><a href="<?php echo $this->url('client', array('action' => 'details', 'id' => $job->clientid)); ?>"><?php echo $this->escapeHtml($job->clientname); ?></a></td>
<td><?php echo $this->printJobType($job->type); ?></td>
<td><?php echo $this->printJobLevel($job->level); ?></td>
<td><?php echo $this->printDate($job->starttime); ?></td>
<td><?php echo $this->printDate($job->endtime); ?></td>
<td><?php echo $this->printJobDuration($job->duration); ?></td>
<td><?php echo $this->printBytes($job->jobbytes); ?></td>
<td><?php echo $this->printJobStatus($job->jobstatus); ?></td>
<td>
<div class="btn-group">
<button type="button" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-cog"></span></button>
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="<?php echo $this->url('log', array('action' => 'job', 'id' => $job->jobid)); ?>" title="<?php echo $this->translate("View messages"); ?>"><span class="glyphicon glyphicon-file"></span> View messages</a></li>
<li class="divider"></li>
<li><a href="<?php echo $this->url('job', array('action' => 'rerun', 'id' => $job->jobid)); ?>" title="<?php echo $this->translate("Rerun"); ?>"><span class="glyphicon glyphicon-repeat"></span> Re-run job</a></li>
<!-- <li><a href="<?php ?>" title="<?php echo $this->translate("Restore"); ?>"><span class="glyphicon glyphicon-import"></span> Restore job</a></li> -->
</ul>
</div>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
</div>
<?php
echo $this->paginationControl(
$this->paginator,
'Elastic',
array('partial/paginator.phtml', 'Job'),
array('route' => 'job')
);
?>
</div>
</div>
<?php elseif(count($this->lastSuccessfulJobs) == 0) : ?>
<div class="alert alert-dismissable alert-info">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<ul>
<li><?php echo $this->translate("No successful jobs found."); ?></li>
</ul>
</div>
<?php endif; ?>