Просмотр исходного кода

HPCC-8044 Redesign WU Details Page

Fix mixed tab/space indentations

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Gordon Smith 12 лет назад
Родитель
Сommit
4de2e1b27f

+ 75 - 75
esp/files/scripts/ESPBase.js

@@ -14,87 +14,87 @@
 #    limitations under the License.
 ############################################################################## */
 define([
-	"dojo/_base/declare",
-	"dojo/_base/config"
+    "dojo/_base/declare",
+    "dojo/_base/config"
 ], function (declare, config) {
-	return declare(null, {
+    return declare(null, {
 
-		constructor: function (args) {
-			declare.safeMixin(this, args);
-		},
+        constructor: function (args) {
+            declare.safeMixin(this, args);
+        },
 
-		getParam: function (key) {
-			var value = dojo.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) == "?" ? 1 : 0)))[key];
+        getParam: function (key) {
+            var value = dojo.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) == "?" ? 1 : 0)))[key];
 
-			if (value)
-				return value;
-			return config[key];
-		},
+            if (value)
+                return value;
+            return config[key];
+        },
 
-		getBaseURL: function (service) {
-			if (!service) {
-				service = "WsWorkunits";
-			}
-			var serverIP = this.getParam("serverIP");
-			if (serverIP)
-				return "http://" + serverIP + ":8010/" + service;
-			return "/" + service;
-		},
+        getBaseURL: function (service) {
+            if (!service) {
+                service = "WsWorkunits";
+            }
+            var serverIP = this.getParam("serverIP");
+            if (serverIP)
+                return "http://" + serverIP + ":8010/" + service;
+            return "/" + service;
+        },
 
-		getValue: function (domXml, tagName, knownObjectArrays) {
-			var retVal = this.getValues(domXml, tagName, knownObjectArrays);
-			if (retVal.length == 0) {
-				return null;
-			} else if (retVal.length != 1) {
-				alert("Invalid length:  " + retVal.length);
-			}
-			return retVal[0];
-		},
+        getValue: function (domXml, tagName, knownObjectArrays) {
+            var retVal = this.getValues(domXml, tagName, knownObjectArrays);
+            if (retVal.length == 0) {
+                return null;
+            } else if (retVal.length != 1) {
+                alert("Invalid length:  " + retVal.length);
+            }
+            return retVal[0];
+        },
 
-		getValues: function (domXml, tagName, knownObjectArrays) {
-			var retVal = [];
-			var items = domXml.getElementsByTagName(tagName);
-			var parentNode = items.length ? items[0].parentNode : null; //  Prevent <Dataset><row><field><row> scenario
-			for (var i = 0; i < items.length; ++i) {
-				if (items[i].parentNode == parentNode)
-					retVal.push(this.flattenXml(items[i], knownObjectArrays));
-			}
-			return retVal;
-		},
+        getValues: function (domXml, tagName, knownObjectArrays) {
+            var retVal = [];
+            var items = domXml.getElementsByTagName(tagName);
+            var parentNode = items.length ? items[0].parentNode : null; //  Prevent <Dataset><row><field><row> scenario
+            for (var i = 0; i < items.length; ++i) {
+                if (items[i].parentNode == parentNode)
+                    retVal.push(this.flattenXml(items[i], knownObjectArrays));
+            }
+            return retVal;
+        },
 
-		flattenXml: function (domXml, knownObjectArrays) {
-			var retValArr = [];
-			var retValStr = "";
-			var retVal = {};
-			for (var i = 0; i < domXml.childNodes.length; ++i) {
-				var childNode = domXml.childNodes[i];
-				if (childNode.childNodes) {
-					if (childNode.nodeName && knownObjectArrays != null && dojo.indexOf(knownObjectArrays, childNode.nodeName) >= 0) {
-						retValArr.push(this.flattenXml(childNode, knownObjectArrays));
-					} else if (childNode.nodeName == "#text") {
-						retValStr += childNode.nodeValue;
-					} else if (childNode.childNodes.length == 0) {
-						retVal[childNode.nodeName] = null;
-					} else {
-						var value = this.flattenXml(childNode, knownObjectArrays);
-						if (retVal[childNode.nodeName] == null) {
-							retVal[childNode.nodeName] = value;
-						} else if (dojo.isArray(retVal[childNode.nodeName])) {
-							retVal[childNode.nodeName].push(value);
-						} else if (dojo.isObject(retVal[childNode.nodeName])) {
-							var tmp = retVal[childNode.nodeName];
-							retVal[childNode.nodeName] = [];
-							retVal[childNode.nodeName].push(tmp);
-							retVal[childNode.nodeName].push(value);
-						}
-					}
-				}
-			}
-			if (retValArr.length)
-				return retValArr;
-			else if (retValStr.length)
-				return retValStr;
-			return retVal;
-		}
-	});
+        flattenXml: function (domXml, knownObjectArrays) {
+            var retValArr = [];
+            var retValStr = "";
+            var retVal = {};
+            for (var i = 0; i < domXml.childNodes.length; ++i) {
+                var childNode = domXml.childNodes[i];
+                if (childNode.childNodes) {
+                    if (childNode.nodeName && knownObjectArrays != null && dojo.indexOf(knownObjectArrays, childNode.nodeName) >= 0) {
+                        retValArr.push(this.flattenXml(childNode, knownObjectArrays));
+                    } else if (childNode.nodeName == "#text") {
+                        retValStr += childNode.nodeValue;
+                    } else if (childNode.childNodes.length == 0) {
+                        retVal[childNode.nodeName] = null;
+                    } else {
+                        var value = this.flattenXml(childNode, knownObjectArrays);
+                        if (retVal[childNode.nodeName] == null) {
+                            retVal[childNode.nodeName] = value;
+                        } else if (dojo.isArray(retVal[childNode.nodeName])) {
+                            retVal[childNode.nodeName].push(value);
+                        } else if (dojo.isObject(retVal[childNode.nodeName])) {
+                            var tmp = retVal[childNode.nodeName];
+                            retVal[childNode.nodeName] = [];
+                            retVal[childNode.nodeName].push(tmp);
+                            retVal[childNode.nodeName].push(value);
+                        }
+                    }
+                }
+            }
+            if (retValArr.length)
+                return retValArr;
+            else if (retValStr.length)
+                return retValStr;
+            return retVal;
+        }
+    });
 });

