├── .gitignore ├── web ├── static │ ├── favicon.ico │ └── css │ │ └── main.css └── templates │ ├── 404.tmpl │ ├── image_list.tmpl │ ├── host_list.tmpl │ ├── container_list.tmpl │ ├── container.tmpl │ ├── base.tmpl │ └── container_new.tmpl ├── service-definitions └── systemd │ └── lxdepot.service ├── internal ├── handlers │ ├── handlers.go │ ├── handler_404.go │ ├── handler_root.go │ ├── handler_images.go │ ├── ws │ │ ├── handler_movecontainer.go │ │ ├── handler_stopcontainer.go │ │ ├── handler_startcontainer.go │ │ ├── handler_deletecontainer.go │ │ ├── handler_containerplaybook.go │ │ ├── handler_createcontainer.go │ │ └── ws.go │ ├── router.go │ ├── templates.go │ ├── handler_hosts.go │ └── handler_containers.go ├── utils │ └── convert.go ├── dns │ ├── dns_test.go │ ├── dns.go │ ├── google.go │ └── amazon.go ├── circularbuffer │ ├── circularbuffer_test.go │ └── circularbuffer.go ├── config │ └── config.go └── lxd │ └── lxd.go ├── Makefile ├── LICENSE ├── go.mod ├── cmd └── lxdepot │ └── lxdepot.go ├── README.md ├── configs └── sample.yaml └── go.sum /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | lxdepot 4 | -------------------------------------------------------------------------------- /web/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neophenix/lxdepot/HEAD/web/static/favicon.ico -------------------------------------------------------------------------------- /web/templates/404.tmpl: -------------------------------------------------------------------------------- 1 | {{define "content"}} 2 |
| Host | 5 |Aliases | 6 |Arch | 7 |Fingerprint | 8 | 9 | 10 | {{range .Images}} 11 |
|---|---|---|---|
| {{.Host.Name}} | 13 |14 | {{range .Aliases}} 15 | {{.Name}} 16 | {{end}} 17 | | 18 |{{.Architecture}} | 19 |{{.Fingerprint}} | 20 |
| Host | 5 |CPUs | 6 |Memory Used / Total | 7 |Containers Running / Total | 8 | 9 | 10 | {{range .Conf.LXDhosts}} 11 |
|---|---|---|---|
| {{.Name}} | 13 |{{(index $.HostResourceMap .Host).Resources.CPU.Total}} | 14 |{{MakeBytesMoreHuman (index $.HostResourceMap .Host).Resources.Memory.Used}} / {{MakeBytesMoreHuman (index $.HostResourceMap .Host).Resources.Memory.Total}} | 15 |{{index (index $.HostContainerInfo .Host) "running"}} / {{index (index $.HostContainerInfo .Host) "total"}} | 16 |
| Host | 5 |Name | 6 |IP Address | 7 |CPU | 8 |Memory | 9 |Status | 10 | 11 | 12 | {{range .Containers}} 13 |
|---|---|---|---|---|---|
| {{.Host.Name}} | 15 |{{.Container.Name}} | 16 |
17 | {{range $iface, $info := .State.Network}}
18 | {{if (ne $iface "lo")}}
19 | {{range $info.Addresses}}
20 | {{if (eq .Family "inet")}}
21 | {{.Address}} ({{$iface}}) 22 | {{end}} 23 | {{end}} 24 | {{end}} 25 | {{end}} 26 | |
27 | {{printf "%.02f" (index .Usage "cpu")}}%% | 28 |{{MakeIntBytesMoreHuman .State.Memory.Usage}} | 29 |{{.Container.Status}} | 30 |
| Name | 6 |{{.Container.Container.Name}} | 7 ||
| FQDN | 11 |{{.Container.Container.Name}}.{{index .Conf.DNS.Options "zone"}} | 12 ||
| IP Address | 16 |
17 | {{range $iface, $info := .Container.State.Network}}
18 | {{if (ne $iface "lo")}}
19 | {{range $info.Addresses}}
20 | {{if (eq .Family "inet")}}
21 | {{.Address}} ({{$iface}}) 22 | {{end}} 23 | {{end}} 24 | {{end}} 25 | {{end}} 26 | |
27 | |
| Host | 30 | {{if and 0 (ge (len .Conf.LXDhosts) 1) (ne (index .Container.Container.ExpandedConfig "user.lxdepot_lock") "true")}} 31 | 32 |33 | 42 | 43 | | 44 | {{else}} 45 | {{range .Conf.LXDhosts}} 46 | {{if eq .Host $.Container.Host.Host}} 47 |{{.Name}} | 48 | {{end}} 49 | {{end}} 50 | {{end}} 51 |
| Image | 54 |{{index .Container.Container.ContainerPut.Config "image.description"}} | 55 ||
| CPU | 58 |{{printf "%.02f" (index .Container.Usage "cpu")}}%% | 59 ||
| Memory | 62 |{{MakeIntBytesMoreHuman .Container.State.Memory.Usage}} | 63 ||
| Status | 66 |{{.Container.Container.Status}} | 67 ||
| Last Boot | 70 |71 | {{if eq .Container.Container.LastUsedAt.Unix 0}} 72 | Never 73 | {{else}} 74 | {{.Container.Container.LastUsedAt}} 75 | {{end}} 76 | | 77 ||
| Playbooks | 83 |84 | 89 | 90 | | 91 |