Added response codes

This commit is contained in:
Jeroen De Meerleer 2021-05-19 20:09:09 +02:00
parent 9cdedc26cd
commit bfeb97c441
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 17 additions and 1 deletions

View File

@ -52,6 +52,7 @@ class Job
{
case 'command':
$data['command'] = $values['command'];
$data['response'] = $values['response'];
break;
case 'reboot':
$data['reboot-command'] = $values['reboot-command'];
@ -72,6 +73,7 @@ class Job
case 'http':
$parsedUrl = parse_url($values['url']);
$data['url'] = $values['url'];
$data['response'] = $values['response'];
$data['basicauth-username'] = $values['basicauth-username'];
if(empty($parsedUrl['host'])) {
return ['success' => false, 'message' => 'Some data was invalid'];

View File

@ -67,6 +67,11 @@
<label for="command">Command</label>
<input type="text" name="command" class="form-control" id="command" placeholder="sudo apt update">
</div>
<div class="mb-3">
<label for="response">Expected exit code</label>
<input type="text" name="response" class="form-control" id="response" placeholder="0">
</div>
</div>
<div class="crontype-reboot crontype-inputs hidden">
@ -110,6 +115,16 @@
<input type="password" name="basicauth-password" class="form-control" placeholder="correct horse battery staple">
<small id="basicauth-password-help" class="form-text text-muted">This field is being saved as a secret</small>
</div>
<div class="mb-3">
<label for="response">Expected response status code</label>
<input type="text" name="response" class="form-control" id="response" placeholder="200">
</div>
</div>
<div class="hosttype-localhost hosttype-inputs hidden">
<h4>Localhost details</h4>
<h5>No options</h5>
</div>
<div class="hosttype-ssh hosttype-inputs hidden">
@ -133,7 +148,6 @@
<small id="custom-file-help" class="form-text text-muted">This file is being saved as a secret</small>
</div>
<div class="mb-3">
<label for="privkey-password">Password for private key</label>
<input type="password" name="privkey-password" class="form-control" placeholder="correct horse battery staple">