2022-07-06 06:08:45 +00:00
< page-header title = "'Create Edge stack'" breadcrumbs = "[{label:'Edge Stacks', link:'edge.stacks'}, 'Create Edge stack']" > < / page-header >
2021-09-09 08:38:34 +00:00
< div class = "row" >
< div class = "col-sm-12" >
< rd-widget >
< rd-widget-body >
< form class = "form-horizontal" name = "$ctrl.form" >
<!-- name - input -->
< div class = "form-group" >
2023-02-12 21:04:24 +00:00
< label for = "stack_name" class = "col-sm-1 control-label required text-left" > Name < / label >
2021-09-09 08:38:34 +00:00
< div class = "col-sm-11" >
< input
type="text"
class="form-control"
ng-model="$ctrl.formValues.Name"
id="stack_name"
name="nameField"
2023-03-01 06:51:08 +00:00
ng-pattern="$ctrl.formValues.DeploymentType === $ctrl.EditorType.Compose ? STACK_NAME_VALIDATION_REGEX : ''"
2021-09-09 08:38:34 +00:00
placeholder="e.g. mystack"
auto-focus
required
data-cy="edgeStackCreate-nameInput"
/>
2022-09-14 23:09:19 +00:00
< div class = "help-block" ng-show = "$ctrl.form.$invalid" >
< div class = "small text-warning" >
< div ng-messages = "$ctrl.form.$error" >
2023-03-01 06:51:08 +00:00
< p ng-message = "required" class = "vertical-center" >
< pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon >
< span > Name is required.< / span >
< / p >
< p ng-message = "pattern" class = "vertical-center" >
< pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon >
< span > This field must consist of lower case alphanumeric characters, '_' or '-' (e.g. 'my-name', or 'abc-123').< / span >
< / p >
2022-09-14 23:09:19 +00:00
< / div >
< / div >
< / div >
2021-09-09 08:38:34 +00:00
< / div >
< / div >
<!-- !name - input -->
2023-05-30 18:33:22 +00:00
< edge-groups-selector ng-if = "$ctrl.formValues.Groups" value = "$ctrl.formValues.Groups" on-change = "($ctrl.onChangeGroups)" > < / edge-groups-selector >
< p class = "col-sm-12 vertical-center help-block small text-warning" ng-if = "$ctrl.formValues.DeploymentType === undefined" >
< pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > There are no available deployment types when there is more than one type of environment in your edge group
selection (e.g. Kubernetes and Docker environments). Please select edge groups that have environments of the same type.
< / p >
2021-09-09 08:38:34 +00:00
< edge-stack-deployment-type-selector
value="$ctrl.formValues.DeploymentType"
2023-05-30 18:33:22 +00:00
has-docker-endpoint="$ctrl.hasType($ctrl.EnvironmentType.EdgeAgentOnDocker)"
has-kube-endpoint="$ctrl.hasType($ctrl.EnvironmentType.EdgeAgentOnKubernetes)"
has-nomad-endpoint="$ctrl.hasType($ctrl.EnvironmentType.EdgeAgentOnNomad)"
2021-09-09 08:38:34 +00:00
on-change="($ctrl.onChangeDeploymentType)"
>< / edge-stack-deployment-type-selector >
2022-12-21 00:18:51 +00:00
< edge-stacks-docker-compose-form
ng-if="$ctrl.formValues.DeploymentType == $ctrl.EditorType.Compose"
form-values="$ctrl.formValues"
state="$ctrl.state"
>< / edge-stacks-docker-compose-form >
2021-09-09 08:38:34 +00:00
2022-12-21 00:18:51 +00:00
< edge-stacks-kube-manifest-form
ng-if="$ctrl.formValues.DeploymentType == $ctrl.EditorType.Kubernetes"
form-values="$ctrl.formValues"
state="$ctrl.state"
>< / edge-stacks-kube-manifest-form >
2021-09-09 08:38:34 +00:00
2023-07-04 04:14:35 +00:00
< div ng-if = "$ctrl.isBE" >
< environment-variables-panel values = "$ctrl.formValues.envVars" on-change = "($ctrl.onEnvVarChange)" > < / environment-variables-panel >
< / div >
2021-09-09 08:38:34 +00:00
<!-- actions -->
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Actions < / div >
2021-09-09 08:38:34 +00:00
< div class = "form-group" >
< div class = "col-sm-12" >
< button
type="button"
class="btn btn-primary btn-sm"
ng-disabled="$ctrl.state.actionInProgress || $ctrl.formIsInvalid()"
ng-click="$ctrl.createStack()"
button-spinner="$ctrl.state.actionInProgress"
analytics-on
analytics-event="edge-stack-creation"
analytics-category="edge"
analytics-properties="$ctrl.buildAnalyticsProperties()"
2021-09-28 09:10:41 +00:00
data-cy="edgeStackCreate-createStackButton"
2021-09-09 08:38:34 +00:00
>
< span ng-hide = "$ctrl.state.actionInProgress" > Deploy the stack< / span >
< span ng-show = "$ctrl.state.actionInProgress" > Deployment 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-09 08:38:34 +00:00
{{ $ctrl.state.formValidationError }}
< / span >
< / div >
< / div >
<!-- !actions -->
< / form >
< / rd-widget-body >
< / rd-widget >
< / div >
< / div >