From c242d188aa3efaf07e78b741d89664ee83622e5a Mon Sep 17 00:00:00 2001 From: Westly Wright Date: Wed, 16 Aug 2017 12:05:59 -0700 Subject: [PATCH] Fix broken ports component on container details fixed misspelled name swap out old container table component for form-ports update form-ports to be editable --- .../container/form-ports/template.hbs | 163 +++++++++++------- .../container/new-edit/template.hbs | 7 +- app/container/template.hbs | 20 +-- 3 files changed, 111 insertions(+), 79 deletions(-) diff --git a/app/components/container/form-ports/template.hbs b/app/components/container/form-ports/template.hbs index 44a29d17f..55ba599c1 100644 --- a/app/components/container/form-ports/template.hbs +++ b/app/components/container/form-ports/template.hbs @@ -1,83 +1,112 @@
{{#if (and portsArray.length (not showIp))}} - + {{#if editing}} + + {{/if}} {{/if}}
{{#if portsArray.length}} - - {{#if showIp}} - - - {{/if}} - - - - - - - - - {{#each portsArray as |port|}} -
- + + {{#if showIp}} - + + {{/if}} + + + + + + + + + + + {{#each portsArray as |port|}} + + {{#if showIp}} + + + {{/if}} + + - {{/if}} - - + + - - + - - - - - {{/each}} + + + {{/each}} +
+ {{#if port.existing}} + {{#if port.bindAddress}} + {{port.bindAddress}} + {{else}} + {{t 'generic.any'}} + {{/if}} {{else}} - {{t 'generic.any'}} + {{#if editing}} + {{input class="form-control input-sm" type="text" value=port.bindAddress placeholder=(t 'formPorts.bindAddress.placeholder')}} + {{else}} + {{#if port.bindAddress}} + {{port.bindAddress}} + {{else}} + {{t 'generic.na'}} + {{/if}} + {{/if}} + {{/if}} +   + {{#if editing}} + {{input-integer class="form-control input-sm public" min="1" max="65535" value=port.public placeholder=(t 'formPorts.public.placeholder')}} {{else}} - {{input class="form-control input-sm" type="text" value=port.bindAddress placeholder=(t 'formPorts.bindAddress.placeholder')}} + {{port.public}} {{/if}}   - {{input-integer class="form-control input-sm public" min="1" max="65535" value=port.public placeholder=(t 'formPorts.public.placeholder')}} -   + {{#if port.existing}} +
{{port.private}}
+ {{else}} + {{#if editing}} + {{input-integer class="form-control input-sm" min="1" max="65535" value=port.private placeholder=(t 'formPorts.private.placeholder')}} + {{else}} + {{port.private}} + {{/if}} + {{/if}} +
  - {{#if port.existing}} -
{{port.private}}
- {{else}} - {{input-integer class="form-control input-sm" min="1" max="65535" value=port.private placeholder=(t 'formPorts.private.placeholder')}} - {{/if}} -
  + {{#if port.existing}} +
{{upper-case port.protocol}}
+ {{else}} + {{#if editing}} + {{new-select + class="form-control input-sm" + content=protocolOptions + value=port.protocol + }} + {{else}} + {{port.protocol}} + {{/if}} + {{/if}} +
- {{#if port.existing}} -
{{upper-case port.protocol}}
- {{else}} - {{new-select - class="form-control input-sm" - content=protocolOptions - value=port.protocol}} - {{/if}} -
- {{#if port.existing}} -   - {{else}} - - {{/if}} -
+ {{#if port.existing}} +   + {{else}} + {{#if editing}} + + {{/if}} + {{/if}} +
{{else}} {{#if editing}} @@ -86,8 +115,10 @@ {{/if}}
- + {{#if editing}} + + {{/if}}
diff --git a/app/components/container/new-edit/template.hbs b/app/components/container/new-edit/template.hbs index a59c5bd26..7c4243b22 100644 --- a/app/components/container/new-edit/template.hbs +++ b/app/components/container/new-edit/template.hbs @@ -57,9 +57,10 @@
{{container/form-ports - initialPorts=launchConfig.ports - errors=portErrors - changedStr=(action (mut launchConfig.ports)) + initialPorts=launchConfig.ports + errors=portErrors + changedStr=(action (mut launchConfig.ports)) + editing=true }}
diff --git a/app/container/template.hbs b/app/container/template.hbs index 9d1292180..10d778dff 100644 --- a/app/container/template.hbs +++ b/app/container/template.hbs @@ -142,17 +142,17 @@
{{#accordion-list-item - title=(t 'containerPage.portsTab.header') - detail=(t 'containerPage.portsTab.detail') - status=(t 'pagination.port' pages=1 count=model.container.publicEndpoints.length) - statusClass=(if model.container.publicEndpoints.length 'bg-success' 'text-muted') - expandAll=al.expandAll - expand=(action expandFn) - componentName='container-table' - as | parent | + title=(t 'containerPage.portsTab.header') + detail=(t 'containerPage.portsTab.detail') + status=(t 'pagination.port' pages=1 count=model.container.publicEndpoints.length) + statusClass=(if model.container.publicEndpoints.length 'bg-success' 'text-muted') + expandAll=al.expandAll + expand=(action expandFn) + as | parent | }} - {{compontent parent.intent - model=model.container + {{container/form-ports + initialPorts=model.container.ports + editing=false }} {{/accordion-list-item}}