Added option to disable new version notice (#4559)

* Updated command line options documentation

* Closes #4110, Added option to disable version update notice

* Updated documentation to include new version notice
This commit is contained in:
elebitzero 2022-02-24 00:15:09 -08:00 committed by GitHub
parent 7140da8d9b
commit 0617d771dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 25 deletions

View File

@ -158,7 +158,7 @@ To see the full list of command-line options, run `./refine -h`.
|-H|HTTP host to expect on incoming requests|./refine -H openrefine.internal|
|-k|Add a Google API key|./refine -k YOUR_API_KEY|
|-v|Verbosity (from low to high: error,warn,info,debug,trace)|./refine -v info|
|-x|Additional Java configuration parameters (see Java documentation)|./refine -x refine.autosave=5 <br/>./refine -x refine.data_dir=/ <br/>./refine -x refine.development=false <br/> ./refine -x refine.headless=false <br/>./refine -x refine.host=127.0.0.1 <br/>./refine -x refine.port=3333 <br/>./refine -x refine.webapp=main/webapp|
|-x|Additional Java configuration parameters (see Java documentation)|./refine -x refine.autosave=5 <br/>./refine -x refine.data_dir=/ <br/>./refine -x refine.development=false <br/> ./refine -x refine.headless=false <br/>./refine -x refine.host=127.0.0.1 <br/>./refine -x refine.port=3333 <br/>./refine -x refine.webapp=main/webapp <br/>./refine -x refine.display.new.version.notice=true|
|--debug|Enable debugging (on port 8000)|./refine --debug|
|--jmx|Enable JMX monitoring for Jconsole and JvisualVM|./refine --jmx|
@ -206,6 +206,7 @@ Some of the most common keys (with their defaults) are:
* IP: `-Drefine.host` (127.0.0.1)
* Port: `-Drefine.port` (3333)
* The application folder: `-Drefine.webapp` (main/webapp)
* New version notice: `-Drefine.display.new.version.notice` (true)
The syntax is as follows:

View File

@ -62,6 +62,8 @@ public class GetVersionCommand extends Command {
@JsonProperty("java_runtime_version")
// public String java_runtime_version = Runtime.getRuntime().version(); // Java 9 or later
public String java_runtime_version = System.getProperty("java.runtime.version", "?");
@JsonProperty("display_new_version_notice")
public String display_new_version_notice = System.getProperty("refine.display.new.version.notice");
}
@Override

View File

@ -135,32 +135,33 @@ $(function() {
$("#openrefine-version").text($.i18n('core-index/refine-version', OpenRefineVersion.full_version));
$("#java-runtime-version").text(OpenRefineVersion.java_runtime_name + " " + OpenRefineVersion.java_runtime_version);
if (OpenRefineVersion.display_new_version_notice === "true") {
$.getJSON("https://api.github.com/repos/openrefine/openrefine/releases/latest",
function( data ) {
var latestVersion = data.tag_name;
var latestVersionName = data.name;
var latestVersionUrl = data.html_url;
var thisVersion = OpenRefineVersion.version;
function (data) {
var latestVersion = data.tag_name;
var latestVersionName = data.name;
var latestVersionUrl = data.html_url;
var thisVersion = OpenRefineVersion.version;
if(latestVersion.startsWith("v")) {
latestVersion = latestVersion.substr(1);
}
if (latestVersion.startsWith("v")) {
latestVersion = latestVersion.substr(1);
}
if (isThereNewRelease(thisVersion,latestVersion)) {
var container = $('<div id="notification-container">')
.appendTo(document.body);
var notification = $('<div id="notification">')
.text($.i18n('core-index/new-version')+' ')
.appendTo(container);
$('<a>')
.addClass('notification-action')
.attr("href", latestVersionUrl)
.attr("target", "_blank")
.text($.i18n('core-index/download-now', latestVersionName))
.appendTo(notification);
}
});
if (isThereNewRelease(thisVersion, latestVersion)) {
var container = $('<div id="notification-container">')
.appendTo(document.body);
var notification = $('<div id="notification">')
.text($.i18n('core-index/new-version') + ' ')
.appendTo(container);
$('<a>')
.addClass('notification-action')
.attr("href", latestVersionUrl)
.attr("target", "_blank")
.text($.i18n('core-index/download-now', latestVersionName))
.appendTo(notification);
}
});
}
}
);
};

View File

@ -20,7 +20,7 @@ REFINE_MIN_MEMORY=1400M
# Some sample configurations. These have no defaults.
#JAVA_HOME=C:\Program Files\Java\jdk1.8.0_151
# Use a single JAVA_OPTIONS that includes any JVM options you need upon OpenRefine startup
#JAVA_OPTIONS=-XX:+UseParallelGC -verbose:gc -Drefine.headless=true -Drefine.data_dir=C:\Users\user\AppData\Roaming\OpenRefine
#JAVA_OPTIONS=-XX:+UseParallelGC -verbose:gc -Drefine.headless=true -Drefine.data_dir=C:\Users\user\AppData\Roaming\OpenRefine -Drefine.display.new.version.notice=true
# Uncomment to increase autosave period to 60 mins (default: 5 minutes)
# for better performance of long-lasting transformations (but increased risk of data loss)

View File

@ -105,6 +105,7 @@ public class Refine {
host = "*";
}
System.setProperty("refine.display.new.version.notice", Configurations.get("refine.display.new.version.notice","true"));
Refine refine = new Refine();
refine.init(args);