2022-07-06 06:08:45 +00:00
< page-header title = "'Create Custom template'" breadcrumbs = "[{label:'Custom Templates', link:'kubernetes.templates.custom'}, 'Create Custom template']" > < / page-header >
2021-09-02 05:28:51 +00:00
< div class = "row" >
< 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
<!-- build - method -->
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Build method < / div >
2023-02-07 03:33:57 +00:00
< box-selector slim = "true" radio-name = "'method'" value = "$ctrl.state.method" options = "$ctrl.methodOptions" on-change = "($ctrl.onChangeMethod)" > < / box-selector >
2021-09-02 05:28:51 +00:00
2022-08-02 02:10:39 +00:00
< div class = "mt-4" >
< web-editor-form
ng-if="$ctrl.state.method === 'editor'"
identifier="template-creation-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"
2022-08-02 02:10:39 +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 >
< / div >
2021-09-02 05:28:51 +00:00
< file-upload-form ng-if = "$ctrl.state.method === 'upload'" file = "$ctrl.formValues.File" on-change = "($ctrl.onChangeFile)" ng-required = "true" >
2022-01-17 05:53:32 +00:00
< file-upload-description > You can upload a Manifest file from your computer. < / file-upload-description >
2021-09-02 05:28:51 +00:00
< / file-upload-form >
2023-04-04 00:44:42 +00:00
< git-form deploy-method = "kubernetes" ng-if = "$ctrl.state.method === 'repository'" value = "$ctrl.formValues" on-change = "($ctrl.handleChange)" > < / git-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="$ctrl.state.method === 'editor'"
>< / custom-templates-variables-definition-field >
2021-09-02 05:28:51 +00:00
< por-access-control-form form-data = "$ctrl.formValues.AccessControlData" > < / por-access-control-form >
<!-- actions -->
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-02 02:10:39 +00:00
class="btn btn-primary btn-sm !ml-0"
2022-05-31 10:00:47 +00:00
ng-disabled="!$ctrl.state.isTemplateValid ||$ctrl.state.actionInProgress || $ctrl.form.$invalid || ($ctrl.state.method === 'editor' & & !$ctrl.formValues.FileContent)"
2021-09-02 05:28:51 +00:00
ng-click="$ctrl.createCustomTemplate()"
button-spinner="$ctrl.state.actionInProgress"
>
< span ng-hide = "$ctrl.state.actionInProgress" > Create custom template< / span >
< span ng-show = "$ctrl.state.actionInProgress" > Creation 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 >
<!-- !actions -->
< / form >
< / rd-widget-body >
< / rd-widget >
< / div >
< / div >