Skip to content

Commit f3585ba

Browse files
authored
Minor tweaks to the frontend (#97)
* Update NetworkSettings.tsx Correct spelling: "Privite" -> "Private" * Update ManuallyAddMember.tsx Update check criteria for member IDs to allow upper case. * Update ManageRoutes.tsx Improve `ipv6cidrRegex` so proper IPV6 CIDR notations can pass the regex check. For example, "2001:db8:1000::/48" would not pass the previous regex, but passes the updated regex.
1 parent f99dd4e commit f3585ba

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

webui/src/views/NetworkView/ManageRoutes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useClient } from '../../Client';
88
export const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
99
export const ipv6Regex = /^((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4}))*::((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4}))*|((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4})){7}$/;
1010
export const ipv4cidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/([0-9]|[1-2][0-9]|3[0-2])$/;
11-
export const ipv6cidrRegex = /^((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4}))*::((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4}))*|((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4})){7}\/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])$/;
11+
export const ipv6cidrRegex = /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){1,4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){1,3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){1,2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:((:[0-9A-Fa-f]{1,4}){1,6}))|:((:[0-9A-Fa-f]{1,4}){1,7}|:))(\/(12[0-8]|1[01][0-9]|[1-9]?[0-9]))$/;/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){1,4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){1,3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){1,2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:((:[0-9A-Fa-f]{1,4}){1,6}))|:((:[0-9A-Fa-f]{1,4}){1,7}|:))(\/(12[0-8]|1[01][0-9]|[1-9]?[0-9]))$/
1212

1313

1414
export default () => {
@@ -94,4 +94,4 @@ export default () => {
9494

9595

9696
</Fieldset>;
97-
};
97+
};

webui/src/views/NetworkView/ManuallyAddMember.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default () => {
99
const [nodeId, setNodeId] = createSignal('');
1010
const nodeIdValidate = createMemo(() => {
1111
const id = nodeId();
12-
return id.length === 10 && [...id].every(c => '0123456789abcdef'.includes(c));
12+
return id.length === 10 && [...id].every(c => '0123456789abcdefABCDEF'.includes(c));
1313
});
1414

1515
return <Fieldset legend="Manually Add Member">

webui/src/views/NetworkView/NetworkSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default () => {
6464
<FormControl label="Access Control" class="max-w-lg">
6565
<div>
6666
<div class="my-4">
67-
<div>Privite</div>
67+
<div>Private</div>
6868
<input type="radio" name="radio-10" class="radio radio-primary" checked={isPrivate()} onChange={(e) => setPrivate(e.target.checked)} />
6969
<div class="text-xs max-w-lg">Nodes must be authorized to become members</div>
7070
</div>

0 commit comments

Comments
 (0)