+ 86 - 86
esp/files/scripts/ESPResult.js

@@ -26,47 +26,47 @@ define([
     "hpcc/WsWorkunits",
     "hpcc/ESPBase"
 ], function (declare, Deferred, ObjectStore, domConstruct,
-            parser, DomParser, entities, 
+            parser, DomParser, entities,
             WsWorkunits, ESPBase) {
-	return declare(ESPBase, {
-		store: null,
-		Total: "-1",
+    return declare(ESPBase, {
+        store: null,
+        Total: "-1",
 
-		constructor: function (args) {
-			declare.safeMixin(this, args);
-			if (this.Sequence != null) {
-				this.store = new WsWorkunits.WUResult({
-					wuid: this.wuid,
-					sequence: this.Sequence,
-					isComplete: this.isComplete()
-				});
-			} else {
-				this.store = new WsWorkunits.WUResult({
-					wuid: this.wuid,
-					name: this.Name,
-					isComplete: true
-				});
-			}
-		},
+        constructor: function (args) {
+            declare.safeMixin(this, args);
+            if (this.Sequence != null) {
+                this.store = new WsWorkunits.WUResult({
+                    wuid: this.wuid,
+                    sequence: this.Sequence,
+                    isComplete: this.isComplete()
+                });
+            } else {
+                this.store = new WsWorkunits.WUResult({
+                    wuid: this.wuid,
+                    name: this.Name,
+                    isComplete: true
+                });
+            }
+        },
 
-		getName: function () {
-			return this.Name;
-		},
+        getName: function () {
+            return this.Name;
+        },
 
-		getID: function () {
-			if (this.Sequence != null) {
-				return this.Sequence;
-			}
-			return this.Name;
-		},
+        getID: function () {
+            if (this.Sequence != null) {
+                return this.Sequence;
+            }
+            return this.Name;
+        },
 
-		isComplete: function () {
-			return this.Total != "-1";
-		},
+        isComplete: function () {
+            return this.Total != "-1";
+        },
 
         getFirstSchemaNode: function (node, name) {
             if (node && node.attributes) {
-                if ((node.baseName && node.baseName == name) || (node.localName && node.localName == name) || (typeof(node.getAttribute) != "undefined" && node.getAttribute("name") == name)) {
+                if ((node.baseName && node.baseName == name) || (node.localName && node.localName == name) || (typeof (node.getAttribute) != "undefined" && node.getAttribute("name") == name)) {
                     return node;
                 }
             }
@@ -242,61 +242,61 @@ define([
             return retVal;
         },
 
-		extractWidth: function (type, name) {
-			var retVal = -1;
+        extractWidth: function (type, name) {
+            var retVal = -1;
 
-			switch (type) {
-				case "xs:boolean":
-					retVal = 5;
-					break;
-				case "xs:integer":
-					retVal = 8;
-					break;
-				case "xs:nonNegativeInteger":
-					retVal = 8;
-					break;
-				case "xs:double":
-					retVal = 8;
-					break;
-				case "xs:string":
-					retVal = 32;
-					break;
-				default:
-					var numStr = "0123456789";
-					var underbarPos = type.lastIndexOf("_");
-					var length = underbarPos > 0 ? underbarPos : type.length;
-					var i = length - 1;
-					for (; i >= 0; --i) {
-						if (numStr.indexOf(type.charAt(i)) == -1)
-							break;
-					}
-					if (i + 1 < length) {
-						retVal = parseInt(type.substring(i + 1, length));
-					}
-					if (type.indexOf("data") == 0) {
-						retVal *= 2;
-					}
-					break;
-			}
-			if (retVal < name.length)
-				retVal = name.length;
+            switch (type) {
+                case "xs:boolean":
+                    retVal = 5;
+                    break;
+                case "xs:integer":
+                    retVal = 8;
+                    break;
+                case "xs:nonNegativeInteger":
+                    retVal = 8;
+                    break;
+                case "xs:double":
+                    retVal = 8;
+                    break;
+                case "xs:string":
+                    retVal = 32;
+                    break;
+                default:
+                    var numStr = "0123456789";
+                    var underbarPos = type.lastIndexOf("_");
+                    var length = underbarPos > 0 ? underbarPos : type.length;
+                    var i = length - 1;
+                    for (; i >= 0; --i) {
+                        if (numStr.indexOf(type.charAt(i)) == -1)
+                            break;
+                    }
+                    if (i + 1 < length) {
+                        retVal = parseInt(type.substring(i + 1, length));
+                    }
+                    if (type.indexOf("data") == 0) {
+                        retVal *= 2;
+                    }
+                    break;
+            }
+            if (retVal < name.length)
+                retVal = name.length;
 
-			return retVal;
-		},
+            return retVal;
+        },
 
-		getObjectStore: function () {
-			return ObjectStore({
-				objectStore: this.store
-			});
-		},
+        getObjectStore: function () {
+            return ObjectStore({
+                objectStore: this.store
+            });
+        },
 
-		getECLRecord: function () {
-			var retVal = "RECORD\n";
-			for (var i = 0; i < this.ECLSchemas.ECLSchemaItem.length; ++i) {
-				retVal += "\t" + this.ECLSchemas.ECLSchemaItem[i].ColumnType + "\t" + this.ECLSchemas.ECLSchemaItem[i].ColumnName + ";\n";
-			}
-			retVal += "END;\n";
-			return retVal;
-		}
-	});
+        getECLRecord: function () {
+            var retVal = "RECORD\n";
+            for (var i = 0; i < this.ECLSchemas.ECLSchemaItem.length; ++i) {
+                retVal += "\t" + this.ECLSchemas.ECLSchemaItem[i].ColumnType + "\t" + this.ECLSchemas.ECLSchemaItem[i].ColumnName + ";\n";
+            }
+            retVal += "END;\n";
+            return retVal;
+        }
+    });
 });

Разница между файлами не показана из-за своего большого размера
+ 513 - 513
esp/files/scripts/ESPWorkunit.js


+ 2 - 2
esp/files/scripts/GraphPageWidget.js

@@ -163,11 +163,11 @@ define([
             this.timingGrid = registry.byId(this.id + "TimingsGrid");
 
             var context = this;
-            this.timingGrid.onClick = function(items) {
+            this.timingGrid.onClick = function (items) {
                 context.syncSelectionFrom(context.timingGrid);
             };
 
-            this.timingGrid.onDblClick = function(item) {
+            this.timingGrid.onDblClick = function (item) {
                 var subgraphID = item.SubGraphId;
                 var mainItem = context.main.getItem(subgraphID);
                 context.main.centerOnItem(mainItem, true);

+ 2 - 2
esp/files/scripts/InfoGridWidget.js

@@ -31,8 +31,8 @@ define([
 
     "dojo/text!../templates/InfoGridWidget.html"
 ],
-    function (declare, array, Memory, ObjectStore, 
-            registry, _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, 
+    function (declare, array, Memory, ObjectStore,
+            registry, _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin,
             DataGrid,
             ESPWorkunit,
             template) {

+ 2 - 2
esp/files/scripts/LogsWidget.js

@@ -35,7 +35,7 @@ define([
     "dojo/text!../templates/LogsWidget.html"
 ],
     function (declare, array, lang, Memory, ObjectStore, iframe,
-            registry, _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, 
+            registry, _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin,
             EnhancedGrid, IndirectSelection,
             ESPWorkunit,
             template) {
@@ -64,7 +64,7 @@ define([
                     ],
                     plugins: {
                         indirectSelection: {
-                            headerSelector:true, width:"40px", styles:"text-align: center;"
+                            headerSelector: true, width: "40px", styles: "text-align: center;"
                         }
                     }
                 });

+ 183 - 183
esp/files/scripts/ResultsControl.js

@@ -14,193 +14,193 @@
 #    limitations under the License.
 ############################################################################## */
 define([
-	"dojo/_base/declare",
-	"dojo/store/Memory",
-	"dojo/data/ObjectStore",
+    "dojo/_base/declare",
+    "dojo/store/Memory",
+    "dojo/data/ObjectStore",
 
-	"dijit/registry",
-	"dijit/layout/ContentPane",
+    "dijit/registry",
+    "dijit/layout/ContentPane",
 
-	"dojox/grid/DataGrid",
-	"dojox/grid/EnhancedGrid",
-	"dojox/grid/enhanced/plugins/Pagination",
-	"dojox/grid/enhanced/plugins/Filter",
-	"dojox/grid/enhanced/plugins/NestedSorting"
+    "dojox/grid/DataGrid",
+    "dojox/grid/EnhancedGrid",
+    "dojox/grid/enhanced/plugins/Pagination",
+    "dojox/grid/enhanced/plugins/Filter",
+    "dojox/grid/enhanced/plugins/NestedSorting"
 
 ], function (declare, Memory, ObjectStore,
     registry, ContentPane,
     DataGrid, EnhancedGrid, Pagination, Filter, NestedSorting) {
-	return declare(null, {
-		workunit: null,
-		paneNum: 0,
-		id: "",
-		dataGridSheet: {},
-		resultIdStoreMap: [],
-		resultIdGridMap: [],
-		delayLoad: [],
-		selectedResult: null,
-
-		//  Callbacks
-		onErrorClick: function (line, col) {
-		},
-
-		// The constructor    
-		constructor: function (args) {
-			declare.safeMixin(this, args);
-
-			this.dataGridSheet = registry.byId(this.id);
-			var context = this;
-			this.dataGridSheet.watch("selectedChildWidget", function (name, oval, nval) {
-				if (nval.id in context.delayLoad) {
-					context.selectedResult = context.delayLoad[nval.id].result;
-					if (!context.selectedResult.isComplete()) {
-						context.delayLoad[nval.id].loadingMessage = context.getLoadingMessage();
-					}
-					context.delayLoad[nval.id].placeAt(nval.containerNode, "last");
-					context.delayLoad[nval.id].startup();
-					nval.resize();
-					delete context.delayLoad[nval.id];
-				}
-			});
-		},
-
-		clear: function () {
-			this.delayLoad = [];
-			this.resultIdStoreMap = [];
-			this.resultIdGridMap = [];
-			var tabs = this.dataGridSheet.getChildren();
-			for (var i = 0; i < tabs.length; ++i) {
-				this.dataGridSheet.removeChild(tabs[i]);
-			}
-		},
-
-		getNextPaneID: function () {
-			return this.id + "Pane_" + ++this.paneNum;
-		},
-
-		addTab: function (label, paneID) {
-			if (paneID == null) {
-				paneID = this.getNextPaneID();
-			}
-			var pane = new ContentPane({
-				title: label,
-				id: paneID,
-				style: {
-					overflow: "hidden",
-					padding: 0
-				}
-			});
-			this.dataGridSheet.addChild(pane);
-			return pane;
-		},
-
-		addResultTab: function (result) {
-			var paneID = this.getNextPaneID();
-
-			var grid = EnhancedGrid({
-				result: result,
-				store: result.getObjectStore(),
-				query: { id: "*" },
-				structure: result.getStructure(),
-				canSort: function (col) {
-					return false;
-				},
-				plugins: {
-					pagination: {
-						pageSizes: [25, 50, 100, "All"],
-						defaultPageSize: 50,
-						description: true,
-						sizeSwitch: true,
-						pageStepper: true,
-						gotoButton: true,
-						maxPageStep: 4,
-						position: "bottom"
-					}
-				}
-			});
-			this.delayLoad[paneID] = grid;
-			this.resultIdStoreMap[result.getID()] = result.store;
-			this.resultIdGridMap[result.getID()] = grid;
-			return this.addTab(result.getName(), paneID);
-		},
-
-		refresh: function (wu) {
-			if (this.workunit != wu) {
-				this.clear();
-				this.workunit = wu;
-			}
-			this.addExceptionTab(this.workunit.exceptions);
-			this.addResultsTab(this.workunit.results);
-		},
-
-		refreshSourceFiles: function (wu) {
-			if (this.workunit != wu) {
-				this.clear();
-				this.workunit = wu;
-			}
-			this.addResultsTab(this.workunit.sourceFiles);
-		},
-
-		addResultsTab: function (results) {
-			for (var i = 0; i < results.length; ++i) {
-				var result = results[i];
-				if (result.getID() in this.resultIdStoreMap) {
-					this.resultIdStoreMap[result.getID()].isComplete = result.isComplete();
-				} else {
-					pane = this.addResultTab(result);
-					if (this.sequence != null && this.sequence == result.getID()) {
-						this.dataGridSheet.selectChild(pane);
-					} else if (this.name != null && this.name == result.getID()) {
-						this.dataGridSheet.selectChild(pane);
-					} 
-				}
-				if (!result.isComplete()) {
-					this.resultIdGridMap[result.getID()].showMessage(this.getLoadingMessage());
-				}
-			}
-		},
-
-		getLoadingMessage: function () {
-			return "<span class=\'dojoxGridWating\'>[" + this.workunit.state + "]</span>";
-		},
-
-		addExceptionTab: function (exceptions) {
-			var hasErrorWarning = false;
-			for (var i = 0; i < exceptions.length; ++i) {
-				if (exceptions[i].Severity == "Error" || exceptions[i].Severity == "Warning") {
-					hasErrorWarning = true;
-					break;
-				}
-			}
-
-			if (hasErrorWarning) {
-				var resultNode = this.addTab("Error/Warning(s)");
-				store = new Memory({ data: exceptions });
-				dataStore = new ObjectStore({ objectStore: store });
-
-				grid = new DataGrid({
-					store: dataStore,
-					query: { id: "*" },
-					structure: [
-						{ name: "Severity", field: "Severity" },
-						{ name: "Line", field: "LineNo" },
-						{ name: "Column", field: "Column" },
-						{ name: "Code", field: "Code" },
-						{ name: "Message", field: "Message", width: "auto" }
-					]
-				});
-				grid.placeAt(resultNode.containerNode, "last");
-				grid.startup();
-
-				var context = this;
-				grid.on("RowClick", function (evt) {
-					var idx = evt.rowIndex;
-					var item = this.getItem(idx);
-					var line = parseInt(this.store.getValue(item, "LineNo"), 10);
-					var col = parseInt(this.store.getValue(item, "Column"), 10);
-					context.onErrorClick(line, col);
-				}, true);
-			}
-		}
-	});
+    return declare(null, {
+        workunit: null,
+        paneNum: 0,
+        id: "",
+        dataGridSheet: {},
+        resultIdStoreMap: [],
+        resultIdGridMap: [],
+        delayLoad: [],
+        selectedResult: null,
+
+        //  Callbacks
+        onErrorClick: function (line, col) {
+        },
+
+        // The constructor    
+        constructor: function (args) {
+            declare.safeMixin(this, args);
+
+            this.dataGridSheet = registry.byId(this.id);
+            var context = this;
+            this.dataGridSheet.watch("selectedChildWidget", function (name, oval, nval) {
+                if (nval.id in context.delayLoad) {
+                    context.selectedResult = context.delayLoad[nval.id].result;
+                    if (!context.selectedResult.isComplete()) {
+                        context.delayLoad[nval.id].loadingMessage = context.getLoadingMessage();
+                    }
+                    context.delayLoad[nval.id].placeAt(nval.containerNode, "last");
+                    context.delayLoad[nval.id].startup();
+                    nval.resize();
+                    delete context.delayLoad[nval.id];
+                }
+            });
+        },
+
+        clear: function () {
+            this.delayLoad = [];
+            this.resultIdStoreMap = [];
+            this.resultIdGridMap = [];
+            var tabs = this.dataGridSheet.getChildren();
+            for (var i = 0; i < tabs.length; ++i) {
+                this.dataGridSheet.removeChild(tabs[i]);
+            }
+        },
+
+        getNextPaneID: function () {
+            return this.id + "Pane_" + ++this.paneNum;
+        },
+
+        addTab: function (label, paneID) {
+            if (paneID == null) {
+                paneID = this.getNextPaneID();
+            }
+            var pane = new ContentPane({
+                title: label,
+                id: paneID,
+                style: {
+                    overflow: "hidden",
+                    padding: 0
+                }
+            });
+            this.dataGridSheet.addChild(pane);
+            return pane;
+        },
+
+        addResultTab: function (result) {
+            var paneID = this.getNextPaneID();
+
+            var grid = EnhancedGrid({
+                result: result,
+                store: result.getObjectStore(),
+                query: { id: "*" },
+                structure: result.getStructure(),
+                canSort: function (col) {
+                    return false;
+                },
+                plugins: {
+                    pagination: {
+                        pageSizes: [25, 50, 100, "All"],
+                        defaultPageSize: 50,
+                        description: true,
+                        sizeSwitch: true,
+                        pageStepper: true,
+                        gotoButton: true,
+                        maxPageStep: 4,
+                        position: "bottom"
+                    }
+                }
+            });
+            this.delayLoad[paneID] = grid;
+            this.resultIdStoreMap[result.getID()] = result.store;
+            this.resultIdGridMap[result.getID()] = grid;
+            return this.addTab(result.getName(), paneID);
+        },
+
+        refresh: function (wu) {
+            if (this.workunit != wu) {
+                this.clear();
+                this.workunit = wu;
+            }
+            this.addExceptionTab(this.workunit.exceptions);
+            this.addResultsTab(this.workunit.results);
+        },
+
+        refreshSourceFiles: function (wu) {
+            if (this.workunit != wu) {
+                this.clear();
+                this.workunit = wu;
+            }
+            this.addResultsTab(this.workunit.sourceFiles);
+        },
+
+        addResultsTab: function (results) {
+            for (var i = 0; i < results.length; ++i) {
+                var result = results[i];
+                if (result.getID() in this.resultIdStoreMap) {
+                    this.resultIdStoreMap[result.getID()].isComplete = result.isComplete();
+                } else {
+                    pane = this.addResultTab(result);
+                    if (this.sequence != null && this.sequence == result.getID()) {
+                        this.dataGridSheet.selectChild(pane);
+                    } else if (this.name != null && this.name == result.getID()) {
+                        this.dataGridSheet.selectChild(pane);
+                    }
+                }
+                if (!result.isComplete()) {
+                    this.resultIdGridMap[result.getID()].showMessage(this.getLoadingMessage());
+                }
+            }
+        },
+
+        getLoadingMessage: function () {
+            return "<span class=\'dojoxGridWating\'>[" + this.workunit.state + "]</span>";
+        },
+
+        addExceptionTab: function (exceptions) {
+            var hasErrorWarning = false;
+            for (var i = 0; i < exceptions.length; ++i) {
+                if (exceptions[i].Severity == "Error" || exceptions[i].Severity == "Warning") {
+                    hasErrorWarning = true;
+                    break;
+                }
+            }
+
+            if (hasErrorWarning) {
+                var resultNode = this.addTab("Error/Warning(s)");
+                store = new Memory({ data: exceptions });
+                dataStore = new ObjectStore({ objectStore: store });
+
+                grid = new DataGrid({
+                    store: dataStore,
+                    query: { id: "*" },
+                    structure: [
+                        { name: "Severity", field: "Severity" },
+                        { name: "Line", field: "LineNo" },
+                        { name: "Column", field: "Column" },
+                        { name: "Code", field: "Code" },
+                        { name: "Message", field: "Message", width: "auto" }
+                    ]
+                });
+                grid.placeAt(resultNode.containerNode, "last");
+                grid.startup();
+
+                var context = this;
+                grid.on("RowClick", function (evt) {
+                    var idx = evt.rowIndex;
+                    var item = this.getItem(idx);
+                    var line = parseInt(this.store.getValue(item, "LineNo"), 10);
+                    var col = parseInt(this.store.getValue(item, "Column"), 10);
+                    context.onErrorClick(line, col);
+                }, true);
+            }
+        }
+    });
 });

+ 19 - 19
esp/files/scripts/ResultsWidget.js

@@ -14,26 +14,26 @@
 #    limitations under the License.
 ############################################################################## */
 define([
-	"dojo/_base/declare",
-	"dojo/_base/lang",
-	"dojo/_base/xhr",
-	"dojo/dom",
-	"dojo/request/iframe",
-
-	"dijit/layout/_LayoutWidget",
-	"dijit/_TemplatedMixin",
-	"dijit/_WidgetsInTemplateMixin",
-	"dijit/layout/TabContainer",
-	"dijit/registry",
-
-	"hpcc/ESPBase",
-	"hpcc/ESPWorkunit",
-	"hpcc/ResultsControl",
-	"dojo/text!../templates/ResultsWidget.html"
+    "dojo/_base/declare",
+    "dojo/_base/lang",
+    "dojo/_base/xhr",
+    "dojo/dom",
+    "dojo/request/iframe",
+
+    "dijit/layout/_LayoutWidget",
+    "dijit/_TemplatedMixin",
+    "dijit/_WidgetsInTemplateMixin",
+    "dijit/layout/TabContainer",
+    "dijit/registry",
+
+    "hpcc/ESPBase",
+    "hpcc/ESPWorkunit",
+    "hpcc/ResultsControl",
+    "dojo/text!../templates/ResultsWidget.html"
 ], function (declare, lang, xhr, dom, iframe,
-				_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, TabContainer, registry,
-				ESPBase, ESPWorkunit, ResultsControl,
-				template) {
+                _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, TabContainer, registry,
+                ESPBase, ESPWorkunit, ResultsControl,
+                template) {
     return declare("ResultsWidget", [_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
         templateString: template,
         baseClass: "ResultsWidget",

+ 43 - 43
esp/files/scripts/SampleSelectControl.js

@@ -14,52 +14,52 @@
 #    limitations under the License.
 ############################################################################## */
 define([
-	"dojo/_base/declare",
-	"dojo/_base/xhr",
-	"dojo/data/ItemFileReadStore",
-	"dijit/form/Select"
+    "dojo/_base/declare",
+    "dojo/_base/xhr",
+    "dojo/data/ItemFileReadStore",
+    "dijit/form/Select"
 ], function (declare, xhr, ItemFileReadStore, Select) {
-	return declare(null, {
-		id: null,
-		samplesURL: null,
-		selectControl: null,
+    return declare(null, {
+        id: null,
+        samplesURL: null,
+        selectControl: null,
 
-		onNewSelection: function (eclText) {
-		},
+        onNewSelection: function (eclText) {
+        },
 
-		constructor: function (args) {
-			declare.safeMixin(this, args);
-			var sampleStore = new dojo.data.ItemFileReadStore({
-				url: this.samplesURL
-			});
+        constructor: function (args) {
+            declare.safeMixin(this, args);
+            var sampleStore = new dojo.data.ItemFileReadStore({
+                url: this.samplesURL
+            });
 
-			var context = this;
-			this.selectControl = new dijit.form.Select({
-				name: this.id,
-				store: sampleStore,
-				value: "default.ecl",
-				maxHeight: 480,
-				style: {
-					padding: 0
-				},
-				onChange: function () {
-					var filename = dijit.byId(this.id).get("value");
-					xhr.get({
-						url: "ecl/" + filename,
-						handleAs: "text",
-						load: function (eclText) {
-							context.onNewSelection(eclText);
-						},
-						error: function () {
-						}
-					});
-				}
-			}, this.id);
-			try {
-				this.selectControl.startup();
-			} catch (e) {
-			}
-		}
+            var context = this;
+            this.selectControl = new dijit.form.Select({
+                name: this.id,
+                store: sampleStore,
+                value: "default.ecl",
+                maxHeight: 480,
+                style: {
+                    padding: 0
+                },
+                onChange: function () {
+                    var filename = dijit.byId(this.id).get("value");
+                    xhr.get({
+                        url: "ecl/" + filename,
+                        handleAs: "text",
+                        load: function (eclText) {
+                            context.onNewSelection(eclText);
+                        },
+                        error: function () {
+                        }
+                    });
+                }
+            }, this.id);
+            try {
+                this.selectControl.startup();
+            } catch (e) {
+            }
+        }
 
-	});
+    });
 });

+ 12 - 12
esp/files/scripts/SampleSelectWidget.js

@@ -14,21 +14,21 @@
 #    limitations under the License.
 ############################################################################## */
 require([
-	"dojo/_base/declare",
-	"dojo/_base/xhr",
-	"dojo/dom",
+    "dojo/_base/declare",
+    "dojo/_base/xhr",
+    "dojo/dom",
 
-	"dijit/layout/_LayoutWidget",
-	"dijit/_TemplatedMixin",
-	"dijit/_WidgetsInTemplateMixin",
-	"dijit/form/Select",
-	"dijit/registry",
+    "dijit/layout/_LayoutWidget",
+    "dijit/_TemplatedMixin",
+    "dijit/_WidgetsInTemplateMixin",
+    "dijit/form/Select",
+    "dijit/registry",
 
-	"hpcc/ESPBase",
-	"dojo/text!./templates/SampleSelectWidget.html"
+    "hpcc/ESPBase",
+    "dojo/text!./templates/SampleSelectWidget.html"
 ], function (declare, xhr, dom,
-					_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, Select, registry,
-					ESPBase, template) {
+                    _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, Select, registry,
+                    ESPBase, template) {
     return declare("SampleSelectWidget", [_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
         templateString: template,
         baseClass: "SampleSelectWidget",

+ 12 - 12
esp/files/scripts/TargetSelectWidget.js

@@ -14,21 +14,21 @@
 #    limitations under the License.
 ############################################################################## */
 require([
-	"dojo/_base/declare",
-	"dojo/_base/xhr",
-	"dojo/dom",
+    "dojo/_base/declare",
+    "dojo/_base/xhr",
+    "dojo/dom",
 
-	"dijit/layout/_LayoutWidget",
-	"dijit/_TemplatedMixin",
-	"dijit/_WidgetsInTemplateMixin",
-	"dijit/form/Select",
-	"dijit/registry",
+    "dijit/layout/_LayoutWidget",
+    "dijit/_TemplatedMixin",
+    "dijit/_WidgetsInTemplateMixin",
+    "dijit/form/Select",
+    "dijit/registry",
 
-	"hpcc/ESPBase",
-	"dojo/text!./templates/TargetSelectWidget.html"
+    "hpcc/ESPBase",
+    "dojo/text!./templates/TargetSelectWidget.html"
 ], function (declare, xhr, dom,
-					_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, Select, registry,
-					ESPBase, template) {
+                    _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, Select, registry,
+                    ESPBase, template) {
     return declare("TargetSelectWidget", [_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
         templateString: template,
         baseClass: "TargetSelectWidget",

+ 2 - 2
esp/files/scripts/TimingGridWidget.js

@@ -31,8 +31,8 @@ define([
 
     "dojo/text!../templates/TimingGridWidget.html"
 ],
-    function (declare, array, Memory, ObjectStore, 
-            registry, _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, 
+    function (declare, array, Memory, ObjectStore,
+            registry, _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin,
             DataGrid,
             ESPWorkunit,
             template) {

+ 2 - 2
esp/files/scripts/TimingPageWidget.js

@@ -28,8 +28,8 @@ define([
 
     "dojo/text!../templates/TimingPageWidget.html"
 ],
-    function (declare, 
-            registry, _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, BorderContainer, 
+    function (declare,
+            registry, _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, BorderContainer,
             TimingGridWidget, TimingTreeMapWidget,
             template) {
         return declare("TimingPageWidget", [_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {

+ 2 - 2
esp/files/scripts/TimingTreeMapWidget.js

@@ -32,7 +32,7 @@ define([
 ],
     function (declare, Memory,
             registry, _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, ContentPane,
-            TreeMap, 
+            TreeMap,
             ESPWorkunit,
             template) {
         return declare("TimingTreeMapWidget", [_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
@@ -99,7 +99,7 @@ define([
                 }
             },
 
-            setQuery: function(query) {
+            setQuery: function (query) {
                 this.loadTimers(this.timers, query);
             },
 

+ 30 - 30
esp/files/scripts/WUDetailsWidget.js

@@ -14,39 +14,39 @@
 #	limitations under the License.
 ############################################################################## */
 define([
-	"dojo/_base/declare",
-	"dojo/_base/xhr",
-	"dojo/dom",
-	"dojo/store/Memory",
-	"dojo/data/ObjectStore",
+    "dojo/_base/declare",
+    "dojo/_base/xhr",
+    "dojo/dom",
+    "dojo/store/Memory",
+    "dojo/data/ObjectStore",
 
-	"dijit/layout/_LayoutWidget",
-	"dijit/_TemplatedMixin",
-	"dijit/_WidgetsInTemplateMixin",
-	"dijit/layout/BorderContainer",
-	"dijit/layout/TabContainer",
-	"dijit/layout/ContentPane",
-	"dijit/Toolbar",
-	"dijit/TooltipDialog",
-	"dijit/form/Textarea",
-	"dijit/form/Button",
-	"dijit/TitlePane",
-	"dijit/registry",
+    "dijit/layout/_LayoutWidget",
+    "dijit/_TemplatedMixin",
+    "dijit/_WidgetsInTemplateMixin",
+    "dijit/layout/BorderContainer",
+    "dijit/layout/TabContainer",
+    "dijit/layout/ContentPane",
+    "dijit/Toolbar",
+    "dijit/TooltipDialog",
+    "dijit/form/Textarea",
+    "dijit/form/Button",
+    "dijit/TitlePane",
+    "dijit/registry",
 
-	"hpcc/ECLSourceWidget",
-	"hpcc/TargetSelectWidget",
-	"hpcc/SampleSelectWidget",
-	"hpcc/GraphWidget",
-	"hpcc/ResultsWidget",
-	"hpcc/InfoGridWidget",
-	"hpcc/LogsWidget",
-	"hpcc/ESPWorkunit",
+    "hpcc/ECLSourceWidget",
+    "hpcc/TargetSelectWidget",
+    "hpcc/SampleSelectWidget",
+    "hpcc/GraphWidget",
+    "hpcc/ResultsWidget",
+    "hpcc/InfoGridWidget",
+    "hpcc/LogsWidget",
+    "hpcc/ESPWorkunit",
 
-	"dojo/text!../templates/WUDetailsWidget.html"
+    "dojo/text!../templates/WUDetailsWidget.html"
 ], function (declare, xhr, dom, Memory, ObjectStore,
-				_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, BorderContainer, TabContainer, ContentPane, Toolbar, TooltipDialog, Textarea, Button, TitlePane, registry,
-				EclSourceWidget, TargetSelectWidget, SampleSelectWidget, GraphWidget, ResultsWidget, InfoGridWidget, LogsWidget, Workunit,
-				template) {
+                _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, BorderContainer, TabContainer, ContentPane, Toolbar, TooltipDialog, Textarea, Button, TitlePane, registry,
+                EclSourceWidget, TargetSelectWidget, SampleSelectWidget, GraphWidget, ResultsWidget, InfoGridWidget, LogsWidget, Workunit,
+                template) {
     return declare("WUDetailsWidget", [_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
         templateString: template,
         baseClass: "WUDetailsWidget",
@@ -360,7 +360,7 @@ define([
                         }
                         context.logsWidget.set("title", "Helpers " + "(" + helpersCount + ")");
                         //dom.byId(context.id + "WUInfoResponse").innerHTML = context.objectToText(response);
-                        dom.byId("showDescription").value = response.Description;                        
+                        dom.byId("showDescription").value = response.Description;
                         dom.byId("showAction").innerHTML = response.ActionEx;
                         dom.byId("showScope").innerHTML = response.Scope;
                         var protectedCheckbox = registry.byId("showProtected");

+ 130 - 130
esp/files/scripts/WsWorkunits.js

@@ -14,136 +14,136 @@
 #    limitations under the License.
 ############################################################################## */
 define([
-	"dojo/_base/declare",
-	"dojo/_base/lang",
-	"dojo/_base/xhr",
-	"dojo/_base/Deferred",
-	"dojo/store/util/QueryResults",
-	"hpcc/ESPBase"
+    "dojo/_base/declare",
+    "dojo/_base/lang",
+    "dojo/_base/xhr",
+    "dojo/_base/Deferred",
+    "dojo/store/util/QueryResults",
+    "hpcc/ESPBase"
 ], function (declare, lang, xhr, Deferred, QueryResults, ESPBase) {
-	var WUQuery = declare(ESPBase, {
-		idProperty: "Wuid",
-
-		constructor: function (options) {
-			declare.safeMixin(this, options);
-		},
-
-		getIdentity: function (object) {
-			return object[this.idProperty];
-		},
-
-		query: function (query, options) {
-			var request = {};
-			lang.mixin(request, options.query);
-			if (options.start)
-				request['PageStartFrom'] = options.start;
-			if (options.count)
-				request['Count'] = options.count;
-			if (options.sort) {
-				request['Sortby'] = options.sort[0].attribute;
-				request['Descending'] = options.sort[0].descending;
-			}
-			request['rawxml_'] = "1";
-
-			var results = xhr.get({
-				url: this.getBaseURL("WsWorkunits") + "/WUQuery",
-				handleAs: "xml",
-				content: request
-			});
-
-			var context = this;
-			var parsedResults = results.then(function (domXml) {
-				data = context.getValues(domXml, "ECLWorkunit");
-				data.total = context.getValue(domXml, "NumWUs");
-				return data;
-			});
-
-			lang.mixin(parsedResults, {
-				total: Deferred.when(parsedResults, function (data) {
-					return data.total;
-				})
-			});
-
-			return QueryResults(parsedResults);
-		}
-	});
-
-	var WUResult = declare(ESPBase, {
-		idProperty: "myInjectedRowNum",
-		wuid: "",
-		sequence: 0,
-		isComplete: false,
-
-		constructor: function (args) {
-			declare.safeMixin(this, args);
-		},
-
-		getIdentity: function (object) {
-			return object[this.idProperty];
-		},
-
-		queryWhenComplete: function (query, options, deferredResults) {
-			var context = this;
-			if (this.isComplete == true) {
-				var request = {};
-				request['Wuid'] = this.wuid;
-				if (this.sequence != null) {
-					request['Sequence'] = this.sequence;
-				} else {
-					request['LogicalName'] = this.name;
-				}
-				request['Start'] = options.start;
-				request['Count'] = options.count;
-				request['rawxml_'] = "1";
-
-				var results = xhr.post({
-					url: this.getBaseURL("WsWorkunits") + "/WUResult",
-					handleAs: "xml",
-					content: request,
-					sync: options.sync != null ? options.sync : false,
-					load: function (domXml) {
-						var rows = context.getValues(domXml, "Row");
-						for (var i = 0; i < rows.length; ++i) {
-							rows[i].myInjectedRowNum = options.start + i + 1;
-						}
-						rows.total = context.getValue(domXml, "Total");
-						//  TODO - Need to check why this happens only sometimes  (Suspect non XML from the server) ---
-						if (rows.total == null) {
-							var debug = context.flattenXml(domXml);
-							setTimeout(function () {
-								context.queryWhenComplete(query, options, deferredResults);
-							}, 100);
-						}
-						else {
-							deferredResults.resolve(rows);
-						}
-					}
-				});
-			} else {
-				setTimeout(function () {
-					context.queryWhenComplete(query, options, deferredResults);
-				}, 100);
-			}
-		},
-
-		query: function (query, options) {
-			var deferredResults = new Deferred();
-
-			this.queryWhenComplete(query, options, deferredResults);
-
-			var retVal = lang.mixin({
-				total: Deferred.when(deferredResults, function (rows) {
-					return rows.total;
-				})
-			}, deferredResults);
-
-			return QueryResults(retVal);
-		}
-	});
-
-	return {
-		WUQuery: WUQuery,
-		WUResult: WUResult
-	};
+    var WUQuery = declare(ESPBase, {
+        idProperty: "Wuid",
+
+        constructor: function (options) {
+            declare.safeMixin(this, options);
+        },
+
+        getIdentity: function (object) {
+            return object[this.idProperty];
+        },
+
+        query: function (query, options) {
+            var request = {};
+            lang.mixin(request, options.query);
+            if (options.start)
+                request['PageStartFrom'] = options.start;
+            if (options.count)
+                request['Count'] = options.count;
+            if (options.sort) {
+                request['Sortby'] = options.sort[0].attribute;
+                request['Descending'] = options.sort[0].descending;
+            }
+            request['rawxml_'] = "1";
+
+            var results = xhr.get({
+                url: this.getBaseURL("WsWorkunits") + "/WUQuery",
+                handleAs: "xml",
+                content: request
+            });
+
+            var context = this;
+            var parsedResults = results.then(function (domXml) {
+                data = context.getValues(domXml, "ECLWorkunit");
+                data.total = context.getValue(domXml, "NumWUs");
+                return data;
+            });
+
+            lang.mixin(parsedResults, {
+                total: Deferred.when(parsedResults, function (data) {
+                    return data.total;
+                })
+            });
+
+            return QueryResults(parsedResults);
+        }
+    });
+
+    var WUResult = declare(ESPBase, {
+        idProperty: "myInjectedRowNum",
+        wuid: "",
+        sequence: 0,
+        isComplete: false,
+
+        constructor: function (args) {
+            declare.safeMixin(this, args);
+        },
+
+        getIdentity: function (object) {
+            return object[this.idProperty];
+        },
+
+        queryWhenComplete: function (query, options, deferredResults) {
+            var context = this;
+            if (this.isComplete == true) {
+                var request = {};
+                request['Wuid'] = this.wuid;
+                if (this.sequence != null) {
+                    request['Sequence'] = this.sequence;
+                } else {
+                    request['LogicalName'] = this.name;
+                }
+                request['Start'] = options.start;
+                request['Count'] = options.count;
+                request['rawxml_'] = "1";
+
+                var results = xhr.post({
+                    url: this.getBaseURL("WsWorkunits") + "/WUResult",
+                    handleAs: "xml",
+                    content: request,
+                    sync: options.sync != null ? options.sync : false,
+                    load: function (domXml) {
+                        var rows = context.getValues(domXml, "Row");
+                        for (var i = 0; i < rows.length; ++i) {
+                            rows[i].myInjectedRowNum = options.start + i + 1;
+                        }
+                        rows.total = context.getValue(domXml, "Total");
+                        //  TODO - Need to check why this happens only sometimes  (Suspect non XML from the server) ---
+                        if (rows.total == null) {
+                            var debug = context.flattenXml(domXml);
+                            setTimeout(function () {
+                                context.queryWhenComplete(query, options, deferredResults);
+                            }, 100);
+                        }
+                        else {
+                            deferredResults.resolve(rows);
+                        }
+                    }
+                });
+            } else {
+                setTimeout(function () {
+                    context.queryWhenComplete(query, options, deferredResults);
+                }, 100);
+            }
+        },
+
+        query: function (query, options) {
+            var deferredResults = new Deferred();
+
+            this.queryWhenComplete(query, options, deferredResults);
+
+            var retVal = lang.mixin({
+                total: Deferred.when(deferredResults, function (rows) {
+                    return rows.total;
+                })
+            }, deferredResults);
+
+            return QueryResults(retVal);
+        }
+    });
+
+    return {
+        WUQuery: WUQuery,
+        WUResult: WUResult
+    };
 });
 

+ 1 - 1
esp/files/templates/LogsWidget.html

@@ -1,5 +1,5 @@
 <div class="${baseClass}">
-    <div id="${id}BorderContainer" class="${baseClass}BorderContainer" style="width: 100%; height: 100%" data-dojo-props="splitter: false"data-dojo-type="dijit.layout.BorderContainer">
+    <div id="${id}BorderContainer" class="${baseClass}BorderContainer" style="width: 100%; height: 100%" data-dojo-props="splitter: false" data-dojo-type="dijit.layout.BorderContainer">
         <div id="${id}Toolbar" class="topPanel" style="padding: 0px; overflow: hidden" data-dojo-props="region: 'top'" data-dojo-type="dijit.Toolbar">
             <span class="bold">Download:</span>
             <div data-dojo-attach-event="onClick:_onDownload" data-dojo-type="dijit.form.Button">File</div>

+ 1 - 1
esp/files/templates/ResultsWidget.html

@@ -1,5 +1,5 @@
 <div class="${baseClass}">
-    <div id="${id}BorderContainer" class="${baseClass}BorderContainer" style="width: 100%; height: 100%" data-dojo-props="splitter: false"data-dojo-type="dijit.layout.BorderContainer">
+    <div id="${id}BorderContainer" class="${baseClass}BorderContainer" style="width: 100%; height: 100%" data-dojo-props="splitter: false" data-dojo-type="dijit.layout.BorderContainer">
         <div id="${id}Toolbar" class="topPanel" style="padding: 0px; overflow: hidden" data-dojo-props="region: 'top'" data-dojo-type="dijit.Toolbar">
             <span class="bold">Download:</span>
             <div data-dojo-attach-event="onClick:_onDownloadZip" data-dojo-type="dijit.form.Button">Zip</div>

+ 1 - 1
esp/files/templates/TimingTreeMapWidget.html

@@ -1,6 +1,6 @@
 <div class="${baseClass}">
     <div id="${id}ContentPane" style="width: 100%; height: 100%; padding: 0px; overflow: hidden" data-dojo-type="dijit.layout.ContentPane">
-	    <link rel="stylesheet" href="dojox/treemap/themes/TreeMap.css">
+        <link rel="stylesheet" href="dojox/treemap/themes/TreeMap.css">
         <div id="${id}TreeMap" data-dojo-type="dojox.treemap.TreeMap"></div>
     </div>
 </div>