luci-app-docker: readme pdf link

This commit is contained in:
LEAN-ESX 2019-10-17 19:56:08 -07:00
parent 4ba172b2ba
commit bca9c23233
2 changed files with 3 additions and 26 deletions

View File

@ -10,7 +10,7 @@ LUCI_TITLE:=Luci for Docker-CE
LUCI_DEPENDS:=+docker-ce
LUCI_PKGARCH:=all
PKG_VERSION:=1
PKG_RELEASE:=8
PKG_RELEASE:=9
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -17,30 +17,7 @@ wan_mode = s:option(Flag, "wan_mode", translate("Enable WAN access Dokcer"), tra
wan_mode.default = 0
wan_mode.rmempty = false
o = s:option(Button,"readme",translate("Docker Readme First"))
o.inputtitle = translate("Download DockerReadme.pdf")
o.description = translate("Please download DockerReadme.pdf to read when first-running")
o.inputstyle = "reload"
o.write = function()
Download()
end
function Download()
local t,e
t=nixio.open("/www/DockerReadme.pdf","r")
luci.http.header('Content-Disposition','attachment; filename="DockerReadme.pdf"')
luci.http.prepare_content("application/octet-stream")
while true do
e=t:read(nixio.const.buffersize)
if(not e)or(#e==0)then
break
else
luci.http.write(e)
end
end
t:close()
luci.http.close()
end
o=s:option(DummyValue,"readme",translate(" "))
o.description=translate("<a href=\"../../../../DockerReadme.pdf\" target=\"_blank\" />"..translate("Download DockerReadme.pdf").."</a>")
return m