-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
54 lines (43 loc) · 1.35 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package main
import (
"fyne.io/fyne/app"
"fyne.io/fyne/widget"
"jdss.docker.client/docker"
"jdss.docker.client/docker/com"
"jdss.docker.client/docker/parser"
"jdss.docker.client/docker/ui"
)
func main() {
app := app.New()
w := app.NewWindow("Docker Manager")
tab := widget.NewTabContainer(
ui.GetImageTab(func(id string) {
imageCommand := com.ImageCommand{Docker: docker.DockerConnector{}, Context: map[string]string{"imageID": id}}
imageResult := imageCommand.Execute()
parserImage := parser.ParserImageCommand{}
image := parserImage.Parse(imageResult)
containerCommand := com.ListContainerByImageCommand{Docker: docker.DockerConnector{}, Context: map[string]string{"imageID": id}}
value := containerCommand.Execute()
parserContainer := parser.ParserContainerCommand{}
containerInfo := parserContainer.Parse(value)
container := widget.NewVBox()
container.Append(ui.GetImageDetailView(image, containerInfo))
as := widget.NewModalPopUp(container, w.Canvas())
container.Append(widget.NewButton("Close", func() {
as.Hide()
}))
}),
ui.GetContainerTab(),
)
// content := widget.NewVBox(
// //tabs,
// widget.NewButton("Quit", func() {
// app.Quit()
// }),
// )
//tab.Resize(fyne.Size{Height: 1520, Width: 400})
container := widget.NewVBox(tab)
w.SetContent(container)
w.CenterOnScreen()
w.ShowAndRun()
}