1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 21:39:40 +02:00

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 99 additions and 61 deletions

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))