Changes for new sortable table features

This commit is contained in:
Westly Wright 2017-03-06 15:52:07 -07:00
parent 66c0971b0c
commit 17cd563a12
No known key found for this signature in database
GPG Key ID: 90C6F54EB2513CAE
22 changed files with 119 additions and 97 deletions

View File

@ -11,19 +11,19 @@ export default Ember.Controller.extend(FilterState, {
translationKey: 'generic.state', translationKey: 'generic.state',
name: 'state', name: 'state',
sort: ['state'], sort: ['state'],
width: '125px' width: '125'
}, },
{ {
translationKey: 'generic.id', translationKey: 'generic.id',
name: 'id', name: 'id',
sort: ['id'], sort: ['id'],
width: '120px' width: '120'
}, },
{ {
translationKey: 'accountsPage.index.table.kind', translationKey: 'accountsPage.index.table.kind',
name: 'kind', name: 'kind',
sort: ['kind'], sort: ['kind'],
width: '120px' width: '120'
}, },
{ {
translationKey: 'accountsPage.index.table.username', translationKey: 'accountsPage.index.table.username',
@ -37,7 +37,7 @@ export default Ember.Controller.extend(FilterState, {
}, },
{ {
isActions: true, isActions: true,
width: '75px', width: '75',
}, },
], ],

View File

@ -11,14 +11,13 @@
classNames="lacsso grid sortable-table" classNames="lacsso grid sortable-table"
bulkActions=false bulkActions=false
paging=false paging=false
fullRows=true
search=false search=false
sortBy=sortBy sortBy=sortBy
headers=headers headers=headers
body=filteredByKind body=filteredByKind
as |row kind| as |sortable kind row dt|
}} }}
{{log 'row' row}}
{{log 'kind' kind}}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
{{account-row model=row isLocal=isLocal}} {{account-row model=row isLocal=isLocal}}
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}

View File

