1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 14:31:44 +01:00

feat: can start and stop containers now using the drop down. This feature is not enabled by default. (#2548)

This commit is contained in:
Akash Ramaswamy
2023-12-01 03:34:22 +05:30
committed by GitHub
parent 050e499f8e
commit f78534f529
11 changed files with 160 additions and 2 deletions

View File

@@ -35,6 +35,7 @@ type Config struct {
NoAnalytics bool
Dev bool
Authorization Authorization
EnableActions bool
}
type Authorization struct {
@@ -63,6 +64,7 @@ type DockerClient interface {
ContainerStats(context.Context, string, chan<- docker.ContainerStat) error
Ping(context.Context) (types.Ping, error)
Host() *docker.Host
ContainerActions(action string, id string) error
}
func CreateServer(clients map[string]DockerClient, content fs.FS, config Config) *http.Server {
@@ -104,6 +106,7 @@ func createRouter(h *handler) *chi.Mux {
r.Get("/api/logs/download/{host}/{id}", h.downloadLogs)
r.Get("/api/logs/{host}/{id}", h.fetchLogsBetweenDates)
r.Get("/api/events/stream", h.streamEvents)
r.Post("/api/actions/{action}/{host}/{id}", h.containerActions)
r.Get("/api/releases", h.releases)
r.Patch("/api/profile", h.updateProfile)
r.Get("/api/content/{id}", h.staticContent)