Skip to content

Commit 6e72d97

Browse files
committed
bump version, support config toggle of add/remove search, exclude query, term hyperlinks and new window
1 parent a88f694 commit 6e72d97

15 files changed

+509
-188
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## [3.1.0](https://github.com/billmurrin/graylog-plugin-quickvaluesplus-widget/tree/3.1.0) (2018-01-12)
2+
* Merged #32 (@pbr0ck3r) - Add options to show/hide search buttons when creating a widget
3+
* Now supports the configuration of defaults for the following:
4+
- Add / Remove to Search Bar (Field Analyzer)
5+
- Pie Chart Visibility
6+
- Show Terms with Hyperlinks (Only applies to Dashboards)
7+
- Exclude Term from Widget Search query button (Only applies to Dashboards)
8+
- Open Search Term Query in New Window (Only applies to Dashboards)
9+
- *Data Table Visibility is not a global configuration, only on widgets*
10+
* Fixed #31 - Quick Values in Dashboard keep changing colors
11+
* Removed debug code added in version 3.0. Not needed.
12+
113
## [3.0.3](https://github.com/billmurrin/graylog-plugin-quickvaluesplus-widget/tree/3.0.2) (2018-01-06)
214
* Fixed *Open Search in New Window* button for `undefined` stream_id. 3.0.2 only fixed the links, not the button.
315
* Fixed bug - Global config value wasn't being sent to the widget upon the initial widget load - it required a menu selection first.

