mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 21:35:23 +02:00
feat(custom-templates): switching a template to standalone makes it disappear in swarm mode (#4829)
* feat(custom-templates): switching a template to standalone makes it disappear in swarm mode * feat(custom-template): disable deploy button and add an error message * fix(custom-template): invert variable * fix(custom-templates): put the warning message below the button
This commit is contained in:
parent
44b6aaedc8
commit
c84da11a91
4 changed files with 9 additions and 24 deletions
|
@ -55,7 +55,7 @@
|
|||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
ng-disabled="$ctrl.state.actionInProgress || !$ctrl.formValues.name"
|
||||
ng-disabled="$ctrl.state.actionInProgress || !$ctrl.formValues.name || $ctrl.state.provider !== $ctrl.template.Type"
|
||||
ng-click="$ctrl.createTemplate()"
|
||||
button-spinner="$ctrl.state.actionInProgress"
|
||||
>
|
||||
|
@ -63,7 +63,10 @@
|
|||
<span ng-show="$ctrl.state.actionInProgress">Deployment in progress...</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-default" ng-click="$ctrl.unselectTemplate($ctrl.template)">Hide</button>
|
||||
<span class="text-danger" ng-if="$ctrl.state.formValidationError" style="margin-left: 5px;">{{ $ctrl.state.formValidationError }}</span>
|
||||
<div class="cols-sm-12 small text-danger" ng-if="$ctrl.state.formValidationError" style="margin-left: 5px; margin-top: 5px;">{{ $ctrl.state.formValidationError }}</div>
|
||||
<div class="cols-sm-12 small text-danger" ng-if="$ctrl.state.provider !== $ctrl.template.Type" style="margin-left: 5px; margin-top: 5px;"
|
||||
>This template type cannot be deployed on this endpoint.</div
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<!-- !actions -->
|
||||
|
|
|
@ -40,6 +40,7 @@ class CustomTemplatesViewController {
|
|||
formValidationError: '',
|
||||
actionInProgress: false,
|
||||
isEditorVisible: false,
|
||||
provider: 0,
|
||||
};
|
||||
|
||||
this.currentUser = {
|
||||
|
@ -231,6 +232,7 @@ class CustomTemplatesViewController {
|
|||
apiVersion,
|
||||
} = applicationState;
|
||||
|
||||
this.state.provider = endpointMode.provider === 'DOCKER_STANDALONE' ? 2 : 1;
|
||||
this.getTemplates(endpointMode);
|
||||
this.getNetworks(endpointMode.provider, apiVersion);
|
||||
|
||||
|
|
|
@ -254,6 +254,7 @@ angular.module('portainer.app').controller('TemplatesController', [
|
|||
|
||||
var endpointMode = $scope.applicationState.endpoint.mode;
|
||||
var apiVersion = $scope.applicationState.endpoint.apiVersion;
|
||||
this.state.provider = endpointMode.provider === 'DOCKER_STANDALONE' ? 2 : 1;
|
||||
|
||||
$q.all({
|
||||
templates: TemplateService.templates(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue