You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2014/12/23 16:28:57 UTC
[2/2] incubator-nifi git commit: NIFI-65: - Replacing calls to
nf.Common.submit with window.open where appropriate.
NIFI-65:
- Replacing calls to nf.Common.submit with window.open where appropriate.
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/7a29166d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/7a29166d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/7a29166d
Branch: refs/heads/NIFI-65
Commit: 7a29166d9cf009e7c259ddf48641f45737b4c76b
Parents: 1f4ae73
Author: Matt Gilman <ma...@gmail.com>
Authored: Tue Dec 23 10:28:41 2014 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Tue Dec 23 10:28:41 2014 -0500
----------------------------------------------------------------------
.../js/nf/provenance/nf-provenance-table.js | 107 +++++++++----------
.../js/nf/templates/nf-templates-table.js | 2 +-
2 files changed, 53 insertions(+), 56 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/7a29166d/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js
index bcd0fce..759bcda 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js
@@ -84,17 +84,18 @@ nf.ProvenanceTable = (function () {
var downloadContent = function (direction) {
var eventId = $('#provenance-event-id').text();
- // build the parameters
- var parameters = {};
+ // build the url
+ var url = config.urls.provenance + '/events/' + encodeURIComponent(eventId) + '/content/' + encodeURIComponent(direction);
// conditionally include the cluster node id
var clusterNodeId = $('#provenance-event-cluster-node-id').text();
if (!nf.Common.isBlank(clusterNodeId)) {
- parameters['clusterNodeId'] = clusterNodeId;
+ window.open(url + '?' + $.param({
+ 'clusterNodeId': clusterNodeId
+ }));
+ } else {
+ window.open(url);
}
-
- // get the content
- nf.Common.submit('GET', config.urls.provenance + '/events/' + encodeURIComponent(eventId) + '/content/' + encodeURIComponent(direction), parameters);
};
/**
@@ -191,6 +192,29 @@ nf.ProvenanceTable = (function () {
}
});
+ // input download
+ $('#input-content-download').on('click', function () {
+ downloadContent('input');
+ });
+
+ // output download
+ $('#output-content-download').on('click', function () {
+ downloadContent('output');
+ });
+
+ // if a content viewer url is specified, use it
+ if (isContentViewConfigured()) {
+ // input view
+ $('#input-content-view').on('click', function () {
+ viewContent('input');
+ });
+
+ // output view
+ $('#output-content-view').on('click', function () {
+ viewContent('output');
+ });
+ }
+
// handle the replay and downloading
if (nf.Common.isDFM()) {
// replay
@@ -220,29 +244,6 @@ nf.ProvenanceTable = (function () {
$('#event-details-dialog').modal('hide');
});
- // input download
- $('#input-content-download').on('click', function () {
- downloadContent('input');
- });
-
- // output download
- $('#output-content-download').on('click', function () {
- downloadContent('output');
- });
-
- // if a content viewer url is specified, use it
- if (isContentViewConfigured()) {
- // input view
- $('#input-content-view').on('click', function () {
- viewContent('input');
- });
-
- // output view
- $('#output-content-view').on('click', function () {
- viewContent('output');
- });
- }
-
// show the replay panel
$('#replay-details').show();
}
@@ -1281,19 +1282,17 @@ nf.ProvenanceTable = (function () {
$('#output-content-download').hide();
- if (nf.Common.isDFM()) {
- if (event.inputContentAvailable === true) {
- $('#input-content-download').show();
+ if (event.inputContentAvailable === true) {
+ $('#input-content-download').show();
- if (isContentViewConfigured()) {
- $('#input-content-view').show();
- } else {
- $('#input-content-view').hide();
- }
+ if (isContentViewConfigured()) {
+ $('#input-content-view').show();
} else {
- $('#input-content-download').hide();
$('#input-content-view').hide();
}
+ } else {
+ $('#input-content-download').hide();
+ $('#input-content-view').hide();
}
} else {
$('#output-content-details').show();
@@ -1327,32 +1326,30 @@ nf.ProvenanceTable = (function () {
outputContentSize.attr('title', nf.Common.formatInteger(event.outputContentClaimFileSizeBytes) + ' bytes');
}
- if (nf.Common.isDFM()) {
- if (event.inputContentAvailable === true) {
- $('#input-content-download').show();
+ if (event.inputContentAvailable === true) {
+ $('#input-content-download').show();
- if (isContentViewConfigured()) {
- $('#input-content-view').show();
- } else {
- $('#input-content-view').hide();
- }
+ if (isContentViewConfigured()) {
+ $('#input-content-view').show();
} else {
- $('#input-content-download').hide();
$('#input-content-view').hide();
}
+ } else {
+ $('#input-content-download').hide();
+ $('#input-content-view').hide();
+ }
- if (event.outputContentAvailable === true) {
- $('#output-content-download').show();
+ if (event.outputContentAvailable === true) {
+ $('#output-content-download').show();
- if (isContentViewConfigured()) {
- $('#output-content-view').show();
- } else {
- $('#output-content-view').hide();
- }
+ if (isContentViewConfigured()) {
+ $('#output-content-view').show();
} else {
- $('#output-content-download').hide();
$('#output-content-view').hide();
}
+ } else {
+ $('#output-content-download').hide();
+ $('#output-content-view').hide();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/7a29166d/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js
index 7f486de..1756207 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js
@@ -270,7 +270,7 @@ nf.TemplatesTable = (function () {
if (nf.Common.isDefinedAndNotNull(grid)) {
var data = grid.getData();
var item = data.getItem(row);
- nf.Common.submit('GET', config.urls.templates + '/' + encodeURIComponent(item.id));
+ window.open(config.urls.templates + '/' + encodeURIComponent(item.id));
}
},