SEBSERV-391 and SEBSERV-397 and SEBSERV-335

This commit is contained in:
anhefti 2023-03-09 10:31:09 +01:00
parent e985e7aa82
commit d35fbed73d
5 changed files with 19 additions and 27 deletions

View file

@ -654,7 +654,7 @@ public class ResourceService {
return localizedNames.get(status) + grantMissingText;
}
} else if (monitoringEntry.grantDenied()) {
return grantDeniedText;
return localizedNames.get(status) + grantDeniedText;
}
}

View file

@ -577,6 +577,17 @@ public final class ClientConnectionTable implements FullPageMonitoringGUIUpdate
tableItem.setForeground(index, statusTextColor);
}
private void updateIndicatorValues(final TableItem tableItem) {
if (this.monitoringData == null || this.indicatorWeights == null) {
return;
}
this.monitoringData.indicatorVals
.entrySet()
.stream()
.forEach(indicatorUpdate(tableItem));
}
private Consumer<Map.Entry<Long, String>> indicatorUpdate(final TableItem tableItem) {
return entry -> {
final Long id = entry.getKey();
@ -608,17 +619,6 @@ public final class ClientConnectionTable implements FullPageMonitoringGUIUpdate
};
}
private void updateIndicatorValues(final TableItem tableItem) {
if (this.monitoringData == null || this.indicatorWeights == null) {
return;
}
this.monitoringData.indicatorVals
.entrySet()
.stream()
.forEach(indicatorUpdate(tableItem));
}
@Override
public int compareTo(final UpdatableTableItem other) {
return Comparator.comparingInt(UpdatableTableItem::notificationWeight)
@ -709,6 +709,9 @@ public final class ClientConnectionTable implements FullPageMonitoringGUIUpdate
if (this.indicatorWeights == null) {
this.indicatorWeights = new int[ClientConnectionTable.this.indicatorMapping.size()];
for (int i = 0; i < this.indicatorWeights.length; i++) {
this.indicatorWeights[i] = -1;
}
}
if (this.indicatorValueChanged) {
updateIndicatorWeight();
@ -743,6 +746,7 @@ public final class ClientConnectionTable implements FullPageMonitoringGUIUpdate
final int indicatorWeight = IndicatorData.getWeight(
indicatorData,
IndicatorValue.getFromDisplayValue(displayValue));
if (this.indicatorWeights[indicatorData.index] != indicatorWeight) {
ClientConnectionTable.this.needsSort = true;
this.thresholdsWeight -= (indicatorData.indicator.type.inverse)
@ -761,7 +765,6 @@ public final class ClientConnectionTable implements FullPageMonitoringGUIUpdate
private ClientConnectionTable getOuterType() {
return ClientConnectionTable.this;
}
}
private void fetchStaticClientConnectionData() {

View file

@ -799,7 +799,7 @@ public class ClientConnectionDAOImpl implements ClientConnectionDAO {
SqlBuilder.isEqualTo(examId))
.and(
ClientConnectionRecordDynamicSqlSupport.status,
SqlBuilder.isIn(ClientConnection.SECURE_STATES))
SqlBuilder.isIn(ClientConnection.SECURE_CHECK_STATES))
.and(
ClientConnectionRecordDynamicSqlSupport.ask,
SqlBuilder.isEqualTo(signatureHash))

View file

@ -179,17 +179,6 @@ public class SecurityKeyServiceImpl implements SecurityKeyService {
return Cryptor
.decryptASK(appSignatureKey, connectionToken, salt)
// .decrypt(appSignatureKey + salt, connectionToken)
// .onErrorDo(error -> {
//
// log.warn(
// "Failed to decrypt ASK with added salt value. Try to decrypt without added salt. Error: {}",
// error.getMessage());
//
// return Cryptor
// .decrypt(appSignatureKey, connectionToken)
// .getOrThrow();
// })
.map(signature -> createSignatureHash(signature));
}

View file

@ -2223,7 +2223,7 @@ sebserver.monitoring.exam.connection.notification.type.RAISE_HAND=Raise Hand
sebserver.monitoring.exam.connection.notificationlist.type=Notification Type
sebserver.monitoring.exam.connection.status.UNDEFINED=Undefined
sebserver.monitoring.exam.connection.status.CONNECTION_REQUESTED=Connection Requested
sebserver.monitoring.exam.connection.status.CONNECTION_REQUESTED=Connecting
sebserver.monitoring.exam.connection.status.AUTHENTICATED=Authenticated
sebserver.monitoring.exam.connection.status.ACTIVE=Active
sebserver.monitoring.exam.connection.status.CLOSED=Closed
@ -2231,7 +2231,7 @@ sebserver.monitoring.exam.connection.status.ABORTED=Aborted
sebserver.monitoring.exam.connection.status.DISABLED=Canceled
sebserver.monitoring.exam.connection.status.MISSING_PING=Missing
sebserver.monitoring.exam.connection.status.MISSING_GRANT=&nbsp;&nbsp;(No ASK Grant)
sebserver.monitoring.exam.connection.status.GRANT_DENIED=ASK Grant Denied
sebserver.monitoring.exam.connection.status.GRANT_DENIED=&nbsp;-&nbsp;ASK Grant Denied
sebserver.monitoring.exam.connection.info=SEB Version: {0}<br/>Operating System: {1}<br/>IP Address: {2}