mirror of https://github.com/portainer/portainer
#2732 feat(stacks): adding html button to save a stack in editor mode
parent
8a4373a113
commit
e1b4fdaab5
|
@ -219,7 +219,7 @@ angular
|
|||
var env = FormHelper.removeInvalidEnvVars($scope.formValues.Env);
|
||||
const endpointId = +$state.params.endpointId;
|
||||
|
||||
if (method === 'editor' || method === 'template') {
|
||||
if (method === 'editor') {
|
||||
var stackFileContent = $scope.formValues.StackFileContent;
|
||||
return StackService.saveComposeStackFromFileContent(name, stackFileContent, env, endpointId);
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ angular
|
|||
var env = FormHelper.removeInvalidEnvVars($scope.formValues.Env);
|
||||
const endpointId = +$state.params.endpointId;
|
||||
|
||||
if (method === 'template' || method === 'editor') {
|
||||
if (method === 'editor') {
|
||||
var stackFileContent = $scope.formValues.StackFileContent;
|
||||
return StackService.saveSwarmStackFromFileContent(name, stackFileContent, env, endpointId);
|
||||
}
|
||||
|
|
|
@ -179,6 +179,25 @@
|
|||
<span ng-hide="state.actionInProgress">Deploy the stack</span>
|
||||
<span ng-show="state.actionInProgress">Deployment in progress...</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm !ml-0"
|
||||
ng-show="state.Method === 'editor'"
|
||||
ng-disabled="state.actionInProgress
|
||||
|| !createStackForm.$valid
|
||||
|| ((state.Method === 'editor') && (!formValues.StackFileContent || state.editorYamlValidationError))
|
||||
|| !formValues.Name"
|
||||
ng-click="saveStack()"
|
||||
button-spinner="state.actionInProgress"
|
||||
analytics-on
|
||||
analytics-category="docker"
|
||||
analytics-event="docker-stack-save"
|
||||
analytics-properties="buildAnalyticsProperties()"
|
||||
>
|
||||
<span ng-hide="state.actionInProgress">Save the stack</span>
|
||||
<span ng-show="state.actionInProgress">Saving in progress...</span>
|
||||
</button>
|
||||
|
||||
<span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px">{{ state.formValidationError }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue