2022-07-06 06:08:45 +00:00
< page-header title = "'Edit Custom Template'" breadcrumbs = "[{label:'Custom templates', link:'kubernetes.templates.custom'}, $ctrl.formValues.Title]" reload = "true" > < / page-header >
2021-09-02 05:28:51 +00:00
< div class = "row" ng-if = "$ctrl.formValues" >
< div class = "col-sm-12" >
< rd-widget >
< rd-widget-body >
< form class = "form-horizontal" name = "$ctrl.form" >
2023-04-20 21:39:55 +00:00
< custom-template-common-fields
form-values="$ctrl.formValues"
name-regex="$ctrl.state.templateNameRegex"
name-regex-error="'This field must consist of lower-case alphanumeric characters, \'.\', \'_\' or \'-\', must start and end with an alphanumeric character and must be 63 characters or less (e.g. \'my-name\', or \'abc-123\').'"
>< / custom-template-common-fields >
2021-09-02 05:28:51 +00:00
2023-04-04 00:44:42 +00:00
< git-form value = "$ctrl.formValues" on-change = "($ctrl.handleChange)" ng-if = "$ctrl.formValues.GitConfig" > < / git-form >
< div class = "form-group" >
< div class = "col-sm-12"
>< button type = "button" class = "btn btn-sm btn-light !ml-0" ng-if = "$ctrl.formValues.GitConfig" ng-click = "$ctrl.previewFileFromGitRepository()" >
< pr-icon icon = "'refresh-cw'" feather = "true" > < / pr-icon > Reload custom template< /button
>
< / div >
< div class = "col-sm-12" ng-if = "$ctrl.state.templatePreviewFailed" >
< p class = "small vertical-center text-danger mt-5" >
< pr-icon icon = "'alert-triangle'" mode = "'danger'" size = "'md'" feather = "true" > < / pr-icon >
Custom template could not be loaded, {{ $ctrl.state.templatePreviewError }}.< /p
>
< / div >
< / div >
2021-09-02 05:28:51 +00:00
< web-editor-form
identifier="template-editor"
value="$ctrl.formValues.FileContent"
on-change="($ctrl.onChangeFileContent)"
ng-required="true"
yml="true"
2023-03-30 09:26:32 +00:00
placeholder="Define or paste the content of your manifest file here"
2023-04-04 00:44:42 +00:00
read-only="$ctrl.state.isEditorReadOnly"
2021-09-02 05:28:51 +00:00
>
< editor-description >
< p > Templates allow deploying any kind of Kubernetes resource (Deployment, Secret, ConfigMap...)< / p >
< p >
You can get more information about Kubernetes file format in the
< a href = "https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/" target = "_blank" > official documentation< / a > .
< / p >
< / editor-description >
< / web-editor-form >
2022-05-31 10:00:47 +00:00
< custom-templates-variables-definition-field
2022-06-16 05:32:41 +00:00
ng-if="$ctrl.isTemplateVariablesEnabled"
2022-05-31 10:00:47 +00:00
value="$ctrl.formValues.Variables"
on-change="($ctrl.onVariablesChange)"
is-variables-names-from-parent="true"
>< / custom-templates-variables-definition-field >
2023-04-04 00:44:42 +00:00
< por-access-control-form
form-data="$ctrl.formValues.AccessControlData"
resource-control="$ctrl.formValues.ResourceControl"
ng-if="$ctrl.formValues.AccessControlData"
>< / por-access-control-form >
2021-09-02 05:28:51 +00:00
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Actions < / div >
2021-09-02 05:28:51 +00:00
< div class = "form-group" >
< div class = "col-sm-12" >
< button
type="button"
2022-08-12 18:22:45 +00:00
class="btn btn-primary btn-sm !ml-0"
2021-09-02 05:28:51 +00:00
ng-disabled="$ctrl.actionInProgress || $ctrl.form.$invalid || !$ctrl.formValues.Title || !$ctrl.formValues.FileContent"
ng-click="$ctrl.submitAction()"
button-spinner="$ctrl.actionInProgress"
>
< span ng-hide = "$ctrl.actionInProgress" > Update the template< / span >
< span ng-show = "$ctrl.actionInProgress" > Update in progress...< / span >
< / button >
2022-01-17 05:53:32 +00:00
< span class = "text-danger" ng-if = "$ctrl.state.formValidationError" style = "margin-left: 5px" >
2021-09-02 05:28:51 +00:00
{{ $ctrl.state.formValidationError }}
< / span >
< / div >
< / div >
< / form >
< / rd-widget-body >
< / rd-widget >
< / div >
< / div >