luci-app-dockerman: merge upstream source
This commit is contained in:
parent
e39eb7971a
commit
933c9d0508
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-dockerman
|
||||
PKG_VERSION:=v0.1.6
|
||||
PKG_VERSION:=v0.1.7
|
||||
PKG_RELEASE:=beta
|
||||
PKG_MAINTAINER:=lisaac <https://github.com/lisaac/luci-app-dockerman>
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
@ -116,7 +116,7 @@ local start_stop_remove = function(m, cmd)
|
||||
end
|
||||
|
||||
m=SimpleForm("docker", container_info.Name:sub(2), translate("Docker Contaienr") )
|
||||
m.tempalte = "cbi/xsimpleform"
|
||||
m.template = "docker/cbi/xsimpleform"
|
||||
m.redirect = luci.dispatcher.build_url("admin/docker/containers")
|
||||
-- m:append(Template("docker/container"))
|
||||
docker_status = m:section(SimpleSection)
|
||||
@ -132,32 +132,32 @@ action_section.rowcolors=false
|
||||
action_section.template="cbi/nullsection"
|
||||
|
||||
btnstart=action_section:option(Button, "_start")
|
||||
btnstart.template="cbi/inlinebutton"
|
||||
btnstart.template="docker/cbi/inlinebutton"
|
||||
btnstart.inputtitle=translate("Start")
|
||||
btnstart.inputstyle = "apply"
|
||||
btnstart.forcewrite = true
|
||||
btnrestart=action_section:option(Button, "_restart")
|
||||
btnrestart.template="cbi/inlinebutton"
|
||||
btnrestart.template="docker/cbi/inlinebutton"
|
||||
btnrestart.inputtitle=translate("Restart")
|
||||
btnrestart.inputstyle = "reload"
|
||||
btnrestart.forcewrite = true
|
||||
btnstop=action_section:option(Button, "_stop")
|
||||
btnstop.template="cbi/inlinebutton"
|
||||
btnstop.template="docker/cbi/inlinebutton"
|
||||
btnstop.inputtitle=translate("Stop")
|
||||
btnstop.inputstyle = "reset"
|
||||
btnstop.forcewrite = true
|
||||
btnupgrade=action_section:option(Button, "_upgrade")
|
||||
btnupgrade.template="cbi/inlinebutton"
|
||||
btnupgrade.template="docker/cbi/inlinebutton"
|
||||
btnupgrade.inputtitle=translate("Upgrade")
|
||||
btnupgrade.inputstyle = "reload"
|
||||
btnstop.forcewrite = true
|
||||
btnduplicate=action_section:option(Button, "_duplicate")
|
||||
btnduplicate.template="cbi/inlinebutton"
|
||||
btnduplicate.template="docker/cbi/inlinebutton"
|
||||
btnduplicate.inputtitle=translate("Duplicate")
|
||||
btnduplicate.inputstyle = "add"
|
||||
btnstop.forcewrite = true
|
||||
btnremove=action_section:option(Button, "_remove")
|
||||
btnremove.template="cbi/inlinebutton"
|
||||
btnremove.template="docker/cbi/inlinebutton"
|
||||
btnremove.inputtitle=translate("Remove")
|
||||
btnremove.inputstyle = "remove"
|
||||
btnremove.forcewrite = true
|
||||
@ -312,7 +312,7 @@ if action == "info" then
|
||||
self.template = "cbi/button"
|
||||
Button.render(self, section, scope)
|
||||
else
|
||||
self.template = "cbi/dummyvalue"
|
||||
self.template = "docker/cbi/dummyvalue"
|
||||
self.default=""
|
||||
DummyValue.render(self, section, scope)
|
||||
end
|
||||
|
||||
@ -73,7 +73,7 @@ local c_lists = get_containers()
|
||||
-- list Containers
|
||||
-- m = Map("docker", translate("Docker"))
|
||||
m = SimpleForm("docker", translate("Docker"))
|
||||
m.tempalte = "cbi/xsimpleform"
|
||||
m.template = "docker/cbi/xsimpleform"
|
||||
m.submit=false
|
||||
m.reset=false
|
||||
|
||||
@ -96,7 +96,7 @@ container_id = c_table:option(DummyValue, "_id", translate("ID"))
|
||||
container_id.width="10%"
|
||||
container_name = c_table:option(DummyValue, "_name", translate("Name"))
|
||||
container_name.width="20%"
|
||||
container_name.template="cbi/dummyvalue"
|
||||
container_name.template="docker/cbi/dummyvalue"
|
||||
container_name.href = function (self, section)
|
||||
return luci.dispatcher.build_url("admin/docker/container/" .. urlencode(container_id:cfgvalue(section)))
|
||||
end
|
||||
@ -108,7 +108,7 @@ container_ip.width="15%"
|
||||
container_ports = c_table:option(DummyValue, "_ports", translate("Ports"))
|
||||
container_ports.width="10%"
|
||||
container_image = c_table:option(DummyValue, "_image", translate("Image"))
|
||||
container_image.template="cbi/dummyvalue"
|
||||
container_image.template="docker/cbi/dummyvalue"
|
||||
container_image.width="10%"
|
||||
-- container_image.href = function (self, section)
|
||||
-- return luci.dispatcher.build_url("admin/docker/image/" .. urlencode(c_lists[section]._image_id))
|
||||
@ -161,26 +161,26 @@ action_section.template="cbi/nullsection"
|
||||
|
||||
btnnew=action_section:option(Button, "_new")
|
||||
btnnew.inputtitle= translate("New")
|
||||
btnnew.template="cbi/inlinebutton"
|
||||
btnnew.template="docker/cbi/inlinebutton"
|
||||
btnnew.inputstyle = "add"
|
||||
btnnew.forcewrite = true
|
||||
btnstart=action_section:option(Button, "_start")
|
||||
btnstart.template="cbi/inlinebutton"
|
||||
btnstart.template="docker/cbi/inlinebutton"
|
||||
btnstart.inputtitle=translate("Start")
|
||||
btnstart.inputstyle = "apply"
|
||||
btnstart.forcewrite = true
|
||||
btnrestart=action_section:option(Button, "_restart")
|
||||
btnrestart.template="cbi/inlinebutton"
|
||||
btnrestart.template="docker/cbi/inlinebutton"
|
||||
btnrestart.inputtitle=translate("Restart")
|
||||
btnrestart.inputstyle = "reload"
|
||||
btnrestart.forcewrite = true
|
||||
btnstop=action_section:option(Button, "_stop")
|
||||
btnstop.template="cbi/inlinebutton"
|
||||
btnstop.template="docker/cbi/inlinebutton"
|
||||
btnstop.inputtitle=translate("Stop")
|
||||
btnstop.inputstyle = "reset"
|
||||
btnstop.forcewrite = true
|
||||
btnremove=action_section:option(Button, "_remove")
|
||||
btnremove.template="cbi/inlinebutton"
|
||||
btnremove.template="docker/cbi/inlinebutton"
|
||||
btnremove.inputtitle=translate("Remove")
|
||||
btnremove.inputstyle = "remove"
|
||||
btnremove.forcewrite = true
|
||||
|
||||
@ -50,7 +50,7 @@ local image_list = get_images()
|
||||
|
||||
-- m = Map("docker", translate("Docker"))
|
||||
m = SimpleForm("docker", translate("Docker"))
|
||||
m.tempalte = "cbi/xsimpleform"
|
||||
m.template = "docker/cbi/xsimpleform"
|
||||
m.submit=false
|
||||
m.reset=false
|
||||
|
||||
@ -58,14 +58,14 @@ local pull_value={{_image_tag_name="", _registry="index.docker.io"}}
|
||||
local pull_section = m:section(Table,pull_value, "Pull Image")
|
||||
pull_section.template="cbi/nullsection"
|
||||
local tag_name = pull_section:option(Value, "_image_tag_name")
|
||||
tag_name.template="cbi/inlinevalue"
|
||||
tag_name.template="docker/cbi/inlinevalue"
|
||||
tag_name.placeholder="lisaac/luci:latest"
|
||||
local registry = pull_section:option(Value, "_registry")
|
||||
registry.template="cbi/inlinevalue"
|
||||
registry.template="docker/cbi/inlinevalue"
|
||||
registry:value("index.docker.io", "DockerHub")
|
||||
local action_pull = pull_section:option(Button, "_pull")
|
||||
action_pull.inputtitle= translate("Pull")
|
||||
action_pull.template="cbi/inlinebutton"
|
||||
action_pull.template="docker/cbi/inlinebutton"
|
||||
action_pull.inputstyle = "add"
|
||||
tag_name.write = function(self, section,value)
|
||||
local hastag = value:find(":")
|
||||
@ -160,7 +160,7 @@ action.template="cbi/nullsection"
|
||||
|
||||
btnremove = action:option(Button, "remove")
|
||||
btnremove.inputtitle= translate("Remove")
|
||||
btnremove.template="cbi/inlinebutton"
|
||||
btnremove.template="docker/cbi/inlinebutton"
|
||||
btnremove.inputstyle = "remove"
|
||||
btnremove.forcewrite = true
|
||||
btnremove.write = function(self, section)
|
||||
@ -169,7 +169,7 @@ end
|
||||
|
||||
btnforceremove = action:option(Button, "forceremove")
|
||||
btnforceremove.inputtitle= translate("Force Remove")
|
||||
btnforceremove.template="cbi/inlinebutton"
|
||||
btnforceremove.template="docker/cbi/inlinebutton"
|
||||
btnforceremove.inputstyle = "remove"
|
||||
btnforceremove.forcewrite = true
|
||||
btnforceremove.write = function(self, section)
|
||||
|
||||
@ -41,7 +41,7 @@ end
|
||||
local network_list = get_networks()
|
||||
-- m = Map("docker", translate("Docker"))
|
||||
m = SimpleForm("docker", translate("Docker"))
|
||||
m.tempalte = "cbi/xsimpleform"
|
||||
m.template = "docker/cbi/xsimpleform"
|
||||
m.submit=false
|
||||
m.reset=false
|
||||
|
||||
@ -49,7 +49,7 @@ network_table = m:section(Table, network_list, translate("Networks"))
|
||||
network_table.nodescr=true
|
||||
|
||||
network_selecter = network_table:option(Flag, "_selected","")
|
||||
network_selecter.template = "cbi/xfvalue"
|
||||
network_selecter.template = "docker/cbi/xfvalue"
|
||||
network_id = network_table:option(DummyValue, "_id", translate("ID"))
|
||||
network_selecter.disabled = 0
|
||||
network_selecter.enabled = 1
|
||||
@ -83,7 +83,7 @@ action.rowcolors=false
|
||||
action.template="cbi/nullsection"
|
||||
btnnew=action:option(Button, "_new")
|
||||
btnnew.inputtitle= translate("New")
|
||||
btnnew.template="cbi/inlinebutton"
|
||||
btnnew.template="docker/cbi/inlinebutton"
|
||||
btnnew.notitle=true
|
||||
btnnew.inputstyle = "add"
|
||||
btnnew.forcewrite = true
|
||||
@ -92,7 +92,7 @@ btnnew.write = function(self, section)
|
||||
end
|
||||
btnremove = action:option(Button, "_remove")
|
||||
btnremove.inputtitle= translate("Remove")
|
||||
btnremove.template="cbi/inlinebutton"
|
||||
btnremove.template="docker/cbi/inlinebutton"
|
||||
btnremove.inputstyle = "remove"
|
||||
btnremove.forcewrite = true
|
||||
btnremove.write = function(self, section)
|
||||
|
||||
@ -146,7 +146,7 @@ elseif cmd_line and cmd_line:match("^duplicate/[^/]+$") then
|
||||
end
|
||||
|
||||
local m = SimpleForm("docker", translate("Docker"))
|
||||
m.tempalte = "cbi/xsimpleform"
|
||||
m.template = "docker/cbi/xsimpleform"
|
||||
m.redirect = luci.dispatcher.build_url("admin", "docker", "containers")
|
||||
-- m.reset = false
|
||||
-- m.submit = false
|
||||
@ -226,26 +226,26 @@ d.rmempty = true
|
||||
d.default = default_config.user or nil
|
||||
|
||||
d = s:option(DynamicList, "link", translate("Links with other containers"))
|
||||
d.template = "cbi/xdynlist"
|
||||
d.template = "docker/cbi/xdynlist"
|
||||
d.placeholder = "container_name:alias"
|
||||
d.rmempty = true
|
||||
d:depends("network", "bridge")
|
||||
d.default = default_config.link or nil
|
||||
|
||||
d = s:option(DynamicList, "env", translate("Environmental Variable"))
|
||||
d.template = "cbi/xdynlist"
|
||||
d.template = "docker/cbi/xdynlist"
|
||||
d.placeholder = "TZ=Asia/Shanghai"
|
||||
d.rmempty = true
|
||||
d.default = default_config.env or nil
|
||||
|
||||
d = s:option(DynamicList, "mount", translate("Bind Mount"))
|
||||
d.template = "cbi/xdynlist"
|
||||
d.template = "docker/cbi/xdynlist"
|
||||
d.placeholder = "/media:/media:slave"
|
||||
d.rmempty = true
|
||||
d.default = default_config.mount or nil
|
||||
|
||||
local d_ports = s:option(DynamicList, "port", translate("Exposed Ports"))
|
||||
d_ports.template = "cbi/xdynlist"
|
||||
d_ports.template = "docker/cbi/xdynlist"
|
||||
d_ports.placeholder = "2200:22/tcp"
|
||||
d_ports.rmempty = true
|
||||
d_ports.default = default_config.port or nil
|
||||
@ -289,14 +289,14 @@ d.datatype="uinteger"
|
||||
d.default = default_config.blkioweight or nil
|
||||
|
||||
d = s:option(DynamicList, "device", translate("Device"))
|
||||
d.template = "cbi/xdynlist"
|
||||
d.template = "docker/cbi/xdynlist"
|
||||
d.placeholder = "/dev/sda:/dev/xvdc:rwm"
|
||||
d.rmempty = true
|
||||
d:depends("advance", 1)
|
||||
d.default = default_config.device or nil
|
||||
|
||||
d = s:option(DynamicList, "tmpfs", translate("Tmpfs"), translate("Mount tmpfs filesystems"))
|
||||
d.template = "cbi/xdynlist"
|
||||
d.template = "docker/cbi/xdynlist"
|
||||
d.placeholder = "/run:rw,noexec,nosuid,size=65536k"
|
||||
d.rmempty = true
|
||||
d:depends("advance", 1)
|
||||
|
||||
@ -14,7 +14,7 @@ local docker = require "luci.model.docker"
|
||||
local dk = docker.new()
|
||||
|
||||
m = SimpleForm("docker", translate("Docker"))
|
||||
m.tempalte = "cbi/xsimpleform"
|
||||
m.template = "docker/cbi/xsimpleform"
|
||||
m.redirect = luci.dispatcher.build_url("admin", "docker", "networks")
|
||||
|
||||
docker_status = m:section(SimpleSection)
|
||||
@ -65,7 +65,7 @@ d.default = 0
|
||||
d:depends("dirver", "overlay")
|
||||
|
||||
d = s:option(DynamicList, "options", translate("Options"))
|
||||
d.template = "cbi/xdynlist"
|
||||
d.template = "docker/cbi/xdynlist"
|
||||
d.rmempty = true
|
||||
d.placeholder="com.docker.network.driver.mtu=1500"
|
||||
|
||||
@ -91,7 +91,7 @@ d.placeholder="10.1.1.0/24"
|
||||
d.datatype="ip4addr"
|
||||
|
||||
d = s:option(DynamicList, "aux_address", translate("Exclude IPs"))
|
||||
d.template = "cbi/xdynlist"
|
||||
d.template = "docker/cbi/xdynlist"
|
||||
d.rmempty = true
|
||||
d.placeholder="my-route=10.1.1.1"
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ local volume_list = get_volumes()
|
||||
|
||||
-- m = Map("docker", translate("Docker"))
|
||||
m = SimpleForm("docker", translate("Docker"))
|
||||
m.tempalte = "cbi/xsimpleform"
|
||||
m.template = "docker/cbi/xsimpleform"
|
||||
m.submit=false
|
||||
m.reset=false
|
||||
|
||||
@ -87,7 +87,7 @@ action.rowcolors=false
|
||||
action.template="cbi/nullsection"
|
||||
btnremove = action:option(Button, "remove")
|
||||
btnremove.inputtitle= translate("Remove")
|
||||
btnremove.template="cbi/inlinebutton"
|
||||
btnremove.template="docker/cbi/inlinebutton"
|
||||
btnremove.inputstyle = "remove"
|
||||
btnremove.forcewrite = true
|
||||
btnremove.write = function(self, section)
|
||||
|
||||
@ -10,4 +10,4 @@
|
||||
%>
|
||||
<%- if self.href then %></a><%end%>
|
||||
<input type="hidden" id="<%=cbid%>" value="<%=pcdata(self:cfgvalue(section) or self.default or "")%>" />
|
||||
<%+cbi/valuefooter%>
|
||||
<%+cbi/valuefooter%>
|
||||
@ -12,6 +12,7 @@
|
||||
}
|
||||
}))
|
||||
%>>
|
||||
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
|
||||
<input type="hidden" name="token" value="<%=token%>" />
|
||||
<input type="hidden" name="cbi.submit" value="1" /><%
|
||||
end
|
||||
Loading…
Reference in New Issue
Block a user