Skip to content

Commit

Permalink
NIFI-13048 Added Build Info and NiFi API version for bundles to Registry
Browse files Browse the repository at this point in the history
This closes #8649

Signed-off-by: David Handermann <exceptionfactory@apache.org>
  • Loading branch information
pvillard31 authored and exceptionfactory committed Apr 17, 2024
1 parent 6eff8a9 commit 5eccc4c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<button class="nf-registry-change-log-refresh" (click)="nfRegistryService.getDropletSnapshotMetadata(droplet)" matTooltip="Refresh" mat-icon-button>
<i class="fa fa-refresh info" aria-hidden="true"></i>
</button>
<div id="nifi-registry-explorer-grid-list-viewer-droplet-container-details-change-log">
<div *ngIf="!droplet.bundleType" id="nifi-registry-explorer-grid-list-viewer-droplet-container-details-change-log">
<td-steps mode="vertical">
<td-step label="Version {{snapshotMeta.version}} - {{snapshotMeta.timestamp | amTimeAgo}}" sublabel="by {{snapshotMeta.author}}"
*ngFor="let snapshotMeta of droplet.snapshotMetadata; let i = index"
Expand All @@ -115,7 +115,41 @@
No comments specified
</div>
<div fxLayout="row" class="mat-caption">
{{(snapshotMeta.timestamp/1000 | amFromUnix) | amDateFormat:'MMM-DD-YYYY'}} at {{(snapshotMeta.timestamp/1000 | amFromUnix) | amDateFormat:'h:mm A'}}
{{(snapshotMeta.timestamp/1000 | amFromUnix) | amDateFormat:'YYYY-MM-DD'}} at {{(snapshotMeta.timestamp/1000 | amFromUnix) | amDateFormat:'h:mm A'}}
</div>
</div>
</td-step>
</td-steps>
</div>
<div *ngIf="droplet.bundleType" id="nifi-registry-explorer-grid-list-viewer-droplet-container-details-change-log">
<td-steps mode="vertical">
<td-step label="Version {{snapshotMeta.version}} ({{nfRegistryService.getHumanReadableSize(snapshotMeta.contentSize)}}) - {{snapshotMeta.timestamp | amTimeAgo}}" sublabel="by {{snapshotMeta.author}}"
*ngFor="let snapshotMeta of droplet.snapshotMetadata; let i = index"
[active]="i === 0 ? true : false">
<div fxLayout="column" fxLayoutAlign="space-between stretch">
<div fxLayout="row" class="mat-body-3">
<div>
Build Information:
<ul>
<li><b>NiFi API Version</b>: {{snapshotMeta.systemApiVersion}}</li>
<li><b>Build Branch</b>: {{snapshotMeta.buildInfo.buildBranch}}</li>
<li><b>Build Flags</b>: {{snapshotMeta.buildInfo.buildFlags}}</li>
<li><b>Build Revision</b>: {{snapshotMeta.buildInfo.buildRevision}}</li>
<li><b>Build Tag</b>: {{snapshotMeta.buildInfo.buildTag}}</li>
<li><b>Build Tool</b>: {{snapshotMeta.buildInfo.buildTool}}</li>
<li><b>Built By</b>: {{snapshotMeta.buildInfo.builtBy}}</li>
<li><b>Built On</b>: {{(snapshotMeta.buildInfo.built/1000 | amFromUnix) | amDateFormat:'YYYY-MM-DD'}} at {{(snapshotMeta.buildInfo.built/1000 | amFromUnix) | amDateFormat:'h:mm A'}}</li>
</ul>
</div>
</div>
<div *ngIf="snapshotMeta.comments" fxLayout="row" class="mat-body-2">
{{snapshotMeta.comments}}
</div>
<div *ngIf="!snapshotMeta.comments" fxLayout="row" class="mat-body-2">
No comments specified
</div>
<div fxLayout="row" class="mat-caption">
{{(snapshotMeta.timestamp/1000 | amFromUnix) | amDateFormat:'YYYY-MM-DD'}} at {{(snapshotMeta.timestamp/1000 | amFromUnix) | amDateFormat:'h:mm A'}}
</div>
</div>
</td-step>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function NfRegistryService(nfRegistryApi, nfStorage, tdDataTableService, router,
}
},
{
name: 'Delete flow',
name: 'Delete',
icon: 'fa fa-trash',
tooltip: 'Delete',
disabled: function (droplet) {
Expand Down Expand Up @@ -436,7 +436,7 @@ NfRegistryService.prototype = {
deleteDroplet: function (droplet) {
var self = this;
this.dialogService.openConfirm({
title: 'Delete Flow',
title: 'Delete ' + droplet.type,
message: 'All versions of this ' + droplet.type.toLowerCase() + ' will be deleted.',
cancelButton: 'Cancel',
acceptButton: 'Delete',
Expand Down Expand Up @@ -543,7 +543,7 @@ NfRegistryService.prototype = {
// Opens the export flow version dialog
this.openExportVersionedFlowDialog(droplet);
break;
case 'delete flow':
case 'delete':
// Deletes the entire data flow
this.deleteDroplet(droplet);
break;
Expand Down Expand Up @@ -1329,6 +1329,16 @@ NfRegistryService.prototype = {
});
}
return data;
},

/**
* Returns a human readable size
*
* @param size Size in bytes.
*/
getHumanReadableSize: function (size) {
var i = size === 0 ? 0 : Math.floor(Math.log(size) / Math.log(1024));
return +((size / (1024 ** i)).toFixed(2)) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
}

//</editor-fold>
Expand Down

0 comments on commit 5eccc4c

Please sign in to comment.