SEBSERV-151 finished up
This commit is contained in:
parent
3cbfd80206
commit
a979d4c13b
4 changed files with 76 additions and 46 deletions
|
@ -775,6 +775,12 @@ public enum ActionDefinition {
|
||||||
ImageIcon.SEND_QUIT,
|
ImageIcon.SEND_QUIT,
|
||||||
PageStateDefinitionImpl.MONITORING_CLIENT_CONNECTION,
|
PageStateDefinitionImpl.MONITORING_CLIENT_CONNECTION,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
|
MONITOR_EXAM_CLIENT_CONNECTION_LOCK(
|
||||||
|
new LocTextKey("sebserver.monitoring.exam.connection.action.instruction.lock"),
|
||||||
|
ImageIcon.LOCK,
|
||||||
|
PageStateDefinitionImpl.MONITORING_CLIENT_CONNECTION,
|
||||||
|
ActionCategory.FORM),
|
||||||
|
|
||||||
MONITOR_EXAM_CLIENT_CONNECTION_PROCTORING(
|
MONITOR_EXAM_CLIENT_CONNECTION_PROCTORING(
|
||||||
new LocTextKey("sebserver.monitoring.exam.connection.action.proctoring"),
|
new LocTextKey("sebserver.monitoring.exam.connection.action.proctoring"),
|
||||||
ImageIcon.PROCTOR_SINGLE,
|
ImageIcon.PROCTOR_SINGLE,
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
|
|
||||||
package ch.ethz.seb.sebserver.gui.content.monitoring;
|
package ch.ethz.seb.sebserver.gui.content.monitoring;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.function.BooleanSupplier;
|
import java.util.function.BooleanSupplier;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
@ -119,6 +121,7 @@ public class MonitoringClientConnection implements TemplateComposer {
|
||||||
private final I18nSupport i18nSupport;
|
private final I18nSupport i18nSupport;
|
||||||
private final InstructionProcessor instructionProcessor;
|
private final InstructionProcessor instructionProcessor;
|
||||||
private final SEBClientEventDetailsPopup sebClientLogDetailsPopup;
|
private final SEBClientEventDetailsPopup sebClientLogDetailsPopup;
|
||||||
|
private final SEBSendLockPopup sebSendLockPopup;
|
||||||
private final MonitoringProctoringService monitoringProctoringService;
|
private final MonitoringProctoringService monitoringProctoringService;
|
||||||
private final long pollInterval;
|
private final long pollInterval;
|
||||||
private final int pageSize;
|
private final int pageSize;
|
||||||
|
@ -133,6 +136,7 @@ public class MonitoringClientConnection implements TemplateComposer {
|
||||||
final InstructionProcessor instructionProcessor,
|
final InstructionProcessor instructionProcessor,
|
||||||
final SEBClientEventDetailsPopup sebClientLogDetailsPopup,
|
final SEBClientEventDetailsPopup sebClientLogDetailsPopup,
|
||||||
final MonitoringProctoringService monitoringProctoringService,
|
final MonitoringProctoringService monitoringProctoringService,
|
||||||
|
final SEBSendLockPopup sebSendLockPopup,
|
||||||
@Value("${sebserver.gui.webservice.poll-interval:500}") final long pollInterval,
|
@Value("${sebserver.gui.webservice.poll-interval:500}") final long pollInterval,
|
||||||
@Value("${sebserver.gui.list.page.size:20}") final Integer pageSize) {
|
@Value("${sebserver.gui.list.page.size:20}") final Integer pageSize) {
|
||||||
|
|
||||||
|
@ -144,6 +148,7 @@ public class MonitoringClientConnection implements TemplateComposer {
|
||||||
this.monitoringProctoringService = monitoringProctoringService;
|
this.monitoringProctoringService = monitoringProctoringService;
|
||||||
this.pollInterval = pollInterval;
|
this.pollInterval = pollInterval;
|
||||||
this.sebClientLogDetailsPopup = sebClientLogDetailsPopup;
|
this.sebClientLogDetailsPopup = sebClientLogDetailsPopup;
|
||||||
|
this.sebSendLockPopup = sebSendLockPopup;
|
||||||
this.pageSize = pageSize;
|
this.pageSize = pageSize;
|
||||||
|
|
||||||
this.typeFilter = new TableFilterAttribute(
|
this.typeFilter = new TableFilterAttribute(
|
||||||
|
@ -371,6 +376,14 @@ public class MonitoringClientConnection implements TemplateComposer {
|
||||||
return action;
|
return action;
|
||||||
})
|
})
|
||||||
.noEventPropagation()
|
.noEventPropagation()
|
||||||
|
.publishIf(() -> isExamSupporter.getAsBoolean() &&
|
||||||
|
connectionData.clientConnection.status.clientActiveStatus)
|
||||||
|
|
||||||
|
.newAction(ActionDefinition.MONITOR_EXAM_CLIENT_CONNECTION_LOCK)
|
||||||
|
.withEntityKey(parentEntityKey)
|
||||||
|
.withExec(action -> this.sebSendLockPopup.show(action,
|
||||||
|
some -> new HashSet<>(Arrays.asList(connectionToken))))
|
||||||
|
.noEventPropagation()
|
||||||
.publishIf(() -> isExamSupporter.getAsBoolean() &&
|
.publishIf(() -> isExamSupporter.getAsBoolean() &&
|
||||||
connectionData.clientConnection.status.clientActiveStatus);
|
connectionData.clientConnection.status.clientActiveStatus);
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,8 @@ public class SEBSendLockPopup {
|
||||||
final PageAction action,
|
final PageAction action,
|
||||||
final Function<Predicate<ClientConnection>, Set<String>> selectionFunction) {
|
final Function<Predicate<ClientConnection>, Set<String>> selectionFunction) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
final PageContext pageContext = action.pageContext();
|
final PageContext pageContext = action.pageContext();
|
||||||
final Set<String> selection = selectionFunction.apply(ClientConnection.getStatusPredicate(
|
final Set<String> selection = selectionFunction.apply(ClientConnection.getStatusPredicate(
|
||||||
ConnectionStatus.CONNECTION_REQUESTED,
|
ConnectionStatus.CONNECTION_REQUESTED,
|
||||||
|
@ -113,7 +115,9 @@ public class SEBSendLockPopup {
|
||||||
doLock,
|
doLock,
|
||||||
Utils.EMPTY_EXECUTION,
|
Utils.EMPTY_EXECUTION,
|
||||||
popupComposer);
|
popupComposer);
|
||||||
|
} catch (final Exception e) {
|
||||||
|
action.pageContext().notifyUnexpectedError(e);
|
||||||
|
}
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,6 +199,8 @@ public class SEBSendLockPopup {
|
||||||
final PageContext pageContext,
|
final PageContext pageContext,
|
||||||
final FormHandle<?> formHandle) {
|
final FormHandle<?> formHandle) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
final EntityKey examKey = pageContext.getEntityKey();
|
final EntityKey examKey = pageContext.getEntityKey();
|
||||||
final String lockMessage = formHandle
|
final String lockMessage = formHandle
|
||||||
.getForm()
|
.getForm()
|
||||||
|
@ -207,6 +213,10 @@ public class SEBSendLockPopup {
|
||||||
connectionTokens,
|
connectionTokens,
|
||||||
pageContext);
|
pageContext);
|
||||||
|
|
||||||
|
} catch (final Exception e) {
|
||||||
|
pageContext.notifyUnexpectedError(e);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1873,6 +1873,7 @@ sebserver.monitoring.exam.connection.action.instruction.quit.all=Quit All SEB Cl
|
||||||
sebserver.monitoring.exam.connection.action.instruction.quit.confirm=Are you sure to quit this SEB client connection?
|
sebserver.monitoring.exam.connection.action.instruction.quit.confirm=Are you sure to quit this SEB client connection?
|
||||||
sebserver.monitoring.exam.connection.action.instruction.quit.selected.confirm=Are you sure to quit all selected, active SEB client connections?
|
sebserver.monitoring.exam.connection.action.instruction.quit.selected.confirm=Are you sure to quit all selected, active SEB client connections?
|
||||||
sebserver.monitoring.exam.connection.action.instruction.quit.all.confirm=Are you sure to quit all active SEB client connections?
|
sebserver.monitoring.exam.connection.action.instruction.quit.all.confirm=Are you sure to quit all active SEB client connections?
|
||||||
|
sebserver.monitoring.exam.connection.action.instruction.lock=Lock SEB Client
|
||||||
sebserver.monitoring.exam.connection.action.instruction.lock.selected=Lock Selected SEB Clients
|
sebserver.monitoring.exam.connection.action.instruction.lock.selected=Lock Selected SEB Clients
|
||||||
sebserver.monitoring.exam.connection.action.instruction.lock.confirm=Are you sure to lock this SEB client connection?
|
sebserver.monitoring.exam.connection.action.instruction.lock.confirm=Are you sure to lock this SEB client connection?
|
||||||
sebserver.monitoring.exam.connection.action.instruction.disable.selected.confirm=Are you sure to disable all selected SEB client connections?
|
sebserver.monitoring.exam.connection.action.instruction.disable.selected.confirm=Are you sure to disable all selected SEB client connections?
|
||||||
|
|
Loading…
Reference in a new issue