diff --git a/backend/src/main/java/com/bakdata/conquery/apiv1/QueryProcessor.java b/backend/src/main/java/com/bakdata/conquery/apiv1/QueryProcessor.java index d3f28b692e..069a2ddfe6 100644 --- a/backend/src/main/java/com/bakdata/conquery/apiv1/QueryProcessor.java +++ b/backend/src/main/java/com/bakdata/conquery/apiv1/QueryProcessor.java @@ -129,7 +129,7 @@ public Stream getQueriesFiltered(DatasetId datasetId, UriBuilde ) .filter(q -> subject.isPermitted(q, Ability.READ)) .map(mq -> { - final OverviewExecutionStatus status = mq.buildStatusOverview(uriBuilder.clone(), subject); + final OverviewExecutionStatus status = mq.buildStatusOverview(subject); if (mq.isReadyToDownload()) { status.setResultUrls(getResultAssets(config.getResultProviders(), mq, uriBuilder, allProviders)); diff --git a/backend/src/main/java/com/bakdata/conquery/apiv1/query/concept/filter/FilterValue.java b/backend/src/main/java/com/bakdata/conquery/apiv1/query/concept/filter/FilterValue.java index 6abb5725f5..ee9be78e84 100644 --- a/backend/src/main/java/com/bakdata/conquery/apiv1/query/concept/filter/FilterValue.java +++ b/backend/src/main/java/com/bakdata/conquery/apiv1/query/concept/filter/FilterValue.java @@ -85,22 +85,45 @@ public Condition convertForTableExport(SqlIdColumns ids, ConversionContext conte @NoArgsConstructor @CPSType(id = FrontendFilterType.Fields.MULTI_SELECT, base = FilterValue.class) - @ToString(callSuper = true) public static class CQMultiSelectFilter extends FilterValue> { public CQMultiSelectFilter(@NsIdRef Filter> filter, Set value) { super(filter, value); } + @Override + public String toString() { + final String valueString; + if (getValue().size() > 20) { + valueString = getValue().size() + " values"; + } + else { + valueString = getValue().toString(); + } + + return "%s(value=%s)".formatted(FrontendFilterType.Fields.BIG_MULTI_SELECT, valueString); + } + } @NoArgsConstructor @CPSType(id = FrontendFilterType.Fields.BIG_MULTI_SELECT, base = FilterValue.class) - @ToString(callSuper = true) public static class CQBigMultiSelectFilter extends FilterValue> { public CQBigMultiSelectFilter(@NsIdRef Filter> filter, Set value) { super(filter, value); } + @Override + public String toString() { + final String valueString; + if (getValue().size() > 20) { + valueString = getValue().size() + " values"; + } + else { + valueString = getValue().toString(); + } + + return "%s(value=%s)".formatted(FrontendFilterType.Fields.BIG_MULTI_SELECT, valueString); + } } @NoArgsConstructor @@ -219,11 +242,10 @@ public GroupFilterValue deserialize(JsonParser p, DeserializationContext ctxt) t final Filter filter = nsIdDeserializer.deserialize(filterTraverse, ctxt); if (!(filter instanceof GroupFilter)) { - throw InvalidTypeIdException.from(filterNode.traverse(), GroupFilter.class, String.format("Expected filter of type %s but was: %s", GroupFilter.class, - filter != null - ? filter.getClass() - : null - )); + throw InvalidTypeIdException.from(filterNode.traverse(), + GroupFilter.class, + String.format("Expected filter of type %s but was: %s", GroupFilter.class, filter != null ? filter.getClass() : null) + ); } GroupFilter groupFilter = (GroupFilter) filter; diff --git a/backend/src/main/java/com/bakdata/conquery/models/execution/ManagedExecution.java b/backend/src/main/java/com/bakdata/conquery/models/execution/ManagedExecution.java index baeaca2288..55dafbee3b 100644 --- a/backend/src/main/java/com/bakdata/conquery/models/execution/ManagedExecution.java +++ b/backend/src/main/java/com/bakdata/conquery/models/execution/ManagedExecution.java @@ -51,7 +51,6 @@ import com.fasterxml.jackson.annotation.OptBoolean; import com.google.common.base.Preconditions; import jakarta.validation.constraints.NotNull; -import jakarta.ws.rs.core.UriBuilder; import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -289,7 +288,7 @@ public void start() { /** * Renders a lightweight status with meta information about this query. Computation an size should be small for this. */ - public OverviewExecutionStatus buildStatusOverview(UriBuilder url, Subject subject) { + public OverviewExecutionStatus buildStatusOverview(Subject subject) { OverviewExecutionStatus status = new OverviewExecutionStatus(); setStatusBase(subject, status); diff --git a/backend/src/main/java/com/bakdata/conquery/resources/admin/rest/AdminResource.java b/backend/src/main/java/com/bakdata/conquery/resources/admin/rest/AdminResource.java index 0f8039d7a3..ef315cf67e 100644 --- a/backend/src/main/java/com/bakdata/conquery/resources/admin/rest/AdminResource.java +++ b/backend/src/main/java/com/bakdata/conquery/resources/admin/rest/AdminResource.java @@ -9,6 +9,7 @@ import java.util.Optional; import java.util.OptionalLong; import java.util.UUID; +import java.util.stream.Stream; import jakarta.inject.Inject; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.GET; @@ -21,6 +22,7 @@ import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.UriBuilder; +import com.bakdata.conquery.apiv1.execution.ExecutionStatus; import com.bakdata.conquery.apiv1.execution.FullExecutionStatus; import com.bakdata.conquery.io.jersey.ExtraMimeTypes; import com.bakdata.conquery.io.storage.MetaStorage; @@ -78,9 +80,7 @@ public Response cancelJob(@PathParam(JOB_ID) UUID jobId) { info.send(new CancelJobMessage(jobId)); } - return Response - .seeOther(UriBuilder.fromPath("/admin/").path(AdminUIResource.class, "getJobs").build()) - .build(); + return Response.seeOther(UriBuilder.fromPath("/admin/").path(AdminUIResource.class, "getJobs").build()).build(); } @GET @@ -97,7 +97,7 @@ public boolean isBusy() { @GET @Path("/queries") - public FullExecutionStatus[] getQueries(@Auth Subject currentUser, @QueryParam("limit") OptionalLong maybeLimit, @QueryParam("since") Optional maybeSince) { + public Stream getQueries(@Auth Subject currentUser, @QueryParam("limit") OptionalLong maybeLimit, @QueryParam("since") Optional maybeSince) { final LocalDate since = maybeSince.map(LocalDate::parse).orElse(LocalDate.now()); final long limit = maybeLimit.orElse(100); @@ -105,13 +105,18 @@ public FullExecutionStatus[] getQueries(@Auth Subject currentUser, @QueryParam(" final MetaStorage storage = processor.getStorage(); - return storage.getAllExecutions().stream() + return storage.getAllExecutions() + .stream() .filter(t -> t.getCreationTime().toLocalDate().isAfter(since) || t.getCreationTime().toLocalDate().isEqual(since)) .limit(limit) .map(t -> { - Namespace namespace = processor.getDatasetRegistry().get(t.getDataset().getId()); try { - return t.buildStatusFull(currentUser, namespace); + if (t.isInitialized()) { + final Namespace namespace = processor.getDatasetRegistry().get(t.getDataset().getId()); + return t.buildStatusFull(currentUser, namespace); + } + + return t.buildStatusOverview(currentUser); } catch (ConqueryError e) { // Initialization of execution probably failed, so we construct a status based on the overview status @@ -121,8 +126,7 @@ public FullExecutionStatus[] getQueries(@Auth Subject currentUser, @QueryParam(" fullExecutionStatus.setError(e); return fullExecutionStatus; } - }) - .toArray(FullExecutionStatus[]::new); + }); } @POST diff --git a/backend/src/main/resources/com/bakdata/conquery/resources/admin/ui/queries.html.ftl b/backend/src/main/resources/com/bakdata/conquery/resources/admin/ui/queries.html.ftl index 032b5ed33a..165918873a 100644 --- a/backend/src/main/resources/com/bakdata/conquery/resources/admin/ui/queries.html.ftl +++ b/backend/src/main/resources/com/bakdata/conquery/resources/admin/ui/queries.html.ftl @@ -1,255 +1,272 @@ -<#import "templates/template.html.ftl" as layout> +<#import "templates/template.html.ftl" as layout /> <@layout.layout> - - -

Queries

- -
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
- \ No newline at end of file + +

Queries

+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+