README.md

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,96 +3,98 @@
33
[![GitHub Release](https://img.shields.io/github/release/billmurrin/graylog-plugin-quickvaluesplus-widget.svg)](https://github.com/billmurrin/graylog-plugin-quickvaluesplus-widget/releases)
44
[![Build Status](https://travis-ci.org/billmurrin/graylog-plugin-quickvaluesplus-widget.svg?branch=master)](https://travis-ci.org/billmurrin/graylog-plugin-quickvaluesplus-widget)
55

6-
The QuickValuesPlus Widget is an enhancement to the Quick Values Widget that ships with GrayLog2. The QuickValuesPlus Widget can be added to a Stream as a Field Analyzer and to Dashboards as a widget.
7-
8-
Several **NEW** features have been added to version 3.0.0 (See below). Version 3.0.0 is only compatible with Graylog 2.3.0 and above.
6+
The QuickValuesPlus Widget is an enhancement to the original Quick Values Widget that shipped with GrayLog2. It can be added to a Stream as a Field Analyzer and to Dashboards as a widget.
97

8+
Several **NEW** features have been added to version 3.1.0 (See below). Version 3.1.0 is only compatible with Graylog 2.3 (not 2.4 yet).
109

1110
Field Analyzer Features
1211
-----------
1312
- "Customize" menu supports modifying the Sort Order (Ascending or Descending), Table Size and number of Top Values displayed by the widget.
1413
- Exclude from search button - Add negated search directly to the Search Bar (E.g. !field_name:foo).
14+
- **New in 3.1** - Can prevent Add to Search/Remove from search buttons via global configuration.
1515

1616
*Field Analyzer Features*
1717
![alt text](http://i.imgur.com/H9SRkRo.png "Field Analyzer Features")
1818

19-
20-
New Dashboard Features
19+
Dashboard Features
2120
-----------
22-
- Widgets now contain links so that you can drill into a Term search and view the results.
23-
- Widgets now contain a button to open the Term search inside of a new window.
24-
- Added Exclude Term from Query button - Negate a search term directly from the widget (Requires dashboard edit permissions)
21+
- Terms can be hyperlinked - drill-down into a Term search and view the results.
22+
- Term searches can be opened inside of a new window.
23+
- Can exclude a Term from the Query using a button - Negate a search term directly from the widget (*Requires dashboard edit permissions*)
24+
- **New in 3.1** - Term hyperlinks, Remove from query, and Open Term search in new window buttons can be hidden - very customizable!
2525

26-
*NEW - Version 3 Dashboard Features*
27-
![alt text](http://i.imgur.com/viZ3AoK.png "Version 3 Dashboard Features")
26+
*Customize your dashboards*
27+
![alt text](https://i.imgur.com/GSm9Yb1.png "Dashboard customization")
2828

29-
New Dashboard Configuration Feature
29+
Dashboard Configuration Feature
3030
-----------
31-
- Can now customize the field name used by the widget (Requires dashboard edit permissions)
32-
31+
- Can customize the field name used by the widget (Requires dashboard edit permissions)
32+
- **New in 3.1** Can now control display of term hyperlinks, remove from query, open term in new window buttons in dashboards.
3333

34-
*NEW - Version 3 Editable Field Name*
35-
![alt text](http://i.imgur.com/Ezs7DL3.png "Edit Field Name")
36-
37-
New Global System Configuration
34+
Global System Configuration
3835
-----------
39-
- Can now Customize the Quick Values Plus default values in the System/Configuration page.
40-
41-
*NEW - Version 3 Globally Configurable Default Values*
42-
![alt text](http://i.imgur.com/DZHbWzh.png "System Global Default Values")
36+
Customize the default display values in the System/Configuration page.
37+
- Pie Chart
38+
- Add to Search Bar button
39+
- Remove from Search Bar button
40+
- Term Hyperlinks (Dashboards)
41+
- Exclude From Search Button (Dashboards)
42+
- Open Term Search in New Window Button (Dashboards)
4343

4444
Supported Graylog Versions
4545
-----------
46-
* Version 3.0.1 was tested and is compatible with Graylog version 2.3.0 and above.
47-
* Version 2.1.0 was tested and is compatible with Graylog versions 2.2.1, 2.2.2, and 2.2.3.
48-
* Version 1.0.0 was tested and is compatible with Graylog version 2.1.3.
46+
* **Not currently compatible with Graylog 2.4.0 - *coming soon!***
47+
* Version 3.1.0 - Tested and compatible with Graylog version 2.3 - not currently compatible with 2.4.0.
48+
* Version 2.1.0 - Tested and compatible with Graylog versions 2.2.1, 2.2.2, and 2.2.3.
49+
* Version 1.0.0 - Tested and compatible with Graylog version 2.1.3.
4950

51+
Installation
52+
------------
53+
* [Download the plugin](https://github.com/billmurrin/graylog-plugin-quickvaluesplus-widget/releases/)
54+
and place the `.jar` file in your Graylog plugin directory. The plugin directory is the `plugins/` folder relative from your `graylog-server` directory by default and can be configured in your `graylog.conf` file.
55+
* Restart `graylog-server`.
56+
* In your web browser, force refresh (Ctrl + F5) a couple of times or clear your cache.
57+
5058
Features and Bugs
5159
-----------
5260
If you come across a bug, require further assistance, or have a great feature request, please file an [Issue](https://github.com/billmurrin/graylog-plugin-quickvaluesplus-widget/issues) providing as much detail as possible.
5361

54-
Contributions to the code-base are greatly appreciated.
62+
Contributions to the code-base are greatly appreciated!
63+
64+
Way Ahead - Version 4.0.0
65+
-----------
66+
* Update codebase to work with Graylog 2.4.0
5567

5668
Related Graylog Issues
5769
-----------
58-
The following are Graylog issues that the QuickValuesPlus widget currently attempts to resolve.
70+
The following are Graylog issues that the QuickValuesPlus widget attempts to resolve.
5971
* [#2459](https://github.com/Graylog2/graylog2-server/issues/2459) - Reverse quick values/Bottom-N
6072
* [#2631](https://github.com/Graylog2/graylog2-server/issues/2631) - Feature request: rare values #2631
6173
* [#1684](https://github.com/Graylog2/graylog2-server/issues/1684) - Make number of terms in quick values widget configurable
6274
* [#3694](https://github.com/Graylog2/graylog2-server/issues/3694) - Add hyperlinks to "Quick Values" dashboard widgets
6375
* [#3394](https://github.com/Graylog2/graylog2-server/issues/3394) - Widgets has no way to edit all properties after creation
64-
65-
Installation
66-
------------
67-
[Download the plugin](https://github.com/billmurrin/graylog-plugin-quickvaluesplus-widget/releases/)
68-
and place the `.jar` file in your Graylog plugin directory. The plugin directory is the `plugins/` folder relative from your `graylog-server` directory by default and can be configured in your `graylog.conf` file.
69-
70-
Restart `graylog-server` and you are done.
71-
72-
Way Ahead - Version 3.1.0
73-
-----------
74-
* Add additional Default Configuration options (show table, show pie chart, links, exclude query button)
75-
* Add ability to Turn Off links and/or exclude from Query buttons for each individual widget in the Widget Configuration.
76-
* Add debug configuration option to enable console messaging in order to help in troubleshooting issues with the plugin.
7776

7877
Development
7978
-----------
8079
You can improve your development experience for the web interface part of your plugin dramatically by making use of hot reloading.
8180

82-
To hot reload using Graylog 2.3.0, your plugin directory should be located two directories above your graylog2-web-server directory (../../) and the folder name of your plugin should be begin with graylog-plugin (More info[HERE](https://github.com/Graylog2/graylog2-server/blob/2.3/graylog2-web-interface/webpack.combined.config.js#L11))
81+
To hot reload using Graylog 2.3, your plugin directory should be located two directories above your graylog2-web-server directory (../../) and the folder name of your plugin should be begin with graylog-plugin (More info[HERE](https://github.com/Graylog2/graylog2-server/blob/2.3/graylog2-web-interface/webpack.combined.config.js#L11))
82+
83+
##### Hot-loading setup with the plugin.
8384

84-
#####Steps for hot-loading setup with the plugin.
8585
* Clone the Repositories
8686
```
87-
git clone -b "2.3.1" https://github.com/Graylog2/graylog2-server.git
87+
git clone -b "2.3.2" https://github.com/Graylog2/graylog2-server.git
8888
git clone https://github.com/billmurrin/graylog-plugin-quickvaluesplus-widget.git
8989
```
90+
9091
* Install the `graylog2-web-interface` node modules and build the Vendor Manifest
9192
```
9293
cd graylog2-server/graylog2-web-interface
9394
npm install
9495
webpack --config webpack.vendor.js
9596
```
97+
9698
* Install the `graylog-plugin-quickvaluesplus-widget` node modules
9799
```
98100
cd graylog-plugin-quickvaluesplus-widget
@@ -105,7 +107,7 @@ cd graylog2-server/graylog2-web-interface
105107
npm start
106108
```
107109

108-
#####Steps to build the plugin.
110+
##### Building the plugin.
109111
* Follow the steps above for hot-loading, but **DO NOT** run the `npm start` command. (no need to start the dev web-server)
110112
* Run `mvn package`
111113
* Copy the generated JAR file located in the `/target` folder to the Graylog plugin directory.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "QuickValuesPlusWidget",
3-
"version": "3.0.3",
3+
"version": "3.1.0",
44
"description": "GrayLog2 QuickValuesPlus Widget Plugin",
55
"repository": {
66
"type": "git",

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<groupId>org.graylog.plugins</groupId>
1010
<artifactId>graylog-plugin-quickvaluesplus-widget</artifactId>
11-
<version>3.0.3</version>
11+
<version>3.1.0</version>
1212
<packaging>jar</packaging>
1313

1414
<name>${project.artifactId}</name>

src/main/java/org/graylog/plugins/quickvaluesplus/QuickValuesPlusDefaultValuesMigration.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,25 @@ public ZonedDateTime createdAt() {
3030
@Override
3131
@SuppressWarnings("unchecked")
3232
public void upgrade() {
33-
if (clusterConfigService.get(QuickValuesPlusPluginConfiguration.class) != null) {
34-
LOG.debug("Migration already done.");
33+
34+
final QuickValuesPlusPluginConfiguration quickValuesPlusPluginConfiguration = clusterConfigService.get(QuickValuesPlusPluginConfiguration.class);
35+
final QuickValuesPlusPluginConfiguration3_1 quickValuesPlusPluginConfiguration3_1 = clusterConfigService.get(QuickValuesPlusPluginConfiguration3_1.class);
36+
37+
if (quickValuesPlusPluginConfiguration3_1 == null) {
38+
if (quickValuesPlusPluginConfiguration == null) {
39+
LOG.info("No Migration Found. Writing values for Quick Values Plugin Configuration");
40+
clusterConfigService.write(QuickValuesPlusPluginConfiguration3_1.create(25, 5, "descending", true, true,true,true, true, true,"3.1.0"));
41+
} else {
42+
LOG.info("3.0 Migration Found. Updating to 3.1");
43+
clusterConfigService.write(QuickValuesPlusPluginConfiguration3_1.create(quickValuesPlusPluginConfiguration.tableSize(), quickValuesPlusPluginConfiguration.topValues(), quickValuesPlusPluginConfiguration.sortOrder(), true, true, true, true, true,true, "3.1.0"));
44+
LOG.info("Removing 3.0 migration information");
45+
clusterConfigService.remove(QuickValuesPlusPluginConfiguration.class);
46+
}
47+
} else {
48+
LOG.info("Migration has already completed. Exiting.");
3549
return;
36-
}
3750

38-
LOG.info("Writing values for Quick Values Plugin Configuration");
39-
clusterConfigService.write(QuickValuesPlusPluginConfiguration.create(25, 5, "descending"));
51+
}
4052
}
4153

4254
}

src/main/java/org/graylog/plugins/quickvaluesplus/QuickValuesPlusPluginConfiguration.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ public abstract class QuickValuesPlusPluginConfiguration {
2222

2323
@JsonCreator
2424
public static QuickValuesPlusPluginConfiguration create(@JsonProperty("table_size") Number tableSize,
25-
@JsonProperty("top_values") Number topValues,
26-
@JsonProperty("sort_order") String sortOrder) {
25+
@JsonProperty("top_values") Number topValues,
26+
@JsonProperty("sort_order") String sortOrder) {
2727
return builder()
28-
.tableSize(tableSize)
29-
.topValues(topValues)
30-
.sortOrder(sortOrder)
31-
.build();
28+
.tableSize(tableSize)
29+
.topValues(topValues)
30+
.sortOrder(sortOrder)
31+
.build();
3232
}
3333

3434
public static Builder builder() {
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
package org.graylog.plugins.quickvaluesplus;
2+
3+
import com.fasterxml.jackson.annotation.JsonAutoDetect;
4+
import com.fasterxml.jackson.annotation.JsonCreator;
5+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
6+
import com.fasterxml.jackson.annotation.JsonProperty;
7+
import com.google.auto.value.AutoValue;
8+
9+
@JsonAutoDetect
10+
@JsonIgnoreProperties(ignoreUnknown = true)
11+
@AutoValue
12+
public abstract class QuickValuesPlusPluginConfiguration3_1 {
13+
14+
@JsonProperty("table_size")
15+
public abstract Number tableSize();
16+
17+
@JsonProperty("top_values")
18+
public abstract Number topValues();
19+
20+
@JsonProperty("sort_order")
21+
public abstract String sortOrder();
22+
23+
@JsonProperty("show_pie_chart")
24+
public abstract Boolean showPieChart();
25+
26+
@JsonProperty("display_add_to_search_button")
27+
public abstract Boolean addToSearch();
28+
29+
@JsonProperty("display_remove_from_search_button")
30+
public abstract Boolean removeFromSearch();
31+
32+
@JsonProperty("display_term_hyperlinks")
33+
public abstract Boolean termHyperlinks();
34+
35+
@JsonProperty("display_exclude_from_query_button")
36+
public abstract Boolean excludeQuery();
37+
38+
@JsonProperty("display_get_term_reply_in_new_window_button")
39+
public abstract Boolean termNewWindow();
40+
41+
@JsonProperty("version")
42+
public abstract String version();
43+
44+
@JsonCreator
45+
public static QuickValuesPlusPluginConfiguration3_1 create(@JsonProperty("table_size") Number tableSize,
46+
@JsonProperty("top_values") Number topValues,
47+
@JsonProperty("sort_order") String sortOrder,
48+
@JsonProperty("show_pie_chart") Boolean showPieChart,
49+
@JsonProperty("display_add_to_search_button") Boolean addToSearch,
50+
@JsonProperty("display_remove_from_search_button") Boolean removeFromSearch,
51+
@JsonProperty("display_term_hyperlinks") Boolean termHyperlinks,
52+
@JsonProperty("display_exclude_from_query_button") Boolean excludeQuery,
53+
@JsonProperty("display_get_term_reply_in_new_window_button") Boolean termNewWindow,
54+
@JsonProperty("version") String version) {
55+
return builder()
56+
.tableSize(tableSize)
57+
.topValues(topValues)
58+
.sortOrder(sortOrder)
59+
.showPieChart(showPieChart)
60+
.addToSearch(addToSearch)
61+
.removeFromSearch(removeFromSearch)
62+
.termHyperlinks(termHyperlinks)
63+
.excludeQuery(excludeQuery)
64+
.termNewWindow(termNewWindow)
65+
.version(version)
66+
.build();
67+
}
68+
69+
public static Builder builder() {
70+
return new AutoValue_QuickValuesPlusPluginConfiguration3_1.Builder();
71+
}
72+
73+
@AutoValue.Builder
74+
public static abstract class Builder {
75+
public abstract Builder tableSize(Number tableSize);
76+
77+
public abstract Builder topValues(Number topValues);
78+
79+
public abstract Builder sortOrder(String sortOrder);
80+
81+
public abstract Builder showPieChart(Boolean showPieChart);
82+
83+
public abstract Builder addToSearch(Boolean addToSearch);
84+
85+
public abstract Builder removeFromSearch(Boolean removeFromSearch);
86+
87+
public abstract Builder termHyperlinks(Boolean termHyperlinks);
88+
89+
public abstract Builder excludeQuery(Boolean excludeQuery);
90+
91+
public abstract Builder termNewWindow(Boolean termNewWindow);
92+
93+
public abstract Builder version(String version);
94+
95+
public abstract QuickValuesPlusPluginConfiguration3_1 build();
96+
}
97+
98+
}

src/main/java/org/graylog/plugins/quickvaluesplus/QuickValuesPlusWidgetModule.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
import org.graylog2.plugin.PluginModule;
44
import org.graylog2.plugin.PluginConfigBean;
55
import org.graylog.plugins.quickvaluesplus.widget.strategy.QuickValuesPlusWidgetStrategy;
6-
import com.github.joschi.jadconfig.Parameter;
76
import com.google.inject.multibindings.Multibinder;
87
import org.graylog2.migrations.Migration;
9-
import org.graylog.plugins.quickvaluesplus.QuickValuesPlusDefaultValuesMigration;
108
import java.util.Collections;
119
import java.util.Set;
1210

0 commit comments

Comments
 (0)