Skip to content

Commit bd3719c

Browse files
kodjo-anipahousmaneolaura-b-gtodvoramaxiadlovskii
authored
Revamp/server input pagination (#24057)
* first iteration of pagination * commit state * fix import and add license header * fix import * fix compliation issues * fix static field deserilization * Move inputsList to PaginatedEntityDataTable (#24113) * Implement entity data table for Inputs * Update InputsDotBadge with cluster endpoint * Delete graylog2-web-interface/src/components/inputs/InputsOveriew/cells/.#ThroughputCell.tsx * add Expanded Title section to show config and static fields * remove InputList and InputListItem - format files * make row clickable and have a single expanded section - remove unnecessary components * fix linter * fix lint * fix lint * refactor imports * fix review --------- Co-authored-by: Laura Bergenthal-Grotlüschen <laura.bergenthalgrotlueschen@graylog.com> * continue refactoring * Remove unused CatApi impl (#24215) * Position leftCol component to the left in ModalSubmit (#24111) * Updating yarn lockfile (#24217) Co-authored-by: Gary Bot <garybot2@graylog.com> * Bump auto-value.version from 1.11.0 to 1.11.1 (#24201) Bumps `auto-value.version` from 1.11.0 to 1.11.1. Updates `com.google.auto.value:auto-value-annotations` from 1.11.0 to 1.11.1 - [Release notes](https://github.com/google/auto/releases) - [Commits](google/auto@auto-value-1.11.0...auto-value-1.11.1) Updates `com.google.auto.value:auto-value` from 1.11.0 to 1.11.1 - [Release notes](https://github.com/google/auto/releases) - [Commits](google/auto@auto-value-1.11.0...auto-value-1.11.1) --- updated-dependencies: - dependency-name: com.google.auto.value:auto-value-annotations dependency-version: 1.11.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.google.auto.value:auto-value dependency-version: 1.11.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump io.modelcontextprotocol.sdk:mcp-bom from 0.15.0 to 0.16.0 (#24211) Bumps [io.modelcontextprotocol.sdk:mcp-bom](https://github.com/modelcontextprotocol/java-sdk) from 0.15.0 to 0.16.0. - [Release notes](https://github.com/modelcontextprotocol/java-sdk/releases) - [Commits](modelcontextprotocol/java-sdk@v0.15.0...v0.16.0) --- updated-dependencies: - dependency-name: io.modelcontextprotocol.sdk:mcp-bom dependency-version: 0.16.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump org.hibernate.validator:hibernate-validator (#24173) Bumps [org.hibernate.validator:hibernate-validator](https://github.com/hibernate/hibernate-validator) from 9.0.1.Final to 9.1.0.Final. - [Release notes](https://github.com/hibernate/hibernate-validator/releases) - [Changelog](https://github.com/hibernate/hibernate-validator/blob/main/changelog.txt) - [Commits](hibernate/hibernate-validator@9.0.1.Final...9.1.0.Final) --- updated-dependencies: - dependency-name: org.hibernate.validator:hibernate-validator dependency-version: 9.1.0.Final dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump software.amazon.msk:aws-msk-iam-auth from 2.3.4 to 2.3.5 (#24157) Bumps [software.amazon.msk:aws-msk-iam-auth](https://github.com/aws/aws-msk-iam-auth) from 2.3.4 to 2.3.5. - [Release notes](https://github.com/aws/aws-msk-iam-auth/releases) - [Commits](aws/aws-msk-iam-auth@v2.3.4...v2.3.5) --- updated-dependencies: - dependency-name: software.amazon.msk:aws-msk-iam-auth dependency-version: 2.3.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Refactor ClusterStateApi to use os3 client (#24196) * Refactor ClusterStateApi to use os3 client * fix empty properties indices * fix conflict * better index deletion handling for unavailable indices * fix deletion of indices * code cleanup * better record name and javadoc * commit compiling state * switch pagination * fix removed class * fix encrypted values * fix extractors * add missing headers * remove import * fix forbidden api call * fix test * fix forbidden api failure * Update InputsOverview.tsx * fix updating input * add back validation * add changelog * fix lint * ignore os java client (#24285) * Refector data_node_status (#24267) * refector data_node_status * Revert "refector data_node_status" This reverts commit 29c78d4. * Refector data_node_status to datanode_status --------- Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com> * add more test cases * fix imports * linter fixes * linter fixes * add node filter when node is set * clean up input to use set pattern on builder * remove not needed prop * Add additional column to inputs page (#24268) * add additional columns - add InputActions test * add expanded section actions * use product name * fix lint * fix lint --------- Co-authored-by: Laura Bergenthal-Grotlüschen <laura.bergenthalgrotlueschen@graylog.com> * fix lint errors * fix desired state and buildFromMap * make returned list immutable again * Update InputsOverview.tsx * add Inputs notifications for failed, setup and stopped state and improve input creation (#24283) * add Inputs notifications for failed, setup and stopped state * fix lint * improve input creation - open wizard after saving input * remove navigation * remove filter copy * adjust to upstream changes * Update InputsPage.tsx * Update graylog2-web-interface/src/util/DocsHelper.ts Co-authored-by: Laura Bergenthal-Grotlüschen <laura.bergenthalgrotlueschen@graylog.com> * reset field after opening wizard * fix typo * add column width --------- Co-authored-by: Mohamed OULD HOCINE <106236152+gally47@users.noreply.github.com> Co-authored-by: Laura Bergenthal-Grotlüschen <laura.bergenthalgrotlueschen@graylog.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Ousmane SAMBA <ousmane@graylog.com> Co-authored-by: Laura Bergenthal-Grotlüschen <laura.bergenthalgrotlueschen@graylog.com> Co-authored-by: Tomas Dvorak <tomas.dvorak@graylog.com> Co-authored-by: Maksym Yadlovskyi <maksym.yadlovskyi@graylog.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Gary Bot <garybot2@graylog.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ousmane Samba <ousmane.samba@graylog.com> Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com> Co-authored-by: Mohamed OULD HOCINE <106236152+gally47@users.noreply.github.com> Co-authored-by: Patrick Mann <patrickmann@users.noreply.github.com> Co-authored-by: patrickmann <patrick.mann@graylog.com>
1 parent de587bb commit bd3719c

File tree

64 files changed

+3837
-1648
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3837
-1648
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type = "a"
2+
message = "Improved Inputs Overview Page: The page has been revamped with pagination and various UI enhancements to improve navigation."
3+
4+
pulls = ["24245", "Graylog2/graylog-plugin-enterprise#12538"]
5+
issues = ["12248"]

graylog2-server/src/main/java/org/graylog2/contentpacks/facades/InputFacade.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ public Optional<Entity> exportEntity(EntityDescriptor entityDescriptor, EntityDe
476476

477477
try {
478478
final Input input = inputService.find(modelId.id());
479-
final InputWithExtractors inputWithExtractors = InputWithExtractors.create(input, inputService.getExtractors(input));
479+
final InputWithExtractors inputWithExtractors = InputWithExtractors.create(input, inputService.getExtractors(input.getId()));
480480
return Optional.of(exportNativeEntity(inputWithExtractors, entityDescriptorIds));
481481
} catch (NotFoundException e) {
482482
return Optional.empty();
@@ -491,7 +491,7 @@ public Graph<EntityDescriptor> resolveNativeEntity(EntityDescriptor entityDescri
491491
final ModelId modelId = entityDescriptor.id();
492492
try {
493493
final Input input = inputService.find(modelId.toString());
494-
final InputWithExtractors inputWithExtractors = InputWithExtractors.create(input, inputService.getExtractors(input));
494+
final InputWithExtractors inputWithExtractors = InputWithExtractors.create(input, inputService.getExtractors(input.getId()));
495495

496496
resolveNativeEntityLookupTable(entityDescriptor, inputWithExtractors, mutableGraph);
497497
resolveNativeEntityGrokPattern(entityDescriptor, inputWithExtractors, mutableGraph);

graylog2-server/src/main/java/org/graylog2/database/utils/MongoUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.mongodb.client.model.Aggregates;
2727
import com.mongodb.client.model.Filters;
2828
import com.mongodb.client.model.ReplaceOptions;
29+
import com.mongodb.client.model.Updates;
2930
import com.mongodb.client.result.InsertOneResult;
3031
import jakarta.annotation.Nonnull;
3132
import org.bson.BsonValue;
@@ -266,4 +267,8 @@ public Map<String, Long> countByField(String field) {
266267
});
267268
return counts;
268269
}
270+
271+
public static Bson removeEmbedded(String fieldName, String key, String value) {
272+
return Updates.pull(fieldName, new Document(key, value));
273+
}
269274
}

graylog2-server/src/main/java/org/graylog2/filters/ExtractorFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private void loadExtractors(final String inputId) {
156156

157157
try {
158158
final Input input = inputService.find(inputId);
159-
final List<Extractor> sortedExtractors = inputService.getExtractors(input).stream()
159+
final List<Extractor> sortedExtractors = inputService.getExtractors(input.getId()).stream()
160160
.sorted(Comparator.comparingLong(Extractor::getOrder))
161161
.collect(Collectors.toList());
162162

graylog2-server/src/main/java/org/graylog2/filters/StaticFieldFilter.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import com.google.common.collect.ImmutableList;
2020
import com.google.common.eventbus.EventBus;
2121
import com.google.common.eventbus.Subscribe;
22-
import org.graylog2.database.NotFoundException;
23-
import org.graylog2.inputs.Input;
22+
import jakarta.inject.Inject;
23+
import jakarta.inject.Named;
2424
import org.graylog2.inputs.InputService;
2525
import org.graylog2.plugin.Message;
2626
import org.graylog2.plugin.filters.MessageFilter;
@@ -31,9 +31,6 @@
3131
import org.slf4j.Logger;
3232
import org.slf4j.LoggerFactory;
3333

34-
import jakarta.inject.Inject;
35-
import jakarta.inject.Named;
36-
3734
import java.util.Collections;
3835
import java.util.List;
3936
import java.util.Map;
@@ -121,12 +118,7 @@ private void loadAllStaticFields() {
121118

122119
private void loadStaticFields(final String inputId) {
123120
LOG.debug("Re-loading static fields for input <{}> into cache.", inputId);
124-
try {
125-
final Input input = inputService.find(inputId);
126-
staticFields.put(inputId, ImmutableList.copyOf(inputService.getStaticFields(input)));
127-
} catch (NotFoundException e) {
128-
LOG.warn("Unable to load input: {}", e.getMessage());
129-
}
121+
staticFields.put(inputId, ImmutableList.copyOf(inputService.getStaticFields(inputId)));
130122
}
131123

132124
@Override

graylog2-server/src/main/java/org/graylog2/inputs/Input.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
package org.graylog2.inputs;
1818

1919
import org.graylog2.plugin.IOState;
20-
import org.graylog2.plugin.database.Persisted;
2120
import org.joda.time.DateTime;
2221

2322
import java.util.Map;
2423

25-
public interface Input extends Persisted {
24+
public interface Input {
25+
String getId();
26+
2627
String getTitle();
2728

2829
DateTime getCreatedAt();
@@ -35,18 +36,19 @@ public interface Input extends Persisted {
3536

3637
String getCreatorUserId();
3738

38-
Boolean isGlobal();
39+
boolean isGlobal();
3940

4041
String getContentPack();
4142

4243
String getNodeId();
4344

4445
IOState.Type getDesiredState();
4546

46-
void setDesiredState(IOState.Type desiredState);
47+
Input withDesiredState(IOState.Type desiredState);
4748

4849
default String toIdentifier() {
4950
return "[" + getType() + "/" + getTitle() + "/" + getId() + "]";
5051
}
5152

53+
Map<String, Object> getFields();
5254
}

0 commit comments

Comments
 (0)