@ -3,11 +3,10 @@ import C from 'ui/utils/constants';
export default Ember.Controller.extend({ export default Ember.Controller.extend({
application : Ember.inject.controller(), application : Ember.inject.controller(),
prefs: Ember.inject.service(), prefs: Ember.inject.service(),
queryParams : ['sortBy', 'sortOrder', 'eventType', 'resourceType', 'resourceId', 'clientIp', 'authType'], queryParams : ['sortBy', 'sortOrder', 'eventType', 'resourceType', 'resourceId', 'clientIp', 'authType'],
resourceTypeAndId : null, resourceTypeAndId : null,
modalService: Ember.inject.service('modal'), modalService: Ember.inject.service('modal'),
headers: [ headers: [
{ {
@ -15,7 +14,7 @@ export default Ember.Controller.extend({
name: 'id', name: 'id',
sort: ['id'], sort: ['id'],
classNames: 'pl-10', classNames: 'pl-10',
width: '115px' width: '115'
}, },
{ {
translationKey: 'auditLogsPage.table.eventType', translationKey: 'auditLogsPage.table.eventType',
@ -40,7 +39,7 @@ export default Ember.Controller.extend({
name: 'accountId', name: 'accountId',
sort: ['accountId'], sort: ['accountId'],
classNames: 'pl-10', classNames: 'pl-10',
width: '125px' width: '125'
}, },
{ {
translationKey: 'auditLogsPage.table.resourceTypeId', translationKey: 'auditLogsPage.table.resourceTypeId',
@ -53,7 +52,7 @@ export default Ember.Controller.extend({
name: 'authenticatedAsIdentityId', name: 'authenticatedAsIdentityId',
sort: ['authenticatedAsIdentityId'], sort: ['authenticatedAsIdentityId'],
classNames: 'pl-10', classNames: 'pl-10',
width: '175px' width: '175'
}, },
], ],

View File

@ -58,7 +58,7 @@
descending=descending descending=descending
headers=headers headers=headers
body=model.auditLog body=model.auditLog
as |log kind| as |sortable kind log dt|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
<td data-title="{{t 'auditLogsPage.table.time'}}:">{{date-from-now log.created}}</td> <td data-title="{{t 'auditLogsPage.table.time'}}:">{{date-from-now log.created}}</td>

View File

@ -8,14 +8,14 @@
<section class="instances"> <section class="instances">
{{#sortable-table {{#sortable-table
classNames="lacsso grid sortable-table" classNames="lacsso grid sortable-table"
bulkActions=false bulkActions=false
paging=false paging=false
search=false search=false
sortBy=sortBy sortBy=sortBy
headers=headers headers=headers
body=model body=model
as |member kind| as |sortable kind member dt|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
<td>{{member.uuid}}</td> <td>{{member.uuid}}</td>
@ -24,7 +24,9 @@
<td>{{#if member.clustered}}{{t 'generic.yess'}}{{else}}{{t 'generic.noo'}}{{/if}}</td> <td>{{#if member.clustered}}{{t 'generic.yess'}}{{else}}{{t 'generic.noo'}}{{/if}}</td>
<td>{{date-str member.heartbeat}}</td> <td>{{date-str member.heartbeat}}</td>
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="{{headers.length}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'processesPage.summary.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'processesPage.summary.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}
</section> </section>

View File

@ -32,8 +32,12 @@
{{/if}} {{/if}}
</td> </td>
{{else if (eq kind "nomatch")}} {{else if (eq kind "nomatch")}}
<td colspan="{{headers.length}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'processesPage.pools.noMatch'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'processesPage.pools.noMatch'}}</td>
</tr>
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="{{headers.length}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'processesPage.pools.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'processesPage.pools.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}

View File

@ -18,19 +18,21 @@
<section> <section>
<p>{{t 'hookPage.receiver.content' appName=settings.appName}}</p> <p>{{t 'hookPage.receiver.content' appName=settings.appName}}</p>
{{#sortable-table {{#sortable-table
classNames="grid fixed r-mb0 r-mt10 sortable-table" classNames="grid fixed r-mb0 r-mt10 sortable-table"
bulkActions=false bulkActions=false
paging=false paging=false
search=false search=false
sortBy=sortBy sortBy=sortBy
headers=headers headers=headers
body=model.receivers body=model.receivers
as |row kind| as |sortable kind row|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
{{hook-row model=row}} {{hook-row model=row}}
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'hookPage.receiver.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'hookPage.receiver.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}
</section> </section>

View File

@ -26,12 +26,14 @@
sortBy=sortBy sortBy=sortBy
headers=headers headers=headers
body=model.account body=model.account
as |key kind| as |sortable kind key|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
{{apikey-row model=key}} {{apikey-row model=key}}
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'apiPage.account.table.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'apiPage.account.table.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}
</section> </section>
@ -68,12 +70,14 @@
sortBy=sortBy sortBy=sortBy
headers=headers headers=headers
body=model.environment body=model.environment
as |key kind| as |sortable kind key|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
{{apikey-row model=key}} {{apikey-row model=key}}
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'apiPage.account.table.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'apiPage.account.table.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}
</section> </section>

View File

@ -7,14 +7,14 @@
<section> <section>
{{#sortable-table {{#sortable-table
classNames="grid fixed mb-0 sortable-table" classNames="grid fixed mb-0 sortable-table"
bulkActions=false bulkActions=false
paging=false paging=false
search=false search=false
sortBy=sortBy sortBy=sortBy
headers=headers headers=headers
body=model.all body=model.all
as |target kind| as |sortable kind target|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
<td class="state"> <td class="state">
@ -40,7 +40,9 @@
{{action-menu model=target}} {{action-menu model=target}}
</td> </td>
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'apiPage.account.table.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'apiPage.account.table.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}
</section> </section>

View File

@ -15,12 +15,14 @@
sortBy=sortBy sortBy=sortBy
headers=headers headers=headers
body=model body=model
as |cert kind| as |sortable kind cert|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
{{certificate-row model=cert}} {{certificate-row model=cert}}
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'certificatesPage.index.table.body.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'certificatesPage.index.table.body.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}
</section> </section>

View File

@ -4,5 +4,5 @@ export default Ember.Component.extend({
model: null, model: null,
isLocal: null, isLocal: null,
tagName: '', tagName: 'TR',
}); });

View File

@ -2,5 +2,5 @@ import Ember from 'ember';
export default Ember.Component.extend({ export default Ember.Component.extend({
model: null, model: null,
tagName: '', tagName: 'TR',
}); });

View File

@ -1,19 +1,21 @@
{{#sortable-table {{#sortable-table
classNames="grid fixed mb-0 sortable-table" classNames="grid fixed mb-0 sortable-table"
bulkActions=false bulkActions=false
paging=false paging=false
search=false search=false
sortBy=sortBy sortBy=sortBy
descending=descending descending=descending
headers=headers headers=headers
body=labelArray body=labelArray
as |label kind| as |sortable kind label|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
{{#if showKind}}<td data-title="{{t 'labelsSection.kind'}}:" class="valign-top">{{uc-first label.type}}</td>{{/if}} {{#if showKind}}<td data-title="{{t 'labelsSection.kind'}}:" class="valign-top">{{uc-first label.type}}</td>{{/if}}
<td data-title="{{t 'labelsSection.key'}}:" class="force-wrap valign-top">{{label.key}}</td> <td data-title="{{t 'labelsSection.key'}}:" class="force-wrap valign-top">{{label.key}}</td>
<td data-title="{{t 'labelsSection.value'}}:" class="force-wrap valign-top">{{pretty-json value=label.value}}</td> <td data-title="{{t 'labelsSection.value'}}:" class="force-wrap valign-top">{{pretty-json value=label.value}}</td>
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="headers.length" class="text-center text-muted">{{t 'labelsSection.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'labelsSection.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}

View File

@ -22,12 +22,14 @@
descending=descending descending=descending
headers=headers headers=headers
body=model body=model
as |p kind| as |sortable kind p|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
{{project-row model=p}} {{project-row model=p}}
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'labelsSection.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'labelsSection.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}
</section> </section>

View File

@ -10,20 +10,22 @@
<section> <section>
{{#sortable-table {{#sortable-table
classNames="grid fixed mb-0 sortable-table" classNames="grid fixed mb-0 sortable-table"
bulkActions=false bulkActions=false
paging=false paging=false
search=false search=false
sortBy=sortBy sortBy=sortBy
descending=descending descending=descending
headers=headers headers=headers
body=model body=model
as |row kind| as |sortable kind row|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
{{project-template-row model=row}} {{project-template-row model=row}}
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="5" class="text-center text-muted">{{t 'projectList.indexTemplate.table.body.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'projectList.indexTemplate.table.body.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}
</section> </section>

View File

@ -2,5 +2,5 @@ import Ember from 'ember';
export default Ember.Component.extend({ export default Ember.Component.extend({
model: null, model: null,
tagName: '', tagName: 'TR',
}); });

View File

@ -2,5 +2,5 @@ import Ember from 'ember';
export default Ember.Component.extend({ export default Ember.Component.extend({
model: null, model: null,
tagName: '', tagName: 'TR',
}); });

View File

@ -2,12 +2,6 @@ import Ember from 'ember';
export default Ember.Controller.extend({ export default Ember.Controller.extend({
sortBy: 'ip', sortBy: 'ip',
sorts: {
ip: ['ipAddress','port'],
port: ['port','ipAddress','instanceId'],
service: ['service.displayName','port','ipAddress'],
container: ['instance.displayName','port','ipAddress'],
},
headers: [ headers: [
{ {
name: 'ip', name: 'ip',

View File

@ -7,7 +7,7 @@
descending=descending descending=descending
headers=headers headers=headers
body=model.displayEndpoints body=model.displayEndpoints
as |port kind| as |sortable kind port|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
<td>{{port.ipAddress}}</td> <td>{{port.ipAddress}}</td>
@ -33,6 +33,8 @@
{{/if}} {{/if}}
</td> </td>
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'hostsPage.hostPage.portsTab.table.body.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'hostsPage.hostPage.portsTab.table.body.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}

View File

@ -7,11 +7,13 @@
descending=descending descending=descending
headers=headers headers=headers
body=nonRootVolumes body=nonRootVolumes
as |volume kind| as |sortable kind volume|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
{{volume-row model=volume}} {{volume-row model=volume}}
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="{{header.length}}" class="text-center text-muted">{{t 'hostsPage.hostPage.storageTab.table.body.noData'}}</td> <tr>
<td colspan="{{header.length}}" class="text-center text-muted">{{t 'hostsPage.hostPage.storageTab.table.body.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}

View File

@ -8,19 +8,21 @@
<section class="instances"> <section class="instances">
{{#sortable-table {{#sortable-table
classNames="grid fixed mb-0 sortable-table" classNames="grid fixed mb-0 sortable-table"
bulkActions=false bulkActions=false
paging=false paging=false
search=false search=false
sortBy=sortBy sortBy=sortBy
headers=headers headers=headers
body=model body=model
as |registry kind| as |sortable kind registry|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
{{registry-row model=registry}} {{registry-row model=registry}}
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'registriesPage.index.table.body.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'registriesPage.index.table.body.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}
</section> </section>

View File

@ -6,7 +6,7 @@
sortBy=sortBy sortBy=sortBy
headers=headers headers=headers
body=model.instances body=model.instances
as |container kind| as |sortable kind container|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
{{container-row {{container-row
@ -21,6 +21,8 @@
storageMax=storageMax storageMax=storageMax
networkMax=networkMax}} networkMax=networkMax}}
{{else if (eq kind "norows")}} {{else if (eq kind "norows")}}
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'servicePage.containersTab.table.body.noData'}}</td> <tr>
<td colspan="{{headers.length}}" class="text-center text-muted">{{t 'servicePage.containersTab.table.body.noData'}}</td>
</tr>
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}