@hpcc-js/eclwatch 3.2.18 → 3.2.20
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.js +579 -262
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2 -5
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +11 -11
package/dist/index.umd.cjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
(function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(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")):typeof define=="function"&&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"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global["@hpcc-js/eclwatch"]={},global["@hpcc-js/codemirror"],global["@hpcc-js/comms"],global["@hpcc-js/phosphor"],global["@hpcc-js/tree"],global["@hpcc-js/util"],global["@hpcc-js/common"],global["@hpcc-js/dgrid"],global["@hpcc-js/graph"],global["@hpcc-js/layout"],global["@hpcc-js/timeline"]))})(this,function(exports2,codemirror,comms,phosphor,tree,util,common,dgrid,graph,layout,timeline){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);const PKG_NAME="@hpcc-js/eclwatch",PKG_VERSION="3.1.1",BUILD_VERSION="3.2.1";class ECLArchiveViewer extends phosphor.SplitPanel{constructor(){super("horizontal");__publicField(this,"_prevHash");__publicField(this,"_contentStr");__publicField(this,"_directoryPane",new tree.DirectoryTree);__publicField(this,"_fileEditorPane",new codemirror.Editor().text(""));this._directoryPane.rowClick=text=>{this._fileEditorPane.text(text).render()}}transformArchiveTreeData(json){const ret={label:json.name,children:json._children.map(transformNode).filter(n=>n)};if(ret.children&&ret.children[0]&&ret.children[0].label==="html")return{label:"root",children:[{label:"error",content:JSON.stringify(ret,null,4)}]};return ret;function transformNode(node){const _node={};if(_node.label=node.name+(node.$&&node.$.key?` (${node.$.key})`:""),node._children&&node._children.length>0)_node.children=node._children.map(_node2=>transformNode(_node2)).filter(n=>n);else if(typeof node.content=="string"&&node.content.trim())_node.content=node.content;else return!1;return _node}}updateDirectoryPane(contentStr){let json;if(contentStr)try{json=JSON.parse(contentStr)}catch{json=util.xml2json(contentStr)}if(json){const _data=this.transformArchiveTreeData(json);this._directoryPane.data(_data).render()}}enter(domNode,element){super.enter(domNode,element),this.addWidget(this._directoryPane).addWidget(this._fileEditorPane)}update(domNode,element){super.update(domNode,element);const hash=util.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==hash||typeof this._contentStr>"u"?comms.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchArchive().then(resp=>{this._contentStr=resp,this.updateDirectoryPane(this._contentStr),this._prevHash=hash}):this.updateDirectoryPane(this._contentStr),this.relativeSizes([this.directoryWidthRatio(),1-this.directoryWidthRatio()])}}ECLArchiveViewer.prototype._class+=" eclwatch_ECLArchiveViewer",ECLArchiveViewer.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),ECLArchiveViewer.prototype.publish("wuid","","string","Workunit ID"),ECLArchiveViewer.prototype.publish("directoryWidthRatio",.38,"number","Default directory panel width ratio relative to the full width"),ECLArchiveViewer.prototype.publish("contentString",null,"string","XML/JSON archive content string"),ECLArchiveViewer.prototype.publishProxy("directoryPaneColor","_directoryPane","backgroundColor"),ECLArchiveViewer.prototype.publishProxy("directoryPaneHoverColor","_directoryPane","hoverBackgroundColor"),ECLArchiveViewer.prototype.publishProxy("iconSize","_directoryPane"),ECLArchiveViewer.prototype.publishProxy("fontColor","_directoryPane"),ECLArchiveViewer.prototype.publishProxy("fontFamily","_directoryPane"),ECLArchiveViewer.prototype.publishProxy("fontSize","_directoryPane"),ECLArchiveViewer.prototype.publishProxy("folderIconOpen","_directoryPane"),ECLArchiveViewer.prototype.publishProxy("folderIconClosed","_directoryPane"),ECLArchiveViewer.prototype.publishProxy("textFileIcon","_directoryPane"),ECLArchiveViewer.prototype.publishProxy("codeFileIcon","_directoryPane"),ECLArchiveViewer.prototype.publishProxy("verticalScroll","_directoryPane");class LegendVertex extends graph.Vertex{constructor(){super()}enter(domNode,element){super.enter(domNode,element),this._icon.on("click",()=>{this.click(this.data())})}click(kind){}}class WUGraphLegend extends layout.Legend{constructor(){super(...arguments);__publicField(this,"icon",common.local());__publicField(this,"_disabled2",{})}disabled(_){if(!arguments.length){const retVal=[];for(const key in this._disabled2)this._disabled2[key]&&retVal.push(key);return retVal}return this._disabled2={},_.forEach(kind=>this._disabled2[kind]=!0),this}toggle(kind){this._disabled2[kind]=!this._disabled2[kind]}update(domNode,element){super.update(domNode,element);const context=this,items=this._g.selectAll(".legendItem").data(this.data(),d=>d.kind);items.enter().append("g").attr("class","legendItem").each(function(d){context.icon.set(this,new LegendVertex().target(this).data(d.kind).textbox_shape_colorStroke("none").textbox_shape_colorFill("none").iconAnchor("left").faChar(d.faChar).text(`${d.label} (${d.count})`).tooltip(`${d.kind} - ${d.label}`).on("click",kind=>{context.toggle(kind),context.render(),context.click(kind)}).on("mouseover",kind=>{context.mouseover(kind)}).on("mouseout",kind=>{context.mouseout(kind)}))}).merge(items).each(function(d,i){const bbox2=context.icon.get(this).icon_shape_colorFill(context._disabled2[d.kind]?"gray":null).render().getBBox();common.select(this).attr("transform",`translate(${+bbox2.width/2}, ${i*30})`)}),items.exit().each(function(d){context.icon.get(this).target(null).render()}).remove();const bbox=this.getBBox(!0,!0);this._g.attr("transform",`translate(16, ${this.height()/2-bbox.height/2})`)}click(kind){}mouseover(kind){}mouseout(kind){}}WUGraphLegend.prototype._class+=" eclwatch_WUGraphLegend";function faCharFactory(kind){switch(kind){case"2":return"";case"3":return"";case"5":return"";case"6":return"";case"12":return"";case"15":return"";case"17":return"";case"22":return"";case"23":return"";case"25":return"";case"26":return"";case"29":return"";case"36":return"";case"44":return"";case"47":return"";case"54":return"";case"56":return"";case"59":return"";case"61":return"";case"82":return"";case"88":return"";case"92":return"";case"93":return"";case"99":return"";case"105":return"";case"7":return"";case"9":return"";case"16":return"";case"19":return"";case"21":return"";case"35":return"";case"37":return"";case"71":return"";case"133":return"";case"148":return"";case"168":return""}return""}class WUScopeController{constructor(){__publicField(this,"graphDB");__publicField(this,"subgraphsMap",{});__publicField(this,"rSubgraphsMap",{});__publicField(this,"verticesMap",{});__publicField(this,"rVerticesMap",{});__publicField(this,"edgesMap",{});__publicField(this,"rEdgesMap",{});__publicField(this,"kindMap",{});__publicField(this,"_disabled",{})}clear(){this.subgraphsMap={},this.rSubgraphsMap={},this.verticesMap={},this.rVerticesMap={},this.edgesMap={},this.rEdgesMap={}}set(masterGraph){this.graphDB=masterGraph,this.graphGui(this.graphDB),this.kindMap={},this.graphDB.walk(item=>{if(!(item instanceof util.Subgraph)){if(item instanceof util.Vertex){const kind=item._.attr("Kind").RawValue;this.kindMap[kind]||(this.kindMap[kind]=[]),this.kindMap[kind].push(item)}}})}disabled(_){if(!arguments.length){const retVal=[];for(const key in this._disabled)this._disabled[key]&&retVal.push(key);return retVal}return this._disabled={},_.forEach(kind=>this._disabled[kind]=!0),this}graphGui(graphDB){const graphGui={subgraphs:[],vertices:[],edges:[],hierarchy:[]};return graphDB.walk(item=>{if(item instanceof util.Subgraph){const subgraph=this.appendSubgraph(item,graphGui.hierarchy,graphGui.subgraphs);subgraph.showMinMax(item.vertices.length>3||subgraph.minState()!=="normal")}else item instanceof util.Vertex?this.appendVertex(item,graphGui.hierarchy,graphGui.vertices):item instanceof util.Edge&&this.appendEdge(item,graphGui.edges)}),graphGui}format(labelTpl,obj){let retVal="",lpos=labelTpl.indexOf("%"),rpos=-1;for(;lpos>=0;){if(retVal+=labelTpl.substring(rpos+1,lpos),rpos=labelTpl.indexOf("%",lpos+1),rpos<0){console.warn("Invalid Label Template");break}const key=labelTpl.substring(lpos+1,rpos);retVal+=key?obj[labelTpl.substring(lpos+1,rpos)]||"":"%",lpos=labelTpl.indexOf("%",rpos+1)}return retVal+=labelTpl.substring(rpos+1,labelTpl.length),retVal.split("\\n").join(`
|
|
2
|
-
`)}createSubgraph(subgraph){let sg=this.subgraphsMap[subgraph._.Id];return sg||(sg=new graph.Subgraph().title(subgraph._.Id).on("minClick",()=>{this.minClick(sg)}),this.subgraphsMap[subgraph._.Id]=sg,this.rSubgraphsMap[sg.id()]=subgraph),sg}createVertex(vertex){let v=this.verticesMap[vertex._.Id];if(!v){const attrs=vertex._.rawAttrs();if(vertex._.ScopeType==="dummy"){const parent=this.subgraphsMap[vertex.parent._.Id];v=new common.Icon().shape_colorFill("darkred").shape_colorStroke("darkred").image_colorFill("white").faChar("").on("click",()=>{parent.minState("normal"),this.minClick(parent)})}else{v=new graph.Vertex().icon_shape_colorFill("#1f77b4").icon_image_colorFill("white").faChar(faCharFactory(attrs.Kind)).text(attrs.Label);const annotations=[];vertex._.hasAttr("Definition")&&annotations.push({faChar:"",tooltip:"Definition",shape_colorFill:"lightgray",shape_colorStroke:"lightgray",image_colorFill:"black"}),vertex._.hasAttr("IsInternal")&&annotations.push({faChar:"",tooltip:"IsInternal",shape_colorFill:"red",shape_colorStroke:"red",image_colorFill:"white"}),v.annotationIcons(annotations)}this.verticesMap[vertex._.Id]=v,this.rVerticesMap[v.id()]=vertex}return v}isSpill(edge){const sourceKind=edge.source._.attr("Kind").RawValue,targetKind=edge.target._.attr("Kind").RawValue;return sourceKind==="2"||targetKind==="71"}spansSubgraph(edge){return edge.source.parent._.Id!==edge.target.parent._.Id}createEdge(edge){let e=this.edgesMap[edge._.Id];if(!e){const attrs=edge._.rawAttrs(),sourceV=this.verticesMap[edge.source._.Id],targetV=this.verticesMap[edge.target._.Id];if(sourceV&&targetV){const isSpill=this.isSpill(edge),spansSubgraph=this.spansSubgraph(edge),label=this.format(`%Label%
|
|
3
|
-
%NumRowsProcessed%`,attrs);let strokeDasharray=null,weight=100;attrs.IsDependency?(weight=10,strokeDasharray="1,5"):attrs._childGraph?strokeDasharray="5,5":isSpill?(weight=25,strokeDasharray="5,5,10,5"):spansSubgraph&&(weight=5,strokeDasharray="5,5"),e=new graph.Edge().sourceVertex(sourceV).targetVertex(targetV).sourceMarker("circle").targetMarker("arrow").weight(weight).strokeDasharray(strokeDasharray).text(label),this.edgesMap[edge._.Id]=e,this.rEdgesMap[e.id()]=edge}}return e}appendSubgraph(subgraph,hierarchy,subgraphs){const sg=this.createSubgraph(subgraph);subgraphs.push(sg);const parent=this.subgraphsMap[subgraph.parent._.Id];return parent&&hierarchy.push({parent,child:sg}),sg}appendVertex(vertex,hierarchy,vertices){const v=this.createVertex(vertex);vertices.push(v);const parent=this.subgraphsMap[vertex.parent._.Id];return parent&&hierarchy.push({parent,child:v}),v}appendEdge(edge,edges){const e=this.createEdge(edge);return e&&edges.push(e),e}filterLegend(graphDB){for(let i=graphDB.vertices.length-1;i>=0;--i){const vertex=graphDB.vertices[i],kind=vertex._.attr("Kind").RawValue;this._disabled[kind]&&vertex.remove(!1,(source,target)=>new comms.BaseScope({ScopeName:vertex._.ScopeName+":in",Id:source.Id+"->"+target.Id,ScopeType:"dummy-edge",Properties:{Property:[vertex._.attr("Label")]},Notes:{Note:[]},SinkActivity:""}))}}filterPartial(graphDB){for(const subgraph of graphDB.subgraphs)switch(this.subgraphsMap[subgraph._.Id].minState()){case"partial":const childVertices=subgraph.vertices,vShow=[],vHide=[];for(const vertex of childVertices)vertex.inEdges.length===0||vertex.inEdges.some(edge=>edge.source.parent!==edge.target.parent)||vertex.outEdges.length===0||vertex.outEdges.some(edge=>edge.source.parent!==edge.target.parent)?vShow.push(vertex):vHide.push(vertex);if(vHide.length>1){const dummyDetails={ScopeName:subgraph._.ScopeName,Id:subgraph._.Id+":dummy",ScopeType:"dummy",Properties:{Property:[{Name:"Activities",RawValue:""+vHide.length,Formatted:""+vHide.length,Measure:"count",Creator:"",CreatorType:""}]},Notes:{Note:[]},SinkActivity:""},dummyScope=new comms.BaseScope(dummyDetails),dummyVertex=subgraph.createVertex(dummyScope);for(const vertex of vHide){for(const edge of vertex.inEdges)if(vShow.indexOf(edge.source)>=0){const dummyEdgeScope=new comms.BaseScope({ScopeName:edge.source._.ScopeName,Id:edge.source._.Id+"->"+dummyVertex._.Id,ScopeType:"dummy-in",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});subgraph.createEdge(edge.source,dummyVertex,dummyEdgeScope)}for(const edge of vertex.outEdges)if(vShow.indexOf(edge.target)>=0){const dummyEdgeScope=new comms.BaseScope({ScopeName:edge.target._.ScopeName,Id:dummyVertex._.Id+"->"+edge.target._.Id,ScopeType:"dummy-out",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});subgraph.createEdge(dummyVertex,edge.target,dummyEdgeScope)}}vHide.forEach(vertex=>vertex.remove(!0))}break}}filterEmptySubgraphs(graphDB){for(;;){const emptySubgraphs=graphDB.subgraphs.filter(subgraph=>subgraph.subgraphs.length===0&&subgraph.vertices.length===0);if(emptySubgraphs.length===0)break;emptySubgraphs.forEach(subgraph=>subgraph.remove(!0))}}removeObsoleteSubgraphs(graphDB){for(const subgraph of[...graphDB.subgraphs])subgraph.vertices.length===0&&subgraph.remove(!1)}graphData(){const graphDB=this.graphDB.clone();return this.filterLegend(graphDB),this.filterPartial(graphDB),this.filterEmptySubgraphs(graphDB),this.removeObsoleteSubgraphs(graphDB),this.graphGui(graphDB)}calcLegend(){const retVal=[];for(const kind in this.kindMap)retVal.push({kind:parseInt(kind),faChar:faCharFactory(kind),label:this.kindMap[kind][0]._.attr("Label").RawValue.split(`
|
|
4
|
-
`)[0],count:this.kindMap[kind].length});return retVal}vertices(kind){const retVal=[];for(const v of this.kindMap[kind])retVal.push(this.verticesMap[v._.Id]);return retVal}formatRow(item,columns2,row){const attrs=item._.formattedAttrs();for(const key in attrs){const idx=columns2.indexOf(key);idx===-1?(columns2.push(key),row.push(attrs[key])):row[idx]=attrs[key]}for(let i=0;i<100;++i)row[i]===void 0&&(row[i]="");return row}activityData(){const columns2=["Id","Kind","Label"],data=this.graphDB.vertices.map(v=>{const row=[parseInt(v._.Id.split("a")[1])];return this.formatRow(v,columns2,row)});return{columns:columns2,data}}edgeData(){const columns2=["Id","Label"],data=this.graphDB.edges.map(e=>{const row=[e._.Id];return this.formatRow(e,columns2,row)});return{columns:columns2,data}}subgraphData(){const columns2=["Id","Label"],data=this.graphDB.subgraphs.map(sg=>{const row=[sg._.Id];return this.formatRow(sg,columns2,row)});return{columns:columns2,data}}calcGraphTooltip(item){let scope,parentScope;if(item instanceof graph.Subgraph){const subgraph=this.rSubgraphsMap[item.id()];scope=subgraph._,parentScope=subgraph.parent._}else if(item instanceof graph.Vertex||item instanceof common.Icon){const vertex=this.rVerticesMap[item.id()];scope=vertex._,parentScope=vertex.parent._}else if(item instanceof graph.Edge){const edge=this.rEdgesMap[item.id()];scope=edge._,parentScope=edge.parent._}return scope?scope.calcTooltip(parentScope):""}subgraph(id){return this.subgraphsMap[id]}vertex(id){return this.verticesMap[id]}edge(id){return this.edgesMap[id]}minClick(sg){}}class WUGraph extends layout.ChartPanel{constructor(){super();__publicField(this,"_partialAll",new common.Button().faChar("fa-window-restore").tooltip("Partial All").on("click",()=>{this.stateClick(this._partialAll)}));__publicField(this,"_maxAll",new common.Button().faChar("fa-window-maximize").tooltip("Max All").on("click",()=>{this.stateClick(this._maxAll)}));__publicField(this,"_toggleGraph",new common.ToggleButton().faChar("fa-chain").tooltip("Graph").selected(!0).on("click",()=>{this.viewClick(this._toggleGraph)}));__publicField(this,"_toggleActivities",new common.ToggleButton().faChar("fa-table").tooltip("Activitiies").selected(!1).on("click",()=>{this.viewClick(this._toggleActivities)}));__publicField(this,"_toggleEdges",new common.ToggleButton().faChar("fa-table").tooltip("Edges").selected(!1).on("click",()=>{this.viewClick(this._toggleEdges)}));__publicField(this,"_toggleSubgraphs",new common.ToggleButton().faChar("fa-table").tooltip("Subgraphs").selected(!1).on("click",()=>{this.viewClick(this._toggleSubgraphs)}));__publicField(this,"_graph",new graph.Graph().layout("Hierarchy").applyScaleOnLayout(!0).showToolbar(!1).allowDragging(!1));__publicField(this,"_activities",new dgrid.Table().pagination(!1));__publicField(this,"_edges",new dgrid.Table().pagination(!1));__publicField(this,"_subgraphs",new dgrid.Table().pagination(!1));__publicField(this,"_legend",new WUGraphLegend(this).on("click",kind=>{this.render()}).on("mouseover",kind=>{const verticesMap={};for(const vertex of this._gc.vertices(kind))verticesMap[vertex.id()]=!0;this._graph.highlightVerticies(verticesMap)}).on("mouseout",kind=>{this._graph.highlightVerticies()}));__publicField(this,"_view",new layout.Carousel().widgets([this._graph,this._activities,this._edges,this._subgraphs]));__publicField(this,"_gc",new WUScopeController);__publicField(this,"_prevHashSum");__publicField(this,"_prevScopeGraph");this.topOverlay(!1),this.widget(this._view);const buttons=[this._toggleGraph,this._toggleActivities,this._toggleEdges,this._toggleSubgraphs,new common.Spacer,this._partialAll,this._maxAll,new common.Spacer,...this._graph.iconBarButtons(),new common.Spacer];this.buttons(buttons.concat(this.buttons())),this._gc.minClick=sg=>{this.loadGraph(),this._graph.render(w=>{this._graph.selection([sg]).centerOnItem(sg)})},this._graph.tooltipHTML(v=>this._gc.calcGraphTooltip(v))}stateClick(sourceB){switch(sourceB){case this._partialAll:this._graph.data().subgraphs.forEach(sg=>{sg.minState("partial")});break;case this._maxAll:this._graph.data().subgraphs.forEach(sg=>{sg.minState("normal")});break}this.render()}viewClick(sourceTB){switch(this._toggleGraph.selected(sourceTB===this._toggleGraph),this._toggleActivities.selected(sourceTB===this._toggleActivities),this._toggleEdges.selected(sourceTB===this._toggleEdges),this._toggleSubgraphs.selected(sourceTB===this._toggleSubgraphs),sourceTB){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);break}this.render(w=>{})}fetchScopeGraph(){const hash=util.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),graphID:this.graphID(),subgraphID:this.subgraphID()});return!this._prevScopeGraph||this._prevHashSum!==hash?(this.startProgress(),this._prevHashSum=hash,this._gc.clear(),comms.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchGraphs().then(graphs=>{for(const graph2 of graphs)if(graph2.Name===this.graphID())return this.finishProgress(),graph2.fetchScopeGraph(this.subgraphID())}).then(scopeGraph=>(this._prevScopeGraph=scopeGraph,this._prevScopeGraph))):Promise.resolve(this._prevScopeGraph)}enter(domNode,_element){super.enter(domNode,_element)}update(domNode,element){super.update(domNode,element)}exit(domNode,element){super.exit(domNode,element)}loadGraph(){this._gc.disabled(this._legend.disabled()),this._graph.data(this._gc.graphData(),!0);{const{columns:columns2,data}=this._gc.activityData();this._activities.columns(columns2).data(data)}{const{columns:columns2,data}=this._gc.edgeData();this._edges.columns(columns2).data(data)}{const{columns:columns2,data}=this._gc.subgraphData();this._subgraphs.columns(columns2).data(data)}}render(callback){return this.wuid()&&this.graphID()?this.fetchScopeGraph().then(scopedGraph=>{this._gc.set(scopedGraph),this._legend.data(this._gc.calcLegend()),this.loadGraph(),super.render(callback)}):super.render(callback),this}selection(_){if(!arguments.length)return this._graph.selection();const item=this._gc.vertex(_)||this._gc.edge(_)||this._gc.subgraph(_);return item&&this._graph.selection([item]),this}}WUGraph.prototype._class+=" eclwatch_WUGraph",WUGraph.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),WUGraph.prototype.publish("wuid","","string","Workunit ID"),WUGraph.prototype.publish("graphID","","string","Graph ID"),WUGraph.prototype.publish("subgraphID","","string","Subgraph ID");function entitiesEncode(str){return String(str).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function safeEncode(item){switch(Object.prototype.toString.call(item)){case"[object Undefined]":case"[object Boolean]":case"[object Number]":return item;case"[object String]":return entitiesEncode(item);default:console.warn("Unknown cell type: "+Object.prototype.toString.call(item))}return item}class Store{constructor(wuResult,schema,renderHtml,filter={},onError){__publicField(this,"wuResult");__publicField(this,"schema");__publicField(this,"_columns");__publicField(this,"_cache",{});__publicField(this,"rowFormatter");__publicField(this,"_filter",{});__publicField(this,"onError");this.wuResult=wuResult,this.schema=schema,this._columns=this.schema2Columns(this.schema.root),this.rowFormatter=new dgrid.RowFormatter(this._columns,renderHtml),this._filter=filter,this.onError=onError}columns(){return this._columns}schema2Columns(parentNode,prefix=""){return parentNode?parentNode.children().filter(node=>node.name.indexOf("__hidden",node.name.length-8)===-1).map((node,idx)=>{const label=node.name,keyed=node.attrs["hpcc:keyed"],column={field:prefix+label,leafID:label,idx,label:label+(keyed?" (i)":""),className:"resultGridCell",sortable:!1,width:keyed?16:0,isSet:node.isSet},children=this.schema2Columns(node,prefix+label+"_");return children.length?(column.width+=10+children.reduce((prev,childNode)=>prev+childNode.width,0),column.children=children):(column.width+=node.charWidth()*9,column.formatter=(cell,row)=>{switch(typeof cell){case"string":return{html:cell.replace(/\t/g," ").trim()};case"undefined":return""}return cell}),column}):[]}isChildDataset(cell){if(Object.prototype.toString.call(cell)!=="[object Object]")return!1;let propCount=0,firstPropType=null;for(const key in cell)firstPropType||(firstPropType=Object.prototype.toString.call(cell[key])),propCount++;return propCount===1&&firstPropType==="[object Array]"}rowToTable(cell,__row,node){if(this.isChildDataset(cell)){for(const key in cell)this.rowToTable(cell[key],__row,node);return}const table=dgrid.domConstruct.create("table",{border:1,cellspacing:0,width:"100%"},node);switch(Object.prototype.toString.call(cell)){case"[object Object]":let tr=dgrid.domConstruct.create("tr",null,table);for(const key in cell)dgrid.domConstruct.create("th",{innerHTML:safeEncode(key)},tr);tr=dgrid.domConstruct.create("tr",null,table);for(const key in cell)switch(Object.prototype.toString.call(cell[key])){case"[object Object]":case"[object Array]":this.rowToTable(cell[key],__row,node);break;default:dgrid.domConstruct.create("td",{innerHTML:safeEncode(cell[key])},tr);break}break;case"[object Array]":for(let i=0;i<cell.length;++i)switch(Object.prototype.toString.call(cell[i])){case"[object Boolean]":case"[object Number]":case"[object String]":const tr1=dgrid.domConstruct.create("tr",null,table);dgrid.domConstruct.create("td",{innerHTML:safeEncode(cell[i])},tr1);break;default:if(i===0){const tr2=dgrid.domConstruct.create("tr",null,table);for(const key in cell[i])dgrid.domConstruct.create("th",{innerHTML:safeEncode(key)},tr2)}dgrid.domConstruct.create("tr",null,table);for(const key in cell[i])if(cell[i][key])if(Object.prototype.toString.call(cell[i][key])==="[object Object]"||Object.prototype.toString.call(cell[i][key])==="[object Array]"){const td=dgrid.domConstruct.create("td",null,tr1);this.rowToTable(cell[i][key],cell[i],td)}else if(key.indexOf("__html",key.length-6)!==-1)dgrid.domConstruct.create("td",{innerHTML:cell[i][key]},tr1);else if(key.indexOf("__javascript",key.length-12)!==-1)dgrid.domConstruct.create("td",null,tr1);else{const val=cell[i][key];dgrid.domConstruct.create("td",{innerHTML:safeEncode(val)},tr1)}else dgrid.domConstruct.create("td",{innerHTML:""},tr1)}break}}getIdentity(row){return row.__hpcc_id}_request(start,end){if(!this.wuResult)return Promise.resolve({totalLength:0,data:[]});const cacheKey=`${start}->${end}`;if(this._cache[cacheKey])return this._cache[cacheKey];const retVal=this.wuResult.fetchRows(start,end-start,!1,this._filter).then(rows=>({totalLength:this.wuResult.Total,data:rows.map((row,idx)=>{const formattedRow=this.rowFormatter.format(row);return formattedRow.__hpcc_id=start+idx,formattedRow.__hpcc_orig=row,formattedRow})})).catch(err=>(this.onError(err.Message||"An exception has occurred"),{totalLength:0,data:[]}));return this._cache[cacheKey]=retVal,retVal}fetchRange(options){const retVal=new dgrid.Deferred;return this._request(options.start,options.end).then(response=>retVal.resolve(response)),new dgrid.QueryResults(retVal.then(response=>response.data),{totalLength:retVal.then(response=>response.totalLength)})}}class WUResult extends dgrid.Common{constructor(){super();__publicField(this,"_result");__publicField(this,"_localStore");__publicField(this,"_prevResultHash");__publicField(this,"_prevStoreHash");__publicField(this,"_prevQueryHash");this.renderHtml(!1)}hashSum(opts={}){return util.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),resultName:this.resultName(),sequence:this.sequence(),nodeGroup:this.nodeGroup(),logicalFile:this.logicalFile(),userID:this.user(),password:this.password(),...opts})}calcResult(){const resultHash=this.hashSum();if(this._prevResultHash!==resultHash){this._prevResultHash=resultHash;const opts={baseUrl:this.baseUrl(),userID:this.user(),password:this.password()};this.wuid()&&this.resultName()?this._result=comms.Result.attach(opts,this.wuid(),this.resultName()):this.wuid()&&this.sequence()!==void 0?this._result=comms.Result.attach(opts,this.wuid(),this.sequence()):this.logicalFile()&&this.nodeGroup()?this._result=comms.Result.attachLogicalFile(opts,this.nodeGroup(),this.logicalFile()):this.logicalFile()&&(this._result=comms.Result.attachLogicalFile(opts,"",this.logicalFile()))}return this._result}fetch(row,count,abortController=new AbortController){const result=this.calcResult();return result?result.fetchRows(row,count,!1,{},abortController.signal):Promise.resolve([])}update(domNode,element){super.update(domNode,element);const storeHash=this.hashSum({renderHtml:this.renderHtml(),filter:this.filter()});if(this._prevStoreHash!==storeHash){this._prevStoreHash=storeHash;const result=this.calcResult();result&&result.fetchXMLSchema().then(schema=>{var _a,_b;this._localStore=new Store(result,schema,this.renderHtml(),this.filter(),msg=>{this._dgrid&&(this._dgrid.noDataMessage=`<span class='dojoxGridNoData'>${msg}</span>`,this._dgrid.refresh())}),(_a=this._dgrid)==null||_a.set("columns",this._localStore.columns()),(_b=this._dgrid)==null||_b.set("collection",this._localStore)})}}click(row,col,sel){}}WUResult.prototype._class+=" eclwatch_WUResult",WUResult.prototype.publish("baseUrl","","string","URL to WsWorkunits"),WUResult.prototype.publish("user","","string","User ID"),WUResult.prototype.publish("password","","string","Password"),WUResult.prototype.publish("wuid","","string","Workunit ID"),WUResult.prototype.publish("resultName","","string","Result Name"),WUResult.prototype.publish("sequence",void 0,"number","Sequence Number"),WUResult.prototype.publish("nodeGroup","","string","NodeGroup"),WUResult.prototype.publish("logicalFile","","string","Logical File Name"),WUResult.prototype.publish("filter",{},"object","Filter");var STATUS=(STATUS2=>(STATUS2.CREATE="Created",STATUS2.COMPILE="Compiled",STATUS2.EXECUTE="Executed",STATUS2.COMPLETE="Completed",STATUS2))(STATUS||{}),STATUS_ACTIVE=(STATUS_ACTIVE2=>(STATUS_ACTIVE2.CREATE="Creating",STATUS_ACTIVE2.COMPILE="Compiling",STATUS_ACTIVE2.EXECUTE="Executing",STATUS_ACTIVE2.COMPLETE="Completed",STATUS_ACTIVE2))(STATUS_ACTIVE||{});class WUStatus extends graph.Graph{constructor(){super();__publicField(this,"_wu");__publicField(this,"_wuHandle");__publicField(this,"_create");__publicField(this,"_compile");__publicField(this,"_execute");__publicField(this,"_complete");__publicField(this,"_prevHash");this.zoomable(!1).zoomToFitLimit(1).layout("Hierarchy").hierarchyRankDirection("LR").showToolbar(!1).allowDragging(!1)}attachWorkunit(){const hash=util.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==hash&&(this._prevHash=hash,this._wu=comms.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()),this._wuHandle&&this._wuHandle.release(),this._wuHandle=this._wu.watch(changes=>{this.lazyRender()}))}createVertex(faChar){return new graph.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(faChar)}updateVertex(vertex,color){vertex.icon_image_colorFill(color).textbox_text_colorFill(color)}updateVertexStatus(level,active=!1){const completeColor=this._wu.isFailed()?"darkred":"darkgreen";switch(this._create.text("Created"),this._compile.text("Compiled"),this._execute.text("Executed"),this._complete.text("Completed"),level){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("Creating"),this.updateVertex(this._create,active?"orange":completeColor),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 2:this._compile.text("Compiling"),this.updateVertex(this._create,completeColor),this.updateVertex(this._compile,active?"orange":completeColor),this.updateVertex(this._execute,completeColor),this.updateVertex(this._complete,"darkgray");break;case 3:this._execute.text("Executing"),this.updateVertex(this._create,completeColor),this.updateVertex(this._compile,completeColor),this.updateVertex(this._execute,active?"orange":completeColor),this.updateVertex(this._complete,"darkgray");break;case 4:this.updateVertex(this._create,completeColor),this.updateVertex(this._compile,completeColor),this.updateVertex(this._execute,completeColor),this.updateVertex(this._complete,completeColor);break}}createEdge(source,target){return new graph.Edge().sourceVertex(source).targetVertex(target).strokeColor("black").showArc(!1)}enter(domNode,element){super.enter(domNode,element),this._create=this.createVertex(""),this._compile=this.createVertex(""),this._execute=this.createVertex(""),this._complete=this.createVertex("");const e1=this.createEdge(this._create,this._compile),e2=this.createEdge(this._compile,this._execute),e3=this.createEdge(this._execute,this._complete);this.data({vertices:[this._create,this._compile,this._execute,this._complete],edges:[e1,e2,e3]})}update(domNode,element){switch(this.attachWorkunit(),this._wu.StateID){case comms.WUStateID.Blocked:case comms.WUStateID.Wait:case comms.WUStateID.Scheduled:case comms.WUStateID.UploadingFiled:this.updateVertexStatus(1);break;case comms.WUStateID.Compiling:this.updateVertexStatus(2,!0);break;case comms.WUStateID.Submitted:this.updateVertexStatus(1,!0);break;case comms.WUStateID.Compiled:this.updateVertexStatus(2);break;case comms.WUStateID.Aborting:case comms.WUStateID.Running:this.updateVertexStatus(3,!0);break;case comms.WUStateID.Aborted:case comms.WUStateID.Archived:case comms.WUStateID.Completed:this.updateVertexStatus(4);break;case comms.WUStateID.Failed:this.updateVertexStatus(4,!1);break;case comms.WUStateID.DebugPaused:case comms.WUStateID.DebugRunning:case comms.WUStateID.Paused:case comms.WUStateID.Unknown:default:this.updateVertexStatus(0);break}super.update(domNode,element),this.zoomToFit()}exit(domNode,element){this._wuHandle&&this._wuHandle.release(),super.exit(domNode,element)}}WUStatus.prototype._class+=" eclwatch_WUStatus",WUStatus.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),WUStatus.prototype.publish("wuid","","string","Workunit ID");const columns=["label","start","end","icon","color","series"];class WUTimeline extends timeline.ReactTimelineSeries{constructor(){super();__publicField(this,"_palette",common.Palette.ordinal("default"));__publicField(this,"_prevHashSum");this.columns(columns).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(d=>d[columns.length].calcTooltip())}clear(){return delete this._prevHashSum,this}fetchScopes(){const hash=util.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),request:this.request()});this._prevHashSum!==hash&&(this._prevHashSum=hash,comms.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchDetails(this.request()).then(scopes=>scopes.filter(scope=>scope.Id&&scope.attr("WhenStarted").RawValue).map(scope=>{const whenStarted=+scope.attr("WhenStarted").RawValue/1e3,timeElapsed=+scope.attr("TimeElapsed").RawValue/1e6;return[scope.Id,new Date(whenStarted).toISOString(),timeElapsed?new Date(whenStarted+timeElapsed).toISOString():void 0,null,this._palette(scope.ScopeType),scope.ScopeName.split("::").join(":").split(":").slice(0,1),scope]})).then(scopes=>{this.data(scopes).render()}))}enter(domNode,_element){super.enter(domNode,_element)}update(domNode,element){this.fetchScopes(),super.update(domNode,element)}exit(domNode,element){super.exit(domNode,element)}}WUTimeline.prototype._class+=" eclwatch_WUTimeline",WUTimeline.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),WUTimeline.prototype.publish("wuid","","string","Workunit ID"),WUTimeline.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"),exports2.BUILD_VERSION=BUILD_VERSION,exports2.ECLArchiveViewer=ECLArchiveViewer,exports2.PKG_NAME=PKG_NAME,exports2.PKG_VERSION=PKG_VERSION,exports2.STATUS=STATUS,exports2.STATUS_ACTIVE=STATUS_ACTIVE,exports2.WUGraph=WUGraph,exports2.WUResult=WUResult,exports2.WUScopeController=WUScopeController,exports2.WUStatus=WUStatus,exports2.WUTimeline=WUTimeline,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(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"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/eclwatch"]={},e["@hpcc-js/codemirror"],e["@hpcc-js/comms"],e["@hpcc-js/phosphor"],e["@hpcc-js/tree"],e["@hpcc-js/util"],e["@hpcc-js/common"],e["@hpcc-js/dgrid"],e["@hpcc-js/graph"],e["@hpcc-js/layout"],e["@hpcc-js/timeline"])}(this,function(e,t,s,r,i,a,o,c,h,n,l){"use strict";var p=Object.defineProperty,u=(e,t)=>p(e,"name",{value:t,configurable:!0}),d=(e,t,s)=>((e,t,s)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);const g=class _ECLArchiveViewer extends r.SplitPanel{constructor(){super("horizontal"),d(this,"_prevHash"),d(this,"_contentStr"),d(this,"_directoryPane",new i.DirectoryTree),d(this,"_fileEditorPane",(new t.Editor).text("")),this._directoryPane.rowClick=e=>{this._fileEditorPane.text(e).render()}}transformArchiveTreeData(e){const t={label:e.name,children:e._children.map(s).filter(e=>e)};return t.children&&t.children[0]&&"html"===t.children[0].label?{label:"root",children:[{label:"error",content:JSON.stringify(t,null,4)}]}:t;function s(e){const t={};if(t.label=e.name+(e.$&&e.$.key?` (${e.$.key})`:""),e._children&&e._children.length>0)t.children=e._children.map(e=>s(e)).filter(e=>e);else{if("string"!=typeof e.content||!e.content.trim())return!1;t.content=e.content}return t}}updateDirectoryPane(e){let t;if(e)try{t=JSON.parse(e)}catch(s){t=a.xml2json(e)}if(t){const e=this.transformArchiveTreeData(t);this._directoryPane.data(e).render()}}enter(e,t){super.enter(e,t),this.addWidget(this._directoryPane).addWidget(this._fileEditorPane)}update(e,t){super.update(e,t);const r=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==r||void 0===this._contentStr?s.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchArchive().then(e=>{this._contentStr=e,this.updateDirectoryPane(this._contentStr),this._prevHash=r}):this.updateDirectoryPane(this._contentStr),this.relativeSizes([this.directoryWidthRatio(),1-this.directoryWidthRatio()])}};u(g,"ECLArchiveViewer");let _=g;_.prototype._class+=" eclwatch_ECLArchiveViewer",_.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),_.prototype.publish("wuid","","string","Workunit ID"),_.prototype.publish("directoryWidthRatio",.38,"number","Default directory panel width ratio relative to the full width"),_.prototype.publish("contentString",null,"string","XML/JSON archive content string"),_.prototype.publishProxy("directoryPaneColor","_directoryPane","backgroundColor"),_.prototype.publishProxy("directoryPaneHoverColor","_directoryPane","hoverBackgroundColor"),_.prototype.publishProxy("iconSize","_directoryPane"),_.prototype.publishProxy("fontColor","_directoryPane"),_.prototype.publishProxy("fontFamily","_directoryPane"),_.prototype.publishProxy("fontSize","_directoryPane"),_.prototype.publishProxy("folderIconOpen","_directoryPane"),_.prototype.publishProxy("folderIconClosed","_directoryPane"),_.prototype.publishProxy("textFileIcon","_directoryPane"),_.prototype.publishProxy("codeFileIcon","_directoryPane"),_.prototype.publishProxy("verticalScroll","_directoryPane");const m=class _LegendVertex extends h.Vertex{constructor(){super()}enter(e,t){super.enter(e,t),this._icon.on("click",()=>{this.click(this.data())})}click(e){}};u(m,"LegendVertex");let b=m;const f=class _WUGraphLegend extends n.Legend{constructor(){super(...arguments),d(this,"icon",o.local()),d(this,"_disabled2",{})}disabled(e){if(!arguments.length){const e=[];for(const t in this._disabled2)this._disabled2[t]&&e.push(t);return e}return this._disabled2={},e.forEach(e=>this._disabled2[e]=!0),this}toggle(e){this._disabled2[e]=!this._disabled2[e]}update(e,t){super.update(e,t);const s=this,r=this._g.selectAll(".legendItem").data(this.data(),e=>e.kind);r.enter().append("g").attr("class","legendItem").each(function(e){s.icon.set(this,(new b).target(this).data(e.kind).textbox_shape_colorStroke("none").textbox_shape_colorFill("none").iconAnchor("left").faChar(e.faChar).text(`${e.label} (${e.count})`).tooltip(`${e.kind} - ${e.label}`).on("click",e=>{s.toggle(e),s.render(),s.click(e)}).on("mouseover",e=>{s.mouseover(e)}).on("mouseout",e=>{s.mouseout(e)}))}).merge(r).each(function(e,t){const r=s.icon.get(this).icon_shape_colorFill(s._disabled2[e.kind]?"gray":null).render().getBBox();o.select(this).attr("transform",`translate(${+r.width/2}, ${30*t})`)}),r.exit().each(function(e){s.icon.get(this).target(null).render()}).remove();const i=this.getBBox(!0,!0);this._g.attr("transform",`translate(16, ${this.height()/2-i.height/2})`)}click(e){}mouseover(e){}mouseout(e){}};u(f,"WUGraphLegend");let S=f;function w(e){switch(e){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""}S.prototype._class+=" eclwatch_WUGraphLegend",u(w,"faCharFactory");const y=class _WUScopeController{constructor(){d(this,"graphDB"),d(this,"subgraphsMap",{}),d(this,"rSubgraphsMap",{}),d(this,"verticesMap",{}),d(this,"rVerticesMap",{}),d(this,"edgesMap",{}),d(this,"rEdgesMap",{}),d(this,"kindMap",{}),d(this,"_disabled",{})}clear(){this.subgraphsMap={},this.rSubgraphsMap={},this.verticesMap={},this.rVerticesMap={},this.edgesMap={},this.rEdgesMap={}}set(e){this.graphDB=e,this.graphGui(this.graphDB),this.kindMap={},this.graphDB.walk(e=>{if(e instanceof a.Subgraph);else if(e instanceof a.Vertex){const t=e._.attr("Kind").RawValue;this.kindMap[t]||(this.kindMap[t]=[]),this.kindMap[t].push(e)}})}disabled(e){if(!arguments.length){const e=[];for(const t in this._disabled)this._disabled[t]&&e.push(t);return e}return this._disabled={},e.forEach(e=>this._disabled[e]=!0),this}graphGui(e){const t={subgraphs:[],vertices:[],edges:[],hierarchy:[]};return e.walk(e=>{if(e instanceof a.Subgraph){const s=this.appendSubgraph(e,t.hierarchy,t.subgraphs);s.showMinMax(e.vertices.length>3||"normal"!==s.minState())}else e instanceof a.Vertex?this.appendVertex(e,t.hierarchy,t.vertices):e instanceof a.Edge&&this.appendEdge(e,t.edges)}),t}format(e,t){let s="",r=e.indexOf("%"),i=-1;for(;r>=0;){if(s+=e.substring(i+1,r),i=e.indexOf("%",r+1),i<0){console.warn("Invalid Label Template");break}s+=e.substring(r+1,i)?t[e.substring(r+1,i)]||"":"%",r=e.indexOf("%",i+1)}return s+=e.substring(i+1,e.length),s.split("\\n").join("\n")}createSubgraph(e){let t=this.subgraphsMap[e._.Id];return t||(t=(new h.Subgraph).title(e._.Id).on("minClick",()=>{this.minClick(t)}),this.subgraphsMap[e._.Id]=t,this.rSubgraphsMap[t.id()]=e),t}createVertex(e){let t=this.verticesMap[e._.Id];if(!t){const s=e._.rawAttrs();if("dummy"===e._.ScopeType){const s=this.subgraphsMap[e.parent._.Id];t=(new o.Icon).shape_colorFill("darkred").shape_colorStroke("darkred").image_colorFill("white").faChar("").on("click",()=>{s.minState("normal"),this.minClick(s)})}else{t=(new h.Vertex).icon_shape_colorFill("#1f77b4").icon_image_colorFill("white").faChar(w(s.Kind)).text(s.Label);const r=[];e._.hasAttr("Definition")&&r.push({faChar:"",tooltip:"Definition",shape_colorFill:"lightgray",shape_colorStroke:"lightgray",image_colorFill:"black"}),e._.hasAttr("IsInternal")&&r.push({faChar:"",tooltip:"IsInternal",shape_colorFill:"red",shape_colorStroke:"red",image_colorFill:"white"}),t.annotationIcons(r)}this.verticesMap[e._.Id]=t,this.rVerticesMap[t.id()]=e}return t}isSpill(e){const t=e.source._.attr("Kind").RawValue,s=e.target._.attr("Kind").RawValue;return"2"===t||"71"===s}spansSubgraph(e){return e.source.parent._.Id!==e.target.parent._.Id}createEdge(e){let t=this.edgesMap[e._.Id];if(!t){const s=e._.rawAttrs(),r=this.verticesMap[e.source._.Id],i=this.verticesMap[e.target._.Id];if(r&&i){const a=this.isSpill(e),o=this.spansSubgraph(e),c=this.format("%Label%\n%NumRowsProcessed%",s);let n=null,l=100;s.IsDependency?(l=10,n="1,5"):s._childGraph?n="5,5":a?(l=25,n="5,5,10,5"):o&&(l=5,n="5,5"),t=(new h.Edge).sourceVertex(r).targetVertex(i).sourceMarker("circle").targetMarker("arrow").weight(l).strokeDasharray(n).text(c),this.edgesMap[e._.Id]=t,this.rEdgesMap[t.id()]=e}}return t}appendSubgraph(e,t,s){const r=this.createSubgraph(e);s.push(r);const i=this.subgraphsMap[e.parent._.Id];return i&&t.push({parent:i,child:r}),r}appendVertex(e,t,s){const r=this.createVertex(e);s.push(r);const i=this.subgraphsMap[e.parent._.Id];return i&&t.push({parent:i,child:r}),r}appendEdge(e,t){const s=this.createEdge(e);return s&&t.push(s),s}filterLegend(e){for(let t=e.vertices.length-1;t>=0;--t){const r=e.vertices[t],i=r._.attr("Kind").RawValue;this._disabled[i]&&r.remove(!1,(e,t)=>new s.BaseScope({ScopeName:r._.ScopeName+":in",Id:e.Id+"->"+t.Id,ScopeType:"dummy-edge",Properties:{Property:[r._.attr("Label")]},Notes:{Note:[]},SinkActivity:""}))}}filterPartial(e){for(const t of e.subgraphs){if("partial"===this.subgraphsMap[t._.Id].minState()){const e=t.vertices,r=[],i=[];for(const t of e)0===t.inEdges.length||t.inEdges.some(e=>e.source.parent!==e.target.parent)||0===t.outEdges.length||t.outEdges.some(e=>e.source.parent!==e.target.parent)?r.push(t):i.push(t);if(i.length>1){const e={ScopeName:t._.ScopeName,Id:t._.Id+":dummy",ScopeType:"dummy",Properties:{Property:[{Name:"Activities",RawValue:""+i.length,Formatted:""+i.length,Measure:"count",Creator:"",CreatorType:""}]},Notes:{Note:[]},SinkActivity:""},a=new s.BaseScope(e),o=t.createVertex(a);for(const c of i){for(const e of c.inEdges)if(r.indexOf(e.source)>=0){const r=new s.BaseScope({ScopeName:e.source._.ScopeName,Id:e.source._.Id+"->"+o._.Id,ScopeType:"dummy-in",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});t.createEdge(e.source,o,r)}for(const e of c.outEdges)if(r.indexOf(e.target)>=0){const r=new s.BaseScope({ScopeName:e.target._.ScopeName,Id:o._.Id+"->"+e.target._.Id,ScopeType:"dummy-out",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});t.createEdge(o,e.target,r)}}i.forEach(e=>e.remove(!0))}}}}filterEmptySubgraphs(e){for(;;){const t=e.subgraphs.filter(e=>0===e.subgraphs.length&&0===e.vertices.length);if(0===t.length)break;t.forEach(e=>e.remove(!0))}}removeObsoleteSubgraphs(e){for(const t of[...e.subgraphs])0===t.vertices.length&&t.remove(!1)}graphData(){const e=this.graphDB.clone();return this.filterLegend(e),this.filterPartial(e),this.filterEmptySubgraphs(e),this.removeObsoleteSubgraphs(e),this.graphGui(e)}calcLegend(){const e=[];for(const t in this.kindMap)e.push({kind:parseInt(t),faChar:w(t),label:this.kindMap[t][0]._.attr("Label").RawValue.split("\n")[0],count:this.kindMap[t].length});return e}vertices(e){const t=[];for(const s of this.kindMap[e])t.push(this.verticesMap[s._.Id]);return t}formatRow(e,t,s){const r=e._.formattedAttrs();for(const i in r){const e=t.indexOf(i);-1===e?(t.push(i),s.push(r[i])):s[e]=r[i]}for(let i=0;i<100;++i)void 0===s[i]&&(s[i]="");return s}activityData(){const e=["Id","Kind","Label"],t=this.graphDB.vertices.map(t=>{const s=[parseInt(t._.Id.split("a")[1])];return this.formatRow(t,e,s)});return{columns:e,data:t}}edgeData(){const e=["Id","Label"],t=this.graphDB.edges.map(t=>{const s=[t._.Id];return this.formatRow(t,e,s)});return{columns:e,data:t}}subgraphData(){const e=["Id","Label"],t=this.graphDB.subgraphs.map(t=>{const s=[t._.Id];return this.formatRow(t,e,s)});return{columns:e,data:t}}calcGraphTooltip(e){let t,s;if(e instanceof h.Subgraph){const r=this.rSubgraphsMap[e.id()];t=r._,s=r.parent._}else if(e instanceof h.Vertex||e instanceof o.Icon){const r=this.rVerticesMap[e.id()];t=r._,s=r.parent._}else if(e instanceof h.Edge){const r=this.rEdgesMap[e.id()];t=r._,s=r.parent._}return t?t.calcTooltip(s):""}subgraph(e){return this.subgraphsMap[e]}vertex(e){return this.verticesMap[e]}edge(e){return this.edgesMap[e]}minClick(e){}};u(y,"WUScopeController");let x=y;const v=class _WUGraph extends n.ChartPanel{constructor(){super(),d(this,"_partialAll",(new o.Button).faChar("fa-window-restore").tooltip("Partial All").on("click",()=>{this.stateClick(this._partialAll)})),d(this,"_maxAll",(new o.Button).faChar("fa-window-maximize").tooltip("Max All").on("click",()=>{this.stateClick(this._maxAll)})),d(this,"_toggleGraph",(new o.ToggleButton).faChar("fa-chain").tooltip("Graph").selected(!0).on("click",()=>{this.viewClick(this._toggleGraph)})),d(this,"_toggleActivities",(new o.ToggleButton).faChar("fa-table").tooltip("Activitiies").selected(!1).on("click",()=>{this.viewClick(this._toggleActivities)})),d(this,"_toggleEdges",(new o.ToggleButton).faChar("fa-table").tooltip("Edges").selected(!1).on("click",()=>{this.viewClick(this._toggleEdges)})),d(this,"_toggleSubgraphs",(new o.ToggleButton).faChar("fa-table").tooltip("Subgraphs").selected(!1).on("click",()=>{this.viewClick(this._toggleSubgraphs)})),d(this,"_graph",(new h.Graph).layout("Hierarchy").applyScaleOnLayout(!0).showToolbar(!1).allowDragging(!1)),d(this,"_activities",(new c.Table).pagination(!1)),d(this,"_edges",(new c.Table).pagination(!1)),d(this,"_subgraphs",(new c.Table).pagination(!1)),d(this,"_legend",new S(this).on("click",e=>{this.render()}).on("mouseover",e=>{const t={};for(const s of this._gc.vertices(e))t[s.id()]=!0;this._graph.highlightVerticies(t)}).on("mouseout",e=>{this._graph.highlightVerticies()})),d(this,"_view",(new n.Carousel).widgets([this._graph,this._activities,this._edges,this._subgraphs])),d(this,"_gc",new x),d(this,"_prevHashSum"),d(this,"_prevScopeGraph"),this.topOverlay(!1),this.widget(this._view);const e=[this._toggleGraph,this._toggleActivities,this._toggleEdges,this._toggleSubgraphs,new o.Spacer,this._partialAll,this._maxAll,new o.Spacer,...this._graph.iconBarButtons(),new o.Spacer];this.buttons(e.concat(this.buttons())),this._gc.minClick=e=>{this.loadGraph(),this._graph.render(t=>{this._graph.selection([e]).centerOnItem(e)})},this._graph.tooltipHTML(e=>this._gc.calcGraphTooltip(e))}stateClick(e){switch(e){case this._partialAll:this._graph.data().subgraphs.forEach(e=>{e.minState("partial")});break;case this._maxAll:this._graph.data().subgraphs.forEach(e=>{e.minState("normal")})}this.render()}viewClick(e){switch(this._toggleGraph.selected(e===this._toggleGraph),this._toggleActivities.selected(e===this._toggleActivities),this._toggleEdges.selected(e===this._toggleEdges),this._toggleSubgraphs.selected(e===this._toggleSubgraphs),e){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(e=>{})}fetchScopeGraph(){const e=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),graphID:this.graphID(),subgraphID:this.subgraphID()});if(!this._prevScopeGraph||this._prevHashSum!==e){this.startProgress(),this._prevHashSum=e,this._gc.clear();return s.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchGraphs().then(e=>{for(const t of e)if(t.Name===this.graphID())return this.finishProgress(),t.fetchScopeGraph(this.subgraphID())}).then(e=>(this._prevScopeGraph=e,this._prevScopeGraph))}return Promise.resolve(this._prevScopeGraph)}enter(e,t){super.enter(e,t)}update(e,t){super.update(e,t)}exit(e,t){super.exit(e,t)}loadGraph(){this._gc.disabled(this._legend.disabled()),this._graph.data(this._gc.graphData(),!0);{const{columns:e,data:t}=this._gc.activityData();this._activities.columns(e).data(t)}{const{columns:e,data:t}=this._gc.edgeData();this._edges.columns(e).data(t)}{const{columns:e,data:t}=this._gc.subgraphData();this._subgraphs.columns(e).data(t)}}render(e){return this.wuid()&&this.graphID()?this.fetchScopeGraph().then(t=>{this._gc.set(t),this._legend.data(this._gc.calcLegend()),this.loadGraph(),super.render(e)}):super.render(e),this}selection(e){if(!arguments.length)return this._graph.selection();const t=this._gc.vertex(e)||this._gc.edge(e)||this._gc.subgraph(e);return t&&this._graph.selection([t]),this}};u(v,"WUGraph");let k=v;function I(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function C(e){switch(Object.prototype.toString.call(e)){case"[object Undefined]":case"[object Boolean]":case"[object Number]":return e;case"[object String]":return I(e);default:console.warn("Unknown cell type: "+Object.prototype.toString.call(e))}return e}k.prototype._class+=" eclwatch_WUGraph",k.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),k.prototype.publish("wuid","","string","Workunit ID"),k.prototype.publish("graphID","","string","Graph ID"),k.prototype.publish("subgraphID","","string","Subgraph ID"),u(I,"entitiesEncode"),u(C,"safeEncode");const D=class _Store{constructor(e,t,s,r={},i){d(this,"wuResult"),d(this,"schema"),d(this,"_columns"),d(this,"_cache",{}),d(this,"rowFormatter"),d(this,"_filter",{}),d(this,"onError"),this.wuResult=e,this.schema=t,this._columns=this.schema2Columns(this.schema.root),this.rowFormatter=new c.RowFormatter(this._columns,s),this._filter=r,this.onError=i}columns(){return this._columns}schema2Columns(e,t=""){return e?e.children().filter(e=>-1===e.name.indexOf("__hidden",e.name.length-8)).map((e,s)=>{const r=e.name,i=e.attrs["hpcc:keyed"],a={field:t+r,leafID:r,idx:s,label:r+(i?" (i)":""),className:"resultGridCell",sortable:!1,width:i?16:0,isSet:e.isSet},o=this.schema2Columns(e,t+r+"_");return o.length?(a.width+=10+o.reduce((e,t)=>e+t.width,0),a.children=o):(a.width+=9*e.charWidth(),a.formatter=(e,t)=>{switch(typeof e){case"string":return{html:e.replace(/\t/g," ").trim()};case"undefined":return""}return e}),a}):[]}isChildDataset(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=0,s=null;for(const r in e)s||(s=Object.prototype.toString.call(e[r])),t++;return 1===t&&"[object Array]"===s}rowToTable(e,t,s){if(this.isChildDataset(e)){for(const r in e)this.rowToTable(e[r],t,s);return}const r=c.domConstruct.create("table",{border:1,cellspacing:0,width:"100%"},s);switch(Object.prototype.toString.call(e)){case"[object Object]":let i=c.domConstruct.create("tr",null,r);for(const t in e)c.domConstruct.create("th",{innerHTML:C(t)},i);i=c.domConstruct.create("tr",null,r);for(const r in e)switch(Object.prototype.toString.call(e[r])){case"[object Object]":case"[object Array]":this.rowToTable(e[r],t,s);break;default:c.domConstruct.create("td",{innerHTML:C(e[r])},i)}break;case"[object Array]":for(let t=0;t<e.length;++t)switch(Object.prototype.toString.call(e[t])){case"[object Boolean]":case"[object Number]":case"[object String]":const s=c.domConstruct.create("tr",null,r);c.domConstruct.create("td",{innerHTML:C(e[t])},s);break;default:if(0===t){const s=c.domConstruct.create("tr",null,r);for(const r in e[t])c.domConstruct.create("th",{innerHTML:C(r)},s)}c.domConstruct.create("tr",null,r);for(const r in e[t])if(e[t][r])if("[object Object]"===Object.prototype.toString.call(e[t][r])||"[object Array]"===Object.prototype.toString.call(e[t][r])){const i=c.domConstruct.create("td",null,s);this.rowToTable(e[t][r],e[t],i)}else if(-1!==r.indexOf("__html",r.length-6))c.domConstruct.create("td",{innerHTML:e[t][r]},s);else if(-1!==r.indexOf("__javascript",r.length-12))c.domConstruct.create("td",null,s);else{const i=e[t][r];c.domConstruct.create("td",{innerHTML:C(i)},s)}else c.domConstruct.create("td",{innerHTML:""},s)}}}getIdentity(e){return e.__hpcc_id}_request(e,t){if(!this.wuResult)return Promise.resolve({totalLength:0,data:[]});const s=`${e}->${t}`;if(this._cache[s])return this._cache[s];const r=this.wuResult.fetchRows(e,t-e,!1,this._filter).then(t=>({totalLength:this.wuResult.Total,data:t.map((t,s)=>{const r=this.rowFormatter.format(t);return r.__hpcc_id=e+s,r.__hpcc_orig=t,r})})).catch(e=>(this.onError(e.Message||"An exception has occurred"),{totalLength:0,data:[]}));return this._cache[s]=r,r}fetchRange(e){const t=new c.Deferred;return this._request(e.start,e.end).then(e=>t.resolve(e)),new c.QueryResults(t.then(e=>e.data),{totalLength:t.then(e=>e.totalLength)})}};u(D,"Store");let U=D;const E=class _WUResult extends c.Common{constructor(){super(),d(this,"_result"),d(this,"_localStore"),d(this,"_prevResultHash"),d(this,"_prevStoreHash"),d(this,"_prevQueryHash"),this.renderHtml(!1)}hashSum(e={}){return a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),resultName:this.resultName(),sequence:this.sequence(),nodeGroup:this.nodeGroup(),logicalFile:this.logicalFile(),userID:this.user(),password:this.password(),...e})}calcResult(){const e=this.hashSum();if(this._prevResultHash!==e){this._prevResultHash=e;const t={baseUrl:this.baseUrl(),userID:this.user(),password:this.password()};this.wuid()&&this.resultName()?this._result=s.Result.attach(t,this.wuid(),this.resultName()):this.wuid()&&void 0!==this.sequence()?this._result=s.Result.attach(t,this.wuid(),this.sequence()):this.logicalFile()&&this.nodeGroup()?this._result=s.Result.attachLogicalFile(t,this.nodeGroup(),this.logicalFile()):this.logicalFile()&&(this._result=s.Result.attachLogicalFile(t,"",this.logicalFile()))}return this._result}fetch(e,t,s=new AbortController){const r=this.calcResult();return r?r.fetchRows(e,t,!1,{},s.signal):Promise.resolve([])}update(e,t){super.update(e,t);const s=this.hashSum({renderHtml:this.renderHtml(),filter:this.filter()});if(this._prevStoreHash!==s){this._prevStoreHash=s;const e=this.calcResult();e&&e.fetchXMLSchema().then(t=>{var s,r;this._localStore=new U(e,t,this.renderHtml(),this.filter(),e=>{this._dgrid&&(this._dgrid.noDataMessage=`<span class='dojoxGridNoData'>${e}</span>`,this._dgrid.refresh())}),null==(s=this._dgrid)||s.set("columns",this._localStore.columns()),null==(r=this._dgrid)||r.set("collection",this._localStore)})}}click(e,t,s){}};u(E,"WUResult");let P=E;P.prototype._class+=" eclwatch_WUResult",P.prototype.publish("baseUrl","","string","URL to WsWorkunits"),P.prototype.publish("user","","string","User ID"),P.prototype.publish("password","","string","Password"),P.prototype.publish("wuid","","string","Workunit ID"),P.prototype.publish("resultName","","string","Result Name"),P.prototype.publish("sequence",void 0,"number","Sequence Number"),P.prototype.publish("nodeGroup","","string","NodeGroup"),P.prototype.publish("logicalFile","","string","Logical File Name"),P.prototype.publish("filter",{},"object","Filter");var V=(e=>(e.CREATE="Created",e.COMPILE="Compiled",e.EXECUTE="Executed",e.COMPLETE="Completed",e))(V||{}),M=(e=>(e.CREATE="Creating",e.COMPILE="Compiling",e.EXECUTE="Executing",e.COMPLETE="Completed",e))(M||{});const T=class _WUStatus extends h.Graph{constructor(){super(),d(this,"_wu"),d(this,"_wuHandle"),d(this,"_create"),d(this,"_compile"),d(this,"_execute"),d(this,"_complete"),d(this,"_prevHash"),this.zoomable(!1).zoomToFitLimit(1).layout("Hierarchy").hierarchyRankDirection("LR").showToolbar(!1).allowDragging(!1)}attachWorkunit(){const e=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==e&&(this._prevHash=e,this._wu=s.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()),this._wuHandle&&this._wuHandle.release(),this._wuHandle=this._wu.watch(e=>{this.lazyRender()}))}createVertex(e){return(new h.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(e)}updateVertex(e,t){e.icon_image_colorFill(t).textbox_text_colorFill(t)}updateVertexStatus(e,t=!1){const s=this._wu.isFailed()?"darkred":"darkgreen";switch(this._create.text("Created"),this._compile.text("Compiled"),this._execute.text("Executed"),this._complete.text("Completed"),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("Creating"),this.updateVertex(this._create,t?"orange":s),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 2:this._compile.text("Compiling"),this.updateVertex(this._create,s),this.updateVertex(this._compile,t?"orange":s),this.updateVertex(this._execute,s),this.updateVertex(this._complete,"darkgray");break;case 3:this._execute.text("Executing"),this.updateVertex(this._create,s),this.updateVertex(this._compile,s),this.updateVertex(this._execute,t?"orange":s),this.updateVertex(this._complete,"darkgray");break;case 4:this.updateVertex(this._create,s),this.updateVertex(this._compile,s),this.updateVertex(this._execute,s),this.updateVertex(this._complete,s)}}createEdge(e,t){return(new h.Edge).sourceVertex(e).targetVertex(t).strokeColor("black").showArc(!1)}enter(e,t){super.enter(e,t),this._create=this.createVertex(""),this._compile=this.createVertex(""),this._execute=this.createVertex(""),this._complete=this.createVertex("");const s=this.createEdge(this._create,this._compile),r=this.createEdge(this._compile,this._execute),i=this.createEdge(this._execute,this._complete);this.data({vertices:[this._create,this._compile,this._execute,this._complete],edges:[s,r,i]})}update(e,t){switch(this.attachWorkunit(),this._wu.StateID){case s.WUStateID.Blocked:case s.WUStateID.Wait:case s.WUStateID.Scheduled:case s.WUStateID.UploadingFiled:this.updateVertexStatus(1);break;case s.WUStateID.Compiling:this.updateVertexStatus(2,!0);break;case s.WUStateID.Submitted:this.updateVertexStatus(1,!0);break;case s.WUStateID.Compiled:this.updateVertexStatus(2);break;case s.WUStateID.Aborting:case s.WUStateID.Running:this.updateVertexStatus(3,!0);break;case s.WUStateID.Aborted:case s.WUStateID.Archived:case s.WUStateID.Completed:this.updateVertexStatus(4);break;case s.WUStateID.Failed:this.updateVertexStatus(4,!1);break;case s.WUStateID.DebugPaused:case s.WUStateID.DebugRunning:case s.WUStateID.Paused:case s.WUStateID.Unknown:default:this.updateVertexStatus(0)}super.update(e,t),this.zoomToFit()}exit(e,t){this._wuHandle&&this._wuHandle.release(),super.exit(e,t)}};u(T,"WUStatus");let j=T;j.prototype._class+=" eclwatch_WUStatus",j.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),j.prototype.publish("wuid","","string","Workunit ID");const W=["label","start","end","icon","color","series"],R=class _WUTimeline extends l.ReactTimelineSeries{constructor(){super(),d(this,"_palette",o.Palette.ordinal("default")),d(this,"_prevHashSum"),this.columns(W).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(e=>e[W.length].calcTooltip())}clear(){return delete this._prevHashSum,this}fetchScopes(){const e=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),request:this.request()});if(this._prevHashSum!==e){this._prevHashSum=e;s.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchDetails(this.request()).then(e=>e.filter(e=>e.Id&&e.attr("WhenStarted").RawValue).map(e=>{const t=+e.attr("WhenStarted").RawValue/1e3,s=+e.attr("TimeElapsed").RawValue/1e6;return[e.Id,new Date(t).toISOString(),s?new Date(t+s).toISOString():void 0,null,this._palette(e.ScopeType),e.ScopeName.split("::").join(":").split(":").slice(0,1),e]})).then(e=>{this.data(e).render()})}}enter(e,t){super.enter(e,t)}update(e,t){this.fetchScopes(),super.update(e,t)}exit(e,t){super.exit(e,t)}};u(R,"WUTimeline");let A=R;A.prototype._class+=" eclwatch_WUTimeline",A.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),A.prototype.publish("wuid","","string","Workunit ID"),A.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"),e.BUILD_VERSION="3.2.1",e.ECLArchiveViewer=_,e.PKG_NAME="@hpcc-js/eclwatch",e.PKG_VERSION="3.1.1",e.STATUS=V,e.STATUS_ACTIVE=M,e.WUGraph=k,e.WUResult=P,e.WUScopeController=x,e.WUStatus=j,e.WUTimeline=A,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
5
2
|
//# sourceMappingURL=index.umd.cjs.map
|
|
6
|
-
|
|
3
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".eclwatch_WUGraphLegend .graph_Vertex{cursor:auto}.eclwatch_WUGraphLegend .graph_Vertex .common_Icon{cursor:pointer}.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}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|