Skip to content

Commit

Permalink
Remove Old Dev UI: Core Logstream
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Kruger <[email protected]>
  • Loading branch information
phillip-kruger committed Aug 2, 2023
1 parent c07c61e commit 9cc8a13
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 1,656 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import io.netty.handler.codec.http.HttpHeaderNames;
import io.quarkus.bootstrap.classloading.ClassPathElement;
import io.quarkus.bootstrap.classloading.QuarkusClassLoader;
import io.quarkus.builder.item.SimpleBuildItem;
import io.quarkus.deployment.IsDevelopment;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
Expand All @@ -49,7 +48,6 @@
import io.quarkus.deployment.builditem.LaunchModeBuildItem;
import io.quarkus.deployment.builditem.ServiceStartBuildItem;
import io.quarkus.deployment.builditem.ShutdownContextBuildItem;
import io.quarkus.deployment.builditem.WebSocketLogHandlerBuildItem;
import io.quarkus.deployment.console.ConsoleCommand;
import io.quarkus.deployment.console.ConsoleStateManager;
import io.quarkus.deployment.dev.devservices.DevServiceDescriptionBuildItem;
Expand Down Expand Up @@ -87,7 +85,6 @@
import io.quarkus.qute.ValueResolver;
import io.quarkus.qute.ValueResolvers;
import io.quarkus.qute.Variant;
import io.quarkus.runtime.RuntimeValue;
import io.quarkus.runtime.TemplateHtmlBuilder;
import io.quarkus.utilities.OS;
import io.quarkus.vertx.http.deployment.BodyHandlerBuildItem;
Expand All @@ -102,8 +99,6 @@
import io.quarkus.vertx.http.runtime.devmode.DevConsoleRecorder;
import io.quarkus.vertx.http.runtime.devmode.RedirectHandler;
import io.quarkus.vertx.http.runtime.devmode.RuntimeDevConsoleRoute;
import io.quarkus.vertx.http.runtime.logstream.LogStreamRecorder;
import io.quarkus.vertx.http.runtime.logstream.WebSocketLogHandler;
import io.quarkus.vertx.http.runtime.management.ManagementInterfaceBuildTimeConfig;
import io.smallrye.common.vertx.VertxContext;
import io.smallrye.config.common.utils.StringUtil;
Expand Down Expand Up @@ -323,17 +318,6 @@ public void runtimeTemplates(List<DevConsoleRuntimeTemplateInfoBuildItem> items,
recorder.initConfigFun();
}

@BuildStep(onlyIf = IsDevelopment.class)
@Record(ExecutionTime.STATIC_INIT)
public void handler(BuildProducer<HistoryHandlerBuildItem> historyProducer,
BuildProducer<WebSocketLogHandlerBuildItem> webSocketLogHandlerBuildItem,
LogStreamRecorder recorder, DevUIConfig devUiConfig) {
RuntimeValue<Optional<WebSocketLogHandler>> handler = recorder.logHandler(devUiConfig.historySize);

webSocketLogHandlerBuildItem.produce(new WebSocketLogHandlerBuildItem((RuntimeValue) handler));
historyProducer.produce(new HistoryHandlerBuildItem(handler));
}

@Consume(LoggingSetupBuildItem.class)
@BuildStep(onlyIf = IsDevelopment.class)
public ServiceStartBuildItem setupDeploymentSideHandling(List<DevTemplatePathBuildItem> devTemplatePaths,
Expand Down Expand Up @@ -446,9 +430,7 @@ public DevConsoleTemplateInfoBuildItem config(List<DevServiceDescriptionBuildIte
public void setupDevConsoleRoutes(
DevUIConfig devUIConfig,
DevConsoleRecorder recorder,
LogStreamRecorder logStreamRecorder,
List<DevConsoleRouteBuildItem> routes,
HistoryHandlerBuildItem historyHandlerBuildItem,
NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem,
ShutdownContextBuildItem shutdownContext,
BuildProducer<RouteBuildItem> routeBuildItemBuildProducer,
Expand All @@ -468,12 +450,6 @@ public void setupDevConsoleRoutes(
result.getWebRootConfigurations(), shutdownContext))
.build());

// Add the log stream
routeBuildItemBuildProducer.produce(nonApplicationRootPathBuildItem.routeBuilder()
.route("dev-v1/logstream")
.handler(logStreamRecorder.websocketHandler(historyHandlerBuildItem.value))
.build());

for (DevConsoleRouteBuildItem i : routes) {
Entry<String, String> groupAndArtifact = i.groupIdAndArtifactId(curateOutcomeBuildItem);
// if the handler is a proxy, then that means it's been produced by a recorder and therefore belongs in the regular runtime Vert.x instance
Expand Down Expand Up @@ -883,14 +859,6 @@ public CompletionStage<Object> resolve(EvalContext context) {
}
}

public static final class HistoryHandlerBuildItem extends SimpleBuildItem {
final RuntimeValue<Optional<WebSocketLogHandler>> value;

public HistoryHandlerBuildItem(RuntimeValue<Optional<WebSocketLogHandler>> value) {
this.value = value;
}
}

private static class DetectPackageFileVisitor extends SimpleFileVisitor<Path> {
private final List<String> paths;

Expand Down

This file was deleted.

Loading

0 comments on commit 9cc8a13

Please sign in to comment.