feat(stack): added ui label in env var section (#7010)

* feat(stack): added ui label in env var section

* feat(stack): added ui label in env var advanced section

* feat(stack): added showHelpMessage flag

* feat(stack): show help message when stack created from web editor.
pull/7149/head^2
fhanportainer 2022-07-10 00:01:51 +12:00 committed by GitHub
parent d9be6d1724
commit de59ea030a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 1 deletions

View File

@ -10,6 +10,7 @@
ng-model="$ctrl.ngModel" ng-model="$ctrl.ngModel"
on-change="($ctrl.handleSimpleChange)" on-change="($ctrl.handleSimpleChange)"
on-switch-mode-click="($ctrl.switchEnvMode)" on-switch-mode-click="($ctrl.switchEnvMode)"
show-help-message="$ctrl.showHelpMessage"
></environment-variables-simple-mode> ></environment-variables-simple-mode>
<div ng-if="$ctrl.mode == 'advanced'" class="environment-variables-panel--advanced"> <div ng-if="$ctrl.mode == 'advanced'" class="environment-variables-panel--advanced">
@ -23,6 +24,10 @@
<div class="form-group" style="margin-left: 1px"> <div class="form-group" style="margin-left: 1px">
<code-editor identifier="environment-variables-editor" placeholder="e.g. key=value" value="$ctrl.editorText" yml="false" on-change="($ctrl.editorUpdate)"></code-editor> <code-editor identifier="environment-variables-editor" placeholder="e.g. key=value" value="$ctrl.editorText" yml="false" on-change="($ctrl.editorUpdate)"></code-editor>
</div> </div>
<div class="col-sm-12 small text-muted" ng-if="$ctrl.showHelpMessage">
<i class="fa fa-info-circle blue-icon space-right" aria-hidden="true"></i>
Environment changes will not take effect until redeployment occurs manually or via webhook.
</div>
</div> </div>
</div> </div>
</ng-form> </ng-form>

View File

@ -10,7 +10,7 @@
} }
.env-items-list { .env-items-list {
margin-top: 10px; margin: 10px 0;
} }
.env-items-list > * + * { .env-items-list > * + * {

View File

@ -33,4 +33,8 @@
on-remove="($ctrl.remove)" on-remove="($ctrl.remove)"
></environment-variables-simple-mode-item> ></environment-variables-simple-mode-item>
</div> </div>
<div class="col-sm-12 small text-muted" ng-if="$ctrl.ngModel.length > 0 && $ctrl.showHelpMessage">
<i class="fa fa-info-circle blue-icon space-right" aria-hidden="true"></i>
Environment changes will not take effect until redeployment occurs manually or via webhook.
</div>
</div> </div>

View File

@ -11,5 +11,6 @@ angular.module('portainer.app').component('environmentVariablesSimpleMode', {
ngModel: '<', ngModel: '<',
onSwitchModeClick: '<', onSwitchModeClick: '<',
onChange: '<', onChange: '<',
showHelpMessage: '<',
}, },
}); });

View File

@ -11,5 +11,6 @@ angular.module('portainer.app').component('environmentVariablesPanel', {
ngModel: '<', ngModel: '<',
explanation: '@', explanation: '@',
onChange: '<', onChange: '<',
showHelpMessage: '<',
}, },
}); });

View File

@ -35,6 +35,7 @@
ng-model="$ctrl.formValues.Env" ng-model="$ctrl.formValues.Env"
explanation="These values will be used as substitutions in the stack file" explanation="These values will be used as substitutions in the stack file"
on-change="($ctrl.onChangeEnvVar)" on-change="($ctrl.onChangeEnvVar)"
show-help-message="true"
></environment-variables-panel> ></environment-variables-panel>
<option-panel ng-if="$ctrl.stack.Type === 1 && $ctrl.endpoint.apiVersion >= 1.27" ng-model="$ctrl.formValues.Option" on-change="($ctrl.onChangeOption)"></option-panel> <option-panel ng-if="$ctrl.stack.Type === 1 && $ctrl.endpoint.apiVersion >= 1.27" ng-model="$ctrl.formValues.Option" on-change="($ctrl.onChangeOption)"></option-panel>
<button <button

View File

@ -180,6 +180,7 @@
ng-model="formValues.Env" ng-model="formValues.Env"
explanation="These values will be used as substitutions in the stack file" explanation="These values will be used as substitutions in the stack file"
on-change="(handleEnvVarChange)" on-change="(handleEnvVarChange)"
show-help-message="true"
></environment-variables-panel> ></environment-variables-panel>
</div> </div>
<!-- !environment-variables --> <!-- !environment-variables -->