fix(docker): create custom template [EE-4114] (#7812)

* EE-4114 fix(docker): create custom template

* Update customtemplate_create.go

remove white space
pull/6986/merge
Rex Wang 2022-10-20 16:42:49 +08:00 committed by GitHub
parent 0219d41ba7
commit 3f51d077ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -380,13 +380,15 @@ func (payload *customTemplateFromFileUploadPayload) Validate(r *http.Request) er
payload.FileContent = composeFileContent
varsString, _ := request.RetrieveMultiPartFormValue(r, "Variables", true)
if varsString != "" {
err = json.Unmarshal([]byte(varsString), &payload.Variables)
if err != nil {
return errors.New("Invalid variables. Ensure that the variables are valid JSON")
}
return validateVariablesDefinitions(payload.Variables)
}
return nil
}
func (handler *Handler) createCustomTemplateFromFileUpload(r *http.Request) (*portainer.CustomTemplate, error) {
payload := &customTemplateFromFileUploadPayload{}

View File

@ -83,9 +83,6 @@
<button type="button" class="btn btn-sm btn-primary" ngf-select ng-model="$ctrl.formValues.File"> Select file </button>
<span class="space-left">
{{ $ctrl.formValues.File.name }}
<span ng-if="$ctrl.formValues.File">
<pr-icon icon="'x'" feather="true" mode="'danger'"></pr-icon>
</span>
</span>
</div>
</div>