luci-mod-status: don't set '-' hostname when creating static lease
authorJo-Philipp Wich <jo@mein.io>
Wed, 30 Jun 2021 15:26:07 +0000 (17:26 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 1 Jul 2021 19:15:25 +0000 (21:15 +0200)
Fixes: #5153
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e3357deb7d273b6a982dfaf9800c83eba85fe6b2)

modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js

index 9b40e23b5e04398ac174830332b03799a434b9a0..69305a2a9c1374cf02d45a0dd1ac44d6c6d7a720 100644 (file)
@@ -31,7 +31,7 @@ return baseclass.extend({
                ev.currentTarget.blur();
 
                var cfg = uci.add('dhcp', 'host');
-               uci.set('dhcp', cfg, 'name', lease.hostname || '-');
+               uci.set('dhcp', cfg, 'name', lease.hostname);
                uci.set('dhcp', cfg, 'ip', lease.ipaddr);
                uci.set('dhcp', cfg, 'mac', lease.macaddr.toUpperCase());
 
@@ -48,7 +48,7 @@ return baseclass.extend({
                var cfg = uci.add('dhcp', 'host'),
                    ip6arr = lease.ip6addrs[0] ? validation.parseIPv6(lease.ip6addrs[0]) : null;
 
-               uci.set('dhcp', cfg, 'name', lease.hostname || '-');
+               uci.set('dhcp', cfg, 'name', lease.hostname);
                uci.set('dhcp', cfg, 'duid', lease.duid.toUpperCase());
                uci.set('dhcp', cfg, 'mac', lease.macaddr);
                if (ip6arr)