projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c79a2bb
)
luci-app-wireguard: add descriptions
author
rwalli
<rwalli@gmx.net>
Sat, 25 Aug 2018 17:04:36 +0000
(19:04 +0200)
committer
Jo-Philipp Wich
<jo@mein.io>
Sat, 29 Sep 2018 12:32:18 +0000
(14:32 +0200)
Add description fields to luci-app-wireguard similar to those in
luci-proto-wireguard.
Ref: https://github.com/openwrt/luci/commit/
140f41b4
Suggested-by: "rwalli" <rwalli@gmx.net>
[squash commits, reword commit message, remove semicolons,
remove trailing white space]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-wireguard/luasrc/view/wireguard.htm
patch
|
blob
|
history
diff --git
a/applications/luci-app-wireguard/luasrc/view/wireguard.htm
b/applications/luci-app-wireguard/luasrc/view/wireguard.htm
index cd08e9ed51864b68496be60b21095a1e8d0d31d2..c25ef85caacc4f1c5dcc23de9f30139c1ac778d5 100644
(file)
--- a/
applications/luci-app-wireguard/luasrc/view/wireguard.htm
+++ b/
applications/luci-app-wireguard/luasrc/view/wireguard.htm
@@
-179,10
+179,26
@@
for ikey, iface in pairs(data) do
</div>
</div>
<%-
</div>
</div>
<%-
+ local cur = uci.cursor()
for pkey, peer in pairs(iface.peers) do
for pkey, peer in pairs(iface.peers) do
+ local desc, tmp_desc, pub_key = "", "", ""
+ cur:foreach("network", "wireguard_" .. ikey, function(s)
+ local tmp_desc, pub_key = "", ""
+ for key, value in pairs(s) do
+ if key == "description" then
+ tmp_desc = value
+ end
+ if value == peer.public_key then
+ pub_key = value
+ end
+ if pub_key == peer.public_key and tmp_desc ~= "" then
+ desc = ': ' .. tmp_desc
+ end
+ end
+ end)
-%>
<div class="tr">
-%>
<div class="tr">
- <div class="td" width="33%" style="vertical-align:top"><%:Peer%></div>
+ <div class="td" width="33%" style="vertical-align:top"><%:Peer%><
%=desc%><
/div>
<div class="td">
<div class="table">
<div class="tr">
<div class="td">
<div class="table">
<div class="tr">