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}}
{{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}}
<section class="pl-0 pr-0">
{{#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")}}
<tr class="group-row">
{{#if inst.ref}}
<td colspan={{sub sortable.fullColspan 4}}>
{{stack-row model=inst.ref}}
</td>
<td></td>
<td>
{{upgrade-btn classNames="btn-sm" model=inst.ref}}
</td>
{{#if rows.length}}
<section class="pl-0 pr-0">
{{#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")}}
<tr class="group-row">
{{#if inst.ref}}
<td colspan={{sub sortable.fullColspan 4}}>
{{stack-row model=inst.ref}}
</td>
<td></td>
<td>
{{upgrade-btn classNames="btn-sm" model=inst.ref}}
</td>
<td data-title="{{dt.instanceState}}">
{{progress-bar-multi
labelKey="state"
valueKey="count"
values=inst.ref.serviceStates.byColor
tooltipValues=inst.ref.serviceStates.byName
}}
</td>
<td data-title="{{dt.actions}}" class="actions">
{{action-menu model=inst.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="balancers.run" newTranslationKey="nav.containers.addBalancer"}}
<td data-title="{{dt.instanceState}}">
{{progress-bar-multi
labelKey="state"
valueKey="count"
values=inst.ref.serviceStates.byColor
tooltipValues=inst.ref.serviceStates.byName
}}
</td>
<td data-title="{{dt.actions}}" class="actions">
{{action-menu model=inst.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="balancers.run" newTranslationKey="nav.containers.addBalancer"}}
{{/if}}
{{/if}}

View File

@ -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}}
<section class="instances">
{{#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}}
<section class="instances">
{{#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")}}
<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}}
<td colspan={{sortable.fullColspan}}>
{{stack-row}}
</td>
{{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}}
</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}}
{{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}}
<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"}}
{{/if}}
{{/if}}

View File

@ -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}}
<section class="pl-0 pr-0">
{{#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")}}
<tr class="group-row">
{{#if inst.ref}}
<td colspan={{sub sortable.fullColspan 2}}>
{{stack-row model=inst.ref}}
</td>
<td>
{{upgrade-btn classNames="btn-sm" model=inst.ref}}
</td>
<td data-title="{{dt.actions}}" class="actions">
{{action-menu model=inst.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 'dnsPage.noMatch'}}</td></tr>
{{else if (eq kind "norows")}}
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'dnsPage.noData'}}</td></tr>
{{/if}}
{{/sortable-table}}
</section>
{{else}}
{{empty-table resource="container" newRoute="dns.new" newTranslationKey="nav.containers.addDns"}}
{{#if rows.length}}
<section class="pl-0 pr-0">
{{#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")}}
<tr class="group-row">
{{#if inst.ref}}
<td colspan={{sub sortable.fullColspan 2}}>
{{stack-row model=inst.ref}}
</td>
<td>
{{upgrade-btn classNames="btn-sm" model=inst.ref}}
</td>
<td data-title="{{dt.actions}}" class="actions">
{{action-menu model=inst.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 'dnsPage.noMatch'}}</td></tr>
{{else if (eq kind "norows")}}
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'dnsPage.noData'}}</td></tr>
{{/if}}
{{/sortable-table}}
</section>
{{else}}
{{empty-table resource="container" newRoute="dns.new" newTranslationKey="nav.containers.addDns"}}
{{/if}}
{{/if}}

View File

@ -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}}
<section class="pl-0 pr-0">
{{#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")}}
<tr class="group-row">
{{#if inst.ref}}
<td colspan={{sub sortable.fullColspan 2}}>
{{stack-row model=inst.ref}}
</td>
<td>
{{upgrade-btn classNames="btn-sm" model=inst.ref}}
</td>
<td data-title="{{dt.actions}}" class="actions">
{{action-menu model=inst.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 'volumesPage.noMatch'}}</td></tr>
{{/if}}
{{/sortable-table}}
</section>
{{else}}
{{empty-table resource="container" newRoute="volumes.new" newTranslationKey="nav.containers.addVolume"}}
{{#if rows.length}}
<section class="pl-0 pr-0">
{{#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")}}
<tr class="group-row">
{{#if inst.ref}}
<td colspan={{sub sortable.fullColspan 2}}>
{{stack-row model=inst.ref}}
</td>
<td>
{{upgrade-btn classNames="btn-sm" model=inst.ref}}
</td>
<td data-title="{{dt.actions}}" class="actions">
{{action-menu model=inst.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 'volumesPage.noMatch'}}</td></tr>
{{/if}}
{{/sortable-table}}
</section>
{{else}}
{{empty-table resource="container" newRoute="volumes.new" newTranslationKey="nav.containers.addVolume"}}
{{/if}}
{{/if}}