Hello Bruno @bnomei,
I use your Janitor plugin to post a webhook request. It works but my Janitor button stay in its progress mode in the panel. This webhook trigger a deploy process on my server.
I would like that the button come back to its initial mode when the deploy process is ended.
Is that possible ? What did I miss ?
This is my code:
blueprints
fields:
deployjanitor:
type: janitor
label: Deploy
icon: refresh
progress: Deploy...
job: deployJanitor
config.php
'bnomei.janitor.jobs' => [
'deployJanitor' => function (Kirby\Cms\Page $page = null, string $data = null) {
// $page => page object where the button as pressed
// $data => 'my custom data'
$url = 'https:/my_webhook_url';
$options = [
'headers' => [
'Access-Control-Allow-Origin: *',
'Access-Control-Allow-Methods: POST',
'Access-Control-Allow-Headers: X-Requested-With'
],
'method' => 'POST'
];
$response = Remote::request($url, $options);
return [
'status' => 200,
'label' => $page->title() . ' - ' . $response,
];
},
],
last question: what is βlabelβ in the return array ?
Thanks for your help