use of org.graylog2.gettingstarted.GettingStartedState in project graylog2-server by Graylog2.
the class GettingStartedResource method displayGettingStarted.
@GET
@ApiOperation("Check whether to display the Getting started guide for this version")
public DisplayGettingStarted displayGettingStarted() {
final GettingStartedState gettingStartedState = clusterConfigService.get(GettingStartedState.class);
if (gettingStartedState == null) {
return DisplayGettingStarted.create(true);
}
final boolean isDismissed = gettingStartedState.dismissedInVersions().contains(currentMinorVersionString());
return DisplayGettingStarted.create(!isDismissed);
}
use of org.graylog2.gettingstarted.GettingStartedState in project graylog2-server by Graylog2.
the class GettingStartedResource method dismissGettingStarted.
@POST
@Path("dismiss")
@ApiOperation("Dismiss auto-showing getting started guide for this version")
@AuditEvent(type = AuditEventTypes.GETTING_STARTED_GUIDE_OPT_OUT_CREATE)
public void dismissGettingStarted() {
final GettingStartedState gettingStartedState = clusterConfigService.getOrDefault(GettingStartedState.class, GettingStartedState.create(Sets.<String>newHashSet()));
gettingStartedState.dismissedInVersions().add(currentMinorVersionString());
clusterConfigService.write(gettingStartedState);
}
Aggregations