feat(templates): add support for bind mounts in volumes

* #777 feat(templates): add support for binding to host path

* #777 feat(templates): add link to templates documentation

* refactor(templates): update warning style to match theme

* fix(templates): remove trailing comma

* refactor(templates): use bind instead of self declaration

* feat(templates): support readonly property in template volumes

* #777 refactor(templates): remove deprecation notice

* #777 refactor(templates): remove deprecated condition from template
pull/1169/head
Adam Snodgrass 2017-08-28 13:53:36 -05:00 committed by Anthony Lapenna
parent 8c68e92e74
commit c1e486bf43
2 changed files with 11 additions and 4 deletions

View File

@ -27,7 +27,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<span class="template-note" ng-bind-html="state.selectedTemplate.Note"></span> <div class="template-note" ng-if="state.selectedTemplate.Note" ng-bind-html="state.selectedTemplate.Note"></div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -16,11 +16,18 @@ function TemplateViewModel(data) {
this.Volumes = []; this.Volumes = [];
if (data.volumes) { if (data.volumes) {
this.Volumes = data.volumes.map(function (v) { this.Volumes = data.volumes.map(function (v) {
return { var volume = {
readOnly: false, readOnly: v.readonly || false,
containerPath: v, containerPath: v.container || v,
type: 'auto' type: 'auto'
}; };
if (v.bind) {
volume.name = v.bind;
volume.type = 'bind';
}
return volume;
}); });
} }
this.Ports = []; this.Ports = [];