Merge branch 'master' of ssh://gitea.limil.top:32222/limil/WG
This commit is contained in:
commit
44356cb88a
@ -124,7 +124,10 @@ function FlowContent(): ReactNode {
|
|||||||
setNodes((prev) =>
|
setNodes((prev) =>
|
||||||
prev.map((node) => {
|
prev.map((node) => {
|
||||||
if (node.data.id === editingNode?.id) {
|
if (node.data.id === editingNode?.id) {
|
||||||
node.data = {...node.data, ...updatedData}
|
return {
|
||||||
|
...node,
|
||||||
|
data: {...node.data, ...updatedData}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return node;
|
return node;
|
||||||
})
|
})
|
||||||
|
|||||||
@ -23,6 +23,14 @@ class Validation {
|
|||||||
function Validate(updateData : NodeDataUpdate, settings : Settings) : Validation {
|
function Validate(updateData : NodeDataUpdate, settings : Settings) : Validation {
|
||||||
const errors: string[] = [];
|
const errors: string[] = [];
|
||||||
|
|
||||||
|
if(!updateData.label) {
|
||||||
|
errors.push("Label不能是空");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!updateData.privateKey) {
|
||||||
|
errors.push("privateKey不能是空");
|
||||||
|
}
|
||||||
|
|
||||||
const ipv4Subnet = settings.ipv4Subnet;
|
const ipv4Subnet = settings.ipv4Subnet;
|
||||||
const ipv4Address = updateData.ipv4Address;
|
const ipv4Address = updateData.ipv4Address;
|
||||||
if(ipv4Subnet) {
|
if(ipv4Subnet) {
|
||||||
|
|||||||
@ -83,11 +83,8 @@ export default function SettingsEditor({
|
|||||||
min="30000"
|
min="30000"
|
||||||
max="49151"
|
max="49151"
|
||||||
step="1"
|
step="1"
|
||||||
value={listenPort}
|
value={listenPort || ""}
|
||||||
onChange={e => {
|
onChange={e => setListenPort(e.target.valueAsNumber)}
|
||||||
const value = e.target.valueAsNumber;
|
|
||||||
setListenPort(isNaN(value) ? 38894 : value);
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user