@hpcc-js/eclwatch 2.77.2 → 2.77.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es6.js +2 -2
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +3 -3
- package/src/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/codemirror"),require("@hpcc-js/comms"),require("@hpcc-js/phosphor"),require("@hpcc-js/tree"),require("@hpcc-js/util"),require("@hpcc-js/common"),require("@hpcc-js/dgrid"),require("@hpcc-js/graph"),require("@hpcc-js/layout"),require("@hpcc-js/timeline")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/codemirror","@hpcc-js/comms","@hpcc-js/phosphor","@hpcc-js/tree","@hpcc-js/util","@hpcc-js/common","@hpcc-js/dgrid","@hpcc-js/graph","@hpcc-js/layout","@hpcc-js/timeline"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/eclwatch"]={},t["@hpcc-js/codemirror"],t["@hpcc-js/comms"],t["@hpcc-js/phosphor"],t["@hpcc-js/tree"],t["@hpcc-js/util"],t["@hpcc-js/common"],t["@hpcc-js/dgrid"],t["@hpcc-js/graph"],t["@hpcc-js/layout"],t["@hpcc-js/timeline"])}(this,(function(t,e,r,i,o,a,n,s,c,p,l){var h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},h(t,e)};function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var d=function(){return d=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},d.apply(this,arguments)};function g(t,e,r,i){var o,a=arguments.length,n=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,r,n):o(e,r))||n);return a>3&&n&&Object.defineProperty(e,r,n),n}function f(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function _(t,e,r){if(r||2===arguments.length)for(var i,o=0,a=e.length;o<a;o++)!i&&o in e||(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var y=function(t){function i(){var r=t.call(this,"horizontal")||this;return r._directoryPane=new o.DirectoryTree,r._fileEditorPane=(new e.Editor).text(""),r._directoryPane.rowClick=function(t){r._fileEditorPane.text(t).render()},r}return u(i,t),i.prototype.transformArchiveTreeData=function(t){var e={label:t.name,children:t._children.map((function t(e){var r={};if(r.label=e.name+(e.$&&e.$.key?" (".concat(e.$.key,")"):""),e._children&&e._children.length>0)r.children=e._children.map((function(e){return t(e)})).filter((function(t){return t}));else{if("string"!=typeof e.content||!e.content.trim())return!1;r.content=e.content}return r})).filter((function(t){return t}))};return e.children&&e.children[0]&&"html"===e.children[0].label?{label:"root",children:[{label:"error",content:JSON.stringify(e,null,4)}]}:e},i.prototype.updateDirectoryPane=function(t){var e;if(t)try{e=JSON.parse(t)}catch(r){e=a.xml2json(t)}if(e){var r=this.transformArchiveTreeData(e);this._directoryPane.data(r).render()}},i.prototype.enter=function(e,r){t.prototype.enter.call(this,e,r),this.addWidget(this._directoryPane).addWidget(this._fileEditorPane)},i.prototype.update=function(e,i){var o=this;t.prototype.update.call(this,e,i);var n=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==n||void 0===this._contentStr?r.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchArchive().then((function(t){o._contentStr=t,o.updateDirectoryPane(o._contentStr),o._prevHash=n})):this.updateDirectoryPane(this._contentStr),this.relativeSizes([this.directoryWidthRatio(),1-this.directoryWidthRatio()])},i}(i.SplitPanel);function b(t,e){void 0===e&&(e={});var r=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}y.prototype._class+=" eclwatch_ECLArchiveViewer",y.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),y.prototype.publish("wuid","","string","Workunit ID"),y.prototype.publish("directoryWidthRatio",.38,"number","Default directory panel width ratio relative to the full width"),y.prototype.publish("contentString",null,"string","XML/JSON archive content string"),y.prototype.publishProxy("directoryPaneColor","_directoryPane","backgroundColor"),y.prototype.publishProxy("directoryPaneHoverColor","_directoryPane","hoverBackgroundColor"),y.prototype.publishProxy("iconSize","_directoryPane"),y.prototype.publishProxy("fontColor","_directoryPane"),y.prototype.publishProxy("fontFamily","_directoryPane"),y.prototype.publishProxy("fontSize","_directoryPane"),y.prototype.publishProxy("folderIconOpen","_directoryPane"),y.prototype.publishProxy("folderIconClosed","_directoryPane"),y.prototype.publishProxy("textFileIcon","_directoryPane"),y.prototype.publishProxy("codeFileIcon","_directoryPane"),y.prototype.publishProxy("verticalScroll","_directoryPane");b(".eclwatch_WUGraphLegend .graph_Vertex{cursor:auto}.eclwatch_WUGraphLegend .graph_Vertex .common_Icon{cursor:pointer}");var m=function(t){function e(){return t.call(this)||this}return u(e,t),e.prototype.enter=function(e,r){var i=this;t.prototype.enter.call(this,e,r),this._icon.on("click",(function(){i.click(i.data())}))},e.prototype.click=function(t){},e}(c.Vertex),v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.icon=n.local(),e._disabled2={},e}return u(e,t),e.prototype.disabled=function(t){var e=this;if(!arguments.length){var r=[];for(var i in this._disabled2)this._disabled2[i]&&r.push(i);return r}return this._disabled2={},t.forEach((function(t){return e._disabled2[t]=!0})),this},e.prototype.toggle=function(t){this._disabled2[t]=!this._disabled2[t]},e.prototype.update=function(e,r){t.prototype.update.call(this,e,r);var i=this,o=this._g.selectAll(".legendItem").data(this.data(),(function(t){return t.kind}));o.enter().append("g").attr("class","legendItem").each((function(t){i.icon.set(this,(new m).target(this).data(t.kind).textbox_shape_colorStroke("none").textbox_shape_colorFill("none").iconAnchor("left").faChar(t.faChar).text("".concat(t.label," (").concat(t.count,")")).tooltip("".concat(t.kind," - ").concat(t.label)).on("click",(function(t){i.toggle(t),i.render(),i.click(t)})).on("mouseover",(function(t){i.mouseover(t)})).on("mouseout",(function(t){i.mouseout(t)})))})).merge(o).each((function(t,e){var r=i.icon.get(this).icon_shape_colorFill(i._disabled2[t.kind]?"gray":null).render().getBBox();n.select(this).attr("transform","translate(".concat(+r.width/2,", ").concat(30*e,")"))})),o.exit().each((function(t){i.icon.get(this).target(null).render()})).remove();var a=this.getBBox(!0,!0);this._g.attr("transform","translate(16, ".concat(this.height()/2-a.height/2,")"))},e.prototype.click=function(t){},e.prototype.mouseover=function(t){},e.prototype.mouseout=function(t){},e}(p.Legend);function S(t){switch(t){case"2":case"44":case"47":case"56":case"61":case"35":case"37":return"";case"3":return"";case"5":return"";case"6":return"";case"12":return"";case"15":case"17":case"59":return"";case"22":return"";case"23":return"";case"25":case"133":case"148":return"";case"26":case"19":return"";case"29":case"16":return"";case"36":return"";case"54":return"";case"82":case"88":case"99":case"105":case"71":return"";case"92":case"93":return"";case"7":return"";case"9":return"";case"21":case"168":return""}return""}v.prototype._class+=" eclwatch_WUGraphLegend";var w=function(){function t(){this.subgraphsMap={},this.rSubgraphsMap={},this.verticesMap={},this.rVerticesMap={},this.edgesMap={},this.rEdgesMap={},this.kindMap={},this._disabled={}}return t.prototype.clear=function(){this.subgraphsMap={},this.rSubgraphsMap={},this.verticesMap={},this.rVerticesMap={},this.edgesMap={},this.rEdgesMap={}},t.prototype.set=function(t){var e=this;this.graphDB=t,this.graphGui(this.graphDB),this.kindMap={},this.graphDB.walk((function(t){if(t instanceof a.Subgraph);else if(t instanceof a.Vertex){var r=t._.attr("Kind").RawValue;e.kindMap[r]||(e.kindMap[r]=[]),e.kindMap[r].push(t)}}))},t.prototype.disabled=function(t){var e=this;if(!arguments.length){var r=[];for(var i in this._disabled)this._disabled[i]&&r.push(i);return r}return this._disabled={},t.forEach((function(t){return e._disabled[t]=!0})),this},t.prototype.graphGui=function(t){var e=this,r={subgraphs:[],vertices:[],edges:[],hierarchy:[]};return t.walk((function(t){if(t instanceof a.Subgraph){var i=e.appendSubgraph(t,r.hierarchy,r.subgraphs);i.showMinMax(t.vertices.length>3||"normal"!==i.minState())}else t instanceof a.Vertex?e.appendVertex(t,r.hierarchy,r.vertices):t instanceof a.Edge&&e.appendEdge(t,r.edges)})),r},t.prototype.format=function(t,e){for(var r="",i=t.indexOf("%"),o=-1;i>=0;){if(r+=t.substring(o+1,i),(o=t.indexOf("%",i+1))<0){console.warn("Invalid Label Template");break}r+=t.substring(i+1,o)?e[t.substring(i+1,o)]||"":"%",i=t.indexOf("%",o+1)}return(r+=t.substring(o+1,t.length)).split("\\n").join("\n")},t.prototype.createSubgraph=function(t){var e=this,r=this.subgraphsMap[t._.Id];return r||(r=(new c.Subgraph).title(t._.Id).on("minClick",(function(){e.minClick(r)})),this.subgraphsMap[t._.Id]=r,this.rSubgraphsMap[r.id()]=t),r},t.prototype.createVertex=function(t){var e=this,r=this.verticesMap[t._.Id];if(!r){var i=t._.rawAttrs();if("dummy"===t._.ScopeType){var o=this.subgraphsMap[t.parent._.Id];r=(new n.Icon).shape_colorFill("darkred").shape_colorStroke("darkred").image_colorFill("white").faChar("").on("click",(function(){o.minState("normal"),e.minClick(o)}))}else{r=(new c.Vertex).icon_shape_colorFill("#1f77b4").icon_image_colorFill("white").faChar(S(i.Kind)).text(i.Label);var a=[];t._.hasAttr("Definition")&&a.push({faChar:"",tooltip:"Definition",shape_colorFill:"lightgray",shape_colorStroke:"lightgray",image_colorFill:"black"}),t._.hasAttr("IsInternal")&&a.push({faChar:"",tooltip:"IsInternal",shape_colorFill:"red",shape_colorStroke:"red",image_colorFill:"white"}),r.annotationIcons(a)}this.verticesMap[t._.Id]=r,this.rVerticesMap[r.id()]=t}return r},t.prototype.isSpill=function(t){var e=t.source._.attr("Kind").RawValue,r=t.target._.attr("Kind").RawValue;return"2"===e||"71"===r},t.prototype.spansSubgraph=function(t){return t.source.parent._.Id!==t.target.parent._.Id},t.prototype.createEdge=function(t){var e=this.edgesMap[t._.Id];if(!e){var r=t._.rawAttrs(),i=this.verticesMap[t.source._.Id],o=this.verticesMap[t.target._.Id];if(i&&o){var a=this.isSpill(t),n=this.spansSubgraph(t),s=this.format("%Label%\n%NumRowsProcessed%",r),p=null,l=100;r.IsDependency?(l=10,p="1,5"):r._childGraph?p="5,5":a?(l=25,p="5,5,10,5"):n&&(l=5,p="5,5"),e=(new c.Edge).sourceVertex(i).targetVertex(o).sourceMarker("circle").targetMarker("arrow").weight(l).strokeDasharray(p).text(s),this.edgesMap[t._.Id]=e,this.rEdgesMap[e.id()]=t}}return e},t.prototype.appendSubgraph=function(t,e,r){var i=this.createSubgraph(t);r.push(i);var o=this.subgraphsMap[t.parent._.Id];return o&&e.push({parent:o,child:i}),i},t.prototype.appendVertex=function(t,e,r){var i=this.createVertex(t);r.push(i);var o=this.subgraphsMap[t.parent._.Id];return o&&e.push({parent:o,child:i}),i},t.prototype.appendEdge=function(t,e){var r=this.createEdge(t);return r&&e.push(r),r},t.prototype.filterLegend=function(t){for(var e=function(e){var o=t.vertices[e],a=o._.attr("Kind").RawValue;i._disabled[a]&&o.remove(!1,(function(t,e){return new r.BaseScope({ScopeName:o._.ScopeName+":in",Id:t.Id+"->"+e.Id,ScopeType:"dummy-edge",Properties:{Property:[o._.attr("Label")]},Notes:{Note:[]},SinkActivity:""})}))},i=this,o=t.vertices.length-1;o>=0;--o)e(o)},t.prototype.filterPartial=function(t){for(var e=0,i=t.subgraphs;e<i.length;e++){var o=i[e];if("partial"===this.subgraphsMap[o._.Id].minState()){for(var a=[],n=[],s=0,c=o.vertices;s<c.length;s++){0===(g=c[s]).inEdges.length||g.inEdges.some((function(t){return t.source.parent!==t.target.parent}))||0===g.outEdges.length||g.outEdges.some((function(t){return t.source.parent!==t.target.parent}))?a.push(g):n.push(g)}if(n.length>1){for(var p={ScopeName:o._.ScopeName,Id:o._.Id+":dummy",ScopeType:"dummy",Properties:{Property:[{Name:"Activities",RawValue:""+n.length,Formatted:""+n.length,Measure:"count",Creator:"",CreatorType:""}]},Notes:{Note:[]},SinkActivity:""},l=new r.BaseScope(p),h=o.createVertex(l),u=0,d=n;u<d.length;u++){for(var g,f=0,_=(g=d[u]).inEdges;f<_.length;f++){var y=_[f];if(a.indexOf(y.source)>=0){var b=new r.BaseScope({ScopeName:y.source._.ScopeName,Id:y.source._.Id+"->"+h._.Id,ScopeType:"dummy-in",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});o.createEdge(y.source,h,b)}}for(var m=0,v=g.outEdges;m<v.length;m++){y=v[m];if(a.indexOf(y.target)>=0){b=new r.BaseScope({ScopeName:y.target._.ScopeName,Id:h._.Id+"->"+y.target._.Id,ScopeType:"dummy-out",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});o.createEdge(h,y.target,b)}}}n.forEach((function(t){return t.remove(!0)}))}}}},t.prototype.filterEmptySubgraphs=function(t){for(;;){var e=t.subgraphs.filter((function(t){return 0===t.subgraphs.length&&0===t.vertices.length}));if(0===e.length)break;e.forEach((function(t){return t.remove(!0)}))}},t.prototype.removeObsoleteSubgraphs=function(t){for(var e=0,r=_([],t.subgraphs,!0);e<r.length;e++){var i=r[e];0===i.vertices.length&&i.remove(!1)}},t.prototype.graphData=function(){var t=this.graphDB.clone();return this.filterLegend(t),this.filterPartial(t),this.filterEmptySubgraphs(t),this.removeObsoleteSubgraphs(t),this.graphGui(t)},t.prototype.calcLegend=function(){var t=[];for(var e in this.kindMap)t.push({kind:parseInt(e),faChar:S(e),label:this.kindMap[e][0]._.attr("Label").RawValue.split("\n")[0],count:this.kindMap[e].length});return t},t.prototype.vertices=function(t){for(var e=[],r=0,i=this.kindMap[t];r<i.length;r++){var o=i[r];e.push(this.verticesMap[o._.Id])}return e},t.prototype.formatRow=function(t,e,r){var i=t._.formattedAttrs();for(var o in i){var a=e.indexOf(o);-1===a?(e.push(o),r.push(i[o])):r[a]=i[o]}for(var n=0;n<100;++n)void 0===r[n]&&(r[n]="");return r},t.prototype.activityData=function(){var t=this,e=["Id","Kind","Label"],r=this.graphDB.vertices.map((function(r){var i=[parseInt(r._.Id.split("a")[1])];return t.formatRow(r,e,i)}));return{columns:e,data:r}},t.prototype.edgeData=function(){var t=this,e=["Id","Label"],r=this.graphDB.edges.map((function(r){var i=[r._.Id];return t.formatRow(r,e,i)}));return{columns:e,data:r}},t.prototype.subgraphData=function(){var t=this,e=["Id","Label"],r=this.graphDB.subgraphs.map((function(r){var i=[r._.Id];return t.formatRow(r,e,i)}));return{columns:e,data:r}},t.prototype.calcGraphTooltip=function(t){var e,r;if(t instanceof c.Subgraph){var i=this.rSubgraphsMap[t.id()];e=i._,r=i.parent._}else if(t instanceof c.Vertex||t instanceof n.Icon){var o=this.rVerticesMap[t.id()];e=o._,r=o.parent._}else if(t instanceof c.Edge){var a=this.rEdgesMap[t.id()];e=a._,r=a.parent._}return e?e.calcTooltip(r):""},t.prototype.subgraph=function(t){return this.subgraphsMap[t]},t.prototype.vertex=function(t){return this.verticesMap[t]},t.prototype.edge=function(t){return this.edgesMap[t]},t.prototype.minClick=function(t){},t}();b(".eclwatch_WUGraph .graph_Vertex{cursor:auto}.eclwatch_WUGraph .marker{fill:#656565;stroke:none;stroke-width:1px}.eclwatch_WUGraph .zoom{fill:none;pointer-events:all}.eclwatch_WUGraph .selectionBrush{fill:none;stroke:#a9a9a9}.d3-tip .eclwatch_WUGraph_Tooltip h3,.d3-tip .eclwatch_WUGraph_Tooltip h4{margin:0}.d3-tip .eclwatch_WUGraph_Tooltip table{border-collapse:separate;border-spacing:5px}.d3-tip .eclwatch_WUGraph_Tooltip table .key{font-weight:700}.d3-tip .eclwatch_WUGraph_Tooltip table .value{font-weight:400}");var x=function(t){function e(){var e=t.call(this)||this;e._partialAll=(new n.Button).faChar("fa-window-restore").tooltip("Partial All").on("click",(function(){e.stateClick(e._partialAll)})),e._maxAll=(new n.Button).faChar("fa-window-maximize").tooltip("Max All").on("click",(function(){e.stateClick(e._maxAll)})),e._toggleGraph=(new n.ToggleButton).faChar("fa-chain").tooltip("Graph").selected(!0).on("click",(function(){e.viewClick(e._toggleGraph)})),e._toggleActivities=(new n.ToggleButton).faChar("fa-table").tooltip("Activitiies").selected(!1).on("click",(function(){e.viewClick(e._toggleActivities)})),e._toggleEdges=(new n.ToggleButton).faChar("fa-table").tooltip("Edges").selected(!1).on("click",(function(){e.viewClick(e._toggleEdges)})),e._toggleSubgraphs=(new n.ToggleButton).faChar("fa-table").tooltip("Subgraphs").selected(!1).on("click",(function(){e.viewClick(e._toggleSubgraphs)})),e._graph=(new c.Graph).layout("Hierarchy").applyScaleOnLayout(!0).showToolbar(!1).allowDragging(!1),e._activities=(new s.Table).pagination(!1),e._edges=(new s.Table).pagination(!1),e._subgraphs=(new s.Table).pagination(!1),e._legend=new v(e).on("click",(function(t){e.render()})).on("mouseover",(function(t){for(var r={},i=0,o=e._gc.vertices(t);i<o.length;i++){r[o[i].id()]=!0}e._graph.highlightVerticies(r)})).on("mouseout",(function(t){e._graph.highlightVerticies()})),e._view=(new p.Carousel).widgets([e._graph,e._activities,e._edges,e._subgraphs]),e._gc=new w,e.topOverlay(!1),e.widget(e._view);var r=_(_([e._toggleGraph,e._toggleActivities,e._toggleEdges,e._toggleSubgraphs,new n.Spacer,e._partialAll,e._maxAll,new n.Spacer],e._graph.iconBarButtons(),!0),[new n.Spacer],!1);return e.buttons(r.concat(e.buttons())),e._gc.minClick=function(t){e.loadGraph(),e._graph.render((function(r){e._graph.selection([t]).centerOnItem(t)}))},e._graph.tooltipHTML((function(t){return e._gc.calcGraphTooltip(t)})),e}return u(e,t),e.prototype.stateClick=function(t){switch(t){case this._partialAll:this._graph.data().subgraphs.forEach((function(t){t.minState("partial")}));break;case this._maxAll:this._graph.data().subgraphs.forEach((function(t){t.minState("normal")}))}this.render()},e.prototype.viewClick=function(t){switch(this._toggleGraph.selected(t===this._toggleGraph),this._toggleActivities.selected(t===this._toggleActivities),this._toggleEdges.selected(t===this._toggleEdges),this._toggleSubgraphs.selected(t===this._toggleSubgraphs),t){case this._toggleGraph:this._view.active(0);break;case this._toggleActivities:this._view.active(1);break;case this._toggleEdges:this._view.active(2);break;case this._toggleSubgraphs:this._view.active(3)}this.render((function(t){}))},e.prototype.fetchScopeGraph=function(){var t=this,e=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),graphID:this.graphID(),subgraphID:this.subgraphID()});return this._prevScopeGraph&&this._prevHashSum===e?Promise.resolve(this._prevScopeGraph):(this.startProgress(),this._prevHashSum=e,this._gc.clear(),r.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchGraphs().then((function(e){for(var r=0,i=e;r<i.length;r++){var o=i[r];if(o.Name===t.graphID())return t.finishProgress(),o.fetchScopeGraph(t.subgraphID())}})).then((function(e){return t._prevScopeGraph=e,t._prevScopeGraph})))},e.prototype.enter=function(e,r){t.prototype.enter.call(this,e,r)},e.prototype.update=function(e,r){t.prototype.update.call(this,e,r)},e.prototype.exit=function(e,r){t.prototype.exit.call(this,e,r)},e.prototype.loadGraph=function(){this._gc.disabled(this._legend.disabled()),this._graph.data(this._gc.graphData(),!0);var t=this._gc.activityData(),e=t.columns,r=t.data;this._activities.columns(e).data(r);var i=this._gc.edgeData();e=i.columns,r=i.data;this._edges.columns(e).data(r);var o=this._gc.subgraphData();e=o.columns,r=o.data;this._subgraphs.columns(e).data(r)},e.prototype.render=function(e){var r=this;return this.wuid()&&this.graphID()?this.fetchScopeGraph().then((function(i){r._gc.set(i),r._legend.data(r._gc.calcLegend()),r.loadGraph(),t.prototype.render.call(r,e)})):t.prototype.render.call(this,e),this},e.prototype.selection=function(t){if(!arguments.length)return this._graph.selection();var e=this._gc.vertex(t)||this._gc.edge(t)||this._gc.subgraph(t);return e&&this._graph.selection([e]),this},e}(p.ChartPanel);function k(t){switch(Object.prototype.toString.call(t)){case"[object Undefined]":case"[object Boolean]":case"[object Number]":return t;case"[object String]":return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");default:console.warn("Unknown cell type: "+Object.prototype.toString.call(t))}return t}x.prototype._class+=" eclwatch_WUGraph",x.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),x.prototype.publish("wuid","","string","Workunit ID"),x.prototype.publish("graphID","","string","Graph ID"),x.prototype.publish("subgraphID","","string","Subgraph ID");var I,C,T=function(){function t(t,e,r,i){void 0===i&&(i={}),this._cache={},this._filter={},this.wuResult=t,this.schema=e,this._columns=this.schema2Columns(this.schema.root),this.rowFormatter=new s.RowFormatter(this._columns,r),this._filter=i}return t.prototype.columns=function(){return this._columns},t.prototype.schema2Columns=function(t,e){var r=this;return void 0===e&&(e=""),t?t.children().filter((function(t){return-1===t.name.indexOf("__hidden",t.name.length-8)})).map((function(t,i){var o=t.name,a=t.attrs["hpcc:keyed"],n={field:e+o,leafID:o,idx:i,label:o+(a?" (i)":""),className:"resultGridCell",sortable:!1,width:a?16:0,isSet:t.isSet},s=r.schema2Columns(t,e+o+"_");return s.length?(n.width+=10+s.reduce((function(t,e){return t+e.width}),0),n.children=s):(n.width+=9*t.charWidth(),n.formatter=function(t,e){switch(typeof t){case"string":return{html:t.replace(/\t/g," ").trim()};case"undefined":return""}return t}),n})):[]},t.prototype.isChildDataset=function(t){if("[object Object]"!==Object.prototype.toString.call(t))return!1;var e=0,r=null;for(var i in t)r||(r=Object.prototype.toString.call(t[i])),e++;return 1===e&&"[object Array]"===r},t.prototype.rowToTable=function(t,e,r){if(this.isChildDataset(t))for(var i in t)this.rowToTable(t[i],e,r);else{var o=s.domConstruct.create("table",{border:1,cellspacing:0,width:"100%"},r);switch(Object.prototype.toString.call(t)){case"[object Object]":var a=s.domConstruct.create("tr",null,o);for(var i in t)s.domConstruct.create("th",{innerHTML:k(i)},a);for(var i in a=s.domConstruct.create("tr",null,o),t)switch(Object.prototype.toString.call(t[i])){case"[object Object]":case"[object Array]":this.rowToTable(t[i],e,r);break;default:s.domConstruct.create("td",{innerHTML:k(t[i])},a)}break;case"[object Array]":for(var n=0;n<t.length;++n)switch(Object.prototype.toString.call(t[n])){case"[object Boolean]":case"[object Number]":case"[object String]":var c=s.domConstruct.create("tr",null,o);s.domConstruct.create("td",{innerHTML:k(t[n])},c);break;default:if(0===n){var p=s.domConstruct.create("tr",null,o);for(var i in t[n])s.domConstruct.create("th",{innerHTML:k(i)},p)}for(var i in s.domConstruct.create("tr",null,o),t[n])if(t[n][i])if("[object Object]"===Object.prototype.toString.call(t[n][i])||"[object Array]"===Object.prototype.toString.call(t[n][i])){var l=s.domConstruct.create("td",null,c);this.rowToTable(t[n][i],t[n],l)}else if(-1!==i.indexOf("__html",i.length-6))s.domConstruct.create("td",{innerHTML:t[n][i]},c);else if(-1!==i.indexOf("__javascript",i.length-12))s.domConstruct.create("td",null,c);else{var h=t[n][i];s.domConstruct.create("td",{innerHTML:k(h)},c)}else s.domConstruct.create("td",{innerHTML:""},c)}}}},t.prototype.getIdentity=function(t){return t.__hpcc_id},t.prototype._request=function(t,e){var r=this;if(!this.wuResult)return Promise.resolve({totalLength:0,data:[]});var i="".concat(t,"->").concat(e);if(this._cache[i])return this._cache[i];var o=this.wuResult.fetchRows(t,e-t,!1,this._filter).then((function(e){return{totalLength:r.wuResult.Total,data:e.map((function(e,i){var o=r.rowFormatter.format(e);return o.__hpcc_id=t+i,o.__hpcc_orig=e,o}))}}));return this._cache[i]=o,o},t.prototype.fetchRange=function(t){var e=new s.Deferred;return this._request(t.start,t.end).then((function(t){return e.resolve(t)})),new s.QueryResults(e.then((function(t){return t.data})),{totalLength:e.then((function(t){return t.totalLength}))})},t}(),E=function(t){function e(){var e=t.call(this)||this;return e.renderHtml(!1),e}return u(e,t),e.prototype.hashSum=function(t){return void 0===t&&(t={}),a.hashSum(d({baseUrl:this.baseUrl(),wuid:this.wuid(),resultName:this.resultName(),sequence:this.sequence(),nodeGroup:this.nodeGroup(),logicalFile:this.logicalFile(),userID:this.user(),password:this.password()},t))},e.prototype.calcResult=function(){var t=this.hashSum();if(this._prevResultHash!==t){this._prevResultHash=t;var e={baseUrl:this.baseUrl(),userID:this.user(),password:this.password()};this.wuid()&&this.resultName()?this._result=r.Result.attach(e,this.wuid(),this.resultName()):this.wuid()&&void 0!==this.sequence()?this._result=r.Result.attach(e,this.wuid(),this.sequence()):this.logicalFile()&&this.nodeGroup()?this._result=r.Result.attachLogicalFile(e,this.nodeGroup(),this.logicalFile()):this.logicalFile()&&(this._result=r.Result.attachLogicalFile(e,"",this.logicalFile()))}return this._result},e.prototype.fetch=function(t,e,r){void 0===r&&(r=new AbortController);var i=this.calcResult();return i?i.fetchRows(t,e,!1,{},r.signal):Promise.resolve([])},e.prototype.update=function(e,r){var i=this;t.prototype.update.call(this,e,r);var o=this.hashSum({renderHtml:this.renderHtml(),filter:this.filter()});if(this._prevStoreHash!==o){this._prevStoreHash=o;var a=this.calcResult();a&&a.fetchXMLSchema().then((function(t){var e,r;i._localStore=new T(a,t,i.renderHtml(),i.filter()),null===(e=i._dgrid)||void 0===e||e.set("columns",i._localStore.columns()),null===(r=i._dgrid)||void 0===r||r.set("collection",i._localStore)}))}},e.prototype.click=function(t,e,r){},g([n.publish("","string","URL to WsWorkunits"),f("design:type",Object)],e.prototype,"baseUrl",void 0),g([n.publish(void 0,"string","Workunit ID"),f("design:type",Object)],e.prototype,"user",void 0),g([n.publish(void 0,"string","User ID"),f("design:type",Object)],e.prototype,"password",void 0),g([n.publish(void 0,"string","Password"),f("design:type",Object)],e.prototype,"wuid",void 0),g([n.publish(void 0,"string","Result Name"),f("design:type",Object)],e.prototype,"resultName",void 0),g([n.publish(void 0,"number","Sequence Number"),f("design:type",Object)],e.prototype,"sequence",void 0),g([n.publish("","string","NodeGroup"),f("design:type",Object)],e.prototype,"nodeGroup",void 0),g([n.publish("","string","Logical File Name"),f("design:type",Object)],e.prototype,"logicalFile",void 0),g([n.publish({},"object","Filter"),f("design:type",Object)],e.prototype,"filter",void 0),e}(s.Common);E.prototype._class+=" eclwatch_WUResult",t.STATUS=void 0,(I=t.STATUS||(t.STATUS={})).CREATE="Created",I.COMPILE="Compiled",I.EXECUTE="Executed",I.COMPLETE="Completed",t.STATUS_ACTIVE=void 0,(C=t.STATUS_ACTIVE||(t.STATUS_ACTIVE={})).CREATE="Creating",C.COMPILE="Compiling",C.EXECUTE="Executing",C.COMPLETE="Completed";var U=function(e){function i(){var t=e.call(this)||this;return t.zoomable(!1).zoomToFitLimit(1).layout("Hierarchy").hierarchyRankDirection("LR").showToolbar(!1).allowDragging(!1),t}return u(i,e),i.prototype.attachWorkunit=function(){var t=this,e=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==e&&(this._prevHash=e,this._wu=r.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()),this._wuHandle&&this._wuHandle.release(),this._wuHandle=this._wu.watch((function(e){t.lazyRender()})))},i.prototype.createVertex=function(t){return(new c.Vertex).icon_diameter(32).icon_shape_colorFill("none").icon_shape_colorStroke("none").icon_image_colorFill("darkgray").iconAnchor("middle").textbox_shape_colorFill("none").textbox_shape_colorStroke("none").textbox_text_colorFill("darkgray").faChar(t)},i.prototype.updateVertex=function(t,e){t.icon_image_colorFill(e).textbox_text_colorFill(e)},i.prototype.updateVertexStatus=function(e,r){void 0===r&&(r=!1);var i=this._wu.isFailed()?"darkred":"darkgreen";switch(this._create.text(t.STATUS.CREATE),this._compile.text(t.STATUS.COMPILE),this._execute.text(t.STATUS.EXECUTE),this._complete.text(t.STATUS.COMPLETE),e){case 0:this.updateVertex(this._create,"darkgray"),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 1:this._create.text(t.STATUS_ACTIVE.CREATE),this.updateVertex(this._create,r?"orange":i),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 2:this._compile.text(t.STATUS_ACTIVE.COMPILE),this.updateVertex(this._create,i),this.updateVertex(this._compile,r?"orange":i),this.updateVertex(this._execute,i),this.updateVertex(this._complete,"darkgray");break;case 3:this._execute.text(t.STATUS_ACTIVE.EXECUTE),this.updateVertex(this._create,i),this.updateVertex(this._compile,i),this.updateVertex(this._execute,r?"orange":i),this.updateVertex(this._complete,"darkgray");break;case 4:this.updateVertex(this._create,i),this.updateVertex(this._compile,i),this.updateVertex(this._execute,i),this.updateVertex(this._complete,i)}},i.prototype.createEdge=function(t,e){return(new c.Edge).sourceVertex(t).targetVertex(e).strokeColor("black").showArc(!1)},i.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._create=this.createVertex(""),this._compile=this.createVertex(""),this._execute=this.createVertex(""),this._complete=this.createVertex("");var i=this.createEdge(this._create,this._compile),o=this.createEdge(this._compile,this._execute),a=this.createEdge(this._execute,this._complete);this.data({vertices:[this._create,this._compile,this._execute,this._complete],edges:[i,o,a]})},i.prototype.update=function(t,i){switch(this.attachWorkunit(),this._wu.StateID){case r.WUStateID.Blocked:case r.WUStateID.Wait:case r.WUStateID.Scheduled:case r.WUStateID.UploadingFiled:this.updateVertexStatus(1);break;case r.WUStateID.Compiling:this.updateVertexStatus(2,!0);break;case r.WUStateID.Submitted:this.updateVertexStatus(1,!0);break;case r.WUStateID.Compiled:this.updateVertexStatus(2);break;case r.WUStateID.Aborting:case r.WUStateID.Running:this.updateVertexStatus(3,!0);break;case r.WUStateID.Aborted:case r.WUStateID.Archived:case r.WUStateID.Completed:this.updateVertexStatus(4);break;case r.WUStateID.Failed:this.updateVertexStatus(4,!1);break;case r.WUStateID.DebugPaused:case r.WUStateID.DebugRunning:case r.WUStateID.Paused:case r.WUStateID.Unknown:default:this.updateVertexStatus(0)}e.prototype.update.call(this,t,i),this.zoomToFit()},i.prototype.exit=function(t,r){this._wuHandle&&this._wuHandle.release(),e.prototype.exit.call(this,t,r)},i}(c.Graph);U.prototype._class+=" eclwatch_WUStatus",U.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),U.prototype.publish("wuid","","string","Workunit ID");var j=["label","start","end","icon","color","series"],P=function(t){function e(){var e=t.call(this)||this;return e._palette=n.Palette.ordinal("default"),e.columns(j).titleColumn("label").iconColumn("icon").colorColumn("color").seriesColumn("series").timePattern("%Y-%m-%dT%H:%M:%S.%LZ").tickFormat("%H:%M").tooltipTimeFormat("%H:%M:%S.%L").tooltipHTML((function(t){return t[j.length].calcTooltip()})),e}return u(e,t),e.prototype.clear=function(){return delete this._prevHashSum,this},e.prototype.fetchScopes=function(){var t=this,e=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),request:this.request()});this._prevHashSum!==e&&(this._prevHashSum=e,r.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchDetails(this.request()).then((function(e){return e.filter((function(t){return t.Id&&t.attr("WhenStarted").RawValue})).map((function(e){var r=+e.attr("WhenStarted").RawValue/1e3,i=+e.attr("TimeElapsed").RawValue/1e6;return[e.Id,new Date(r).toISOString(),i?new Date(r+i).toISOString():void 0,null,t._palette(e.ScopeType),e.ScopeName.split("::").join(":").split(":").slice(0,1),e]}))})).then((function(e){t.data(e).render()})))},e.prototype.enter=function(e,r){t.prototype.enter.call(this,e,r)},e.prototype.update=function(e,r){this.fetchScopes(),t.prototype.update.call(this,e,r)},e.prototype.exit=function(e,r){t.prototype.exit.call(this,e,r)},e}(l.ReactTimelineSeries);P.prototype._class+=" eclwatch_WUTimeline",P.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),P.prototype.publish("wuid","","string","Workunit ID"),P.prototype.publish("request",{ScopeFilter:{MaxDepth:3,ScopeTypes:["graph","subgraph"]},NestedFilter:{Depth:0,ScopeTypes:[]},PropertiesToReturn:{AllProperties:!1,AllStatistics:!0,AllHints:!1,Properties:["WhenStarted","TimeElapsed"]},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},"object","WUDetails Request"),t.BUILD_VERSION="2.108.2",t.ECLArchiveViewer=y,t.PKG_NAME="@hpcc-js/eclwatch",t.PKG_VERSION="2.77.2",t.WUGraph=x,t.WUResult=E,t.WUScopeController=w,t.WUStatus=U,t.WUTimeline=P}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/codemirror"),require("@hpcc-js/comms"),require("@hpcc-js/phosphor"),require("@hpcc-js/tree"),require("@hpcc-js/util"),require("@hpcc-js/common"),require("@hpcc-js/dgrid"),require("@hpcc-js/graph"),require("@hpcc-js/layout"),require("@hpcc-js/timeline")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/codemirror","@hpcc-js/comms","@hpcc-js/phosphor","@hpcc-js/tree","@hpcc-js/util","@hpcc-js/common","@hpcc-js/dgrid","@hpcc-js/graph","@hpcc-js/layout","@hpcc-js/timeline"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/eclwatch"]={},t["@hpcc-js/codemirror"],t["@hpcc-js/comms"],t["@hpcc-js/phosphor"],t["@hpcc-js/tree"],t["@hpcc-js/util"],t["@hpcc-js/common"],t["@hpcc-js/dgrid"],t["@hpcc-js/graph"],t["@hpcc-js/layout"],t["@hpcc-js/timeline"])}(this,(function(t,e,r,i,o,a,n,s,c,p,l){var h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},h(t,e)};function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var d=function(){return d=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},d.apply(this,arguments)};function g(t,e,r,i){var o,a=arguments.length,n=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,r,n):o(e,r))||n);return a>3&&n&&Object.defineProperty(e,r,n),n}function f(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function _(t,e,r){if(r||2===arguments.length)for(var i,o=0,a=e.length;o<a;o++)!i&&o in e||(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var y=function(t){function i(){var r=t.call(this,"horizontal")||this;return r._directoryPane=new o.DirectoryTree,r._fileEditorPane=(new e.Editor).text(""),r._directoryPane.rowClick=function(t){r._fileEditorPane.text(t).render()},r}return u(i,t),i.prototype.transformArchiveTreeData=function(t){var e={label:t.name,children:t._children.map((function t(e){var r={};if(r.label=e.name+(e.$&&e.$.key?" (".concat(e.$.key,")"):""),e._children&&e._children.length>0)r.children=e._children.map((function(e){return t(e)})).filter((function(t){return t}));else{if("string"!=typeof e.content||!e.content.trim())return!1;r.content=e.content}return r})).filter((function(t){return t}))};return e.children&&e.children[0]&&"html"===e.children[0].label?{label:"root",children:[{label:"error",content:JSON.stringify(e,null,4)}]}:e},i.prototype.updateDirectoryPane=function(t){var e;if(t)try{e=JSON.parse(t)}catch(r){e=a.xml2json(t)}if(e){var r=this.transformArchiveTreeData(e);this._directoryPane.data(r).render()}},i.prototype.enter=function(e,r){t.prototype.enter.call(this,e,r),this.addWidget(this._directoryPane).addWidget(this._fileEditorPane)},i.prototype.update=function(e,i){var o=this;t.prototype.update.call(this,e,i);var n=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==n||void 0===this._contentStr?r.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchArchive().then((function(t){o._contentStr=t,o.updateDirectoryPane(o._contentStr),o._prevHash=n})):this.updateDirectoryPane(this._contentStr),this.relativeSizes([this.directoryWidthRatio(),1-this.directoryWidthRatio()])},i}(i.SplitPanel);function b(t,e){void 0===e&&(e={});var r=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}y.prototype._class+=" eclwatch_ECLArchiveViewer",y.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),y.prototype.publish("wuid","","string","Workunit ID"),y.prototype.publish("directoryWidthRatio",.38,"number","Default directory panel width ratio relative to the full width"),y.prototype.publish("contentString",null,"string","XML/JSON archive content string"),y.prototype.publishProxy("directoryPaneColor","_directoryPane","backgroundColor"),y.prototype.publishProxy("directoryPaneHoverColor","_directoryPane","hoverBackgroundColor"),y.prototype.publishProxy("iconSize","_directoryPane"),y.prototype.publishProxy("fontColor","_directoryPane"),y.prototype.publishProxy("fontFamily","_directoryPane"),y.prototype.publishProxy("fontSize","_directoryPane"),y.prototype.publishProxy("folderIconOpen","_directoryPane"),y.prototype.publishProxy("folderIconClosed","_directoryPane"),y.prototype.publishProxy("textFileIcon","_directoryPane"),y.prototype.publishProxy("codeFileIcon","_directoryPane"),y.prototype.publishProxy("verticalScroll","_directoryPane");b(".eclwatch_WUGraphLegend .graph_Vertex{cursor:auto}.eclwatch_WUGraphLegend .graph_Vertex .common_Icon{cursor:pointer}");var m=function(t){function e(){return t.call(this)||this}return u(e,t),e.prototype.enter=function(e,r){var i=this;t.prototype.enter.call(this,e,r),this._icon.on("click",(function(){i.click(i.data())}))},e.prototype.click=function(t){},e}(c.Vertex),v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.icon=n.local(),e._disabled2={},e}return u(e,t),e.prototype.disabled=function(t){var e=this;if(!arguments.length){var r=[];for(var i in this._disabled2)this._disabled2[i]&&r.push(i);return r}return this._disabled2={},t.forEach((function(t){return e._disabled2[t]=!0})),this},e.prototype.toggle=function(t){this._disabled2[t]=!this._disabled2[t]},e.prototype.update=function(e,r){t.prototype.update.call(this,e,r);var i=this,o=this._g.selectAll(".legendItem").data(this.data(),(function(t){return t.kind}));o.enter().append("g").attr("class","legendItem").each((function(t){i.icon.set(this,(new m).target(this).data(t.kind).textbox_shape_colorStroke("none").textbox_shape_colorFill("none").iconAnchor("left").faChar(t.faChar).text("".concat(t.label," (").concat(t.count,")")).tooltip("".concat(t.kind," - ").concat(t.label)).on("click",(function(t){i.toggle(t),i.render(),i.click(t)})).on("mouseover",(function(t){i.mouseover(t)})).on("mouseout",(function(t){i.mouseout(t)})))})).merge(o).each((function(t,e){var r=i.icon.get(this).icon_shape_colorFill(i._disabled2[t.kind]?"gray":null).render().getBBox();n.select(this).attr("transform","translate(".concat(+r.width/2,", ").concat(30*e,")"))})),o.exit().each((function(t){i.icon.get(this).target(null).render()})).remove();var a=this.getBBox(!0,!0);this._g.attr("transform","translate(16, ".concat(this.height()/2-a.height/2,")"))},e.prototype.click=function(t){},e.prototype.mouseover=function(t){},e.prototype.mouseout=function(t){},e}(p.Legend);function S(t){switch(t){case"2":case"44":case"47":case"56":case"61":case"35":case"37":return"";case"3":return"";case"5":return"";case"6":return"";case"12":return"";case"15":case"17":case"59":return"";case"22":return"";case"23":return"";case"25":case"133":case"148":return"";case"26":case"19":return"";case"29":case"16":return"";case"36":return"";case"54":return"";case"82":case"88":case"99":case"105":case"71":return"";case"92":case"93":return"";case"7":return"";case"9":return"";case"21":case"168":return""}return""}v.prototype._class+=" eclwatch_WUGraphLegend";var w=function(){function t(){this.subgraphsMap={},this.rSubgraphsMap={},this.verticesMap={},this.rVerticesMap={},this.edgesMap={},this.rEdgesMap={},this.kindMap={},this._disabled={}}return t.prototype.clear=function(){this.subgraphsMap={},this.rSubgraphsMap={},this.verticesMap={},this.rVerticesMap={},this.edgesMap={},this.rEdgesMap={}},t.prototype.set=function(t){var e=this;this.graphDB=t,this.graphGui(this.graphDB),this.kindMap={},this.graphDB.walk((function(t){if(t instanceof a.Subgraph);else if(t instanceof a.Vertex){var r=t._.attr("Kind").RawValue;e.kindMap[r]||(e.kindMap[r]=[]),e.kindMap[r].push(t)}}))},t.prototype.disabled=function(t){var e=this;if(!arguments.length){var r=[];for(var i in this._disabled)this._disabled[i]&&r.push(i);return r}return this._disabled={},t.forEach((function(t){return e._disabled[t]=!0})),this},t.prototype.graphGui=function(t){var e=this,r={subgraphs:[],vertices:[],edges:[],hierarchy:[]};return t.walk((function(t){if(t instanceof a.Subgraph){var i=e.appendSubgraph(t,r.hierarchy,r.subgraphs);i.showMinMax(t.vertices.length>3||"normal"!==i.minState())}else t instanceof a.Vertex?e.appendVertex(t,r.hierarchy,r.vertices):t instanceof a.Edge&&e.appendEdge(t,r.edges)})),r},t.prototype.format=function(t,e){for(var r="",i=t.indexOf("%"),o=-1;i>=0;){if(r+=t.substring(o+1,i),(o=t.indexOf("%",i+1))<0){console.warn("Invalid Label Template");break}r+=t.substring(i+1,o)?e[t.substring(i+1,o)]||"":"%",i=t.indexOf("%",o+1)}return(r+=t.substring(o+1,t.length)).split("\\n").join("\n")},t.prototype.createSubgraph=function(t){var e=this,r=this.subgraphsMap[t._.Id];return r||(r=(new c.Subgraph).title(t._.Id).on("minClick",(function(){e.minClick(r)})),this.subgraphsMap[t._.Id]=r,this.rSubgraphsMap[r.id()]=t),r},t.prototype.createVertex=function(t){var e=this,r=this.verticesMap[t._.Id];if(!r){var i=t._.rawAttrs();if("dummy"===t._.ScopeType){var o=this.subgraphsMap[t.parent._.Id];r=(new n.Icon).shape_colorFill("darkred").shape_colorStroke("darkred").image_colorFill("white").faChar("").on("click",(function(){o.minState("normal"),e.minClick(o)}))}else{r=(new c.Vertex).icon_shape_colorFill("#1f77b4").icon_image_colorFill("white").faChar(S(i.Kind)).text(i.Label);var a=[];t._.hasAttr("Definition")&&a.push({faChar:"",tooltip:"Definition",shape_colorFill:"lightgray",shape_colorStroke:"lightgray",image_colorFill:"black"}),t._.hasAttr("IsInternal")&&a.push({faChar:"",tooltip:"IsInternal",shape_colorFill:"red",shape_colorStroke:"red",image_colorFill:"white"}),r.annotationIcons(a)}this.verticesMap[t._.Id]=r,this.rVerticesMap[r.id()]=t}return r},t.prototype.isSpill=function(t){var e=t.source._.attr("Kind").RawValue,r=t.target._.attr("Kind").RawValue;return"2"===e||"71"===r},t.prototype.spansSubgraph=function(t){return t.source.parent._.Id!==t.target.parent._.Id},t.prototype.createEdge=function(t){var e=this.edgesMap[t._.Id];if(!e){var r=t._.rawAttrs(),i=this.verticesMap[t.source._.Id],o=this.verticesMap[t.target._.Id];if(i&&o){var a=this.isSpill(t),n=this.spansSubgraph(t),s=this.format("%Label%\n%NumRowsProcessed%",r),p=null,l=100;r.IsDependency?(l=10,p="1,5"):r._childGraph?p="5,5":a?(l=25,p="5,5,10,5"):n&&(l=5,p="5,5"),e=(new c.Edge).sourceVertex(i).targetVertex(o).sourceMarker("circle").targetMarker("arrow").weight(l).strokeDasharray(p).text(s),this.edgesMap[t._.Id]=e,this.rEdgesMap[e.id()]=t}}return e},t.prototype.appendSubgraph=function(t,e,r){var i=this.createSubgraph(t);r.push(i);var o=this.subgraphsMap[t.parent._.Id];return o&&e.push({parent:o,child:i}),i},t.prototype.appendVertex=function(t,e,r){var i=this.createVertex(t);r.push(i);var o=this.subgraphsMap[t.parent._.Id];return o&&e.push({parent:o,child:i}),i},t.prototype.appendEdge=function(t,e){var r=this.createEdge(t);return r&&e.push(r),r},t.prototype.filterLegend=function(t){for(var e=function(e){var o=t.vertices[e],a=o._.attr("Kind").RawValue;i._disabled[a]&&o.remove(!1,(function(t,e){return new r.BaseScope({ScopeName:o._.ScopeName+":in",Id:t.Id+"->"+e.Id,ScopeType:"dummy-edge",Properties:{Property:[o._.attr("Label")]},Notes:{Note:[]},SinkActivity:""})}))},i=this,o=t.vertices.length-1;o>=0;--o)e(o)},t.prototype.filterPartial=function(t){for(var e=0,i=t.subgraphs;e<i.length;e++){var o=i[e];if("partial"===this.subgraphsMap[o._.Id].minState()){for(var a=[],n=[],s=0,c=o.vertices;s<c.length;s++){0===(g=c[s]).inEdges.length||g.inEdges.some((function(t){return t.source.parent!==t.target.parent}))||0===g.outEdges.length||g.outEdges.some((function(t){return t.source.parent!==t.target.parent}))?a.push(g):n.push(g)}if(n.length>1){for(var p={ScopeName:o._.ScopeName,Id:o._.Id+":dummy",ScopeType:"dummy",Properties:{Property:[{Name:"Activities",RawValue:""+n.length,Formatted:""+n.length,Measure:"count",Creator:"",CreatorType:""}]},Notes:{Note:[]},SinkActivity:""},l=new r.BaseScope(p),h=o.createVertex(l),u=0,d=n;u<d.length;u++){for(var g,f=0,_=(g=d[u]).inEdges;f<_.length;f++){var y=_[f];if(a.indexOf(y.source)>=0){var b=new r.BaseScope({ScopeName:y.source._.ScopeName,Id:y.source._.Id+"->"+h._.Id,ScopeType:"dummy-in",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});o.createEdge(y.source,h,b)}}for(var m=0,v=g.outEdges;m<v.length;m++){y=v[m];if(a.indexOf(y.target)>=0){b=new r.BaseScope({ScopeName:y.target._.ScopeName,Id:h._.Id+"->"+y.target._.Id,ScopeType:"dummy-out",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});o.createEdge(h,y.target,b)}}}n.forEach((function(t){return t.remove(!0)}))}}}},t.prototype.filterEmptySubgraphs=function(t){for(;;){var e=t.subgraphs.filter((function(t){return 0===t.subgraphs.length&&0===t.vertices.length}));if(0===e.length)break;e.forEach((function(t){return t.remove(!0)}))}},t.prototype.removeObsoleteSubgraphs=function(t){for(var e=0,r=_([],t.subgraphs,!0);e<r.length;e++){var i=r[e];0===i.vertices.length&&i.remove(!1)}},t.prototype.graphData=function(){var t=this.graphDB.clone();return this.filterLegend(t),this.filterPartial(t),this.filterEmptySubgraphs(t),this.removeObsoleteSubgraphs(t),this.graphGui(t)},t.prototype.calcLegend=function(){var t=[];for(var e in this.kindMap)t.push({kind:parseInt(e),faChar:S(e),label:this.kindMap[e][0]._.attr("Label").RawValue.split("\n")[0],count:this.kindMap[e].length});return t},t.prototype.vertices=function(t){for(var e=[],r=0,i=this.kindMap[t];r<i.length;r++){var o=i[r];e.push(this.verticesMap[o._.Id])}return e},t.prototype.formatRow=function(t,e,r){var i=t._.formattedAttrs();for(var o in i){var a=e.indexOf(o);-1===a?(e.push(o),r.push(i[o])):r[a]=i[o]}for(var n=0;n<100;++n)void 0===r[n]&&(r[n]="");return r},t.prototype.activityData=function(){var t=this,e=["Id","Kind","Label"],r=this.graphDB.vertices.map((function(r){var i=[parseInt(r._.Id.split("a")[1])];return t.formatRow(r,e,i)}));return{columns:e,data:r}},t.prototype.edgeData=function(){var t=this,e=["Id","Label"],r=this.graphDB.edges.map((function(r){var i=[r._.Id];return t.formatRow(r,e,i)}));return{columns:e,data:r}},t.prototype.subgraphData=function(){var t=this,e=["Id","Label"],r=this.graphDB.subgraphs.map((function(r){var i=[r._.Id];return t.formatRow(r,e,i)}));return{columns:e,data:r}},t.prototype.calcGraphTooltip=function(t){var e,r;if(t instanceof c.Subgraph){var i=this.rSubgraphsMap[t.id()];e=i._,r=i.parent._}else if(t instanceof c.Vertex||t instanceof n.Icon){var o=this.rVerticesMap[t.id()];e=o._,r=o.parent._}else if(t instanceof c.Edge){var a=this.rEdgesMap[t.id()];e=a._,r=a.parent._}return e?e.calcTooltip(r):""},t.prototype.subgraph=function(t){return this.subgraphsMap[t]},t.prototype.vertex=function(t){return this.verticesMap[t]},t.prototype.edge=function(t){return this.edgesMap[t]},t.prototype.minClick=function(t){},t}();b(".eclwatch_WUGraph .graph_Vertex{cursor:auto}.eclwatch_WUGraph .marker{fill:#656565;stroke:none;stroke-width:1px}.eclwatch_WUGraph .zoom{fill:none;pointer-events:all}.eclwatch_WUGraph .selectionBrush{fill:none;stroke:#a9a9a9}.d3-tip .eclwatch_WUGraph_Tooltip h3,.d3-tip .eclwatch_WUGraph_Tooltip h4{margin:0}.d3-tip .eclwatch_WUGraph_Tooltip table{border-collapse:separate;border-spacing:5px}.d3-tip .eclwatch_WUGraph_Tooltip table .key{font-weight:700}.d3-tip .eclwatch_WUGraph_Tooltip table .value{font-weight:400}");var x=function(t){function e(){var e=t.call(this)||this;e._partialAll=(new n.Button).faChar("fa-window-restore").tooltip("Partial All").on("click",(function(){e.stateClick(e._partialAll)})),e._maxAll=(new n.Button).faChar("fa-window-maximize").tooltip("Max All").on("click",(function(){e.stateClick(e._maxAll)})),e._toggleGraph=(new n.ToggleButton).faChar("fa-chain").tooltip("Graph").selected(!0).on("click",(function(){e.viewClick(e._toggleGraph)})),e._toggleActivities=(new n.ToggleButton).faChar("fa-table").tooltip("Activitiies").selected(!1).on("click",(function(){e.viewClick(e._toggleActivities)})),e._toggleEdges=(new n.ToggleButton).faChar("fa-table").tooltip("Edges").selected(!1).on("click",(function(){e.viewClick(e._toggleEdges)})),e._toggleSubgraphs=(new n.ToggleButton).faChar("fa-table").tooltip("Subgraphs").selected(!1).on("click",(function(){e.viewClick(e._toggleSubgraphs)})),e._graph=(new c.Graph).layout("Hierarchy").applyScaleOnLayout(!0).showToolbar(!1).allowDragging(!1),e._activities=(new s.Table).pagination(!1),e._edges=(new s.Table).pagination(!1),e._subgraphs=(new s.Table).pagination(!1),e._legend=new v(e).on("click",(function(t){e.render()})).on("mouseover",(function(t){for(var r={},i=0,o=e._gc.vertices(t);i<o.length;i++){r[o[i].id()]=!0}e._graph.highlightVerticies(r)})).on("mouseout",(function(t){e._graph.highlightVerticies()})),e._view=(new p.Carousel).widgets([e._graph,e._activities,e._edges,e._subgraphs]),e._gc=new w,e.topOverlay(!1),e.widget(e._view);var r=_(_([e._toggleGraph,e._toggleActivities,e._toggleEdges,e._toggleSubgraphs,new n.Spacer,e._partialAll,e._maxAll,new n.Spacer],e._graph.iconBarButtons(),!0),[new n.Spacer],!1);return e.buttons(r.concat(e.buttons())),e._gc.minClick=function(t){e.loadGraph(),e._graph.render((function(r){e._graph.selection([t]).centerOnItem(t)}))},e._graph.tooltipHTML((function(t){return e._gc.calcGraphTooltip(t)})),e}return u(e,t),e.prototype.stateClick=function(t){switch(t){case this._partialAll:this._graph.data().subgraphs.forEach((function(t){t.minState("partial")}));break;case this._maxAll:this._graph.data().subgraphs.forEach((function(t){t.minState("normal")}))}this.render()},e.prototype.viewClick=function(t){switch(this._toggleGraph.selected(t===this._toggleGraph),this._toggleActivities.selected(t===this._toggleActivities),this._toggleEdges.selected(t===this._toggleEdges),this._toggleSubgraphs.selected(t===this._toggleSubgraphs),t){case this._toggleGraph:this._view.active(0);break;case this._toggleActivities:this._view.active(1);break;case this._toggleEdges:this._view.active(2);break;case this._toggleSubgraphs:this._view.active(3)}this.render((function(t){}))},e.prototype.fetchScopeGraph=function(){var t=this,e=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),graphID:this.graphID(),subgraphID:this.subgraphID()});return this._prevScopeGraph&&this._prevHashSum===e?Promise.resolve(this._prevScopeGraph):(this.startProgress(),this._prevHashSum=e,this._gc.clear(),r.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchGraphs().then((function(e){for(var r=0,i=e;r<i.length;r++){var o=i[r];if(o.Name===t.graphID())return t.finishProgress(),o.fetchScopeGraph(t.subgraphID())}})).then((function(e){return t._prevScopeGraph=e,t._prevScopeGraph})))},e.prototype.enter=function(e,r){t.prototype.enter.call(this,e,r)},e.prototype.update=function(e,r){t.prototype.update.call(this,e,r)},e.prototype.exit=function(e,r){t.prototype.exit.call(this,e,r)},e.prototype.loadGraph=function(){this._gc.disabled(this._legend.disabled()),this._graph.data(this._gc.graphData(),!0);var t=this._gc.activityData(),e=t.columns,r=t.data;this._activities.columns(e).data(r);var i=this._gc.edgeData();e=i.columns,r=i.data;this._edges.columns(e).data(r);var o=this._gc.subgraphData();e=o.columns,r=o.data;this._subgraphs.columns(e).data(r)},e.prototype.render=function(e){var r=this;return this.wuid()&&this.graphID()?this.fetchScopeGraph().then((function(i){r._gc.set(i),r._legend.data(r._gc.calcLegend()),r.loadGraph(),t.prototype.render.call(r,e)})):t.prototype.render.call(this,e),this},e.prototype.selection=function(t){if(!arguments.length)return this._graph.selection();var e=this._gc.vertex(t)||this._gc.edge(t)||this._gc.subgraph(t);return e&&this._graph.selection([e]),this},e}(p.ChartPanel);function k(t){switch(Object.prototype.toString.call(t)){case"[object Undefined]":case"[object Boolean]":case"[object Number]":return t;case"[object String]":return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");default:console.warn("Unknown cell type: "+Object.prototype.toString.call(t))}return t}x.prototype._class+=" eclwatch_WUGraph",x.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),x.prototype.publish("wuid","","string","Workunit ID"),x.prototype.publish("graphID","","string","Graph ID"),x.prototype.publish("subgraphID","","string","Subgraph ID");var I,C,T=function(){function t(t,e,r,i){void 0===i&&(i={}),this._cache={},this._filter={},this.wuResult=t,this.schema=e,this._columns=this.schema2Columns(this.schema.root),this.rowFormatter=new s.RowFormatter(this._columns,r),this._filter=i}return t.prototype.columns=function(){return this._columns},t.prototype.schema2Columns=function(t,e){var r=this;return void 0===e&&(e=""),t?t.children().filter((function(t){return-1===t.name.indexOf("__hidden",t.name.length-8)})).map((function(t,i){var o=t.name,a=t.attrs["hpcc:keyed"],n={field:e+o,leafID:o,idx:i,label:o+(a?" (i)":""),className:"resultGridCell",sortable:!1,width:a?16:0,isSet:t.isSet},s=r.schema2Columns(t,e+o+"_");return s.length?(n.width+=10+s.reduce((function(t,e){return t+e.width}),0),n.children=s):(n.width+=9*t.charWidth(),n.formatter=function(t,e){switch(typeof t){case"string":return{html:t.replace(/\t/g," ").trim()};case"undefined":return""}return t}),n})):[]},t.prototype.isChildDataset=function(t){if("[object Object]"!==Object.prototype.toString.call(t))return!1;var e=0,r=null;for(var i in t)r||(r=Object.prototype.toString.call(t[i])),e++;return 1===e&&"[object Array]"===r},t.prototype.rowToTable=function(t,e,r){if(this.isChildDataset(t))for(var i in t)this.rowToTable(t[i],e,r);else{var o=s.domConstruct.create("table",{border:1,cellspacing:0,width:"100%"},r);switch(Object.prototype.toString.call(t)){case"[object Object]":var a=s.domConstruct.create("tr",null,o);for(var i in t)s.domConstruct.create("th",{innerHTML:k(i)},a);for(var i in a=s.domConstruct.create("tr",null,o),t)switch(Object.prototype.toString.call(t[i])){case"[object Object]":case"[object Array]":this.rowToTable(t[i],e,r);break;default:s.domConstruct.create("td",{innerHTML:k(t[i])},a)}break;case"[object Array]":for(var n=0;n<t.length;++n)switch(Object.prototype.toString.call(t[n])){case"[object Boolean]":case"[object Number]":case"[object String]":var c=s.domConstruct.create("tr",null,o);s.domConstruct.create("td",{innerHTML:k(t[n])},c);break;default:if(0===n){var p=s.domConstruct.create("tr",null,o);for(var i in t[n])s.domConstruct.create("th",{innerHTML:k(i)},p)}for(var i in s.domConstruct.create("tr",null,o),t[n])if(t[n][i])if("[object Object]"===Object.prototype.toString.call(t[n][i])||"[object Array]"===Object.prototype.toString.call(t[n][i])){var l=s.domConstruct.create("td",null,c);this.rowToTable(t[n][i],t[n],l)}else if(-1!==i.indexOf("__html",i.length-6))s.domConstruct.create("td",{innerHTML:t[n][i]},c);else if(-1!==i.indexOf("__javascript",i.length-12))s.domConstruct.create("td",null,c);else{var h=t[n][i];s.domConstruct.create("td",{innerHTML:k(h)},c)}else s.domConstruct.create("td",{innerHTML:""},c)}}}},t.prototype.getIdentity=function(t){return t.__hpcc_id},t.prototype._request=function(t,e){var r=this;if(!this.wuResult)return Promise.resolve({totalLength:0,data:[]});var i="".concat(t,"->").concat(e);if(this._cache[i])return this._cache[i];var o=this.wuResult.fetchRows(t,e-t,!1,this._filter).then((function(e){return{totalLength:r.wuResult.Total,data:e.map((function(e,i){var o=r.rowFormatter.format(e);return o.__hpcc_id=t+i,o.__hpcc_orig=e,o}))}}));return this._cache[i]=o,o},t.prototype.fetchRange=function(t){var e=new s.Deferred;return this._request(t.start,t.end).then((function(t){return e.resolve(t)})),new s.QueryResults(e.then((function(t){return t.data})),{totalLength:e.then((function(t){return t.totalLength}))})},t}(),E=function(t){function e(){var e=t.call(this)||this;return e.renderHtml(!1),e}return u(e,t),e.prototype.hashSum=function(t){return void 0===t&&(t={}),a.hashSum(d({baseUrl:this.baseUrl(),wuid:this.wuid(),resultName:this.resultName(),sequence:this.sequence(),nodeGroup:this.nodeGroup(),logicalFile:this.logicalFile(),userID:this.user(),password:this.password()},t))},e.prototype.calcResult=function(){var t=this.hashSum();if(this._prevResultHash!==t){this._prevResultHash=t;var e={baseUrl:this.baseUrl(),userID:this.user(),password:this.password()};this.wuid()&&this.resultName()?this._result=r.Result.attach(e,this.wuid(),this.resultName()):this.wuid()&&void 0!==this.sequence()?this._result=r.Result.attach(e,this.wuid(),this.sequence()):this.logicalFile()&&this.nodeGroup()?this._result=r.Result.attachLogicalFile(e,this.nodeGroup(),this.logicalFile()):this.logicalFile()&&(this._result=r.Result.attachLogicalFile(e,"",this.logicalFile()))}return this._result},e.prototype.fetch=function(t,e,r){void 0===r&&(r=new AbortController);var i=this.calcResult();return i?i.fetchRows(t,e,!1,{},r.signal):Promise.resolve([])},e.prototype.update=function(e,r){var i=this;t.prototype.update.call(this,e,r);var o=this.hashSum({renderHtml:this.renderHtml(),filter:this.filter()});if(this._prevStoreHash!==o){this._prevStoreHash=o;var a=this.calcResult();a&&a.fetchXMLSchema().then((function(t){var e,r;i._localStore=new T(a,t,i.renderHtml(),i.filter()),null===(e=i._dgrid)||void 0===e||e.set("columns",i._localStore.columns()),null===(r=i._dgrid)||void 0===r||r.set("collection",i._localStore)}))}},e.prototype.click=function(t,e,r){},g([n.publish("","string","URL to WsWorkunits"),f("design:type",Object)],e.prototype,"baseUrl",void 0),g([n.publish(void 0,"string","Workunit ID"),f("design:type",Object)],e.prototype,"user",void 0),g([n.publish(void 0,"string","User ID"),f("design:type",Object)],e.prototype,"password",void 0),g([n.publish(void 0,"string","Password"),f("design:type",Object)],e.prototype,"wuid",void 0),g([n.publish(void 0,"string","Result Name"),f("design:type",Object)],e.prototype,"resultName",void 0),g([n.publish(void 0,"number","Sequence Number"),f("design:type",Object)],e.prototype,"sequence",void 0),g([n.publish("","string","NodeGroup"),f("design:type",Object)],e.prototype,"nodeGroup",void 0),g([n.publish("","string","Logical File Name"),f("design:type",Object)],e.prototype,"logicalFile",void 0),g([n.publish({},"object","Filter"),f("design:type",Object)],e.prototype,"filter",void 0),e}(s.Common);E.prototype._class+=" eclwatch_WUResult",t.STATUS=void 0,(I=t.STATUS||(t.STATUS={})).CREATE="Created",I.COMPILE="Compiled",I.EXECUTE="Executed",I.COMPLETE="Completed",t.STATUS_ACTIVE=void 0,(C=t.STATUS_ACTIVE||(t.STATUS_ACTIVE={})).CREATE="Creating",C.COMPILE="Compiling",C.EXECUTE="Executing",C.COMPLETE="Completed";var U=function(e){function i(){var t=e.call(this)||this;return t.zoomable(!1).zoomToFitLimit(1).layout("Hierarchy").hierarchyRankDirection("LR").showToolbar(!1).allowDragging(!1),t}return u(i,e),i.prototype.attachWorkunit=function(){var t=this,e=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==e&&(this._prevHash=e,this._wu=r.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()),this._wuHandle&&this._wuHandle.release(),this._wuHandle=this._wu.watch((function(e){t.lazyRender()})))},i.prototype.createVertex=function(t){return(new c.Vertex).icon_diameter(32).icon_shape_colorFill("none").icon_shape_colorStroke("none").icon_image_colorFill("darkgray").iconAnchor("middle").textbox_shape_colorFill("none").textbox_shape_colorStroke("none").textbox_text_colorFill("darkgray").faChar(t)},i.prototype.updateVertex=function(t,e){t.icon_image_colorFill(e).textbox_text_colorFill(e)},i.prototype.updateVertexStatus=function(e,r){void 0===r&&(r=!1);var i=this._wu.isFailed()?"darkred":"darkgreen";switch(this._create.text(t.STATUS.CREATE),this._compile.text(t.STATUS.COMPILE),this._execute.text(t.STATUS.EXECUTE),this._complete.text(t.STATUS.COMPLETE),e){case 0:this.updateVertex(this._create,"darkgray"),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 1:this._create.text(t.STATUS_ACTIVE.CREATE),this.updateVertex(this._create,r?"orange":i),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 2:this._compile.text(t.STATUS_ACTIVE.COMPILE),this.updateVertex(this._create,i),this.updateVertex(this._compile,r?"orange":i),this.updateVertex(this._execute,i),this.updateVertex(this._complete,"darkgray");break;case 3:this._execute.text(t.STATUS_ACTIVE.EXECUTE),this.updateVertex(this._create,i),this.updateVertex(this._compile,i),this.updateVertex(this._execute,r?"orange":i),this.updateVertex(this._complete,"darkgray");break;case 4:this.updateVertex(this._create,i),this.updateVertex(this._compile,i),this.updateVertex(this._execute,i),this.updateVertex(this._complete,i)}},i.prototype.createEdge=function(t,e){return(new c.Edge).sourceVertex(t).targetVertex(e).strokeColor("black").showArc(!1)},i.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._create=this.createVertex(""),this._compile=this.createVertex(""),this._execute=this.createVertex(""),this._complete=this.createVertex("");var i=this.createEdge(this._create,this._compile),o=this.createEdge(this._compile,this._execute),a=this.createEdge(this._execute,this._complete);this.data({vertices:[this._create,this._compile,this._execute,this._complete],edges:[i,o,a]})},i.prototype.update=function(t,i){switch(this.attachWorkunit(),this._wu.StateID){case r.WUStateID.Blocked:case r.WUStateID.Wait:case r.WUStateID.Scheduled:case r.WUStateID.UploadingFiled:this.updateVertexStatus(1);break;case r.WUStateID.Compiling:this.updateVertexStatus(2,!0);break;case r.WUStateID.Submitted:this.updateVertexStatus(1,!0);break;case r.WUStateID.Compiled:this.updateVertexStatus(2);break;case r.WUStateID.Aborting:case r.WUStateID.Running:this.updateVertexStatus(3,!0);break;case r.WUStateID.Aborted:case r.WUStateID.Archived:case r.WUStateID.Completed:this.updateVertexStatus(4);break;case r.WUStateID.Failed:this.updateVertexStatus(4,!1);break;case r.WUStateID.DebugPaused:case r.WUStateID.DebugRunning:case r.WUStateID.Paused:case r.WUStateID.Unknown:default:this.updateVertexStatus(0)}e.prototype.update.call(this,t,i),this.zoomToFit()},i.prototype.exit=function(t,r){this._wuHandle&&this._wuHandle.release(),e.prototype.exit.call(this,t,r)},i}(c.Graph);U.prototype._class+=" eclwatch_WUStatus",U.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),U.prototype.publish("wuid","","string","Workunit ID");var j=["label","start","end","icon","color","series"],P=function(t){function e(){var e=t.call(this)||this;return e._palette=n.Palette.ordinal("default"),e.columns(j).titleColumn("label").iconColumn("icon").colorColumn("color").seriesColumn("series").timePattern("%Y-%m-%dT%H:%M:%S.%LZ").tickFormat("%H:%M").tooltipTimeFormat("%H:%M:%S.%L").tooltipHTML((function(t){return t[j.length].calcTooltip()})),e}return u(e,t),e.prototype.clear=function(){return delete this._prevHashSum,this},e.prototype.fetchScopes=function(){var t=this,e=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),request:this.request()});this._prevHashSum!==e&&(this._prevHashSum=e,r.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchDetails(this.request()).then((function(e){return e.filter((function(t){return t.Id&&t.attr("WhenStarted").RawValue})).map((function(e){var r=+e.attr("WhenStarted").RawValue/1e3,i=+e.attr("TimeElapsed").RawValue/1e6;return[e.Id,new Date(r).toISOString(),i?new Date(r+i).toISOString():void 0,null,t._palette(e.ScopeType),e.ScopeName.split("::").join(":").split(":").slice(0,1),e]}))})).then((function(e){t.data(e).render()})))},e.prototype.enter=function(e,r){t.prototype.enter.call(this,e,r)},e.prototype.update=function(e,r){this.fetchScopes(),t.prototype.update.call(this,e,r)},e.prototype.exit=function(e,r){t.prototype.exit.call(this,e,r)},e}(l.ReactTimelineSeries);P.prototype._class+=" eclwatch_WUTimeline",P.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),P.prototype.publish("wuid","","string","Workunit ID"),P.prototype.publish("request",{ScopeFilter:{MaxDepth:3,ScopeTypes:["graph","subgraph"]},NestedFilter:{Depth:0,ScopeTypes:[]},PropertiesToReturn:{AllProperties:!1,AllStatistics:!0,AllHints:!1,Properties:["WhenStarted","TimeElapsed"]},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},"object","WUDetails Request"),t.BUILD_VERSION="2.108.3",t.ECLArchiveViewer=y,t.PKG_NAME="@hpcc-js/eclwatch",t.PKG_VERSION="2.77.3",t.WUGraph=x,t.WUResult=E,t.WUScopeController=w,t.WUStatus=U,t.WUTimeline=P}));
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|