graphdb-workbench
Version:
The web application for GraphDB APIs
2 lines • 8.74 kB
JavaScript
export const __webpack_esm_id__=57952;export const __webpack_esm_ids__=[48581,57952,70962];export const __webpack_esm_modules__={57952:(t,e,n)=>{n.d(e,{$$:()=>R,CQ:()=>x,D6:()=>m,HF:()=>S,Iz:()=>T,J5:()=>u,Wg:()=>D,Xl:()=>I,ZC:()=>A,_D:()=>v,cZ:()=>E,cy:()=>y,dB:()=>O,kI:()=>h,r_:()=>_,ss:()=>Y});var o=n(70962),r=n(98980),s=n(93462);const a={line:s.line,select:s.select},i={ontoOrange:"var(--gw-primary-base)",ontoBlue:"var(--gw-secondary-base)",ontoGreen:"var(--gw-tertiary-base)",ontoGrey:"var(--gw-neutral-base)"},c={[o.gC.IN_SYNC]:i.ontoBlue,[o.gC.SYNCING]:i.ontoBlue,[o.gC.OUT_OF_SYNC]:i.ontoGrey,[o.gC.RECEIVING_SNAPSHOT]:i.ontoBlue},l={[o.gC.IN_SYNC]:"none",[o.gC.SYNCING]:"10 10",[o.gC.OUT_OF_SYNC]:"10 10",[o.gC.RECEIVING_SNAPSHOT]:"10 10"},d={REMIXICON:"REMIXICON",ICOMOON:"ICOMOON"},N=40;function u(t){return a.select(t).append("svg").classed("cluster-diagram",!0)}function O(t){const e=t.append("g");return e.append("circle").classed("cluster-zone",!0).style("fill","transparent").style("stroke-width","4"),e}function I(t,e,n,o=!1){if(e.select(".cluster-zone").classed("no-cluster",!t).classed("has-access",o),t)e.selectAll("#no-cluster-zone").remove();else{const t=e.append("g").attr("id","no-cluster-zone");t.append("text").attr("id","no-cluster-label").text(n.no_cluster_configured).attr("y",-50).classed("h2",!0).style("text-anchor","middle"),o&&t.append("text").attr("id","create-cluster-label").classed("h3",!0).text(n.create_cluster_btn).style("text-anchor","middle"),t.append("text").attr("y",130).attr("class","icon-any repo").attr("fill",i.ontoOrange).style("text-anchor","middle").classed("settings-icon",!0).text("")}}function _(t,e,n){t||(e.select("#no-cluster-zone #no-cluster-label").text(n.no_cluster_configured),e.select("#no-cluster-zone #create-cluster-label").text(n.create_cluster_btn))}function E(t,e,n){t.attr("transform",()=>`translate(${e}, ${n})`)}function h(t,e,n){const o=t.enter().append("g").attr("id","node-group").classed("legend",n),r=o.merge(t).attr("id","node-group").classed("legend",n);return function(t,e){const n=Math.sqrt(3)/2,o=[[e+0,0],[e/2+0,e*n+0],[-e/2+0,e*n+0],[0-e,0],[-e/2+0,-e*n+0],[e/2+0,-e*n+0],[e+0,0],[e/2+0,e*n+0]];t.selectAll("path.area").data([o]).enter().append("path").attr("class","node member").attr("stroke-width","10").attr("stroke-linejoin","round").attr("d",a.line())}(o,e),t.exit().remove(),o.append("text").attr("class","icon-any node-icon"),n||function(t,e){const n=t.append("g");n.append("rect").attr("class","id-host-background").attr("rx",6),n.append("rect").attr("class","node-info-background").attr("rx",6),n.append("text").attr("y",e+25).attr("class","id id-host"),n.append("text").attr("y",e+55).attr("class","node-info-text")}(o,e),r}function S(t){!function(t){t.select(".node-icon").each(function(t){const e=(n=t,(0,r.isEmpty)(n.recoveryStatus)?function(t){return C[t.nodeState]||{icon:"",font:""}}(t):function(t){const e=t.recoveryStatus;return e&&e.state&&f[e.state]||{icon:"",font:""}}(t));var n;a.select(this).classed("icon-any",e.font===d.ICOMOON).classed("remixicon",e.font===d.REMIXICON).text(e.icon)})}(t),function(t){t.select(".node.member").classed("leader",t=>t.nodeState===o.UY.LEADER).classed("follower",t=>t.nodeState===o.UY.FOLLOWER).classed("candidate",t=>t.nodeState===o.UY.CANDIDATE).classed("other",t=>t.nodeState!==o.UY.LEADER&&t.nodeState!==o.UY.FOLLOWER&&t.nodeState!==o.UY.CANDIDATE)}(t),function(t){t.select(".id.id-host").each(function(t){t.labelNode=this}).text(function(t){return t.hostname}),t.select(".id-host-background").attr("width",function(t){return a.select(t.labelNode).node().getBBox().width+10}).attr("height",function(t){return a.select(t.labelNode).node().getBBox().height+10}).attr("x",function(t){return a.select(t.labelNode).node().getBBox().x-5}).attr("y",function(t){return a.select(t.labelNode).node().getBBox().y-5})}(t),function(t){let e,n;t.select(".node-info-text").each(function(t){t.infoNode=this}).select(function(){return this.parentNode}).append("foreignObject").attr("width",function(t){let o="";(0,r.isEmpty)(t.recoveryStatus)||(o=g(t));const s=p(o);return e=s.height,n=s.width,n}).attr("height",function(t){return e}).attr("x",function(t){return-n/2}).attr("y",function(t){return 78}).classed("hidden",function(t){return(0,r.isEmpty)(t.recoveryStatus)}).style("font-size","12px").style("font-weight","400").style("text-align","center").style("padding","4px").style("background","#EEEEEE").style("border-radius","6px").attr("class","node-info-fo").append("xhtml:div").html(function(t){return g(t)}),t.select(".node-info-text").remove(),function(t){t.select(".node-info-fo").each(function(t){const e=a.select(this);if((0,r.isEmpty)(t.recoveryStatus))return void e.attr("width",0);const n=g(t),o=t.recoveryStatus.message&&t.recoveryStatus.message.length>N&&n!==t.recoveryStatus.message,s=o?n:t.recoveryStatus.message,i=p(n),c=p(t.recoveryStatus.message);e.on(".tooltip",null),o&&function(t,e,n,o,r){t.on("mouseover.tooltip",()=>{t.attr("width",r.width).attr("height",r.height).attr("x",-r.width/2).html(`<div>${e}</div>`)}),t.on("mouseout.tooltip",()=>{t.attr("width",n.width).attr("height",n.height).attr("x",-n.width/2).html(`<div>${o}</div>`)})}(e,t.recoveryStatus.message,i,s,c),e.attr("width",i.width).attr("height",i.height).attr("x",-i.width/2).html(`<div>${s}</div>`)})}(t)}(t)}const f={[o.vQ.SEARCHING_FOR_NODE]:{icon:"",font:d.REMIXICON},[o.vQ.WAITING_FOR_SNAPSHOT]:{icon:"",font:d.REMIXICON},[o.vQ.RECEIVING_SNAPSHOT]:{icon:"",font:d.REMIXICON},[o.vQ.APPLYING_SNAPSHOT]:{icon:"",font:d.REMIXICON},[o.vQ.BUILDING_SNAPSHOT]:{icon:"",font:d.REMIXICON},[o.vQ.SENDING_SNAPSHOT]:{icon:"",font:d.REMIXICON},[o.vQ.RECOVERY_OPERATION_FAILURE_WARNING]:{icon:"",font:d.ICOMOON}},C={[o.UY.CANDIDATE]:{icon:"",font:d.ICOMOON},[o.UY.NO_CONNECTION]:{icon:"",font:d.ICOMOON},[o.UY.OUT_OF_SYNC]:{icon:"",font:d.ICOMOON},[o.UY.READ_ONLY]:{icon:"",font:d.ICOMOON},[o.UY.RESTRICTED]:{icon:"",font:d.ICOMOON}};function g(t){return t.recoveryStatus.message&&t.recoveryStatus.message.length>N?t.recoveryStatus.message.substring(0,N)+"...":t.recoveryStatus.message||""}function p(t){const e=document.createElement("div");e.innerHTML=t,e.style.padding="4px",e.style.position="absolute",e.style.visibility="hidden",e.style.fontSize="12px",e.style.fontWeight="400",e.style.textAlign="center",e.style.height="auto",e.style.width="auto",e.style.whiteSpace="nowrap",document.body.appendChild(e);const n=e.getBoundingClientRect(),o=n.height,r=n.width;return document.body.removeChild(e),{height:o,width:r}}function y(t){t.enter().append("path").classed("link",!0),t.exit().remove()}function R(t,e){t.attr("class",t=>`link ${t.id.replaceAll(":","-")}`).attr("stroke",v).style("stroke-dasharray",x).style("marker-mid",t=>T(t,A.BIG)).attr("d",t=>function(t,e){const n=e.find(e=>e.address===t.source),o=e.find(e=>e.address===t.target),r=o.x-n.x,s=o.y-n.y,a=Math.sqrt(r*r+s*s),i=r/a,c=s/a,l=n.x+55*i,d=n.y+55*c,N=o.x-55*i,u=o.y-55*c;return"M"+l+","+d+"L"+(l+N)/2+","+(d+u)/2+"L"+N+","+u}(t,e))}const A={SMALL:{name:"small",size:3},BIG:{name:"big",size:5}};function m(t,e){t.append("svg:defs").append("svg:marker").attr("id",`arrowhead_${e.name}`).attr("viewBox",`0 0 ${2*e.size} ${2*e.size}`).attr("refX",e.size).attr("refY",e.size).attr("markerWidth",e.size).attr("markerHeight",e.size).attr("orient","auto-start-reverse").append("path").attr("d",`M 0 0 L ${2*e.size} ${e.size} L 0 ${2*e.size} z`).style("fill","var(--gw-secondary-base)")}function T(t,e){if(t.status===o.gC.RECEIVING_SNAPSHOT)return`url(#arrowhead_${e.name})`}function v(t){return c[t.status]||"none"}function x(t){return l[t.status]||"none"}function Y(t,e,n,o){t.attr("transform",(r,s)=>{const a=2*Math.PI*s/t.size(),i=e+Math.cos(a)*o,c=n+Math.sin(a)*o;return r.x=i,r.y=c,`translate(${i}, ${c})`})}function D(){a.select(document).selectAll(".node-info-fo").on(".tooltip",null)}},70962:(t,e,n)=>{n.d(e,{UY:()=>o,gC:()=>s,vQ:()=>r,zB:()=>a});const o={LEADER:"LEADER",FOLLOWER:"FOLLOWER",CANDIDATE:"CANDIDATE",OUT_OF_SYNC:"OUT_OF_SYNC",NO_CONNECTION:"NO_CONNECTION",READ_ONLY:"READ_ONLY",RESTRICTED:"RESTRICTED",NO_CLUSTER:"NO_CLUSTER"},r={SEARCHING_FOR_NODE:"SEARCHING_FOR_NODE",WAITING_FOR_SNAPSHOT:"WAITING_FOR_SNAPSHOT",RECEIVING_SNAPSHOT:"RECEIVING_SNAPSHOT",APPLYING_SNAPSHOT:"APPLYING_SNAPSHOT",BUILDING_SNAPSHOT:"BUILDING_SNAPSHOT",SENDING_SNAPSHOT:"SENDING_SNAPSHOT",RECOVERY_OPERATION_FAILURE_WARNING:"RECOVERY_OPERATION_FAILURE_WARNING"},s={IN_SYNC:"IN_SYNC",OUT_OF_SYNC:"OUT_OF_SYNC",SYNCING:"SYNCING",NO_CONNECTION:"NO_CONNECTION",RECEIVING_SNAPSHOT:"RECEIVING_SNAPSHOT"},a={PRIMARY_NODE:"PRIMARY_NODE",SECONDARY_NODE:"SECONDARY_NODE"}}};
//# sourceMappingURL=57952.7a4cf6065df396671855.bundle.js.map