OSDN Git Service

luci-app-filetransfer: tidy up code
authorBeginner-Go <70857188+Beginner-Go@users.noreply.github.com>
Thu, 5 May 2022 15:27:19 +0000 (15:27 +0000)
committerTianling Shen <cnsztl@gmail.com>
Sun, 15 May 2022 06:55:58 +0000 (14:55 +0800)
applications/luci-app-filetransfer/Makefile
applications/luci-app-filetransfer/luasrc/controller/filetransfer.lua
applications/luci-app-filetransfer/luasrc/model/cbi/filetransfer.lua [moved from applications/luci-app-filetransfer/luasrc/model/cbi/updownload.lua with 94% similarity]
applications/luci-app-filetransfer/luasrc/view/filetransfer/other_button.htm [moved from applications/luci-app-filetransfer/luasrc/view/cbi/other_button.htm with 100% similarity]
applications/luci-app-filetransfer/luasrc/view/filetransfer/other_download.htm [moved from applications/luci-app-filetransfer/luasrc/view/cbi/other_download.htm with 100% similarity]
applications/luci-app-filetransfer/luasrc/view/filetransfer/other_dvalue.htm [moved from applications/luci-app-filetransfer/luasrc/view/cbi/other_dvalue.htm with 100% similarity]
applications/luci-app-filetransfer/luasrc/view/filetransfer/other_upload.htm [moved from applications/luci-app-filetransfer/luasrc/view/cbi/other_upload.htm with 100% similarity]

index af2f900..eae1c33 100644 (file)
@@ -12,5 +12,3 @@ LUCI_DEPENDS:=+luci-lib-fs
 include ../../luci.mk
 
 # call BuildPackage - OpenWrt buildroot signature
-
-
index fea2a03..c679390 100644 (file)
@@ -8,5 +8,8 @@ Modify: ayongwifi@126.com  www.openwrtdl.com
 module("luci.controller.filetransfer", package.seeall)
 
 function index()
-       entry({"admin", "system", "filetransfer"}, form("updownload"), _("FileTransfer"),89).acl_depends = { "luci-app-filetransfer" }
+
+       local page = entry({"admin", "system", "filetransfer"}, form("filetransfer"), _("FileTransfer"), 89)
+       page.dependent = true
+       page.acl_depends = { "luci-app-filetransfer" }
 end
@@ -6,19 +6,24 @@ ful.reset = false
 ful.submit = false
 
 sul = ful:section(SimpleSection, "", translate("Upload file to '/tmp/upload/'"))
+
 fu = sul:option(FileUpload, "")
-fu.template = "cbi/other_upload"
+fu.template = "filetransfer/other_upload"
+
 um = sul:option(DummyValue, "", nil)
-um.template = "cbi/other_dvalue"
+um.template = "filetransfer/other_dvalue"
 
 fdl = SimpleForm("download", translate("Download"), nil)
 fdl.reset = false
 fdl.submit = false
+
 sdl = fdl:section(SimpleSection, "", translate("Download file"))
+
 fd = sdl:option(FileUpload, "")
-fd.template = "cbi/other_download"
+fd.template = "filetransfer/other_download"
+
 dm = sdl:option(DummyValue, "", nil)
-dm.template = "cbi/other_dvalue"
+dm.template = "filetransfer/other_dvalue"
 
 function Download()
        local sPath, sFile, fd, block
@@ -128,7 +133,7 @@ function IsIpkFile(name)
 end
 
 btnis = tb:option(Button, "install", translate("Install"))
-btnis.template = "cbi/other_button"
+btnis.template = "filetransfer/other_button"
 btnis.render = function(self, section, scope)
        if not inits[section] then return false end
        if IsIpkFile(inits[section].name) then