From 8ff8abfc9481f9abb4a6234e86db586d7ca3540e Mon Sep 17 00:00:00 2001 From: Westly Wright Date: Wed, 2 Aug 2017 12:14:17 -0700 Subject: [PATCH] Fix container header nav for simple mode rancher/rancher#9535 --- app/balancers/index/template.hbs | 128 +++++++++++++------------- app/containers/index/template.hbs | 148 +++++++++++++++--------------- app/dns/index/template.hbs | 110 +++++++++++----------- app/volumes/index/template.hbs | 104 +++++++++++---------- 4 files changed, 249 insertions(+), 241 deletions(-) diff --git a/app/balancers/index/template.hbs b/app/balancers/index/template.hbs index 8402535b2..706883c18 100644 --- a/app/balancers/index/template.hbs +++ b/app/balancers/index/template.hbs @@ -1,72 +1,74 @@ {{#if projectController.showOrchestrationWelcome}} {{orchestration-welcome}} -{{else if rows.length}} +{{else}} {{#containers-header tags=tags}} {{#link-to "new-stack" classNames="btn btn-sm bg-default mr-10"}}{{t 'nav.containers.importCompose'}}{{/link-to}} {{#link-to "balancers.run" projects.current.id class="btn btn-sm bg-primary"}}{{t 'nav.containers.addBalancer'}}{{/link-to}} {{/containers-header}} -
- {{#sortable-table - classNames="grid sortable-table" - body=rows - searchText=searchText - sortBy=sortBy - bulkActions=true - subRows=true - fullRows=true - groupByKey=groupBy - groupByRef="stack" - pagingLabel="pagination.loadBalancers" - subSearchField="instances" - extraSearchFields=extraSearchFields - extraSearchSubFields=extraSearchSubFields - headers=headers as |sortable kind inst dt|}} - {{#if (eq kind "row")}} - {{service-row - model=inst - toggle=(action "toggleExpand" inst.id) - expanded=(array-includes expandedInstances inst.id) - searchText=searchText - subMatches=sortable.subMatches - fullColspan=sortable.fullColspan - dt=dt - }} - {{else if (eq kind "group")}} - - {{#if inst.ref}} - - {{stack-row model=inst.ref}} - - - - {{upgrade-btn classNames="btn-sm" model=inst.ref}} - + {{#if rows.length}} +
+ {{#sortable-table + classNames="grid sortable-table" + body=rows + searchText=searchText + sortBy=sortBy + bulkActions=true + subRows=true + fullRows=true + groupByKey=groupBy + groupByRef="stack" + pagingLabel="pagination.loadBalancers" + subSearchField="instances" + extraSearchFields=extraSearchFields + extraSearchSubFields=extraSearchSubFields + headers=headers as |sortable kind inst dt|}} + {{#if (eq kind "row")}} + {{service-row + model=inst + toggle=(action "toggleExpand" inst.id) + expanded=(array-includes expandedInstances inst.id) + searchText=searchText + subMatches=sortable.subMatches + fullColspan=sortable.fullColspan + dt=dt + }} + {{else if (eq kind "group")}} + + {{#if inst.ref}} + + {{stack-row model=inst.ref}} + + + + {{upgrade-btn classNames="btn-sm" model=inst.ref}} + - - {{progress-bar-multi - labelKey="state" - valueKey="count" - values=inst.ref.serviceStates.byColor - tooltipValues=inst.ref.serviceStates.byName - }} - - - {{action-menu model=inst.ref}} - - {{else}} - - {{stack-row}} - - {{/if}} - - {{else if (eq kind "nomatch")}} - {{t 'containersPage.table.noMatch'}} - {{else if (eq kind "norows")}} - {{t 'containersPage.table.noData'}} - {{/if}} - {{/sortable-table}} -
-{{else}} - {{empty-table resource="container" newRoute="balancers.run" newTranslationKey="nav.containers.addBalancer"}} + + {{progress-bar-multi + labelKey="state" + valueKey="count" + values=inst.ref.serviceStates.byColor + tooltipValues=inst.ref.serviceStates.byName + }} + + + {{action-menu model=inst.ref}} + + {{else}} + + {{stack-row}} + + {{/if}} + + {{else if (eq kind "nomatch")}} + {{t 'containersPage.table.noMatch'}} + {{else if (eq kind "norows")}} + {{t 'containersPage.table.noData'}} + {{/if}} + {{/sortable-table}} +
+ {{else}} + {{empty-table resource="container" newRoute="balancers.run" newTranslationKey="nav.containers.addBalancer"}} + {{/if}} {{/if}} diff --git a/app/containers/index/template.hbs b/app/containers/index/template.hbs index f9aeef576..d87141b60 100644 --- a/app/containers/index/template.hbs +++ b/app/containers/index/template.hbs @@ -1,85 +1,87 @@ {{#if projectController.showOrchestrationWelcome}} {{orchestration-welcome}} -{{else if rows.length}} +{{else}} {{#containers-header tags=tags simpleMode=simpleMode}} {{#link-to "new-stack" classNames="btn btn-sm bg-default mr-10"}}{{t 'nav.containers.importCompose'}}{{/link-to}} {{#link-to "containers.run" projects.current.id class="btn btn-sm bg-primary"}}{{t 'nav.containers.addContainer'}}{{/link-to}} {{/containers-header}} -
- {{#sortable-table - tableClassNames="double-rows" - classNames="grid sortable-table" - body=rows - searchText=searchText - sortBy=sortBy - bulkActions=true - subRows=true - fullRows=true - groupByKey=groupBy - groupByRef="stack" - extraGroups=emptyStacks - pagingLabel="pagination.containerService" - subSearchField="instances" - extraSearchFields=extraSearchFields - extraSearchSubFields=extraSearchSubFields - headers=headers as |sortable kind row dt|}} - {{#if (eq kind "row")}} - {{#if (eq row.baseType "instance")}} - {{container-row - model=row - dt=dt - showHost=true - expandPlaceholder=true - scalePlaceholder=true - fullColspan=sortable.fullColspan + {{#if rows.length}} +
+ {{#sortable-table + tableClassNames="double-rows" + classNames="grid sortable-table" + body=rows + searchText=searchText + sortBy=sortBy + bulkActions=true + subRows=true + fullRows=true + groupByKey=groupBy + groupByRef="stack" + extraGroups=emptyStacks + pagingLabel="pagination.containerService" + subSearchField="instances" + extraSearchFields=extraSearchFields + extraSearchSubFields=extraSearchSubFields + headers=headers as |sortable kind row dt|}} + {{#if (eq kind "row")}} + {{#if (eq row.baseType "instance")}} + {{container-row + model=row + dt=dt + showHost=true + expandPlaceholder=true + scalePlaceholder=true + fullColspan=sortable.fullColspan }} - {{else}} - {{service-row - model=row - toggle=(action "toggleExpand" row.id) - expanded=(array-includes expandedInstances row.id) - searchText=searchText - subMatches=sortable.subMatches - fullColspan=sortable.fullColspan - dt=dt - }} - {{/if}} - {{else if (eq kind "group")}} - - {{#if row.ref}} - - {{stack-row model=row.ref}} - - - {{upgrade-btn classNames="btn-sm" model=row.ref}} - - -
- {{progress-bar-multi - labelKey="state" - valueKey="count" - values=row.ref.serviceStates.byColor - tooltipValues=row.ref.serviceStates.byName - }} -
- - - {{action-menu model=row.ref}} - {{else}} - - {{stack-row}} - + {{service-row + model=row + toggle=(action "toggleExpand" row.id) + expanded=(array-includes expandedInstances row.id) + searchText=searchText + subMatches=sortable.subMatches + fullColspan=sortable.fullColspan + dt=dt + }} {{/if}} - - {{else if (eq kind "nomatch")}} - {{t 'containersPage.table.noMatch'}} - {{else if (eq kind "norows")}} - {{t 'containersPage.table.noData'}} - {{/if}} - {{/sortable-table}} -
-{{else}} + {{else if (eq kind "group")}} + + {{#if row.ref}} + + {{stack-row model=row.ref}} + + + {{upgrade-btn classNames="btn-sm" model=row.ref}} + + +
+ {{progress-bar-multi + labelKey="state" + valueKey="count" + values=row.ref.serviceStates.byColor + tooltipValues=row.ref.serviceStates.byName + }} +
+ + + {{action-menu model=row.ref}} + + {{else}} + + {{stack-row}} + + {{/if}} + + {{else if (eq kind "nomatch")}} + {{t 'containersPage.table.noMatch'}} + {{else if (eq kind "norows")}} + {{t 'containersPage.table.noData'}} + {{/if}} + {{/sortable-table}} +
+ {{else}} {{empty-table resource="container" newRoute="containers.run" newTranslationKey="nav.containers.addContainer"}} + {{/if}} {{/if}} diff --git a/app/dns/index/template.hbs b/app/dns/index/template.hbs index 893f3fe69..41f7e042b 100644 --- a/app/dns/index/template.hbs +++ b/app/dns/index/template.hbs @@ -1,61 +1,63 @@ {{#if projectController.showOrchestrationWelcome}} {{orchestration-welcome}} -{{else if rows.length}} +{{else}} {{#containers-header tags=tags}} {{#link-to "new-stack" classNames="btn btn-sm bg-default mr-10"}}{{t 'nav.containers.importCompose'}}{{/link-to}} {{#link-to "dns.new" projects.current.id class="btn btn-sm bg-primary"}}{{t 'nav.containers.addDns'}}{{/link-to}} {{/containers-header}} -
- {{#sortable-table - classNames="grid sortable-table" - body=rows - searchText=searchText - sortBy=sortBy - bulkActions=true - subRows=true - fullRows=true - groupByKey=groupBy - groupByRef="stack" - pagingLabel="pagination.dnsRecord" - subHeaders=containerHeaders - subSearchField="instances" - headers=headers as |sortable kind inst dt|}} - {{#if (eq kind "row")}} - {{dns-row - model=inst - toggle=(action "toggleExpand" inst.id) - expanded=(array-includes expandedInstances inst.id) - searchText=searchText - subMatches=sortable.subMatches - fullColspan=sortable.fullColspan - dt=dt - }} - {{else if (eq kind "group")}} - - {{#if inst.ref}} - - {{stack-row model=inst.ref}} - - - {{upgrade-btn classNames="btn-sm" model=inst.ref}} - - - {{action-menu model=inst.ref}} - - {{else}} - - {{stack-row}} - - {{/if}} - - {{else if (eq kind "nomatch")}} - {{t 'dnsPage.noMatch'}} - {{else if (eq kind "norows")}} - {{t 'dnsPage.noData'}} - {{/if}} - {{/sortable-table}} -
-{{else}} - {{empty-table resource="container" newRoute="dns.new" newTranslationKey="nav.containers.addDns"}} -{{/if}} + {{#if rows.length}} +
+ {{#sortable-table + classNames="grid sortable-table" + body=rows + searchText=searchText + sortBy=sortBy + bulkActions=true + subRows=true + fullRows=true + groupByKey=groupBy + groupByRef="stack" + pagingLabel="pagination.dnsRecord" + subHeaders=containerHeaders + subSearchField="instances" + headers=headers as |sortable kind inst dt|}} + {{#if (eq kind "row")}} + {{dns-row + model=inst + toggle=(action "toggleExpand" inst.id) + expanded=(array-includes expandedInstances inst.id) + searchText=searchText + subMatches=sortable.subMatches + fullColspan=sortable.fullColspan + dt=dt + }} + {{else if (eq kind "group")}} + + {{#if inst.ref}} + + {{stack-row model=inst.ref}} + + + {{upgrade-btn classNames="btn-sm" model=inst.ref}} + + + {{action-menu model=inst.ref}} + + {{else}} + + {{stack-row}} + + {{/if}} + + {{else if (eq kind "nomatch")}} + {{t 'dnsPage.noMatch'}} + {{else if (eq kind "norows")}} + {{t 'dnsPage.noData'}} + {{/if}} + {{/sortable-table}} +
+ {{else}} + {{empty-table resource="container" newRoute="dns.new" newTranslationKey="nav.containers.addDns"}} + {{/if}} +{{/if}} \ No newline at end of file diff --git a/app/volumes/index/template.hbs b/app/volumes/index/template.hbs index 4d0ffd48a..79c2e8963 100644 --- a/app/volumes/index/template.hbs +++ b/app/volumes/index/template.hbs @@ -1,59 +1,61 @@ {{#if projectController.showOrchestrationWelcome}} {{orchestration-welcome}} -{{else if rows.length}} +{{else}} {{#containers-header tags=tags}} {{#link-to "new-stack" classNames="btn btn-sm bg-default mr-10"}}{{t 'nav.containers.importCompose'}}{{/link-to}} {{#link-to "volumes.new" projects.current.id class="btn btn-sm bg-primary"}}{{t 'nav.containers.addVolume'}}{{/link-to}} {{/containers-header}} -
- {{#sortable-table - classNames="grid sortable-table" - body=rows - searchText=searchText - sortBy=sortBy - bulkActions=true - subRows=true - fullRows=true - groupByKey=groupBy - groupByRef="stack" - pagingLabel="pagination.volume" - subHeaders=containerHeaders - subSearchField="instances" - headers=headers as |sortable kind inst dt|}} - {{#if (eq kind "row")}} - {{volume-row - model=inst - toggle=(action "toggleExpand" inst.id) - expanded=(array-includes expandedInstances inst.id) - searchText=searchText - subMatches=sortable.subMatches - fullColspan=sortable.fullColspan - dt=dt - }} - {{else if (eq kind "group")}} - - {{#if inst.ref}} - - {{stack-row model=inst.ref}} - - - {{upgrade-btn classNames="btn-sm" model=inst.ref}} - - - {{action-menu model=inst.ref}} - - {{else}} - - {{stack-row}} - - {{/if}} - - {{else if (eq kind "nomatch")}} - {{t 'volumesPage.noMatch'}} - {{/if}} - {{/sortable-table}} -
-{{else}} - {{empty-table resource="container" newRoute="volumes.new" newTranslationKey="nav.containers.addVolume"}} + {{#if rows.length}} +
+ {{#sortable-table + classNames="grid sortable-table" + body=rows + searchText=searchText + sortBy=sortBy + bulkActions=true + subRows=true + fullRows=true + groupByKey=groupBy + groupByRef="stack" + pagingLabel="pagination.volume" + subHeaders=containerHeaders + subSearchField="instances" + headers=headers as |sortable kind inst dt|}} + {{#if (eq kind "row")}} + {{volume-row + model=inst + toggle=(action "toggleExpand" inst.id) + expanded=(array-includes expandedInstances inst.id) + searchText=searchText + subMatches=sortable.subMatches + fullColspan=sortable.fullColspan + dt=dt + }} + {{else if (eq kind "group")}} + + {{#if inst.ref}} + + {{stack-row model=inst.ref}} + + + {{upgrade-btn classNames="btn-sm" model=inst.ref}} + + + {{action-menu model=inst.ref}} + + {{else}} + + {{stack-row}} + + {{/if}} + + {{else if (eq kind "nomatch")}} + {{t 'volumesPage.noMatch'}} + {{/if}} + {{/sortable-table}} +
+ {{else}} + {{empty-table resource="container" newRoute="volumes.new" newTranslationKey="nav.containers.addVolume"}} + {{/if}} {{/if}}