luci-app-olsr: handle empty result for non-status tables
[oweals/luci.git] / protocols / luci-proto-wireguard / luasrc / model / cbi / admin_network / proto_wireguard.lua
index 46a8f49d976b7b187b9192a88486f17e99e9aabb..64e256a517cbf5185d52a1488af15d132cf93187 100644 (file)
@@ -5,7 +5,7 @@
 local map, section, net = ...
 local ifname = net:get_interface():name()
 local private_key, listen_port
-local metric, mtu, preshared_key
+local metric, mtu, preshared_key, description
 local peers, public_key, allowed_ips, endpoint, persistent_keepalive
 
 
@@ -89,13 +89,23 @@ peers = map:section(
   "wireguard_" .. ifname,
   translate("Peers"),
   translate("Further information about WireGuard interfaces and peers " ..
-            "at <a href=\"http://wireguard.io\">wireguard.io</a>.")
+            "at <a href=\"http://wireguard.com\">wireguard.com</a>.")
 )
 peers.template = "cbi/tsection"
 peers.anonymous = true
 peers.addremove = true
 
 
+description = peers:option(
+  Value,
+  "description",
+  translate("Description"),
+  translate("Optional. Description of peer."))
+description.placeholder = "My Peer"
+description.datatype = "string"
+description.optional = true
+
+
 public_key = peers:option(
   Value,
   "public_key",