Skip to content

Commit

Permalink
add v3.8.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwang401 committed Mar 8, 2023
1 parent a1dc3fa commit a711d71
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ This file is a running track of new features and fixes to each version of the pa

This project follows [Semantic Versioning](http://semver.org) guidelines.

## v3.8.0-beta

### Changed

- Made system OS password optional if create server option isn't checked when creating a new server in the administrator
area

## v3.7.5-beta

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Admin/Servers/StoreServerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function rules()
'limits.bandwidth' => $rules['bandwidth_limit'],
'limits.address_ids' => 'sometimes|nullable|array',
'limits.address_ids.*' => 'integer|exists:ip_addresses,id',
'account_password' => ['required', 'string', 'min:8', 'max:191', new Password(), new EnglishKeyboardCharacters(),],
'account_password' => ['required_if:should_create_server,1', 'string', 'min:8', 'max:191', new Password(), new EnglishKeyboardCharacters(),],
'should_create_server' => 'present|boolean',
'template_uuid' => 'required_if:create_server,1|string|exists:templates,uuid',
'start_on_completion' => 'present|boolean',
Expand Down
6 changes: 4 additions & 2 deletions resources/scripts/api/admin/servers/createServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface CreateServerParameters {
vmid: number | null
hostname: string
limits: ServerLimits
accountPassword: string
accountPassword: string | null
shouldCreateServer: boolean
templateUuid: string | null
startOnCompletion: boolean
Expand All @@ -44,7 +44,9 @@ const createServer = async ({
...limits,
address_ids: addressIds,
},
account_password: accountPassword,
...((accountPassword && accountPassword.length > 0) && {
account_password: accountPassword
}),
should_create_server: shouldCreateServer,
...(shouldCreateServer && {
template_uuid: templateUuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ const CreateServerModal = ({ nodeId, userId, open, onClose }: Props) => {
.passwordRequirements()
// @ts-ignore
.englishKeyboardCharacters()
.required(),
.when('shouldCreateServer', {
is: true,
then: yup.string().required('Must enter a password'),
}),
shouldCreateServer: yup.boolean(),
templateUuid: yup.string().when('createServer', {
is: true,
Expand Down

0 comments on commit a711d71

Please sign in to comment.