• R/O
  • HTTP
  • SSH
  • HTTPS

luci: Commit

LuCI - OpenWrt Configuration Interface


Commit MetaInfo

Révision6d341aa2d65629233b34051bef806d55190e374a (tree)
l'heure2022-05-08 14:47:52
AuteurBeginner-Go <70857188+Beginner-Go@user...>
CommiterTianling Shen

Message de Log

luci-app-gowebdav: code alignment

(cherry picked from commit 67019d1f6d0a2745665627e1620c3795a5486bcb)

Change Summary

Modification

--- a/applications/luci-app-gowebdav/luasrc/controller/gowebdav.lua
+++ b/applications/luci-app-gowebdav/luasrc/controller/gowebdav.lua
@@ -1,20 +1,22 @@
1-module("luci.controller.gowebdav", package.seeall)
2-
3-function index()
4- if not nixio.fs.access("/etc/config/gowebdav") then
5- return
6- end
7- entry({"admin", "nas"}, firstchild(), _("NAS") , 45).dependent = false
8- local page
9- page = entry({"admin", "nas", "gowebdav"}, cbi("gowebdav"), _("GoWebDav"), 100)
10- page.dependent = true
11- page.acl_depends = { "luci-app-gowebdav" }
12- entry({"admin","nas","gowebdav","status"},call("act_status")).leaf=true
13-end
14-
15-function act_status()
16- local e={}
17- e.running=luci.sys.call("pgrep gowebdav >/dev/null")==0
18- luci.http.prepare_content("application/json")
19- luci.http.write_json(e)
20-end
1+module("luci.controller.gowebdav", package.seeall)
2+
3+function index()
4+ if not nixio.fs.access("/etc/config/gowebdav") then
5+ return
6+ end
7+
8+ entry({"admin", "nas"}, firstchild(), _("NAS"), 45).dependent = false
9+
10+ local page = entry({"admin", "nas", "gowebdav"}, cbi("gowebdav"), _("GoWebDav"), 100)
11+ page.dependent = true
12+ page.acl_depends = { "luci-app-gowebdav" }
13+
14+ entry({"admin", "nas", "gowebdav", "status"}, call("act_status")).leaf = true
15+end
16+
17+function act_status()
18+ local e = {}
19+ e.running = luci.sys.call("pgrep gowebdav >/dev/null") == 0
20+ luci.http.prepare_content("application/json")
21+ luci.http.write_json(e)
22+end
--- a/applications/luci-app-gowebdav/luasrc/model/cbi/gowebdav.lua
+++ b/applications/luci-app-gowebdav/luasrc/model/cbi/gowebdav.lua
@@ -1,7 +1,8 @@
11 -- Created By ImmortalWrt
22 -- https://github.com/immortalwrt
33
4-m = Map("gowebdav", translate("GoWebDav"), translate("GoWebDav is a tiny, simple, fast WevDav server."))
4+m = Map("gowebdav", translate("GoWebDav"))
5+m.description = translate("GoWebDav is a tiny, simple, fast WevDav server.")
56
67 m:section(SimpleSection).template = "gowebdav/gowebdav_status"
78
@@ -9,51 +10,51 @@ s = m:section(TypedSection, "gowebdav")
910 s.addremove = false
1011 s.anonymous = true
1112
12-enable = s:option(Flag, "enable", translate("Enable"))
13-enable.rmempty = false
13+o = s:option(Flag, "enable", translate("Enable"))
14+o.rmempty = false
1415
15-listen_port = s:option(Value, "listen_port", translate("Listen Port"))
16-listen_port.placeholder = 6086
17-listen_port.default = 6086
18-listen_port.datatype = "port"
19-listen_port.rmempty = false
16+o = s:option(Value, "listen_port", translate("Listen Port"))
17+o.placeholder = 6086
18+o.default = 6086
19+o.datatype = "port"
20+o.rmempty = false
2021
21-username = s:option(Value, "username", translate("Username"))
22-username.description = translate("Leave blank to disable auth.")
23-username.placeholder = user
24-username.default = user
25-username.datatype = "string"
22+o = s:option(Value, "username", translate("Username"))
23+o.description = translate("Leave blank to disable auth.")
24+o.placeholder = user
25+o.default = user
26+o.datatype = "string"
2627
27-password = s:option(Value, "password", translate("Password"))
28-password.description = translate("Leave blank to disable auth.")
29-password.placeholder = pass
30-password.default = pass
31-password.datatype = "string"
32-password.password = true
28+o = s:option(Value, "password", translate("Password"))
29+o.description = translate("Leave blank to disable auth.")
30+o.placeholder = pass
31+o.default = pass
32+o.datatype = "string"
33+o.password = true
3334
34-root_dir = s:option(Value, "root_dir", translate("Root Directory"))
35-root_dir.placeholder = "/mnt"
36-root_dir.default = "/mnt"
37-root_dir.rmempty = false
35+o = s:option(Value, "root_dir", translate("Root Directory"))
36+o.placeholder = "/mnt"
37+o.default = "/mnt"
38+o.rmempty = false
3839
39-read_only = s:option(Flag, "read_only", translate("Read-Only Mode"))
40-read_only.rmempty = false
40+o = s:option(Flag, "read_only", translate("Read-Only Mode"))
41+o.rmempty = false
4142
42-allow_wan = s:option(Flag, "allow_wan", translate("Allow Access From Internet"))
43-allow_wan.rmempty = false
43+o = s:option(Flag, "allow_wan", translate("Allow Access From Internet"))
44+o.rmempty = false
4445
45-use_https = s:option(Flag, "use_https", translate("Use HTTPS instead of HTTP"))
46-use_https.rmempty = false
46+o = s:option(Flag, "use_https", translate("Use HTTPS instead of HTTP"))
47+o.rmempty = false
4748
48-cert_cer = s:option(Value, "cert_cer", translate("Path to Certificate"))
49-cert_cer.datatype = "file"
50-cert_cer:depends("use_https", 1)
49+o = s:option(Value, "cert_cer", translate("Path to Certificate"))
50+o.datatype = "file"
51+o:depends("use_https", 1)
5152
52-cert_key = s:option(Value, "cert_key", translate("Path to Certificate Key"))
53-cert_key.datatype = "file"
54-cert_key:depends("use_https", 1)
53+o = s:option(Value, "cert_key", translate("Path to Certificate Key"))
54+o.datatype = "file"
55+o:depends("use_https", 1)
5556
56-download_reg = s:option(DummyValue,"opennewwindow",translate("<input type=\"button\" class=\"cbi-button cbi-button-apply\" value=\"Download Reg File\" onclick=\"window.open('https://raw.githubusercontent.com/1715173329/gowebdav/master/allow_http.reg')\" />"))
57-download_reg.description = translate("Windows doesn't allow HTTP auth by default, you need to import this reg key to enable it (Reboot needed).")
57+o = s:option(DummyValue, "opennewwindow", translate("<input type=\"button\" class=\"cbi-button cbi-button-apply\" value=\"Download Reg File\" onclick=\"window.open('https://raw.githubusercontent.com/1715173329/gowebdav/master/allow_http.reg')\" />"))
58+o.description = translate("Windows doesn't allow HTTP auth by default, you need to import this reg key to enable it (Reboot needed).")
5859
5960 return m
Afficher sur ancien navigateur de dépôt.