From c1e486bf438f01a00d8550fae11553a18cc724e1 Mon Sep 17 00:00:00 2001 From: Adam Snodgrass Date: Mon, 28 Aug 2017 13:53:36 -0500 Subject: [PATCH] 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 --- app/components/templates/templates.html | 2 +- app/models/api/template.js | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/components/templates/templates.html b/app/components/templates/templates.html index 4d2e0dd71..bf05cbbfb 100644 --- a/app/components/templates/templates.html +++ b/app/components/templates/templates.html @@ -27,7 +27,7 @@
- +
diff --git a/app/models/api/template.js b/app/models/api/template.js index 01532f6f6..3883edf4f 100644 --- a/app/models/api/template.js +++ b/app/models/api/template.js @@ -16,11 +16,18 @@ function TemplateViewModel(data) { this.Volumes = []; if (data.volumes) { this.Volumes = data.volumes.map(function (v) { - return { - readOnly: false, - containerPath: v, + var volume = { + readOnly: v.readonly || false, + containerPath: v.container || v, type: 'auto' }; + + if (v.bind) { + volume.name = v.bind; + volume.type = 'bind'; + } + + return volume; }); } this.Ports = [];