Add usernames and sudo_usernames fields to VM request form
- DB: add usernames/sudo_usernames columns to vm_requests table - create.php: add form inputs for usernames and sudo_usernames - send.php: capture, validate, and store both fields in DB - netbox_integration/netbox_api.php: pass custom_fields to NetBox VM API - requests.php: show usernames/sudo_usernames in request list
This commit is contained in:
@@ -119,6 +119,18 @@ class NetBoxClient {
|
||||
'description' => $params['description'] ?? '',
|
||||
];
|
||||
|
||||
// Custom fields: usernames and sudo_usernames
|
||||
$cf = [];
|
||||
if (!empty($params['usernames'])) {
|
||||
$cf['usernames'] = $params['usernames'];
|
||||
}
|
||||
if (!empty($params['sudo_usernames'])) {
|
||||
$cf['sudo_usernames'] = $params['sudo_usernames'];
|
||||
}
|
||||
if (!empty($cf)) {
|
||||
$payload['custom_fields'] = $cf;
|
||||
}
|
||||
|
||||
// Tag lookup for domain — tags must be numeric IDs in the NetBox API
|
||||
if (!empty($params['domain'])) {
|
||||
$tag = $this->findTag($params['domain']);
|
||||
|
||||
Reference in New Issue
Block a user