Skip to content

Commit 8ef07d0

Browse files
committed
Auto reset
1 parent 5aebcc8 commit 8ef07d0

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

src/Controller/Admin/QueuedJobsController.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,17 @@ public function import() {
124124

125125
unset($data['id']);
126126
$data['created'] = new FrozenTime($data['created']);
127+
128+
if ($this->request->getData('reset')) {
129+
$data['fetched'] = null;
130+
$data['completed'] = null;
131+
$data['progress'] = null;
132+
$data['failed'] = 0;
133+
$data['failure_message'] = null;
134+
$data['workerkey'] = null;
135+
$data['status'] = null;
136+
}
137+
127138
if ($data['notbefore']) {
128139
$data['notbefore'] = new FrozenTime($data['notbefore']);
129140
}

src/Template/Admin/QueuedJobs/import.ctp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@
44
*/
55
?>
66
<nav class="large-3 medium-4 columns" id="actions-sidebar">
7-
<ul class="side-nav">
8-
<li class="heading"><?= __('Actions') ?></li>
9-
<li><?= $this->Html->link('Back', ['action' => 'index']); ?></li>
10-
</ul>
7+
<ul class="side-nav">
8+
<li class="heading"><?= __('Actions') ?></li>
9+
<li><?= $this->Html->link('Back', ['action' => 'index']); ?></li>
10+
</ul>
1111
</nav>
1212
<div class="releases form large-9 medium-8 columns content">
13-
<h2>Import</h2>
13+
<h2>Import</h2>
1414

15-
<?= $this->Form->create(null, ['type' => 'file']) ?>
16-
<fieldset>
17-
<legend><?= __('Import Job from exported JSON') ?></legend>
18-
<?php
19-
echo $this->Form->control('file', ['type' => 'file', 'required' => true, 'accept' => '.json']);
20-
?>
21-
</fieldset>
22-
<?= $this->Form->button(__('Submit')) ?>
23-
<?= $this->Form->end() ?>
15+
<?= $this->Form->create(null, ['type' => 'file']) ?>
16+
<fieldset>
17+
<legend><?= __('Import Job from exported JSON') ?></legend>
18+
<?php
19+
echo $this->Form->control('file', ['type' => 'file', 'required' => true, 'accept' => '.json']);
20+
echo $this->Form->control('reset', ['type' => 'checkbox', 'default' => true]);
21+
?>
22+
</fieldset>
23+
<?= $this->Form->button(__('Submit')) ?>
24+
<?= $this->Form->end() ?>
2425
</div>

0 commit comments

Comments
 (0)