Update dockman

This commit is contained in:
mrsang 2021-04-01 13:01:33 +02:00
parent 0db7a23c07
commit 98b49f8294
8 changed files with 38 additions and 4 deletions

View File

@ -117,6 +117,15 @@ handle.stop_container = function(data)
end
end
handle.restart_container = function(data)
local res = exec(data.host, "docker restart "..data.id, false)
res = res:gsub('[\n\r]+', '')
if res == data.id then
return result("OK")
else
return error(res)
end
end
handle.rm_container = function(data)
local res = exec(data.host, "docker stop "..data.id, false)

View File

@ -117,6 +117,15 @@ handle.stop_container = function(data)
end
end
handle.restart_container = function(data)
local res = exec(data.host, "docker restart "..data.id, false)
res = res:gsub('[\n\r]+', '')
if res == data.id then
return result("OK")
else
return error(res)
end
end
handle.rm_container = function(data)
local res = exec(data.host, "docker stop "..data.id, false)

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com"
},
"version":"0.1.0-b",
"version":"0.1.1-b",
"category":"Development",
"iconclass":"fa fa-cubes",
"mimes":["none"],

Binary file not shown.

View File

@ -213,6 +213,22 @@ class Dockman extends this.OS.application.BaseApplication
return @error r.error if r.error
@notify __("Container {0} removed", data.ID)
@loadContainer(data.Image, true)
},
{
text: "",
iconclass: "bi bi-bootstrap-reboot",
onbtclick: () =>
sel = @ctnlist.selectedItem
return unless sel and sel.data
data = sel.data
@exec("restart_container", {
host: @currenthost.url,
id: data.ID
})
.then (r) =>
return @error r.error if r.error
@notify __("Container {0} restarted", data.ID)
@loadContainer(data.Image, true)
}
]

View File

@ -7,7 +7,7 @@
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com"
},
"version":"0.1.0-b",
"version":"0.1.1-b",
"category":"Development",
"iconclass":"fa fa-cubes",
"mimes":["none"],

View File

@ -115,7 +115,7 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Dockman/README.md",
"category": "Development",
"author": "Xuan Sang LE",
"version": "0.1.0-b",
"version": "0.1.1-b",
"dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Dockman/build/release/Dockman.zip"
},