1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-20 05:49:40 +02:00

feat(containers): add column visibility dropdown in containers view (#1977)

This commit is contained in:
Parag Jayant Datar 2018-07-05 01:24:53 -06:00 committed by Anthony Lapenna
parent 863d917acc
commit 50020dae89
5 changed files with 146 additions and 16 deletions

View file

@ -34,6 +34,54 @@ function (PaginationService, DatatableService, EndpointProvider) {
}
};
this.columnVisibility = {
state: {
open: false
},
columns: {
state: {
label: 'State',
display: true
},
actions: {
label: 'Quick Actions',
display: true
},
stack: {
label: 'Stack',
display: true
},
image: {
label: 'Image',
display: true
},
created: {
label: 'Created',
display: true
},
ip: {
label: 'IP Address',
display: true
},
host: {
label: 'Host',
display: true
},
ports: {
label: 'Published Ports',
display: true
},
ownership: {
label: 'Ownership',
display: true
}
}
};
this.onColumnVisibilityChange = function() {
DatatableService.setColumnVisibilitySettings(this.tableKey, this.columnVisibility);
};
this.changeOrderBy = function(orderField) {
this.state.reverseOrder = this.state.orderBy === orderField ? !this.state.reverseOrder : false;
this.state.orderBy = orderField;
@ -181,6 +229,12 @@ function (PaginationService, DatatableService, EndpointProvider) {
this.settings = storedSettings;
}
this.settings.open = false;
var storedColumnVisibility = DatatableService.getColumnVisibilitySettings(this.tableKey);
if (storedColumnVisibility !== null) {
this.columnVisibility = storedColumnVisibility;
}
this.columnVisibility.state.open = false;
};
function setDefaults(ctrl) {