mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
feat(endpoints): UX enhancements (#1943)
* feat(endpoints): add details about endpoints in datatable * feat(endpoint-details): add the ability to inspect/update azure endpoint * feat(endpoint-selector): disable placeholder selection
This commit is contained in:
parent
bfc49574b7
commit
9bb885629a
10 changed files with 122 additions and 39 deletions
|
@ -68,13 +68,16 @@ type (
|
|||
}
|
||||
|
||||
putEndpointsRequest struct {
|
||||
Name string `valid:"-"`
|
||||
URL string `valid:"-"`
|
||||
PublicURL string `valid:"-"`
|
||||
GroupID int `valid:"-"`
|
||||
TLS bool `valid:"-"`
|
||||
TLSSkipVerify bool `valid:"-"`
|
||||
TLSSkipClientVerify bool `valid:"-"`
|
||||
Name string `valid:"-"`
|
||||
URL string `valid:"-"`
|
||||
PublicURL string `valid:"-"`
|
||||
GroupID int `valid:"-"`
|
||||
TLS bool `valid:"-"`
|
||||
TLSSkipVerify bool `valid:"-"`
|
||||
TLSSkipClientVerify bool `valid:"-"`
|
||||
AzureApplicationID string `valid:"-"`
|
||||
AzureTenantID string `valid:"-"`
|
||||
AzureAuthenticationKey string `valid:"-"`
|
||||
}
|
||||
|
||||
postEndpointPayload struct {
|
||||
|
@ -143,7 +146,7 @@ func (handler *EndpointHandler) createAzureEndpoint(payload *postEndpointPayload
|
|||
|
||||
endpoint := &portainer.Endpoint{
|
||||
Name: payload.name,
|
||||
URL: payload.url,
|
||||
URL: proxy.AzureAPIBaseURL,
|
||||
Type: portainer.AzureEnvironment,
|
||||
GroupID: portainer.EndpointGroupID(payload.groupID),
|
||||
PublicURL: payload.publicURL,
|
||||
|
@ -405,8 +408,6 @@ func (handler *EndpointHandler) handleGetEndpoint(w http.ResponseWriter, r *http
|
|||
return
|
||||
}
|
||||
|
||||
endpoint.AzureCredentials = portainer.AzureCredentials{}
|
||||
|
||||
encodeJSON(w, endpoint, handler.Logger)
|
||||
}
|
||||
|
||||
|
@ -518,6 +519,18 @@ func (handler *EndpointHandler) handlePutEndpoint(w http.ResponseWriter, r *http
|
|||
endpoint.GroupID = portainer.EndpointGroupID(req.GroupID)
|
||||
}
|
||||
|
||||
if endpoint.Type == portainer.AzureEnvironment {
|
||||
if req.AzureApplicationID != "" {
|
||||
endpoint.AzureCredentials.ApplicationID = req.AzureApplicationID
|
||||
}
|
||||
if req.AzureTenantID != "" {
|
||||
endpoint.AzureCredentials.TenantID = req.AzureTenantID
|
||||
}
|
||||
if req.AzureAuthenticationKey != "" {
|
||||
endpoint.AzureCredentials.AuthenticationKey = req.AzureAuthenticationKey
|
||||
}
|
||||
}
|
||||
|
||||
folder := strconv.Itoa(int(endpoint.ID))
|
||||
if req.TLS {
|
||||
endpoint.TLSConfig.TLS = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue