Revision 2c597c2d
Von Sven Schöling vor etwa 9 Jahren hinzugefügt
SL/Controller/BackgroundJob.pm | ||
---|---|---|
19 | 19 |
|
20 | 20 |
__PACKAGE__->run_before('check_auth'); |
21 | 21 |
__PACKAGE__->run_before('check_task_server'); |
22 |
__PACKAGE__->run_before('load_background_job', only => [ qw(edit update destroy execute) ]); |
|
22 |
__PACKAGE__->run_before('load_background_job', only => [ qw(edit update destroy execute show) ]);
|
|
23 | 23 |
|
24 | 24 |
# |
25 | 25 |
# actions |
... | ... | |
51 | 51 |
JOB_CLASSES => [ SL::BackgroundJob::Base->get_known_job_classes ]); |
52 | 52 |
} |
53 | 53 |
|
54 |
sub action_show { |
|
55 |
my ($self) = @_; |
|
56 |
|
|
57 |
if ($::request->type eq 'json') { |
|
58 |
$self->render(\ SL::JSON::to_json($self->background_job->as_tree), { type => 'json' }); |
|
59 |
} else { |
|
60 |
$self->action_edit; |
|
61 |
} |
|
62 |
} |
|
63 |
|
|
54 | 64 |
sub action_create { |
55 | 65 |
my ($self) = @_; |
56 | 66 |
|
Auch abrufbar als: Unified diff
BackgroundJobs optional als json ausliefern