diff --git a/public/i18n/en/translation.json b/public/i18n/en/translation.json index 77626e56..60af4722 100644 --- a/public/i18n/en/translation.json +++ b/public/i18n/en/translation.json @@ -907,7 +907,8 @@ "create_bond": "Create bond", "configure_bond": "Configure bond", "configure_bond_name": "Configure bond {name}", - "clients_network": "Clients network" + "clients_network": "Clients network", + "pppoe_name_too_long_need_reconfiguration": "PPPoE interface names are limited to {num} characters. You can remove the configuration from this device, then reconfigure it with a shorter interface name." }, "multi_wan": { "title": "MultiWAN", diff --git a/src/components/standalone/interfaces_and_devices/ConfigureDeviceDrawer.vue b/src/components/standalone/interfaces_and_devices/ConfigureDeviceDrawer.vue index 01f1afbf..2ac4a10e 100644 --- a/src/components/standalone/interfaces_and_devices/ConfigureDeviceDrawer.vue +++ b/src/components/standalone/interfaces_and_devices/ConfigureDeviceDrawer.vue @@ -657,6 +657,9 @@ function validate() { if (logicalIfaceType.value == 'bond') { maxLen = 10 } + if (protocol.value == 'pppoe') { + maxLen = 5 + } let { valid, errMessage, i18Params } = validateUciName(interfaceName.value, maxLen) if (!valid) { error.value.interfaceName = t(errMessage as string, i18Params as any) @@ -665,6 +668,20 @@ function validate() { focusElement(interfaceNameRef) } } + } else { + // editing an already configured device + if (protocol.value == 'pppoe' && interfaceName.value.length > 5) { + error.value.interfaceName = t( + 'standalone.interfaces_and_devices.pppoe_name_too_long_need_reconfiguration', + { + num: 5 + } + ) + if (isValidationOk) { + isValidationOk = false + focusElement(interfaceNameRef) + } + } } if (isConfiguringFromScratch.value) {