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">
|
|
|
|
<custom-template-common-fields form-values="$ctrl.formValues"></custom-template-common-fields>
|
|
|
|
|
|
|
|
<!-- build-method -->
|
2022-01-17 05:53:32 +00:00
|
|
|
<div class="col-sm-12 form-section-title"> Build method </div>
|
2021-12-14 19:14:53 +00:00
|
|
|
<box-selector radio-name="'method'" value="$ctrl.state.method" options="$ctrl.methodOptions" on-change="($ctrl.onChangeMethod)"></box-selector>
|
2021-09-02 05:28:51 +00:00
|
|
|
|
|
|
|
<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"
|
|
|
|
placeholder="# Define or paste the content of your manifest file here"
|
|
|
|
>
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
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"
|
|
|
|
class="btn btn-primary btn-sm"
|
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>
|