From eba597048d51801ba3bad598b996334d5bcd024e Mon Sep 17 00:00:00 2001 From: Westly Wright Date: Thu, 4 Oct 2018 10:17:01 -0700 Subject: [PATCH] Rework ingress detail page rancher/rancher#15096 --- .../form-labels-annotations/template.hbs | 120 +++++++++--------- app/components/new-edit-ingress/template.hbs | 48 +++---- app/ingress/template.hbs | 37 ++++-- .../components/form-ingress-rows/template.hbs | 51 ++++++-- .../components/form-ingress-rule/template.hbs | 11 +- 5 files changed, 155 insertions(+), 112 deletions(-) diff --git a/app/components/form-labels-annotations/template.hbs b/app/components/form-labels-annotations/template.hbs index 4505a4e29..5145653b8 100644 --- a/app/components/form-labels-annotations/template.hbs +++ b/app/components/form-labels-annotations/template.hbs @@ -1,67 +1,67 @@ {{#accordion-list-item - title=(t 'formLabelsAnnotations.title') - detail=(t detailKey appName=settings.appName) - showStatus=true - status=status - statusClass=statusClass - expandAll=expandAll - expand=(action expandFn) + title=(t 'formLabelsAnnotations.title') + detail=(t detailKey appName=settings.appName) + showStatus=true + status=status + statusClass=statusClass + expandAll=expandAll + expand=(action expandFn) }}
{{#if editing}} -
-
- -
- {{#if userLabelArray.length}} - - - - - - - - - - - {{#each userLabelArray as |label|}} - - - - - - - - - - {{/each}} - -
- {{input-paste pasted="pastedLabels" class="form-control input-sm key js-label" type="text" value=label.key placeholder="formUserLabels.key.placeholder" disabled=(eq label.readonly true)}} - - {{#if editing}} - {{t 'formKeyValue.separator'}} - {{/if}} - - {{input class="form-control input-sm" type="text" value=label.value placeholder=(t 'formUserLabels.value.placeholder') disabled=(eq label.readonly true)}} - - -
-
- {{t 'formUserLabels.protip'}} +
+
+
- {{/if}} + {{#if userLabelArray.length}} + + + + + + + + + + + {{#each userLabelArray as |label|}} + + - - + + + + + + + {{/each}} + +
+ {{input-paste pasted="pastedLabels" class="form-control input-sm key js-label" type="text" value=label.key placeholder="formUserLabels.key.placeholder" disabled=(eq label.readonly true)}} + + {{#if editing}} + {{t 'formKeyValue.separator'}} + {{/if}} + + {{input class="form-control input-sm" type="text" value=label.value placeholder=(t 'formUserLabels.value.placeholder') disabled=(eq label.readonly true)}} + + +
+
+ {{t 'formUserLabels.protip'}} +
+ {{/if}} + + +
{{else}} {{#if model.canHaveLabels}} {{table-labels - header=(t 'formUserLabels.title') - model=model.labels + header=(t 'formUserLabels.title') + model=model.labels }} {{/if}} {{/if}} @@ -70,18 +70,18 @@ {{/unless}}
{{#if editing}} - {{form-key-value + {{form-key-value header=(t 'formAnnotations.title') editing=editing initialMap=model.annotations changed=(action "annotationsChange") addActionLabel="formAnnotations.addActionLabel" - }} + }} {{else}} {{table-labels - header=(t 'formAnnotations.title') - model=model.annotations - labelIntlSec="annotationsSection" + header=(t 'formAnnotations.title') + model=model.annotations + labelIntlSec="annotationsSection" }} {{/if}}
diff --git a/app/components/new-edit-ingress/template.hbs b/app/components/new-edit-ingress/template.hbs index 39399aff1..3b99cd48b 100644 --- a/app/components/new-edit-ingress/template.hbs +++ b/app/components/new-edit-ingress/template.hbs @@ -5,50 +5,50 @@
{{form-name-description - model=ingress - nameDisabled=existing - namePlaceholder="servicePage.newIngress.form.name.placeholder" - descriptionPlaceholder="servicePage.newIngress.form.description.placeholder" + model=ingress + nameDisabled=existing + namePlaceholder="servicePage.newIngress.form.name.placeholder" + descriptionPlaceholder="servicePage.newIngress.form.description.placeholder" }}
{{form-namespace - editing=(and editing (not existing)) - namespace=namespace - errors=namespaceErrors + editing=(and editing (not existing)) + namespace=namespace + errors=namespaceErrors }}
{{form-ingress-rule - ingress=ingress - editing=true + ingress=ingress + editing=true }}
{{#accordion-list as | al expandFn | }} {{form-ssl-termination - editing=true - ingress=ingress - namespace=namespace - namespacedCertificates=namespacedCertificates - certificates=certificates - expandAll=al.expandAll - expandFn=expandFn + certificates=certificates + editing=true + expandAll=al.expandAll + expandFn=expandFn + ingress=ingress + namespace=namespace + namespacedCertificates=namespacedCertificates }} {{form-labels-annotations - classNames="accordion-wrapper" - labelErrors=labelErrors - initialLabels=ingress.labels - setLabels=(action 'setLabels') - expandAll=al.expandAll - expandFn=expandFn - model=ingress - annotationErrors=annotationErrors + annotationErrors=annotationErrors + classNames="accordion-wrapper" + expandAll=al.expandAll + expandFn=expandFn + initialLabels=ingress.labels + labelErrors=labelErrors + model=ingress + setLabels=(action 'setLabels') }} {{/accordion-list}} diff --git a/app/ingress/template.hbs b/app/ingress/template.hbs index f339b6b41..50aff0245 100644 --- a/app/ingress/template.hbs +++ b/app/ingress/template.hbs @@ -18,16 +18,33 @@
{{form-ingress-rule - ingress=model.ingress - editing=false + ingress=model.ingress + editing=false }} -
-{{form-ssl-termination - editing=false - ingress=model.ingress - namespace=model.ingress.namespace - namespacedCertificates=model.namespacedCertificates - certificates=model.certificates -}} +
+ +
+ {{#accordion-list as | al expandFn | }} + {{form-ssl-termination + editing=false + expandAll=al.expandAll + expandFn=expandFn + ingress=model.ingress + namespace=model.ingress.namespace + namespacedCertificates=model.namespacedCertificates + certificates=model.certificates + }} + + + {{form-labels-annotations + classNames="accordion-wrapper" + editing=false + expandAll=al.expandAll + expandFn=expandFn + initialLabels=model.ingress.labels + model=model.ingress + }} + {{/accordion-list}} +
diff --git a/lib/shared/addon/components/form-ingress-rows/template.hbs b/lib/shared/addon/components/form-ingress-rows/template.hbs index 95cc9d594..4479b366e 100644 --- a/lib/shared/addon/components/form-ingress-rows/template.hbs +++ b/lib/shared/addon/components/form-ingress-rows/template.hbs @@ -19,23 +19,43 @@
-
- {{#unless rule.new}} +
+ {{#if editing}} + {{#unless rule.new}} +
+ +
+ {{/unless}} + {{#if settings.ingress-ip-domain}} +
+ +
+ {{/if}}
- +
- {{/unless}} - {{#if settings.ingress-ip-domain}}
- +
+ {{else}} + {{#if (eq mode "existing")}} +
+ +
+ {{else if (eq mode "automatic")}} +
+ +
+ {{else if (eq mode "manual")}} +
+ +
+ {{else}} +
+ +
+ {{/if}} {{/if}} -
- -
-
- -
{{#if (eq mode "manual")}} @@ -50,5 +70,10 @@
- {{form-ingress-backends ingress=ingress isDefault=isDefault rule=rule editing=editing}} + {{form-ingress-backends + ingress=ingress + isDefault=isDefault + rule=rule + editing=editing + }}
diff --git a/lib/shared/addon/components/form-ingress-rule/template.hbs b/lib/shared/addon/components/form-ingress-rule/template.hbs index 737d300a3..6218ebf5d 100644 --- a/lib/shared/addon/components/form-ingress-rule/template.hbs +++ b/lib/shared/addon/components/form-ingress-rule/template.hbs @@ -4,11 +4,12 @@
{{#each rules as |rule|}} {{form-ingress-rows - removeRule=(action 'removeRule') - rules=rules - rule=rule - ingress=ingress - editing=editing}} + removeRule=(action 'removeRule') + rules=rules + rule=rule + ingress=ingress + editing=editing + }} {{else}}
{{t 'formIngress.noRules'}}
{{/each}}