1<?php
2
3/**
4 *
5 * bareos-webui - Bareos Web-Frontend
6 *
7 * @link      https://github.com/bareos/bareos for the canonical source repository
8 * @copyright Copyright (c) 2013-2017 Bareos GmbH & Co. KG (http://www.bareos.org/)
9 * @license   GNU Affero General Public License (http://www.gnu.org/licenses/)
10 *
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Affero General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 * GNU Affero General Public License for more details.
20 *
21 * You should have received a copy of the GNU Affero General Public License
22 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 *
24 */
25
26$title = 'Jobs';
27$this->headTitle($title);
28
29?>
30
31<ul class="nav nav-tabs">
32   <li><a href="<?php echo $this->url('job', array('action'=>'index')); ?>"><?php echo $this->translate('Show'); ?></a></li>
33   <li><a href="<?php echo $this->url('job', array('action'=>'actions')); ?>"><?php echo $this->translate('Actions'); ?></a></li>
34   <li class="active"><a href="<?php echo $this->url('job', array('action'=>'run')); ?>"><?php echo $this->translate('Run'); ?></a></li>
35</ul>
36
37<br />
38
39<?php if($this->acl_alert) : echo $this->ACLAlert($this->invalid_commands); elseif(!$this->acl_alert) : ?>
40
41<div class="container-fluid col-md-6">
42
43<div class="panel panel-default">
44   <div class="panel-heading">
45      <h3 class="panel-title">Run jobs</h3>
46   </div>
47   <div class="panel-body">
48   <div class="container-fluid">
49
50<?php
51   $form->prepare();
52   $form->setAttribute('class','form-horizontal');
53   echo $this->form()->openTag($form);
54?>
55
56<div class="row">
57
58   <div class="form-group">
59      <label class="control-label col-md-2"><?php echo $this->formLabel($form->get('job')); ?>*</label>
60      <div class="control-input col-md-6">
61         <?php echo $this->formSelect($form->get('job')); ?>
62      </div>
63   </div>
64
65   <div class="form-group">
66      <label class="control-label col-md-2"><?php echo $this->formLabel($form->get('client')); ?></label>
67      <div class="control-input col-md-6">
68         <?php echo $this->formSelect($form->get('client')); ?>
69      </div>
70   </div>
71
72   <div class="form-group">
73      <label class="control-label col-md-2"><?php echo $this->formLabel($form->get('fileset')); ?></label>
74      <div class="control-input col-md-6">
75         <?php echo $this->formSelect($form->get('fileset')); ?>
76      </div>
77   </div>
78
79   <div class="form-group">
80      <label class="control-label col-md-2"><?php echo $this->formLabel($form->get('storage')); ?></label>
81      <div class="control-input col-md-6">
82         <?php echo $this->formSelect($form->get('storage')); ?>
83      </div>
84   </div>
85
86   <div class="form-group">
87      <label class="control-label col-md-2"><?php echo $this->formLabel($form->get('pool')); ?></label>
88      <div class="control-input col-md-6">
89         <?php echo $this->formSelect($form->get('pool')); ?>
90      </div>
91   </div>
92
93   <div class="form-group">
94      <label class="control-label col-md-2"><?php echo $this->formLabel($form->get('level')); ?></label>
95      <div class="control-input col-md-6">
96         <?php echo $this->formSelect($form->get('level')); ?>
97      </div>
98   </div>
99
100   <div class="form-group">
101      <label class="control-label col-md-2"><?php echo $this->formLabel($form->get('type')); ?></label>
102      <div class="control-input col-md-6">
103         <?php echo $this->formInput($form->get('type')); ?>
104      </div>
105   </div>
106
107   <div class="form-group">
108      <label class="control-label col-md-2"><?php echo $this->formLabel($form->get('priority')); ?></label>
109      <div class="control-input col-md-6">
110         <?php echo $this->formInput($form->get('priority')); ?>
111      </div>
112   </div>
113
114<!--
115   <div class="form-group">
116      <label class="control-label col-md-2"><?php // echo $this->formLabel($form->get('backupformat')); ?></label>
117      <div class="control-input col-md-6">
118         <?php // echo $this->formInput($form->get('backupformat')); ?>
119      </div>
120   </div>
121-->
122
123   <div class="form-group">
124      <label class="control-label col-md-2"><?php echo $this->formLabel($form->get('when')); ?></label>
125      <div class="col-md-6">
126         <div class="input-group date" id="when-datepicker">
127            <?php echo $this->formInput($form->get('when')); ?>
128            <span class="input-group-addon">
129               <span class="glyphicon glyphicon-calendar"></span>
130            </span>
131         </div>
132      </div>
133   </div>
134
135   <div class="form-group">
136      <div class="col-md-6 col-md-offset-2">
137         <span class="text-muted"><i>(Input fields marked with * are required.)</i></span>
138      </div>
139   </div>
140
141   <div class="form-group">
142      <div class="col-md-6 col-md-offset-2">
143         <?php echo $this->formSubmit($form->get('submit')->setAttribute('class','btn btn-primary')); ?>
144      </div>
145   </div>
146
147</div>
148
149</div>
150
151<?php
152   echo $this->form()->closeTag($form);
153?>
154
155</div>
156</div>
157
158</div>
159</div>
160
161<?php endif; ?>
162
163<script type="text/javascript">
164
165   function updateQueryParams(k, v) {
166      var p = [];
167      var params = [];
168
169      p['jobname'] = '<?php echo $this->jobname; ?>';
170
171      p[k] = v;
172
173      for(key in p) {
174          params.push(key + "=" + p[key]);
175      }
176
177      return params.join('&');
178   }
179
180   $('#job').change(function(event) {
181      window.location.href = window.location.pathname + '?' + updateQueryParams('jobname', this.value);
182   });
183
184   $(function() {
185      $('#when-datepicker').datetimepicker({
186         format: 'YYYY-MM-DD HH:mm:ss',
187         sideBySide: true
188      });
189   });
190
191</script>
192