luci-app-firewall: remove hinting
authorDirk Brenken <dev@brenken.org>
Wed, 28 Nov 2018 12:55:42 +0000 (13:55 +0100)
committerDirk Brenken <dev@brenken.org>
Wed, 28 Nov 2018 12:55:42 +0000 (13:55 +0100)
Remove firewall hinting as discussed in #2340

Signed-off-by: Dirk Brenken <dev@brenken.org>
applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm
applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm

index 1bb86821ecb4dae7c19a527c4f3b6884bd5a1826..38f36b49c87363e932def79e424b480ebfbcbddf 100644 (file)
                        var n = document.getElementById('_newfwd.name');
                        var p = document.getElementById('_newfwd.proto');
                        var i = document.getElementById('_newfwd.intport');
-                       var hints = {
-                       /*  port    name     0=both, 1=tcp, 2=udp, 3=other */
-                               21:   [ 'FTP',   1 ],
-                               22:   [ 'SSH',   1 ],
-                               53:   [ 'DNS',   0 ],
-                               80:   [ 'HTTP',  1 ],
-                               443:  [ 'HTTPS', 1 ],
-                               3389: [ 'RDP',   1 ],
-                               5900: [ 'VNC',   1 ],
-                       };
 
                        if (!this.className.match(/invalid/))
                        {
                                if (!i.value) i.value = this.value;
 
-                               var hint = hints[this.value || 0] || hints[i.value || 0];
-                               if (hint)
-                               {
-                                       p.selectedIndex = hint[1];
-
-                                       if (!n.value)
-                                               n.value = hint[0];
-                               }
-                               else if (!n.value)
+                               if (!n.value)
                                {
                                        n.value = 'Forward' + this.value;
                                }
index c02fc20f9e8be2eb11499f2a021ebd71131585f6..e0092a7a56e4f8e36682f6ae8a0e2f07e4d0d1a8 100644 (file)
                        function() {
                                var n = document.getElementById('_newopen.name');
                                var p = document.getElementById('_newopen.proto');
-                               var hints = {
-                               /*  port    name     0=both, 1=tcp, 2=udp, 3=other */
-                                       22:   [ 'SSH',   1 ],
-                                       53:   [ 'DNS',   0 ],
-                                       80:   [ 'HTTP',  1 ],
-                                       443:  [ 'HTTPS', 1 ],
-                               };
 
                                if (!this.className.match(/invalid/))
                                {
-                                       var hint = hints[this.value || 0];
-                                       if (hint)
-                                       {
-                                               p.selectedIndex = hint[1];
-
-                                               if (!n.value)
-                                                       n.value = hint[0];
-                                       }
-                                       else if (!n.value && this.value)
+                                       if (!n.value && this.value)
                                        {
                                                n.value = 'Open' + this.value;
                                        }