|
@@ -15,6 +15,7 @@
|
|
############################################################################## */
|
|
############################################################################## */
|
|
define([
|
|
define([
|
|
"dojo/_base/declare",
|
|
"dojo/_base/declare",
|
|
|
|
+ "dojo/_base/array",
|
|
"dojo/on",
|
|
"dojo/on",
|
|
|
|
|
|
"dijit/form/Button",
|
|
"dijit/form/Button",
|
|
@@ -29,12 +30,13 @@ define([
|
|
"hpcc/GridDetailsWidget",
|
|
"hpcc/GridDetailsWidget",
|
|
"hpcc/ESPWorkunit",
|
|
"hpcc/ESPWorkunit",
|
|
"hpcc/GraphPageWidget",
|
|
"hpcc/GraphPageWidget",
|
|
|
|
+ "hpcc/TimingTreeMapWidget",
|
|
"hpcc/ESPUtil"
|
|
"hpcc/ESPUtil"
|
|
|
|
|
|
-], function (declare, on,
|
|
|
|
|
|
+], function (declare, arrayUtil, on,
|
|
Button,
|
|
Button,
|
|
OnDemandGrid, Keyboard, Selection, selector, ColumnResizer, DijitRegistry,
|
|
OnDemandGrid, Keyboard, Selection, selector, ColumnResizer, DijitRegistry,
|
|
- GridDetailsWidget, ESPWorkunit, GraphPageWidget, ESPUtil) {
|
|
|
|
|
|
+ GridDetailsWidget, ESPWorkunit, GraphPageWidget, TimingTreeMapWidget, ESPUtil) {
|
|
return declare("GraphsWidget", [GridDetailsWidget], {
|
|
return declare("GraphsWidget", [GridDetailsWidget], {
|
|
|
|
|
|
gridTitle: "Graphs",
|
|
gridTitle: "Graphs",
|
|
@@ -42,6 +44,18 @@ define([
|
|
|
|
|
|
wu: null,
|
|
wu: null,
|
|
|
|
|
|
|
|
+ postCreate: function (args) {
|
|
|
|
+ this.inherited(arguments);
|
|
|
|
+ this.timingTreeMap = new TimingTreeMapWidget({
|
|
|
|
+ id: this.id + "TimingTreeMap",
|
|
|
|
+ region: "right",
|
|
|
|
+ splitter: true,
|
|
|
|
+ style: "width: 33%",
|
|
|
|
+ minSize: 120
|
|
|
|
+ });
|
|
|
|
+ this.timingTreeMap.placeAt(this.gridTab, "last");
|
|
|
|
+ },
|
|
|
|
+
|
|
init: function (params) {
|
|
init: function (params) {
|
|
if (this.inherited(arguments))
|
|
if (this.inherited(arguments))
|
|
return;
|
|
return;
|
|
@@ -56,6 +70,15 @@ define([
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ this.timingTreeMap.init(params);
|
|
|
|
+ this.timingTreeMap.onClick = function (value) {
|
|
|
|
+ context.syncSelectionFrom(context.timingTreeMap);
|
|
|
|
+ }
|
|
|
|
+ this.timingTreeMap.onDblClick = function (item) {
|
|
|
|
+ context._onOpen(item, {
|
|
|
|
+ SubGraphId: item.SubGraphId
|
|
|
|
+ });
|
|
|
|
+ }
|
|
this._refreshActionState();
|
|
this._refreshActionState();
|
|
},
|
|
},
|
|
|
|
|
|
@@ -93,6 +116,10 @@ define([
|
|
}, domID);
|
|
}, domID);
|
|
|
|
|
|
var context = this;
|
|
var context = this;
|
|
|
|
+ retVal.on(".dgrid-row:click", function (evt) {
|
|
|
|
+ context.syncSelectionFrom(evt);
|
|
|
|
+ });
|
|
|
|
+
|
|
on(document, "." + this.id + "GraphClick:click", function (evt) {
|
|
on(document, "." + this.id + "GraphClick:click", function (evt) {
|
|
if (context._onRowDblClick) {
|
|
if (context._onRowDblClick) {
|
|
var row = retVal.row(evt).data;
|
|
var row = retVal.row(evt).data;
|
|
@@ -103,10 +130,6 @@ define([
|
|
},
|
|
},
|
|
|
|
|
|
createDetail: function (id, row, params) {
|
|
createDetail: function (id, row, params) {
|
|
- var safeMode = false;
|
|
|
|
- if (params && params.safeMode) {
|
|
|
|
- var safeMode = true;
|
|
|
|
- }
|
|
|
|
return new GraphPageWidget({
|
|
return new GraphPageWidget({
|
|
id: id,
|
|
id: id,
|
|
title: row.Name,
|
|
title: row.Name,
|
|
@@ -116,7 +139,8 @@ define([
|
|
params: {
|
|
params: {
|
|
Wuid: this.wu.Wuid,
|
|
Wuid: this.wu.Wuid,
|
|
GraphName: row.Name,
|
|
GraphName: row.Name,
|
|
- SafeMode: safeMode
|
|
|
|
|
|
+ SubGraphId: (params && params.SubGraphId) ? params.SubGraphId : null,
|
|
|
|
+ SafeMode: (params && params.safeMode) ? true : false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -139,6 +163,41 @@ define([
|
|
this.inherited(arguments);
|
|
this.inherited(arguments);
|
|
|
|
|
|
this.openSafeMode.set("disabled", !selection.length);
|
|
this.openSafeMode.set("disabled", !selection.length);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ syncSelectionFrom: function (sourceControl) {
|
|
|
|
+ var graphItems = [];
|
|
|
|
+ var timingItems = [];
|
|
|
|
+
|
|
|
|
+ // Get Selected Items ---
|
|
|
|
+ if (sourceControl == this.grid) {
|
|
|
|
+ arrayUtil.forEach(sourceControl.getSelected(), function (item, idx) {
|
|
|
|
+ timingItems.push(item);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if (sourceControl == this.timingTreeMap) {
|
|
|
|
+ arrayUtil.forEach(sourceControl.getSelected(), function (item, idx) {
|
|
|
|
+ if (item.children) {
|
|
|
|
+ if (item.children.length) {
|
|
|
|
+ graphItems.push({
|
|
|
|
+ Name: item.children[0].GraphName
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ graphItems.push({
|
|
|
|
+ Name: item.GraphName
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Set Selected Items ---
|
|
|
|
+ if (sourceControl != this.grid) {
|
|
|
|
+ this.grid.setSelected(graphItems);
|
|
|
|
+ }
|
|
|
|
+ if (sourceControl != this.timingTreeMap) {
|
|
|
|
+ this.timingTreeMap.setSelectedGraphs(timingItems);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|