mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 00:09:40 +02:00
feat(edge): show last check in date (#4782)
* feat(k8s): better form validation for configuration keys (#4728) (#4733) Co-authored-by: Simon Meng <simon.meng@portainer.io> * feat(home): show edge valid tag * fix(endpoint): show right heartbeat * style(endpoints): add some comments Co-authored-by: cong meng <mcpacino@gmail.com> Co-authored-by: Simon Meng <simon.meng@portainer.io>
This commit is contained in:
parent
f2faccdb10
commit
91ff7e4143
5 changed files with 64 additions and 22 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"errors"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
httperror "github.com/portainer/libhttp/error"
|
||||
"github.com/portainer/libhttp/request"
|
||||
|
@ -100,11 +101,13 @@ func (handler *Handler) endpointStatusInspect(w http.ResponseWriter, r *http.Req
|
|||
} else if agentPlatform == portainer.AgentPlatformKubernetes {
|
||||
endpoint.Type = portainer.EdgeAgentOnKubernetesEnvironment
|
||||
}
|
||||
}
|
||||
|
||||
err = handler.DataStore.Endpoint().UpdateEndpoint(endpoint.ID, endpoint)
|
||||
if err != nil {
|
||||
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to Unable to persist endpoint changes inside the database", err}
|
||||
}
|
||||
endpoint.LastCheckInDate = time.Now().Unix()
|
||||
|
||||
err = handler.DataStore.Endpoint().UpdateEndpoint(endpoint.ID, endpoint)
|
||||
if err != nil {
|
||||
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to Unable to persist endpoint changes inside the database", err}
|
||||
}
|
||||
|
||||
settings, err := handler.DataStore.Settings().Settings()
|
||||
|
|
|
@ -249,6 +249,8 @@ type (
|
|||
ComposeSyntaxMaxVersion string `json:"ComposeSyntaxMaxVersion" example:"3.8"`
|
||||
// Endpoint specific security settings
|
||||
SecuritySettings EndpointSecuritySettings
|
||||
// LastCheckInDate mark last check-in date on checkin
|
||||
LastCheckInDate int64
|
||||
|
||||
// Deprecated fields
|
||||
// Deprecated in DBVersion == 4
|
||||
|
@ -339,7 +341,7 @@ type (
|
|||
// EndpointType represents the type of an endpoint
|
||||
EndpointType int
|
||||
|
||||
// EndpointRelation represnts a endpoint relation object
|
||||
// EndpointRelation represents a endpoint relation object
|
||||
EndpointRelation struct {
|
||||
EndpointID EndpointID
|
||||
EdgeStacks map[EdgeStackID]bool
|
||||
|
@ -1182,7 +1184,7 @@ type (
|
|||
DeleteResourceControl(ID ResourceControlID) error
|
||||
}
|
||||
|
||||
// ReverseTunnelService represensts a service used to manage reverse tunnel connections.
|
||||
// ReverseTunnelService represents a service used to manage reverse tunnel connections.
|
||||
ReverseTunnelService interface {
|
||||
StartTunnelServer(addr, port string, snapshotService SnapshotService) error
|
||||
GenerateEdgeKey(url, host string, endpointIdentifier int) string
|
||||
|
@ -1224,7 +1226,7 @@ type (
|
|||
GetNextIdentifier() int
|
||||
}
|
||||
|
||||
// StackService represents a service for managing endpoint snapshots
|
||||
// SnapshotService represents a service for managing endpoint snapshots
|
||||
SnapshotService interface {
|
||||
Start()
|
||||
SetSnapshotInterval(snapshotInterval string) error
|
||||
|
@ -1547,6 +1549,7 @@ const (
|
|||
EdgeAgentActive string = "ACTIVE"
|
||||
)
|
||||
|
||||
// represents an authorization type
|
||||
const (
|
||||
OperationDockerContainerArchiveInfo Authorization = "DockerContainerArchiveInfo"
|
||||
OperationDockerContainerList Authorization = "DockerContainerList"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue