diff --git a/nifi-assembly/pom.xml b/nifi-assembly/pom.xml index 036926f5e3..8e109d8033 100755 --- a/nifi-assembly/pom.xml +++ b/nifi-assembly/pom.xml @@ -48,6 +48,28 @@ language governing permissions and limitations under the License. --> + + org.codehaus.mojo + buildnumber-maven-plugin + false + + + validate + + create + + + + + false + false + 7 + true + + buildRevision + buildBranch + + @@ -630,5 +652,18 @@ language governing permissions and limitations under the License. --> + + build-info-no-git + + false + + ../.git/HEAD + + + + + + + diff --git a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java index 0242905a7c..554bae55e0 100644 --- a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java +++ b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java @@ -24,9 +24,12 @@ import java.net.InetSocketAddress; import java.nio.file.InvalidPathException; import java.nio.file.Path; import java.nio.file.Paths; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -198,6 +201,12 @@ public abstract class NiFiProperties { // expression language properties public static final String VARIABLE_REGISTRY_PROPERTIES = "nifi.variable.registry.properties"; + // build info + public static final String BUILD_TAG = "nifi.build.tag"; + public static final String BUILD_BRANCH = "nifi.build.branch"; + public static final String BUILD_REVISION = "nifi.build.revision"; + public static final String BUILD_TIMESTAMP = "nifi.build.timestamp"; + // defaults public static final String DEFAULT_TITLE = "NiFi"; public static final Boolean DEFAULT_AUTO_RESUME_STATE = true; @@ -992,6 +1001,21 @@ public abstract class NiFiProperties { } } + public Date getBuildTimestamp() { + String buildTimestampString = getProperty(NiFiProperties.BUILD_TIMESTAMP); + if (!StringUtils.isEmpty(buildTimestampString)) { + try { + SimpleDateFormat buildTimestampFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); + Date buildTimestampDate = buildTimestampFormat.parse(buildTimestampString); + return buildTimestampDate; + } catch (ParseException parseEx) { + return null; + } + } else { + return null; + } + } + public int size() { return getPropertyKeys().size(); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/AboutDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/AboutDTO.java index 913401b537..c33b6ab144 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/AboutDTO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/AboutDTO.java @@ -17,6 +17,7 @@ package org.apache.nifi.web.api.dto; import com.wordnik.swagger.annotations.ApiModelProperty; +import org.apache.nifi.web.api.dto.util.DateTimeAdapter; import org.apache.nifi.web.api.dto.util.TimezoneAdapter; import javax.xml.bind.annotation.XmlType; @@ -36,6 +37,11 @@ public class AboutDTO { private String contentViewerUrl; private Date timezone; + private String buildTag; + private String buildRevision; + private String buildBranch; + private Date buildTimestamp; + /* getters / setters */ /** * The title to be used on the page and in the About dialog. @@ -113,4 +119,50 @@ public class AboutDTO { public void setTimezone(Date timezone) { this.timezone = timezone; } + + @ApiModelProperty( + value = "Build tag" + ) + public String getBuildTag() { + return buildTag; + } + + public void setBuildTag(String buildTag) { + this.buildTag = buildTag; + } + + @ApiModelProperty( + value = "Build revision or commit hash" + ) + public String getBuildRevision() { + return buildRevision; + } + + public void setBuildRevision(String buildRevision) { + this.buildRevision = buildRevision; + } + + @ApiModelProperty( + value = "Build branch" + ) + public String getBuildBranch() { + return buildBranch; + } + + public void setBuildBranch(String buildBranch) { + this.buildBranch = buildBranch; + } + + @XmlJavaTypeAdapter(DateTimeAdapter.class) + @ApiModelProperty( + value = "Build timestamp", + dataType = "string" + ) + public Date getBuildTimestamp() { + return buildTimestamp; + } + + public void setBuildTimestamp(Date buildTimestamp) { + this.buildTimestamp = buildTimestamp; + } } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsSnapshotDTO.java index 0ff7eadf30..05826fc464 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsSnapshotDTO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsSnapshotDTO.java @@ -23,6 +23,7 @@ import java.util.Set; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.apache.nifi.web.api.dto.util.DateTimeAdapter; import org.apache.nifi.web.api.dto.util.TimeAdapter; import com.wordnik.swagger.annotations.ApiModelProperty; @@ -65,6 +66,8 @@ public class SystemDiagnosticsSnapshotDTO implements Cloneable { private Date statsLastRefreshed; + private VersionInfoDTO versionInfo; + @ApiModelProperty("Number of available processors if supported by the underlying system.") public Integer getAvailableProcessors() { @@ -305,6 +308,14 @@ public class SystemDiagnosticsSnapshotDTO implements Cloneable { this.maxHeapBytes = maxHeapBytes; } + @ApiModelProperty("The nifi, os, java, and build version information") + public VersionInfoDTO getVersionInfo() { + return versionInfo; + } + + public void setVersionInfo(VersionInfoDTO versionInfo) { + this.versionInfo = versionInfo; + } @Override public SystemDiagnosticsSnapshotDTO clone() { @@ -347,6 +358,8 @@ public class SystemDiagnosticsSnapshotDTO implements Cloneable { gcUsage.add(gcDto.clone()); } + other.setVersionInfo(getVersionInfo().clone()); + return other; } @@ -549,4 +562,129 @@ public class SystemDiagnosticsSnapshotDTO implements Cloneable { return other; } } + + /** + * Details for version information. + */ + @XmlType(name = "versionInfo") + public static class VersionInfoDTO implements Cloneable { + + private String nifiVersion; + private String javaVendor; + private String javaVersion; + private String osName; + private String osVersion; + private String osArchitecture; + private String buildTag; + private String buildRevision; + private String buildBranch; + private Date buildTimestamp; + + @ApiModelProperty("The version of this NiFi.") + public String getNiFiVersion() { + return nifiVersion; + } + + public void setNiFiVersion(String nifiVersion) { + this.nifiVersion = nifiVersion; + } + + @ApiModelProperty("Java JVM vendor") + public String getJavaVendor() { + return javaVendor; + } + + public void setJavaVendor(String javaVendor) { + this.javaVendor = javaVendor; + } + + @ApiModelProperty("Java version") + public String getJavaVersion() { + return javaVersion; + } + + public void setJavaVersion(String javaVersion) { + this.javaVersion = javaVersion; + } + + @ApiModelProperty("Host operating system name") + public String getOsName() { + return osName; + } + + public void setOsName(String osName) { + this.osName = osName; + } + + @ApiModelProperty("Host operating system version") + public String getOsVersion() { + return osVersion; + } + + public void setOsVersion(String osVersion) { + this.osVersion = osVersion; + } + + @ApiModelProperty("Host operating system architecture") + public String getOsArchitecture() { + return osArchitecture; + } + + public void setOsArchitecture(String osArchitecture) { + this.osArchitecture = osArchitecture; + } + + @ApiModelProperty("Build tag") + public String getBuildTag() { + return buildTag; + } + + public void setBuildTag(String buildTag) { + this.buildTag = buildTag; + } + + @ApiModelProperty("Build revision or commit hash") + public String getBuildRevision() { + return buildRevision; + } + + public void setBuildRevision(String buildRevision) { + this.buildRevision = buildRevision; + } + + @ApiModelProperty("Build branch") + public String getBuildBranch() { + return buildBranch; + } + + public void setBuildBranch(String buildBranch) { + this.buildBranch = buildBranch; + } + + @XmlJavaTypeAdapter(DateTimeAdapter.class) + @ApiModelProperty("Build timestamp") + public Date getBuildTimestamp() { + return buildTimestamp; + } + + public void setBuildTimestamp(Date buildTimestamp) { + this.buildTimestamp = buildTimestamp; + } + + @Override + public VersionInfoDTO clone() { + final VersionInfoDTO other = new VersionInfoDTO(); + other.setNiFiVersion(getNiFiVersion()); + other.setJavaVendor(getJavaVendor()); + other.setJavaVersion(getJavaVersion()); + other.setOsName(getOsName()); + other.setOsVersion(getOsVersion()); + other.setOsArchitecture(getOsArchitecture()); + other.setBuildTag(getBuildTag()); + other.setBuildTimestamp(getBuildTimestamp()); + other.setBuildBranch(getBuildBranch()); + other.setBuildRevision(getBuildRevision()); + return other; + } + } } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml index 4c1c07c784..c98fbfae35 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml @@ -170,6 +170,13 @@ 12 hours + + + ${project.scm.tag} + ${maven.build.timestamp} + + ${buildBranch} + ${buildRevision} diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties index d34380c3d1..a768af47b9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties @@ -195,4 +195,10 @@ nifi.kerberos.spnego.authentication.expiration=${nifi.kerberos.spnego.authentica # external properties files for variable registry # supports a comma delimited list of file locations -nifi.variable.registry.properties= \ No newline at end of file +nifi.variable.registry.properties= + +# Build info +nifi.build.tag=${nifi.build.tag} +nifi.build.branch=${nifi.build.branch} +nifi.build.revision=${nifi.build.revision} +nifi.build.timestamp=${nifi.build.timestamp} \ No newline at end of file diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java index c97bb71289..3119863d30 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java @@ -1089,7 +1089,14 @@ public class FlowResource extends ApplicationResource { aboutDTO.setTimezone(new Date()); // get the content viewer url - aboutDTO.setContentViewerUrl(getProperties().getProperty(NiFiProperties.CONTENT_VIEWER_URL)); + final NiFiProperties properties = getProperties(); + aboutDTO.setContentViewerUrl(properties.getProperty(NiFiProperties.CONTENT_VIEWER_URL)); + + // Get build info + aboutDTO.setBuildTag(properties.getProperty(NiFiProperties.BUILD_TAG)); + aboutDTO.setBuildRevision(properties.getProperty(NiFiProperties.BUILD_REVISION)); + aboutDTO.setBuildBranch(properties.getProperty(NiFiProperties.BUILD_BRANCH)); + aboutDTO.setBuildTimestamp(properties.getBuildTimestamp()); // create the response entity final AboutEntity entity = new AboutEntity(); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java index 3826b63f8c..39d09e94fe 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java @@ -107,6 +107,7 @@ import org.apache.nifi.reporting.BulletinRepository; import org.apache.nifi.reporting.ReportingTask; import org.apache.nifi.scheduling.SchedulingStrategy; import org.apache.nifi.util.FormatUtils; +import org.apache.nifi.util.NiFiProperties; import org.apache.nifi.util.StringUtils; import org.apache.nifi.web.FlowModification; import org.apache.nifi.web.Revision; @@ -193,6 +194,7 @@ public final class DtoFactory { private ControllerServiceProvider controllerServiceProvider; private EntityFactory entityFactory; private Authorizer authorizer; + private NiFiProperties properties; public ControllerConfigurationDTO createControllerConfigurationDto(final ControllerFacade controllerFacade) { final ControllerConfigurationDTO dto = new ControllerConfigurationDTO(); @@ -2356,6 +2358,10 @@ public final class DtoFactory { garbageCollectionDtos.add(createGarbageCollectionDTO(entry.getKey(), entry.getValue())); } + // version info + final SystemDiagnosticsSnapshotDTO.VersionInfoDTO versionInfoDto = createVersionInfoDTO(); + snapshot.setVersionInfo(versionInfoDto); + return dto; } @@ -2395,6 +2401,21 @@ public final class DtoFactory { return dto; } + public SystemDiagnosticsSnapshotDTO.VersionInfoDTO createVersionInfoDTO() { + final SystemDiagnosticsSnapshotDTO.VersionInfoDTO dto = new SystemDiagnosticsSnapshotDTO.VersionInfoDTO(); + dto.setNiFiVersion(properties.getUiTitle()); + dto.setJavaVendor(System.getProperty("java.vendor")); + dto.setJavaVersion(System.getProperty("java.version")); + dto.setOsName(System.getProperty("os.name")); + dto.setOsVersion(System.getProperty("os.version")); + dto.setOsArchitecture(System.getProperty("os.arch")); + dto.setBuildTag(properties.getProperty(NiFiProperties.BUILD_TAG)); + dto.setBuildRevision(properties.getProperty(NiFiProperties.BUILD_REVISION)); + dto.setBuildBranch(properties.getProperty(NiFiProperties.BUILD_BRANCH)); + dto.setBuildTimestamp(properties.getBuildTimestamp()); + return dto; + } + /** * Creates a ResourceDTO from the specified Resource. * @@ -3063,4 +3084,8 @@ public final class DtoFactory { public void setBulletinRepository(BulletinRepository bulletinRepository) { this.bulletinRepository = bulletinRepository; } + + public void setProperties(final NiFiProperties properties) { + this.properties = properties; + } } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml index 7cfe448c2c..bdc042af6c 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml @@ -52,6 +52,7 @@ + diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/about-dialog.jsp b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/about-dialog.jsp index 9024f35b98..0d99aaaf3a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/about-dialog.jsp +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/about-dialog.jsp @@ -22,6 +22,17 @@
+
+

+ +

+

+ Tagged +

+

+ From on branch +

+

Apache NiFi is a framework to support highly scalable and flexible dataflows. It can be run on on laptops up through clusters of enterprise class servers. diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/cluster/cluster-content.jsp b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/cluster/cluster-content.jsp index 02bcf610db..2b68060cec 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/cluster/cluster-content.jsp +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/cluster/cluster-content.jsp @@ -45,6 +45,9 @@

+
+
+
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/summary/system-diagnostics-dialog.jsp b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/summary/system-diagnostics-dialog.jsp index 9ab19e3601..11fda4632d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/summary/system-diagnostics-dialog.jsp +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/summary/system-diagnostics-dialog.jsp @@ -163,6 +163,35 @@
+ +
+
+
NiFi
+
+
NiFi Version
+
Tag
+
Build Date/Time
+
Branch
+
Revision
+
+
+
+
Java
+
+
Version
+
Vendor
+
+
+
+
Operating System
+
+
Name
+
Version
+
Architecture
+
+
+
+
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/about.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/about.css index 9556b28ecf..0c29af28dc 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/about.css +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/about.css @@ -22,20 +22,21 @@ } #nf-about-pic { - height: 50%; + height: 60%; background: url(../images/nifi-logo-about.svg) #000000 no-repeat center center; - top: 25%; + top: 20%; position: relative; } #nf-about-pic-container { - height: 50%; + height: 40%; background: #000000; } #nf-version { font-weight:500; font-size: 13px; + cursor: pointer; } #nf-about-content p { @@ -51,3 +52,20 @@ font-weight:900; } +#nf-version-detail { + padding: 5px 0 0 5px; + display: none; +} + +#nf-version-detail-tag { + display: none; +} + +#nf-version-detail-commit { + display: none; +} + +#nf-about-content #nf-version-detail p { + font-size: 12px; + padding: 0; +} diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/summary.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/summary.css index 3f0e5cfe0f..03101973b5 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/summary.css +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/summary.css @@ -217,6 +217,25 @@ div.storage-usage-progressbar div.ui-progressbar-value { border-radius: 0; } +dl.setting-attributes-list { + float: left; + font-size: 12px; + width: 100%; + padding-bottom: 20px; +} + +.setting-attributes-list dt { + float: left; + clear: left; + padding: 0 0.5em 0.3em 0; + font-weight: bold; +} + +.setting-attributes-list dd { + margin-left: 8em; + padding-bottom: 0.3em; +} + /* summary tabs */ #summary-tabs { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-global-menu-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-global-menu-controller.js index 2c44d48982..9981a32db5 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-global-menu-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-global-menu-controller.js @@ -278,6 +278,26 @@ nf.ng.Canvas.GlobalMenuCtrl = function (serviceProvider) { // set the document title and the about title document.title = aboutDetails.title; $('#nf-version').text(aboutDetails.version); + var showVersionDetail = false; + if (aboutDetails.buildTag && aboutDetails.buildTag !== 'HEAD') { + $('#nf-about-build-tag').text(aboutDetails.buildTag); + $('#nf-version-detail-tag').show(); + showVersionDetail = true; + } + if (aboutDetails.buildRevision) { + $('#nf-about-build-revision').text(aboutDetails.buildRevision); + $('#nf-about-build-branch').text(aboutDetails.buildBranch); + $('#nf-version-detail-commit').show(); + showVersionDetail = true + } + if (aboutDetails.buildTimestamp) { + $('#nf-about-build-timestamp').text(aboutDetails.buildTimestamp); + $('#nf-version-detail-timestamp').show(); + showVersionDetail = true; + } + if (showVersionDetail) { + $('#nf-version-detail').show(); + } // store the content viewer url if available if (!nf.Common.isBlank(aboutDetails.contentViewerUrl)) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js index 8bc169b302..689afa8484 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js @@ -191,7 +191,36 @@ nf.ClusterTable = (function () { }] }; - var clusterTabs = [nodesTab, systemTab, jvmTab, flowFileTab, contentTab]; + var versionTab = { + name: 'Versions', + data: { + dataSet: 'systemDiagnostics', + update: updateVersionTableData + }, + tabContentId: 'cluster-version-tab-content', + tableId: 'cluster-version-table', + tableColumnModel: [ + {id: 'node', field: 'node', name: 'Node Address', sortable: true, resizable: true}, + {id: 'version', field: 'version', name: 'NiFi Version', sortable: true, resizable: true}, + {id: 'javavendor', field: 'javaVendor', name: 'Java Vendor', sortable: true, resizable: true}, + {id: 'javaversion', field: 'javaVersion', name: 'Java Version', sortable: true, resizable: true}, + {id: 'osname', field: 'osName', name: 'OS Name', sortable: true, resizable: true}, + {id: 'osversion', field: 'osVersion', name: 'OS Version', sortable: true, resizable: true}, + {id: 'osarch', field: 'osArchitecture', name: 'OS Architecture', sortable: true, resizable: true} + ], + tableIdColumn: 'id', + tableOptions: commonTableOptions, + tableOnClick: null, + init: commonTableInit, + onSort: sort, + onTabSelected: onSelectTab, + filterOptions: [{ + text: 'by address', + value: 'address' + }] + }; + + var clusterTabs = [nodesTab, systemTab, jvmTab, flowFileTab, contentTab, versionTab]; var tabsByName = {}; var dataSetHandlers = {}; @@ -769,6 +798,35 @@ nf.ClusterTable = (function () { } } + /** + * Applies system diagnostics data to the Versions tab. + */ + function updateVersionTableData (systemDiagnosticsResponse) { + if (nf.Common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics) + && nf.Common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) { + + var versionTableRows = []; + systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots.forEach(function (nodeSnapshot) { + var snapshot = nodeSnapshot.snapshot; + versionTableRows.push({ + id: nodeSnapshot.nodeId, + address: nodeSnapshot.address, + node: nodeSnapshot.address + ':' + nodeSnapshot.apiPort, + version: snapshot.versionInfo.niFiVersion, + javaVendor: snapshot.versionInfo.javaVendor, + javaVersion: snapshot.versionInfo.javaVersion, + osName: snapshot.versionInfo.osName, + osVersion: snapshot.versionInfo.osVersion, + osArchitecture: snapshot.versionInfo.osArchitecture + }); + }); + + versionTab.dataView.setItems(versionTableRows); + versionTab.dataView.reSort(); + versionTab.grid.invalidate(); + } + } + /** * Loads system diagnostics data for the cluster. */ diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js index eb4dac6e29..11eec7e2e5 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js @@ -2010,6 +2010,9 @@ nf.SummaryTable = (function () { }, { name: 'System', tabContentId: 'system-tab-content' + }, { + name: 'Version', + tabContentId: 'version-tab-content' }] }); @@ -2293,6 +2296,28 @@ nf.SummaryTable = (function () { addStorageUsage(contentRepositoryUsageContainer, contentRepository); }); + // Version + var versionSpanSelectorToFieldMap = { + '#version-nifi': aggregateSnapshot.versionInfo.niFiVersion, + '#version-build-tag': aggregateSnapshot.versionInfo.buildTag, + '#version-build-timestamp': aggregateSnapshot.versionInfo.buildTimestamp, + '#version-build-branch': aggregateSnapshot.versionInfo.buildBranch, + '#version-build-revision': aggregateSnapshot.versionInfo.buildRevision, + '#version-java-version': aggregateSnapshot.versionInfo.javaVersion, + '#version-java-vendor': aggregateSnapshot.versionInfo.javaVendor, + '#version-os-name': aggregateSnapshot.versionInfo.osName, + '#version-os-version': aggregateSnapshot.versionInfo.osVersion, + '#version-os-arch': aggregateSnapshot.versionInfo.osArchitecture + }; + for (versionSpanSelector in versionSpanSelectorToFieldMap) { + var dataField = versionSpanSelectorToFieldMap[versionSpanSelector]; + if (dataField) { + $(versionSpanSelector).text(dataField); + } else { + $(versionSpanSelector).text('(not available)').addClass('unset'); + } + } + // update the stats last refreshed timestamp $('#system-diagnostics-last-refreshed').text(aggregateSnapshot.statsLastRefreshed); }).fail(nf.Common.handleAjaxError); diff --git a/pom.xml b/pom.xml index 11bcd3687f..c2daf65162 100644 --- a/pom.xml +++ b/pom.xml @@ -1537,6 +1537,11 @@ language governing permissions and limitations under the License. --> rpm-maven-plugin 2.1.4 + + org.codehaus.mojo + buildnumber-maven-plugin + 1.4 + org.antlr antlr3-maven-plugin