LuCI - OpenWrt Configuration Interface
Revisão | c7c4c2b6feecb2d852fb62a64f8c1557340de696 (tree) |
---|---|
Hora | 2022-05-18 17:21:20 |
Autor | Beginner-Go <70857188+Beginner-Go@user...> |
Commiter | Tianling Shen |
luci-app-filetransfer: tidy up code
(cherry picked from commit 796a89a64c1af541aa1d1a4bf6d66d776f11c144)
@@ -12,5 +12,3 @@ LUCI_DEPENDS:=+luci-lib-fs | ||
12 | 12 | include ../../luci.mk |
13 | 13 | |
14 | 14 | # call BuildPackage - OpenWrt buildroot signature |
15 | - | |
16 | - |
@@ -8,5 +8,8 @@ Modify: ayongwifi@126.com www.openwrtdl.com | ||
8 | 8 | module("luci.controller.filetransfer", package.seeall) |
9 | 9 | |
10 | 10 | function index() |
11 | - entry({"admin", "system", "filetransfer"}, form("updownload"), _("FileTransfer"),89).acl_depends = { "luci-app-filetransfer" } | |
11 | + | |
12 | + local page = entry({"admin", "system", "filetransfer"}, form("filetransfer"), _("FileTransfer"), 89) | |
13 | + page.dependent = true | |
14 | + page.acl_depends = { "luci-app-filetransfer" } | |
12 | 15 | end |
@@ -6,19 +6,24 @@ ful.reset = false | ||
6 | 6 | ful.submit = false |
7 | 7 | |
8 | 8 | sul = ful:section(SimpleSection, "", translate("Upload file to '/tmp/upload/'")) |
9 | + | |
9 | 10 | fu = sul:option(FileUpload, "") |
10 | -fu.template = "cbi/other_upload" | |
11 | +fu.template = "filetransfer/other_upload" | |
12 | + | |
11 | 13 | um = sul:option(DummyValue, "", nil) |
12 | -um.template = "cbi/other_dvalue" | |
14 | +um.template = "filetransfer/other_dvalue" | |
13 | 15 | |
14 | 16 | fdl = SimpleForm("download", translate("Download"), nil) |
15 | 17 | fdl.reset = false |
16 | 18 | fdl.submit = false |
19 | + | |
17 | 20 | sdl = fdl:section(SimpleSection, "", translate("Download file")) |
21 | + | |
18 | 22 | fd = sdl:option(FileUpload, "") |
19 | -fd.template = "cbi/other_download" | |
23 | +fd.template = "filetransfer/other_download" | |
24 | + | |
20 | 25 | dm = sdl:option(DummyValue, "", nil) |
21 | -dm.template = "cbi/other_dvalue" | |
26 | +dm.template = "filetransfer/other_dvalue" | |
22 | 27 | |
23 | 28 | function Download() |
24 | 29 | local sPath, sFile, fd, block |
@@ -128,7 +133,7 @@ function IsIpkFile(name) | ||
128 | 133 | end |
129 | 134 | |
130 | 135 | btnis = tb:option(Button, "install", translate("Install")) |
131 | -btnis.template = "cbi/other_button" | |
136 | +btnis.template = "filetransfer/other_button" | |
132 | 137 | btnis.render = function(self, section, scope) |
133 | 138 | if not inits[section] then return false end |
134 | 139 | if IsIpkFile(inits[section].name) then |