feat(docker/stacks): add creation and update dates (#4418)

* feat(docker/stacks): add creation and update dates

* feat(docker/stacks): put ownership column as the last column

* feat(docker/stacks): fix the no stacks message
This commit is contained in:
Alice Groux
2020-12-16 04:11:59 +01:00
committed by GitHub
parent 4bc958f865
commit bd98b8956a
8 changed files with 99 additions and 61 deletions
+3
View File
@@ -4,6 +4,7 @@ import (
"errors"
"net/http"
"strconv"
"time"
"github.com/asaskevich/govalidator"
httperror "github.com/portainer/libhttp/error"
@@ -123,6 +124,7 @@ func (handler *Handler) updateComposeStack(r *http.Request, stack *portainer.Sta
}
stack.Env = payload.Env
stack.UpdateDate = time.Now().Unix()
stackFolder := strconv.Itoa(int(stack.ID))
_, err = handler.FileService.StoreStackFileFromBytes(stackFolder, stack.EntryPoint, []byte(payload.StackFileContent))
@@ -151,6 +153,7 @@ func (handler *Handler) updateSwarmStack(r *http.Request, stack *portainer.Stack
}
stack.Env = payload.Env
stack.UpdateDate = time.Now().Unix()
stackFolder := strconv.Itoa(int(stack.ID))
_, err = handler.FileService.StoreStackFileFromBytes(stackFolder, stack.EntryPoint, []byte(payload.StackFileContent))