fixes on sort

This commit is contained in:
anhefti 2019-07-18 17:02:46 +02:00
parent 043f6b72e5
commit 565e048df9
3 changed files with 11 additions and 9 deletions

View file

@ -133,7 +133,6 @@ public final class ClientConnectionTable {
} }
public void updateGUI() { public void updateGUI() {
fillTable(); fillTable();
if (this.needsSort) { if (this.needsSort) {
sortTable(); sortTable();
@ -171,12 +170,10 @@ public final class ClientConnectionTable {
while (this.tableMapping.size() > this.table.getItemCount()) { while (this.tableMapping.size() > this.table.getItemCount()) {
new TableItem(this.table, SWT.NONE); new TableItem(this.table, SWT.NONE);
} }
this.needsSort = true;
} else if (this.tableMapping.size() < this.table.getItemCount()) { } else if (this.tableMapping.size() < this.table.getItemCount()) {
while (this.tableMapping.size() < this.table.getItemCount()) { while (this.tableMapping.size() < this.table.getItemCount()) {
this.table.getItem(0).dispose(); this.table.getItem(0).dispose();
} }
this.needsSort = true;
} }
} }
@ -240,9 +237,11 @@ public final class ClientConnectionTable {
} }
void updateIndicatorValues(final TableItem tableItem) { void updateIndicatorValues(final TableItem tableItem) {
if (this.connectionData == null) {
return;
}
final boolean fillEmpty = (this.connectionData == null || final boolean fillEmpty = this.connectionData.clientConnection.status != ConnectionStatus.ESTABLISHED;
this.connectionData.clientConnection.status != ConnectionStatus.ESTABLISHED);
for (int i = 0; i < this.connectionData.indicatorValues.size(); i++) { for (int i = 0; i < this.connectionData.indicatorValues.size(); i++) {
final IndicatorValue indicatorValue = this.connectionData.indicatorValues.get(i); final IndicatorValue indicatorValue = this.connectionData.indicatorValues.get(i);
@ -334,9 +333,13 @@ public final class ClientConnectionTable {
this.changed = this.connectionData == null || this.changed = this.connectionData == null ||
!this.connectionData.dataEquals(connectionData); !this.connectionData.dataEquals(connectionData);
ClientConnectionTable.this.needsSort = this.connectionData == null || final boolean statusChanged = this.connectionData == null ||
this.connectionData.clientConnection.status != connectionData.clientConnection.status; this.connectionData.clientConnection.status != connectionData.clientConnection.status;
if (statusChanged) {
ClientConnectionTable.this.needsSort = true;
}
if (this.thresholdColorIndices == null) { if (this.thresholdColorIndices == null) {
this.thresholdColorIndices = new int[connectionData.indicatorValues.size()]; this.thresholdColorIndices = new int[connectionData.indicatorValues.size()];
} }

View file

@ -23,7 +23,6 @@ sebserver.webservice.api.exam.endpoint=/exam-api
sebserver.webservice.api.exam.endpoint.discovery=${sebserver.webservice.api.exam.endpoint}/discovery sebserver.webservice.api.exam.endpoint.discovery=${sebserver.webservice.api.exam.endpoint}/discovery
sebserver.webservice.api.exam.endpoint.v1=${sebserver.webservice.api.exam.endpoint}/v1 sebserver.webservice.api.exam.endpoint.v1=${sebserver.webservice.api.exam.endpoint}/v1
sebserver.webservice.api.exam.accessTokenValiditySeconds=86400 sebserver.webservice.api.exam.accessTokenValiditySeconds=86400
#sebserver.webservice.api.redirect.unauthorized=${sebserver.webservice.http.scheme}://${sebserver.webservice.http.server.name}:${server.port}${sebserver.gui.entrypoint}
sebserver.webservice.api.pagination.maxPageSize=500 sebserver.webservice.api.pagination.maxPageSize=500
# comma separated list of known possible OpenEdX API access token request endpoints # comma separated list of known possible OpenEdX API access token request endpoints
sebserver.webservice.lms.openedx.api.token.request.paths=/oauth2/access_token sebserver.webservice.lms.openedx.api.token.request.paths=/oauth2/access_token
@ -34,7 +33,7 @@ management.endpoints.web.exposure.include=logfile,loggers
sebserver.gui.entrypoint=/gui sebserver.gui.entrypoint=/gui
sebserver.gui.webservice.protocol=http sebserver.gui.webservice.protocol=http
sebserver.gui.webservice.address=0.0.0.0 sebserver.gui.webservice.address=${server.address}
sebserver.gui.webservice.port=8080 sebserver.gui.webservice.port=8080
sebserver.gui.webservice.apipath=/admin-api/v1 sebserver.gui.webservice.apipath=/admin-api/v1
sebserver.gui.theme=css/sebserver.css sebserver.gui.theme=css/sebserver.css

View file

@ -5,6 +5,6 @@ spring.mandatory-file-encoding=UTF-8
spring.http.encoding.charset=UTF-8 spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true spring.http.encoding.enabled=true
sebserver.version=0.3.1 pre-beta sebserver.version=0.3.2 pre-beta
sebserver.supported.languages=en,de sebserver.supported.languages=en,de