Skip to content

Commit

Permalink
added initial filter information
Browse files Browse the repository at this point in the history
  • Loading branch information
saumya1singh committed Feb 22, 2021
1 parent 0c3d785 commit 53f80a7
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
import java.util.List;
import java.util.Stack;

import org.jboss.resteasy.reactive.common.model.ResourceInterceptors;

import io.quarkus.deployment.ApplicationArchive;
import io.quarkus.deployment.IsDevelopment;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.ApplicationArchivesBuildItem;
import io.quarkus.devconsole.spi.DevConsoleRuntimeTemplateInfoBuildItem;
import io.quarkus.devconsole.spi.DevConsoleTemplateInfoBuildItem;
import io.quarkus.resteasy.reactive.common.deployment.ResourceInterceptorsBuildItem;
import io.quarkus.resteasy.reactive.server.runtime.EndpointScoresSupplier;
import io.quarkus.vertx.http.deployment.devmode.NotFoundPageDisplayableEndpointBuildItem;
import io.quarkus.vertx.http.runtime.StaticResourcesRecorder;
Expand All @@ -34,6 +37,15 @@ public DevConsoleTemplateInfoBuildItem collectAdditionalEndpoints(
return new DevConsoleTemplateInfoBuildItem("additionalEndpointInfo", additionalEndpoint);
}


@BuildStep(onlyIf = IsDevelopment.class)
public DevConsoleTemplateInfoBuildItem collectFiltersInfo(ResourceInterceptorsBuildItem resourceInterceptorsBuildItem) {

ResourceInterceptors interceptors = resourceInterceptorsBuildItem.getResourceInterceptors();
return new DevConsoleTemplateInfoBuildItem("filterInfo", interceptors);
}


@BuildStep(onlyIf = IsDevelopment.class)
public DevConsoleTemplateInfoBuildItem collectStaticResourcesInfo(
ApplicationArchivesBuildItem applicationArchivesBuildItem) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
<a href="{urlbase}/endpoints" class="badge badge-light">
<i class="fa fa-map fa-fw"></i>
List of endpoints</a>
<a href="{urlbase}/filters" class="badge badge-light">
<i class="fa fa-map fa-fw"></i>
Filters</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{#include main}
{#title} Filter Information {/title}
{#style}
{/style}
{#body}
{#for requestFilterGlobalResource in info:filterInfo.getContainerRequestFilters.getGlobalResourceInterceptors}
<div class="row">
<div class="col">
<code>{requestFilterGlobalResource.getClassName}</code>
</div>
</div>
{/for}

{#for requestFilterNameResource in info:filterInfo.getContainerRequestFilters.getNameResourceInterceptors}
<div class="row">
<div class="col">
<code>{requestFilterNameResource.getClassName}</code>
</div>
</div>
{/for}

{#for requestFilterPreMatch in info:filterInfo.getContainerRequestFilters.getPreMatchInterceptors}
<div class="row">
<div class="col">
<code>{requestFilterPreMatch.getClassName}</code>
</div>
</div>
{/for}

{#for responseFilterNameResource in info:filterInfo.getContainerResponseFilters.getNameResourceInterceptors}
<div class="row">
<div class="col">
<code>{responseFilterNameResource.getClassName}</code>
</div>
</div>
{/for}

{#for responseFilterGlobalResource in info:filterInfo.getContainerResponseFilters.getGlobalResourceInterceptors()}
<div class="row">
<div class="col">
<code>{responseFilterGlobalResource.getClassName}</code>
</div>
</div>
{/for}
{/body}
{/include}

0 comments on commit 53f80a7

Please sign in to comment.