Author: kamrul
Date: Fri Nov 2 01:47:22 2012
New Revision: 1404852
URL: http://svn.apache.org/viewvc?rev=1404852&view=rev
Log:
OOZIE-959 Use API from OOZIE-906 in console (Ashish via Mohammad)
Modified:
oozie/branches/branch-3.3/webapp/src/main/webapp/oozie-console.js
Modified: oozie/branches/branch-3.3/webapp/src/main/webapp/oozie-console.js
URL:
http://svn.apache.org/viewvc/oozie/branches/branch-3.3/webapp/src/main/webapp/oozie-console.js?rev=1404852&r1=1404851&r2=1404852&view=diff
==============================================================================
--- oozie/branches/branch-3.3/webapp/src/main/webapp/oozie-console.js (original)
+++ oozie/branches/branch-3.3/webapp/src/main/webapp/oozie-console.js Fri Nov
2 01:47:22 2012
@@ -169,6 +169,40 @@ function getPagingBar(dataStore) {
return pagingBar;
}
+// Image object display
+Ext.ux.Image = Ext.extend(Ext.BoxComponent, {
+
+ url: Ext.BLANK_IMAGE_URL, //for initial src value
+
+ autoEl: {
+ tag: 'img',
+ src: Ext.BLANK_IMAGE_URL,
+ },
+
+ initComponent: function() {
+ Ext.ux.Image.superclass.initComponent.call(this);
+ this.addEvents('load');
+ },
+
+// Add our custom processing to the onRender phase.
+// We add a âloadâ listener to our element.
+ onRender: function() {
+ Ext.ux.Image.superclass.onRender.apply(this, arguments);
+ this.el.on('load', this.onLoad, this);
+ if(this.url){
+ this.setSrc(this.url);
+ }
+ },
+
+ onLoad: function() {
+ this.fireEvent('load', this);
+ },
+
+ setSrc: function(src) {
+ this.el.dom.src = src;
+ }
+});
+
// stuff to show details of a job
function jobDetailsPopup(response, request) {
var jobDefinitionArea = new Ext.form.TextArea({
@@ -498,6 +532,18 @@ function jobDetailsPopup(response, reque
win.show();
}
}
+ var dagImg = new Ext.ux.Image({
+ id: 'dagImage',
+ url: getOozieBase() + 'job/' + workflowId + "?show=graph",
+ readOnly: true,
+ editable: false,
+ autoScroll: true
+ });
+
+ function fetchDAG(workflowId) {
+ dagImg.setSrc(getOozieBase() + 'job/' + workflowId +
'?show=graph&token=' + Math.random());
+ }
+
var jobDetailsTab = new Ext.TabPanel({
activeTab: 0,
autoHeight: true,
@@ -532,6 +578,16 @@ function jobDetailsPopup(response, reque
}
}]
+ }, {
+ title: 'Job DAG',
+ items: dagImg,
+ tbar: [{
+ text: " ",
+ icon: 'ext-2.2/resources/images/default/grid/refresh.gif',
+ handler: function() {
+ fetchDAG(workflowId);
+ }
+ }]
}]
});
jobDetailsTab.addListener("tabchange", function(panel, selectedTab) {
@@ -544,6 +600,8 @@ function jobDetailsPopup(response, reque
}
else if (selectedTab.title == 'Job Definition') {
fetchDefinition(workflowId);
+ } else if(selectedTab.title == 'Job DAG') {
+ fetchDAG(workflowId);
}
jobs_grid.setVisible(false);
});
@@ -674,13 +732,13 @@ function coordJobDetailsPopup(response,
name: 'user',
width: 200,
value: jobDetails["user"]
- }, {
+ }, {
fieldLabel: 'Group',
editable: false,
name: 'group',
width: 200,
value: jobDetails["group"]
- }, {
+ }, {
fieldLabel: 'Frequency',
editable: false,
name: 'frequency',
@@ -704,7 +762,7 @@ function coordJobDetailsPopup(response,
name: 'nextMaterializedTime',
width: 170,
value: jobDetails["nextMaterializedTime"]
- }, ]
+ }]
});
var fs = new Ext.FormPanel({
frame: true,
@@ -941,8 +999,8 @@ function coordJobDetailsPopup(response,
items: [jobLogArea, actionsTextBox, getLogButton],
tbar: [ {
text: " ",
- icon: 'ext-2.2/resources/images/default/grid/refresh.gif',
- }],
+ icon: 'ext-2.2/resources/images/default/grid/refresh.gif'
+ }]
}]
});
@@ -1523,11 +1581,9 @@ var checkStatus = new Ext.Action({
else {
checkStatus.setText("<font color='007000' size='2> Status
- Normal</font>");
}
- },
-
+ }
});
- },
-
+ }
});
@@ -1639,17 +1695,14 @@ var viewOSDetails = new Ext.Action({
success: function(response, request) {
var configData = getConfigObject(response.responseText);
configGridData.loadData(configData);
- },
-
+ }
});
- },
-
+ }
});
var treeRoot = new Ext.tree.TreeNode({
text: "Instrumentation",
- expanded: true,
-
+ expanded: true
});
var timeZones_store = new Ext.data.JsonStore({
@@ -1760,8 +1813,7 @@ function initConsole() {
cellclick: {
fn: showJobContextMenu
}
- },
-
+ }
});
var expander = new Ext.grid.RowExpander({
tpl: new Ext.Template('<br><p><b>Name:</b> {name}</p>',
'<p><b>Value:</b> {value}</p>')
@@ -1888,7 +1940,7 @@ function initConsole() {
cellclick: {
fn: showCoordJobContextMenu
}
- },
+ }
});
var bundleJobArea = new Ext.grid.GridPanel({
store: bundle_jobs_store,
@@ -2008,4 +2060,4 @@ function initConsole() {
// now the on ready function
Ext.onReady(function() {
getSupportedVersions.execute();
-});
\ No newline at end of file
+});