luci-mod-network: fix incorrectly reverting vlan device name
authorJo-Philipp Wich <jo@mein.io>
Mon, 19 Jun 2023 22:31:21 +0000 (00:31 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 19 Jun 2023 22:31:21 +0000 (00:31 +0200)
Fixes: #6435
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js

index 97bbf0ab5ddeafbfdd5d932218c74a0eecc758f1..092bbbc14a69131585437f3e0abdfa1ea6f52c5a 100644 (file)
@@ -475,7 +475,7 @@ return baseclass.extend({
                            vid = this.section.formvalue(section_id, 'vid'),
                            name = this.section.getUIElement(section_id, 'name_complex');
 
-                       if (base && vid && name && !name.isChanged()) {
+                       if (base && vid && name && !name.isChanged() && isNew) {
                                name.setValue('%s.%d'.format(base, vid));
                                name.triggerValidation();
                        }