More changes to use form.select component. Re-engineered user BBS registration

This commit is contained in:
2024-12-06 08:33:24 +11:00
parent fd780d1756
commit e7336a942b
13 changed files with 253 additions and 422 deletions

View File

@@ -56,8 +56,11 @@ class SystemRegisterRequest extends FormRequest
return [];
$so = $this->route('o');
// When we have selected a system during the register/linking process
if ((! $so) && ($request->action === 'register'))
return [];
// If system ID is not numeric, then its a new system
return is_numeric($request->system_id) ? ['system_id'=>'required|exists:systems,id'] : [];
return array_filter(array_merge([
'name' => 'required|min:3',
@@ -68,14 +71,16 @@ class SystemRegisterRequest extends FormRequest
'port' => 'nullable|digits_between:2,5',
'method' => 'nullable|numeric',
'mailer_details.*' => 'nullable|array',
// @todo Port should be present if active is true
'mailer_details.*.port' => 'nullable|digits_between:2,5',
'mailer_details.*.active' => 'sometimes|boolean',
'zt_id' => 'nullable|size:10|regex:/^([A-Fa-f0-9]){10}$/|unique:systems,zt_id,'.($so ? $so->id : 0),
'pkt_type' => ['required',Rule::in(array_keys(Packet::PACKET_TYPES))],
],($so && $so->exists) ? [
'users' => 'nullable|array|min:1|max:2',
'active' => 'required|boolean',
'hold' => 'sometimes|boolean',
'pollmode' => 'required|integer|min:0|max:2',
],($so && $so->exists) ? [
'users' => 'nullable|array|min:1|max:2',
'heartbeat' => [
'nullable',
'integer',