Fix container header nav for simple mode

rancher/rancher#9535
This commit is contained in:
Westly Wright 2017-08-02 12:14:17 -07:00
parent 98123333d3
commit 8ff8abfc94
No known key found for this signature in database
GPG Key ID: 4FAB3D8673DC54A3
4 changed files with 249 additions and 241 deletions

View File

@ -1,72 +1,74 @@
{{#if projectController.showOrchestrationWelcome}} {{#if projectController.showOrchestrationWelcome}}
{{orchestration-welcome}} {{orchestration-welcome}}
{{else if rows.length}} {{else}}
{{#containers-header tags=tags}} {{#containers-header tags=tags}}
{{#link-to "new-stack" classNames="btn btn-sm bg-default mr-10"}}{{t 'nav.containers.importCompose'}}{{/link-to}} {{#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}} {{#link-to "balancers.run" projects.current.id class="btn btn-sm bg-primary"}}{{t 'nav.containers.addBalancer'}}{{/link-to}}
{{/containers-header}} {{/containers-header}}
<section class="pl-0 pr-0"> {{#if rows.length}}
{{#sortable-table <section class="pl-0 pr-0">
classNames="grid sortable-table" {{#sortable-table
body=rows classNames="grid sortable-table"
searchText=searchText body=rows
sortBy=sortBy searchText=searchText
bulkActions=true sortBy=sortBy
subRows=true bulkActions=true
fullRows=true subRows=true
groupByKey=groupBy fullRows=true
groupByRef="stack" groupByKey=groupBy
pagingLabel="pagination.loadBalancers" groupByRef="stack"
subSearchField="instances" pagingLabel="pagination.loadBalancers"
extraSearchFields=extraSearchFields subSearchField="instances"
extraSearchSubFields=extraSearchSubFields extraSearchFields=extraSearchFields
headers=headers as |sortable kind inst dt|}} extraSearchSubFields=extraSearchSubFields
{{#if (eq kind "row")}} headers=headers as |sortable kind inst dt|}}
{{service-row {{#if (eq kind "row")}}
model=inst {{service-row
toggle=(action "toggleExpand" inst.id) model=inst
expanded=(array-includes expandedInstances inst.id) toggle=(action "toggleExpand" inst.id)
searchText=searchText expanded=(array-includes expandedInstances inst.id)
subMatches=sortable.subMatches searchText=searchText
fullColspan=sortable.fullColspan subMatches=sortable.subMatches
dt=dt fullColspan=sortable.fullColspan
}} dt=dt
{{else if (eq kind "group")}} }}
<tr class="group-row"> {{else if (eq kind "group")}}
{{#if inst.ref}} <tr class="group-row">
<td colspan={{sub sortable.fullColspan 4}}> {{#if inst.ref}}
{{stack-row model=inst.ref}} <td colspan={{sub sortable.fullColspan 4}}>
</td> {{stack-row model=inst.ref}}
<td></td> </td>
<td> <td></td>
{{upgrade-btn classNames="btn-sm" model=inst.ref}} <td>
</td> {{upgrade-btn classNames="btn-sm" model=inst.ref}}
</td>
<td data-title="{{dt.instanceState}}"> <td data-title="{{dt.instanceState}}">
{{progress-bar-multi {{progress-bar-multi
labelKey="state" labelKey="state"
valueKey="count" valueKey="count"
values=inst.ref.serviceStates.byColor values=inst.ref.serviceStates.byColor
tooltipValues=inst.ref.serviceStates.byName tooltipValues=inst.ref.serviceStates.byName
}} }}
</td> </td>
<td data-title="{{dt.actions}}" class="actions"> <td data-title="{{dt.actions}}" class="actions">
{{action-menu model=inst.ref}} {{action-menu model=inst.ref}}
</td> </td>
{{else}} {{else}}
<td colspan={{sortable.fullColspan}}> <td colspan={{sortable.fullColspan}}>
{{stack-row}} {{stack-row}}
</td> </td>
{{/if}} {{/if}}
</tr> </tr>
{{else if (eq kind "nomatch")}} {{else if (eq kind "nomatch")}}
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'containersPage.table.noMatch'}}</td></tr> <tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'containersPage.table.noMatch'}}</td></tr>
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'containersPage.table.noData'}}</td></tr> <tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'containersPage.table.noData'}}</td></tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}
</section> </section>
{{else}} {{else}}
{{empty-table resource="container" newRoute="balancers.run" newTranslationKey="nav.containers.addBalancer"}} {{empty-table resource="container" newRoute="balancers.run" newTranslationKey="nav.containers.addBalancer"}}
{{/if}}
{{/if}} {{/if}}

View File

@ -1,85 +1,87 @@
{{#if projectController.showOrchestrationWelcome}} {{#if projectController.showOrchestrationWelcome}}
{{orchestration-welcome}} {{orchestration-welcome}}
{{else if rows.length}} {{else}}
{{#containers-header tags=tags simpleMode=simpleMode}} {{#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 "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}} {{#link-to "containers.run" projects.current.id class="btn btn-sm bg-primary"}}{{t 'nav.containers.addContainer'}}{{/link-to}}
{{/containers-header}} {{/containers-header}}
<section class="instances"> {{#if rows.length}}
{{#sortable-table <section class="instances">
tableClassNames="double-rows" {{#sortable-table
classNames="grid sortable-table" tableClassNames="double-rows"
body=rows classNames="grid sortable-table"
searchText=searchText body=rows
sortBy=sortBy searchText=searchText
bulkActions=true sortBy=sortBy
subRows=true bulkActions=true
fullRows=true subRows=true
groupByKey=groupBy fullRows=true
groupByRef="stack" groupByKey=groupBy
extraGroups=emptyStacks groupByRef="stack"
pagingLabel="pagination.containerService" extraGroups=emptyStacks
subSearchField="instances" pagingLabel="pagination.containerService"
extraSearchFields=extraSearchFields subSearchField="instances"
extraSearchSubFields=extraSearchSubFields extraSearchFields=extraSearchFields
headers=headers as |sortable kind row dt|}} extraSearchSubFields=extraSearchSubFields
{{#if (eq kind "row")}} headers=headers as |sortable kind row dt|}}
{{#if (eq row.baseType "instance")}} {{#if (eq kind "row")}}
{{container-row {{#if (eq row.baseType "instance")}}
model=row {{container-row
dt=dt model=row
showHost=true dt=dt
expandPlaceholder=true showHost=true
scalePlaceholder=true expandPlaceholder=true
fullColspan=sortable.fullColspan 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")}}
<tr class="group-row">
{{#if row.ref}}
<td colspan={{sub sortable.fullColspan 3}}>
{{stack-row model=row.ref}}
</td>
<td>
{{upgrade-btn classNames="btn-sm" model=row.ref}}
</td>
<td data-title="{{dt.instanceState}}" class="progress-td">
<div class="mt-10">
{{progress-bar-multi
labelKey="state"
valueKey="count"
values=row.ref.serviceStates.byColor
tooltipValues=row.ref.serviceStates.byName
}}
</div>
</td>
<td data-title="{{dt.actions}}" class="actions">
{{action-menu model=row.ref}}
</td>
{{else}} {{else}}
<td colspan={{sortable.fullColspan}}> {{service-row
{{stack-row}} model=row
</td> toggle=(action "toggleExpand" row.id)
expanded=(array-includes expandedInstances row.id)
searchText=searchText
subMatches=sortable.subMatches
fullColspan=sortable.fullColspan
dt=dt
}}
{{/if}} {{/if}}
</tr> {{else if (eq kind "group")}}
{{else if (eq kind "nomatch")}} <tr class="group-row">
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'containersPage.table.noMatch'}}</td></tr> {{#if row.ref}}
{{else if (eq kind "norows")}} <td colspan={{sub sortable.fullColspan 3}}>
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'containersPage.table.noData'}}</td></tr> {{stack-row model=row.ref}}
{{/if}} </td>
{{/sortable-table}} <td>
</section> {{upgrade-btn classNames="btn-sm" model=row.ref}}
{{else}} </td>
<td data-title="{{dt.instanceState}}" class="progress-td">
<div class="mt-10">
{{progress-bar-multi
labelKey="state"
valueKey="count"
values=row.ref.serviceStates.byColor
tooltipValues=row.ref.serviceStates.byName
}}
</div>
</td>
<td data-title="{{dt.actions}}" class="actions">
{{action-menu model=row.ref}}
</td>
{{else}}
<td colspan={{sortable.fullColspan}}>
{{stack-row}}
</td>
{{/if}}
</tr>
{{else if (eq kind "nomatch")}}
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'containersPage.table.noMatch'}}</td></tr>
{{else if (eq kind "norows")}}
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'containersPage.table.noData'}}</td></tr>
{{/if}}
{{/sortable-table}}
</section>
{{else}}
{{empty-table resource="container" newRoute="containers.run" newTranslationKey="nav.containers.addContainer"}} {{empty-table resource="container" newRoute="containers.run" newTranslationKey="nav.containers.addContainer"}}
{{/if}}
{{/if}} {{/if}}

View File

@ -1,61 +1,63 @@
{{#if projectController.showOrchestrationWelcome}} {{#if projectController.showOrchestrationWelcome}}
{{orchestration-welcome}} {{orchestration-welcome}}
{{else if rows.length}} {{else}}
{{#containers-header tags=tags}} {{#containers-header tags=tags}}
{{#link-to "new-stack" classNames="btn btn-sm bg-default mr-10"}}{{t 'nav.containers.importCompose'}}{{/link-to}} {{#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}} {{#link-to "dns.new" projects.current.id class="btn btn-sm bg-primary"}}{{t 'nav.containers.addDns'}}{{/link-to}}
{{/containers-header}} {{/containers-header}}
<section class="pl-0 pr-0"> {{#if rows.length}}
{{#sortable-table <section class="pl-0 pr-0">
classNames="grid sortable-table" {{#sortable-table
body=rows classNames="grid sortable-table"
searchText=searchText body=rows
sortBy=sortBy searchText=searchText
bulkActions=true sortBy=sortBy
subRows=true bulkActions=true
fullRows=true subRows=true
groupByKey=groupBy fullRows=true
groupByRef="stack" groupByKey=groupBy
pagingLabel="pagination.dnsRecord" groupByRef="stack"
subHeaders=containerHeaders pagingLabel="pagination.dnsRecord"
subSearchField="instances" subHeaders=containerHeaders
headers=headers as |sortable kind inst dt|}} subSearchField="instances"
{{#if (eq kind "row")}} headers=headers as |sortable kind inst dt|}}
{{dns-row {{#if (eq kind "row")}}
model=inst {{dns-row
toggle=(action "toggleExpand" inst.id) model=inst
expanded=(array-includes expandedInstances inst.id) toggle=(action "toggleExpand" inst.id)
searchText=searchText expanded=(array-includes expandedInstances inst.id)
subMatches=sortable.subMatches searchText=searchText
fullColspan=sortable.fullColspan subMatches=sortable.subMatches
dt=dt fullColspan=sortable.fullColspan
}} dt=dt
{{else if (eq kind "group")}} }}
<tr class="group-row"> {{else if (eq kind "group")}}
{{#if inst.ref}} <tr class="group-row">
<td colspan={{sub sortable.fullColspan 2}}> {{#if inst.ref}}
{{stack-row model=inst.ref}} <td colspan={{sub sortable.fullColspan 2}}>
</td> {{stack-row model=inst.ref}}
<td> </td>
{{upgrade-btn classNames="btn-sm" model=inst.ref}} <td>
</td> {{upgrade-btn classNames="btn-sm" model=inst.ref}}
<td data-title="{{dt.actions}}" class="actions"> </td>
{{action-menu model=inst.ref}} <td data-title="{{dt.actions}}" class="actions">
</td> {{action-menu model=inst.ref}}
{{else}} </td>
<td colspan={{sortable.fullColspan}}> {{else}}
{{stack-row}} <td colspan={{sortable.fullColspan}}>
</td> {{stack-row}}
{{/if}} </td>
</tr> {{/if}}
{{else if (eq kind "nomatch")}} </tr>
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'dnsPage.noMatch'}}</td></tr> {{else if (eq kind "nomatch")}}
{{else if (eq kind "norows")}} <tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'dnsPage.noMatch'}}</td></tr>
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'dnsPage.noData'}}</td></tr> {{else if (eq kind "norows")}}
{{/if}} <tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'dnsPage.noData'}}</td></tr>
{{/sortable-table}} {{/if}}
</section> {{/sortable-table}}
{{else}} </section>
{{empty-table resource="container" newRoute="dns.new" newTranslationKey="nav.containers.addDns"}} {{else}}
{{/if}} {{empty-table resource="container" newRoute="dns.new" newTranslationKey="nav.containers.addDns"}}
{{/if}}
{{/if}}

View File

@ -1,59 +1,61 @@
{{#if projectController.showOrchestrationWelcome}} {{#if projectController.showOrchestrationWelcome}}
{{orchestration-welcome}} {{orchestration-welcome}}
{{else if rows.length}} {{else}}
{{#containers-header tags=tags}} {{#containers-header tags=tags}}
{{#link-to "new-stack" classNames="btn btn-sm bg-default mr-10"}}{{t 'nav.containers.importCompose'}}{{/link-to}} {{#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}} {{#link-to "volumes.new" projects.current.id class="btn btn-sm bg-primary"}}{{t 'nav.containers.addVolume'}}{{/link-to}}
{{/containers-header}} {{/containers-header}}
<section class="pl-0 pr-0"> {{#if rows.length}}
{{#sortable-table <section class="pl-0 pr-0">
classNames="grid sortable-table" {{#sortable-table
body=rows classNames="grid sortable-table"
searchText=searchText body=rows
sortBy=sortBy searchText=searchText
bulkActions=true sortBy=sortBy
subRows=true bulkActions=true
fullRows=true subRows=true
groupByKey=groupBy fullRows=true
groupByRef="stack" groupByKey=groupBy
pagingLabel="pagination.volume" groupByRef="stack"
subHeaders=containerHeaders pagingLabel="pagination.volume"
subSearchField="instances" subHeaders=containerHeaders
headers=headers as |sortable kind inst dt|}} subSearchField="instances"
{{#if (eq kind "row")}} headers=headers as |sortable kind inst dt|}}
{{volume-row {{#if (eq kind "row")}}
model=inst {{volume-row
toggle=(action "toggleExpand" inst.id) model=inst
expanded=(array-includes expandedInstances inst.id) toggle=(action "toggleExpand" inst.id)
searchText=searchText expanded=(array-includes expandedInstances inst.id)
subMatches=sortable.subMatches searchText=searchText
fullColspan=sortable.fullColspan subMatches=sortable.subMatches
dt=dt fullColspan=sortable.fullColspan
}} dt=dt
{{else if (eq kind "group")}} }}
<tr class="group-row"> {{else if (eq kind "group")}}
{{#if inst.ref}} <tr class="group-row">
<td colspan={{sub sortable.fullColspan 2}}> {{#if inst.ref}}
{{stack-row model=inst.ref}} <td colspan={{sub sortable.fullColspan 2}}>
</td> {{stack-row model=inst.ref}}
<td> </td>
{{upgrade-btn classNames="btn-sm" model=inst.ref}} <td>
</td> {{upgrade-btn classNames="btn-sm" model=inst.ref}}
<td data-title="{{dt.actions}}" class="actions"> </td>
{{action-menu model=inst.ref}} <td data-title="{{dt.actions}}" class="actions">
</td> {{action-menu model=inst.ref}}
{{else}} </td>
<td colspan={{sortable.fullColspan}}> {{else}}
{{stack-row}} <td colspan={{sortable.fullColspan}}>
</td> {{stack-row}}
{{/if}} </td>
</tr> {{/if}}
{{else if (eq kind "nomatch")}} </tr>
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'volumesPage.noMatch'}}</td></tr> {{else if (eq kind "nomatch")}}
{{/if}} <tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'volumesPage.noMatch'}}</td></tr>
{{/sortable-table}} {{/if}}
</section> {{/sortable-table}}
{{else}} </section>
{{empty-table resource="container" newRoute="volumes.new" newTranslationKey="nav.containers.addVolume"}} {{else}}
{{empty-table resource="container" newRoute="volumes.new" newTranslationKey="nav.containers.addVolume"}}
{{/if}}
{{/if}} {{/if}}