mirror of https://github.com/portainer/portainer
fix(docker): create custom template [EE-4114] (#7812)
* EE-4114 fix(docker): create custom template * Update customtemplate_create.go remove white spacepull/6986/merge
parent
0219d41ba7
commit
3f51d077ac
|
@ -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{}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue