refactor updating of interface settings to allow removing values when saving an existing interface

This commit is contained in:
liamcottle 2025-02-02 23:06:06 +13:00
parent 33e4888737
commit 734eaeed1b
3 changed files with 137 additions and 142 deletions

View file

@ -334,7 +334,7 @@
<div class="mb-2">
<FormLabel class="mb-1">Serial connection baud rate (bps)</FormLabel>
<input v-model="newInterfaceSpeed" placeholder="115200" type="number" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-zinc-900 dark:border-zinc-600 dark:text-white">
<input v-model="newInterfaceSpeed" placeholder="9600" type="number" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-zinc-900 dark:border-zinc-600 dark:text-white">
</div>
<div class="mb-2">
@ -344,7 +344,11 @@
<div class="mb-2">
<FormLabel class="mb-1">Parity</FormLabel>
<input v-model="newInterfaceParity" type="number" placeholder="" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-zinc-900 dark:border-zinc-600 dark:text-white">
<select v-model="newInterfaceParity" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-zinc-900 dark:border-zinc-600 dark:text-white dark:focus:ring-blue-600 dark:focus:border-blue-600">
<option :value="undefined">None</option>
<option value="even">Even</option>
<option value="odd">Odd</option>
</select>
</div>
<div>
@ -605,9 +609,9 @@
</template>
</ExpandingSection>
<!-- optional TCPClientInterface and UDPInterface settings -->
<ExpandingSection v-if="newInterfaceType === 'TCPServerInterface' || newInterfaceType === 'UDPInterface'">
<template v-slot:title>Optional {{ newInterfaceType }} settings</template>
<!-- optional TCPClientInterface settings -->
<ExpandingSection v-if="newInterfaceType === 'TCPServerInterface'">
<template v-slot:title>Optional TCPServerInterface settings</template>
<template v-slot:content>
<div class="p-2 space-y-3">
@ -635,6 +639,22 @@
</template>
</ExpandingSection>
<!-- optional UDPInterface settings -->
<ExpandingSection v-if="newInterfaceType === 'UDPInterface'">
<template v-slot:title>Optional UDPInterface settings</template>
<template v-slot:content>
<div class="p-2 space-y-3">
<div>
<FormLabel>Network device</FormLabel>
<span class="text-sm text-gray-500 dark:text-zinc-300">Binds the interface to a specific network interface</span>
<input type="text" placeholder="e.g: eth0" v-model="newInterfaceNetworkDevice" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-zinc-900 dark:border-zinc-600 dark:text-white dark:focus:ring-blue-600 dark:focus:border-blue-600">
</div>
</div>
</template>
</ExpandingSection>
<!-- optional RNodeInterface settings -->
<ExpandingSection v-if="newInterfaceType === 'RNodeInterface'">
<template v-slot:title>Optional RNodeInterface Settings</template>