mirror of https://github.com/portainer/portainer
feat(environment): update wording when editing agent environment [EE-3081] (#7445)
* change wording when editing agent environmentpull/7137/merge
parent
02355acfa8
commit
6a4a353b92
|
@ -259,13 +259,7 @@ func (handler *Handler) createEndpoint(payload *endpointCreatePayload) (*portain
|
|||
endpointType := portainer.DockerEnvironment
|
||||
if payload.EndpointCreationType == agentEnvironment {
|
||||
|
||||
// Case insensitive strip http or https scheme if URL entered
|
||||
index := strings.Index(payload.URL, "://")
|
||||
if index >= 0 {
|
||||
payload.URL = payload.URL[index+3:]
|
||||
}
|
||||
|
||||
payload.URL = "tcp://" + payload.URL
|
||||
payload.URL = "tcp://" + normalizeAgentAddress(payload.URL)
|
||||
|
||||
agentPlatform, err := handler.pingAndCheckPlatform(payload)
|
||||
if err != nil {
|
||||
|
|
|
@ -105,7 +105,12 @@ func (handler *Handler) endpointUpdate(w http.ResponseWriter, r *http.Request) *
|
|||
}
|
||||
|
||||
if payload.URL != nil {
|
||||
endpoint.URL = *payload.URL
|
||||
if endpoint.Type == portainer.AgentOnDockerEnvironment ||
|
||||
endpoint.Type == portainer.AgentOnKubernetesEnvironment {
|
||||
endpoint.URL = normalizeAgentAddress(*payload.URL)
|
||||
} else {
|
||||
endpoint.URL = *payload.URL
|
||||
}
|
||||
}
|
||||
|
||||
if payload.PublicURL != nil {
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
package endpoints
|
||||
|
||||
import "strings"
|
||||
|
||||
func BoolAddr(b bool) *bool {
|
||||
boolVar := b
|
||||
return &boolVar
|
||||
}
|
||||
|
||||
func normalizeAgentAddress(url string) string {
|
||||
// Case insensitive strip http or https scheme if URL entered
|
||||
index := strings.Index(url, "://")
|
||||
if index >= 0 {
|
||||
return url[index+3:]
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
|
|
|
@ -107,7 +107,8 @@
|
|||
<!-- endpoint-url-input -->
|
||||
<div class="form-group" ng-if="!state.edgeEndpoint">
|
||||
<label for="endpoint_url" class="col-sm-3 col-lg-2 control-label text-left">
|
||||
Environment URL
|
||||
<span ng-if="!state.agentEndpoint">Environment URL</span>
|
||||
<span ng-if="state.agentEndpoint">Environment address</span>
|
||||
<portainer-tooltip
|
||||
message="'URL or IP address of a Docker host. The Docker API must be exposed over a TCP port. Please refer to the Docker documentation to configure it.'"
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue