mirror of https://github.com/portainer/portainer
refactor(templates): use the set field instead of default (#164)
parent
7c5c693f17
commit
3c75c5fe25
|
@ -53,7 +53,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- !name-and-network-inputs -->
|
||||
<div ng-repeat="var in selectedTemplate.env" ng-if="!var.default" class="form-group">
|
||||
<div ng-repeat="var in selectedTemplate.env" ng-if="!var.set" class="form-group">
|
||||
<label for="field_{{ $index }}" class="col-sm-2 control-label text-left">{{ var.label }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select ng-if="!swarm && var.type === 'container'" ng-options="container|containername for container in runningContainers" class="selectpicker form-control" ng-model="var.value">
|
||||
|
|
|
@ -76,7 +76,7 @@ function createConfigFromTemplate(template) {
|
|||
containerConfig.Image = template.image;
|
||||
if (template.env) {
|
||||
template.env.forEach(function (v) {
|
||||
if (v.value || v.default) {
|
||||
if (v.value || v.set) {
|
||||
var val;
|
||||
if (v.type && v.type === 'container') {
|
||||
if ($scope.swarm && $scope.formValues.network.Scope === 'global') {
|
||||
|
@ -86,7 +86,7 @@ function createConfigFromTemplate(template) {
|
|||
val = container.NetworkSettings.Networks[Object.keys(container.NetworkSettings.Networks)[0]].IPAddress;
|
||||
}
|
||||
} else {
|
||||
val = v.default ? v.default : v.value;
|
||||
val = v.set ? v.set : v.value;
|
||||
}
|
||||
containerConfig.Env.push(v.name + "=" + val);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue