SEBSERV-376 finished up

This commit is contained in:
anhefti 2023-02-07 17:20:11 +01:00
parent e85f2acfd2
commit 4bc0a2da06
5 changed files with 31 additions and 9 deletions

View file

@ -115,7 +115,8 @@ public final class ClientConnection implements GrantEntity {
//@JsonProperty(Domain.CLIENT_CONNECTION.ATTR_VDI_PAIR_TOKEN)
public final String vdiPairToken;
@JsonIgnore
//@JsonIgnore
@JsonProperty(Domain.CLIENT_CONNECTION.ATTR_CLIENT_ADDRESS)
public final String clientAddress;
@JsonIgnore
public final Long remoteProctoringRoomId;
@ -127,11 +128,13 @@ public final class ClientConnection implements GrantEntity {
public final Long updateTime;
@JsonIgnore
public final Boolean remoteProctoringRoomUpdate;
@JsonIgnore
//@JsonIgnore
@JsonProperty(Domain.CLIENT_CONNECTION.ATTR_CLIENT_OS_NAME)
public final String sebOSName;
@JsonIgnore
public final String sebMachineName;
@JsonIgnore
//@JsonIgnore
@JsonProperty(Domain.CLIENT_CONNECTION.ATTR_CLIENT_VERSION)
public final String sebVersion;
@JsonIgnore
public final String ask;
@ -148,6 +151,9 @@ public final class ClientConnection implements GrantEntity {
@JsonProperty(Domain.CLIENT_CONNECTION.ATTR_VDI) final Boolean vdi,
@JsonProperty(Domain.CLIENT_CONNECTION.ATTR_VDI_PAIR_TOKEN) final String vdiPairToken,
@JsonProperty(Domain.CLIENT_CONNECTION.ATTR_REMOTE_PROCTORING_ROOM_ID) final Long remoteProctoringRoomId,
@JsonProperty(Domain.CLIENT_CONNECTION.ATTR_CLIENT_ADDRESS) final String clientAddress,
@JsonProperty(Domain.CLIENT_CONNECTION.ATTR_CLIENT_OS_NAME) final String sebOSName,
@JsonProperty(Domain.CLIENT_CONNECTION.ATTR_CLIENT_VERSION) final String sebVersion,
@JsonProperty(Domain.CLIENT_CONNECTION.ATTR_SECURITY_CHECK_GRANTED) final Boolean securityCheckGranted,
@JsonProperty(Domain.CLIENT_CONNECTION.ATTR_CLIENT_VERSION_GRANTED) final Boolean clientVersionGranted) {
@ -166,10 +172,10 @@ public final class ClientConnection implements GrantEntity {
this.remoteProctoringRoomId = remoteProctoringRoomId;
this.remoteProctoringRoomUpdate = false;
this.clientAddress = Constants.EMPTY_NOTE;
this.sebOSName = Constants.EMPTY_NOTE;
this.clientAddress = clientAddress;
this.sebOSName = sebOSName;
this.sebMachineName = Constants.EMPTY_NOTE;
this.sebVersion = Constants.EMPTY_NOTE;
this.sebVersion = sebVersion;
this.securityCheckGranted = securityCheckGranted;
this.ask = null;
this.clientVersionGranted = clientVersionGranted;

View file

@ -32,6 +32,7 @@ import ch.ethz.seb.sebserver.gbl.model.session.ClientConnection.ConnectionStatus
import ch.ethz.seb.sebserver.gbl.model.session.ClientConnectionData;
import ch.ethz.seb.sebserver.gbl.model.session.ClientNotification;
import ch.ethz.seb.sebserver.gbl.monitoring.IndicatorValue;
import ch.ethz.seb.sebserver.gbl.util.Utils;
import ch.ethz.seb.sebserver.gui.content.action.ActionDefinition;
import ch.ethz.seb.sebserver.gui.form.Form;
import ch.ethz.seb.sebserver.gui.form.FormBuilder;
@ -132,7 +133,8 @@ public class ClientConnectionDetails implements MonitoringEntry {
.addField(FormBuilder.text(
ClientConnection.ATTR_INFO,
CONNECTION_INFO_TEXT_KEY,
Constants.EMPTY_NOTE))
Constants.EMPTY_NOTE)
.asArea(50))
.withDefaultSpanInput(3)
.addField(FormBuilder.text(
Domain.CLIENT_CONNECTION.ATTR_STATUS,
@ -251,7 +253,7 @@ public class ClientConnectionDetails implements MonitoringEntry {
form.setFieldValue(
ClientConnection.ATTR_INFO,
this.connectionData.clientConnection.info);
getConnectionInfo(this.connectionData.clientConnection));
if (this.hasClientGroups
&& Constants.EMPTY_NOTE.equals(form.getFieldValue(ClientConnectionData.ATTR_CLIENT_GROUPS))) {
@ -317,6 +319,14 @@ public class ClientConnectionDetails implements MonitoringEntry {
}
}
private String getConnectionInfo(final ClientConnection clientConnection) {
return Utils.formatLineBreaks(this.pageService.getI18nSupport().getText(
"sebserver.monitoring.exam.connection.info", "--",
clientConnection.getSebVersion(),
clientConnection.getSebOSName(),
clientConnection.clientAddress));
}
private void reloadPage(final PageContext pageContext) {
final PageAction pageReloadAction = this.pageService.pageActionBuilder(pageContext)
.newAction(ActionDefinition.MONITOR_EXAM_CLIENT_CONNECTION)

View file

@ -2218,7 +2218,8 @@ sebserver.monitoring.exam.connection.status.DISABLED=Canceled
sebserver.monitoring.exam.connection.status.MISSING_PING=Missing
sebserver.monitoring.exam.connection.status.MISSING_GRANT=  (No ASK Grant)
sebserver.monitoring.exam.connection.status.GRANT_DENIED=ASK Grant Denied
sebserver.monitoring.exam.connection.status.SEB_VERSION_DENIED=SEB Version Invalid
sebserver.monitoring.exam.connection.info=SEB Version: {0}<br/>Operating System: {1}<br/>IP Address: {2}
sebserver.monitoring.lock.title=Lock SEB Clients
sebserver.monitoring.lock.form.info.title=Info

View file

@ -99,6 +99,9 @@ public class ExamProctoringRoomServiceTest extends AdministrationAPIIntegrationT
false,
"",
null,
"",
null,
null,
false, false));
assertFalse(createNew.hasError());
}

View file

@ -47,6 +47,8 @@ public class SEBClientInstructionServiceTest extends AdministrationAPIIntegratio
if (cc == null) {
this.clientConnectionDAO.createNew(new ClientConnection(
null, 1L, 2L, ConnectionStatus.ACTIVE, "testToken", "user1", "0.0.0.0", false, null, null,
"0.0.0.0",
null, null,
false, false))
.getOrThrow();
}