@spaceandtimelabs/dapp-mi-space-time 0.1.7-258 → 0.1.7-260
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/build/assets/{ErdWrapper-4048b208.js → ErdWrapper-16464cd6.js} +1 -1
- package/build/assets/{Queries-f7fcde81.js → Queries-2c867a79.js} +1 -1
- package/build/assets/{QueryEditorWrapper-a8d3d1d1.js → QueryEditorWrapper-12c8869e.js} +1 -1
- package/build/assets/{index-2be4f602.js → index-b86011c5.js} +1 -1
- package/build/assets/{index-4cc40cbe.js → index-f575fb85.js} +1798 -1798
- package/build/index.html +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{lO as o,k as e,r as t}from"./vendor-charts-a85b2946.js";import{u as n,O as s,E as d,a as p}from"./index-
|
|
1
|
+
import{lO as o,k as e,r as t}from"./vendor-charts-a85b2946.js";import{u as n,O as s,E as d,a as p}from"./index-f575fb85.js";import"./vendor-editor-3dd5e143.js";import"./vendor-three-43ec9d9f.js";const x=r=>{const a=o(),{height:i}=n();return e.jsx(t.Suspense,{fallback:s,children:e.jsx(d,{pageHeight:i,children:a?e.jsx(s,{}):e.jsx(p,{...r,hideSchemaSidebar:!1})})})};export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{iD as Ue,oP as Et,r as g,a9 as Te,k as e,an as Qe,b8 as i,eg as We,oQ as jt,ed as Ae,oR as Ct,oS as Nt,cV as Ce,ew as be,eX as Le,am as Ne,mV as $e,dL as Me,dW as ve,oT as Tt,oU as bt,oV as yt,eI as h,e$ as at,aa as Rt,dM as de,f1 as mt,bx as Qt,o6 as vt,a_ as Dt,eK as It,bd as it,c_ as _t,cM as je,fn as Ot,oW as wt,fg as Ut,R as Ht,as as At,fr as Lt,oo as T,au as fe,dv as ce,fF as Xe,eY as Je,bH as De,op as Mt,eV as Ze,fA as kt,fB as Se,ad as le,cE as Ie,aX as Bt,cF as zt,eU as _e,eT as Oe,fC as Vt,cI as Yt,oX as Kt}from"./vendor-charts-a85b2946.js";import{u as ye,b as Gt,c as Wt,d as ct,e as ke,f as Be,r as Fe,g as ze,C as Pe,h as qe,M as $t,V as Ve,P as Ye,i as Xt,H as Jt,j as Ke,I as V,B as M,k as Zt,l as Ft,m as Pt,n as He,N as we,o as ge,L as qt,p as en,s as re,q as tn,t as nn,v as lt,w as rt,T as dt,x as sn,y as gt,z as ht,A as on,D as an,F as cn,G as et,J as ln,O as rn,K as dn,R as tt,S as gn,W as hn,U as nt,X as st,Y as ot,Z as Ee,_ as un,$ as xn,a0 as pn,a1 as fn,a2 as Sn,a3 as En}from"./index-4cc40cbe.js";import"./vendor-editor-3dd5e143.js";import"./vendor-three-43ec9d9f.js";const jn="/assets/emptyHistory-39807386.png",Cn="/assets/emptyHistory-e09c1ac9.webp",Nn="/assets/heartbeat-d012a4c0.png";Ue.extend(Et);function Tn({queryParams:s,setSortBy:k,setPageNumber:y,onPageChange:K,onPageSizeChange:R,defaultSize:f}){var l,v,U;const{height:C,headerHeight:d}=ye(),[_,x]=g.useState(!1),[O,D]=g.useState([]),[E,w]=g.useState(null),[m,N]=g.useState({areaChartConfig:[],lineChartConfig:[]}),[I,o]=g.useState(0),u=(l=Object.keys(m))==null?void 0:l.length,t=Gt(),S=Wt(),r=ct(),A=ke(),j=Be(),p=A||j,{totalPages:Q=0,totalElements:L=0}=(S==null?void 0:S.pageable)||{},Y=Te();g.useEffect(()=>()=>Fe(),[]),g.useEffect(()=>{var c,H,F,ie,Ge;if((c=r==null?void 0:r.content)!=null&&c.length){const ut=(H=r==null?void 0:r.content)==null?void 0:H.map(b=>b==null?void 0:b.queryType),pe={};(ut??[]).forEach(b=>{pe[b]?pe[b]+=1:pe[b]=1});const xt=(F=Object.entries(pe))==null?void 0:F.map(([b,St])=>({Source:b,Trafic:St}));D(xt);const pt=(ie=r==null?void 0:r.content)==null?void 0:ie.map(b=>({Timestamp:b.timestamp,Usage:b.usage,Runtime:b.runtime})),ft=(Ge=r==null?void 0:r.content)==null?void 0:Ge.map(b=>({Timestamp:b.timestamp,Usage:b.usage,DataVolume:b.responseSize}));N({areaChartConfig:pt,lineChartConfig:ft}),(s==null?void 0:s.isRecent)==="false"&&o(0)}else D([])},[r==null?void 0:r.content,s]);const B=c=>y(c),P=(c,H)=>{if(c==="systemHeartbeat"||c==="CPUSkew")return;const F=H==="ASC"?"DESC":"ASC";Fe(),k(c,F)},X=c=>{Y.push("/queries/new?tabID=1"),$e(c)},q=c=>{w(c),x(!0)},G=()=>{w(null),x(!1)},J=({timestamp:c})=>Ae(c),ee=({runtime:c})=>Ct(c),te=({responseSize:c=0})=>Nt(c),ne=({cpuskew:c="59%"})=>e.jsx(Xt,{children:c}),Z=({systemHeartbeat:c="58"})=>e.jsxs(Jt,{children:[e.jsx("img",{src:Nn,alt:"system-heartbeat"}),e.jsx("span",{children:c})]}),W=c=>e.jsx("span",{className:"text",children:c.queryType?c.queryType:"-"}),$=c=>e.jsx("span",{className:"text",children:c!=null&&c.usage?c.usage:"-"}),a=c=>e.jsxs(Ke,{onClick:()=>q(c),className:"queryText",children:[e.jsx("span",{className:"text",children:c.sqlText}),e.jsx(V,{tooltip:"Preview",children:e.jsx(Ce,{})})]}),z=c=>e.jsx(V,{onClick:()=>{X(c)},tooltip:i.VIEW_IN_EDITOR,children:e.jsx(be,{})}),se=()=>e.jsx(Le,{imgPath:jn,imgPathWebp:Cn,title:!(s!=null&&s.tagName)&&!(s!=null&&s.searchKeyword)?i.EMPTY_QUERY_HISTORY:i.NO_RESULT_FOUND_ON_FILTER,children:!(s!=null&&s.tagName)&&!(s!=null&&s.searchKeyword)&&e.jsx(Ne,{to:"/queries/new?tabID=1",children:e.jsx(M,{variant:"contained",color:"primary",size:"large",children:i.CREATE_NEW_QUERY})})}),ae=()=>C-d-230||300,oe=()=>{E&&$e(E)},Re=()=>e.jsx(Me,{title:t,children:t});if((S==null?void 0:S.totalElements)===0)return se();if(t)return Re();const he=()=>{o(c=>c+1)},me=()=>{o(c=>c-1)},ue=()=>{o(0)},xe=()=>{o(u-1)},n=()=>{var ie;let c,H,F;switch(I){case 1:I===1&&(c="Usage and Data Volume Variation over time",H=ve.column_chart,F=yt);break;default:c="Usage and Runtime Trends Over Time",H=ve.area_chart,F=bt}return console.log("queryHistory",r.content),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"cardHead",children:[e.jsx("span",{className:"cardHeadTitle",children:c}),e.jsx("span",{className:"cardHeadCount",children:(ie=r==null?void 0:r.content)==null?void 0:ie.length})]}),e.jsx("div",{className:"cardBody",children:e.jsx(We,{isRunning:p,config:qe({data:H===ve.area_chart?m.areaChartConfig:m.lineChartConfig,chartConfigurationData:F}).config,type:H})})]})};return e.jsxs(e.Fragment,{children:[e.jsx(ze,{open:_,id:E==null?void 0:E.savedQueryId,text:E==null?void 0:E.sqlText,onClose:G,onClickView:oe,isHistory:!0}),(p||((v=r==null?void 0:r.content)==null?void 0:v.length)>0)&&(s==null?void 0:s.isRecent)==="false"&&e.jsxs(Qe,{container:!0,spacing:{xs:1,sm:3},children:[e.jsx(Qe,{item:!0,sm:5,xs:12,children:e.jsxs(Pe,{children:[e.jsxs("div",{className:"cardHead",children:[e.jsx("span",{className:"cardHeadTitle",children:i.TOTAL_QUERIES}),e.jsx("span",{className:"cardHeadCount",children:(U=r==null?void 0:r.content)==null?void 0:U.length})]}),e.jsx("div",{className:"cardBody",children:e.jsx(We,{isRunning:p,config:qe({data:O,chartConfigurationData:Tt}).config,type:"pie_chart"})})]})}),e.jsx(Qe,{item:!0,sm:7,xs:12,children:e.jsxs(Pe,{children:[n(),!p&&e.jsx($t,{maxSteps:u,activeStep:I,handleFirst:ue,handleLast:xe,handleNext:he,handlePrev:me})]})})]}),e.jsx(Ve,{data:r==null?void 0:r.content,columns:jt,isAction:!0,actionComponent:c=>z(c),loading:p,rowRender:[{dataKey:"sqlText",func:a},{dataKey:"timestamp",func:J},{dataKey:"runtime",func:ee},{dataKey:"responseSize",func:te},{dataKey:"systemHeartbeat",func:Z},{dataKey:"CPUSkew",func:ne},{dataKey:"queryType",func:W},{dataKey:"usage",func:$}],rowSize:75,bodyHeight:ae(),onItemsSort:P,sortBy:s==null?void 0:s.sortBy,sortOrder:(s==null?void 0:s.sortOrder)||""}),(p?!0:(r==null?void 0:r.length)!==0)&&e.jsx(Ye,{onChange:B,count:Q,page:s.pageNo,onPageChange:K,totalElements:L,onPageSizeChange:R,isGotoPage:!0,isPageSize:!0,pageSize:s.pageSize,defaultSize:f})]})}const bn=s=>{const{row:k,handleClose:y,handlePublishCallback:K,open:R}=s,{id:f,queryName:C,visibility:d,slug:_}=k||{},[x,O]=g.useState(""),[D,E]=g.useState(!1),[w,m]=g.useState(!1),[N,I]=g.useState(!1),o=Zt()||(k==null?void 0:k.visibility),u=g.useRef(null),t=d===h.public;g.useEffect(()=>{if(R&&d===h.public){const p=window.location.origin+de.queriesSlug(f,_);O(p)}else O(""),I(!1),u.current=null},[R]);const S=p=>{var Y,B;const Q=((B=(Y=p==null?void 0:p.target)==null?void 0:Y.value)==null?void 0:B.trim())||"",L=(Q==null?void 0:Q.length)>0&&mt(Q);E(L),Q!==x&&O(Q)},r=async()=>{m(!0),await en(f,C,x,o,K)===i.RESPONSE_SUCCESS_STATUS&&y(),m(!1)},A=p=>{switch(p){case h.public:re(h.public);break;case h.private:re(h.private);break;case h.subscription:re(h.subscription);break;default:re(h.private)}},j=()=>{Qt(x).then(()=>{I(!0)})};return e.jsx(Ft,{title:i.QUERY_PUBLISH,visible:R,maxWidth:"sm",onClose:y,children:e.jsxs(Pt,{children:[e.jsxs("div",{className:"visibilityCheck",children:[e.jsx("div",{className:"label",children:"Choose the visibility for your query"}),e.jsxs(at,{variant:"contained",className:`isPublicCheck ${d===h.public&&"disabled"}`,children:[e.jsx(M,{variant:"contained",onClick:()=>{A(h.private)},color:o===h.public||o===h.subscription?"secondary":"primary",disabled:d===h.public,children:i.PRIVATE}),e.jsx(M,{variant:"contained",onClick:()=>{A(h.subscription)},color:o===h.subscription?"primary":"secondary",disabled:d===h.public,children:i.PRIVATE_TO_MY_ORG}),e.jsx(M,{variant:"contained",onClick:()=>{A(h.public)},color:o===h.public?"primary":"secondary",children:i.PUBLIC})]})]}),o===h.public&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"slugInput",children:e.jsx(He,{autoFocus:!0,label:"Unique Query Name",required:!0,placeholder:"Enter slug name",ishelpertext:1,helperText:!t&&`${x==null?void 0:x.length}/${we}`,value:x,warningText:!t&&i.MAX_LENGTH_ERROR("slug name",we),hasMax:!0,maxValue:we,onChange:S,errorText:D&&i.VIEW_NAME_ERROR("Slug"),ref:u,inputProps:{readOnly:t},endAdornment:_?e.jsx(Rt,{position:"end",children:e.jsx(V,{onClick:()=>window.open(window.location.origin+de.queriesSlug(f,_),"_blank"),children:e.jsx(be,{})})}):null})}),t&&e.jsx(ge,{message:i.PUBLISHED_TEXT("query")}),o===h.public&&!t&&e.jsx(ge,{message:i.PUBLISH_CONFIRM_MESSAGE("Query")})]}),e.jsxs("div",{className:"btnRow",children:[e.jsx(M,{disabled:w,variant:"contained",color:"secondary",onClick:y,className:"formBtn cancel",children:i.CANCEL}),!t&&e.jsx(M,{disabled:D||(x==null?void 0:x.length)>=50||w||o===h.public&&!(x!=null&&x.trim()),variant:"contained",color:"primary",onClick:r,className:"formBtn submit",children:w?e.jsx("img",{src:qt,alt:"loading",height:36}):i.SUBMIT}),t&&e.jsx(M,{type:"button",variant:"contained",color:"primary",onClick:j,children:N?i.COPIED:i.COPY_LINK})]})]})})};function yn({queryParams:s,setPageNumber:k,setSortBy:y,onPageChange:K,onPageSizeChange:R,deleteQuery:f,defaultSize:C,handlePublishCallback:d}){const _=Te(),{height:x,headerHeight:O}=ye(),D=tn(),E=nn(),{totalPages:w=0,totalElements:m=0}=(E==null?void 0:E.pageable)||{},N=lt(),I=ke(),o=Be(),u=I||o,[t,S]=g.useState(!1),[r,A]=g.useState({}),[j,p]=g.useState(!1),[Q,L]=g.useState({}),Y=(a,z)=>{y(a,z==="ASC"?"DESC":"ASC")},B=a=>k(a),P=a=>e.jsx(rt,{className:"queryName",onClick:()=>{_.push(`/queries/${a.id}`)},children:(a==null?void 0:a.name)||"Untitled Query"}),X=a=>a&&Ae(a==null?void 0:a.modified),q=a=>a&&e.jsx(dt,{tags:a==null?void 0:a.tags}),G=a=>{A(a),S(!0)},J=a=>e.jsxs(Ke,{onClick:()=>G(a),className:"queryText",children:[e.jsx("span",{className:"text",children:a.queryText}),e.jsx(V,{tooltip:"Preview",children:e.jsx(Ce,{})})]}),ee=()=>x-O-170||300,te=()=>{p(!1),L({}),re("")},ne=a=>e.jsxs(e.Fragment,{children:[e.jsx(Dt,{label:(a==null?void 0:a.visibility)===h.public?i.PUBLISHED:i.PUBLISH("Query"),children:e.jsx("span",{className:"publishBtn",children:e.jsx(V,{onClick:()=>{p(!0),L(a)},children:e.jsx(It,{})})})}),e.jsx(V,{onClick:()=>{_.push(`/queries/${a.id}`)},tooltip:"View",children:e.jsx(be,{})}),e.jsx(sn,{icon:!0,confirmButtonMessage:i.YES,cancelButtonMessage:i.NO,disabled:a.visibility===h.public,tooltip:i.DELETE(""),title:i.DELETE("Query"),confirmMessage:i.DELETE_CONFIRM_MESSAGE(`'${a.name||""}' query`),description:i.DELETE_QUERY_DESCRIPTION,onConfirm:z=>{z.stopPropagation(),f(a.id,a.name)}},"expire")]}),Z=()=>e.jsx(Le,{imgPath:gt,imgPathWebp:ht,title:!(s!=null&&s.tagName)&&!(s!=null&&s.searchPattern)&&!(s!=null&&s.status)?i.NO_QUERY_FOUND:i.NO_RESULT_FOUND_ON_FILTER,className:"emptyBlock",children:!(s!=null&&s.tagName)&&!(s!=null&&s.searchPattern)&&e.jsx(Ne,{to:"/queries/new?tabID=1",children:e.jsx(M,{variant:"contained",color:"primary",size:"large",children:i.CREATE_NEW_QUERY})})}),W=()=>e.jsx(Me,{title:D,children:D});if(w===0&&!u&&!D)return Z();if(D)return W();const $=()=>{A({}),S(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(ze,{open:t,id:r==null?void 0:r.id,text:r==null?void 0:r.queryText,queryPreview:r,onClose:$}),e.jsx(Ve,{data:N,columns:vt,isAction:!0,actionComponent:ne,actionColumnName:"Actions",rowRender:[{dataKey:"name",func:P},{dataKey:"modified",func:X},{dataKey:"tags",func:q},{dataKey:"queryText",func:J}],loading:u,rowSize:75,bodyHeight:ee(),onItemsSort:Y,sortBy:(s==null?void 0:s.sortBy)||"",sortOrder:(s==null?void 0:s.sortOrder)||"",nonSortableColumns:{tags:!0}}),(u?!0:(N==null?void 0:N.length)!==0)&&e.jsx("div",{className:"queryPagePagination",children:e.jsx(Ye,{onChange:B,count:w,page:(s==null?void 0:s.pageNo)||0,onPageChange:K,totalElements:m,onPageSizeChange:R,isGotoPage:!0,isPageSize:!0,pageSize:(s==null?void 0:s.pageSize)||0,defaultSize:C})}),e.jsx(bn,{open:j,handleClose:te,row:Q,handlePublishCallback:d})]})}function Rn({queryParams:s,setPageNumber:k,setSortBy:y,onPageChange:K,onPageSizeChange:R,onTagChange:f,resetTags:C,defaultSize:d}){const _=Te(),x=it(a=>a.isLoggedIn),{data:O,error:D}=_t.useGetPopularTags(je.stringify({entityType:Ot.SAVEDQUERY_TAG_TYPE}),x),E=!O&&!D,{height:w,headerHeight:m}=ye(),N=on(),I=an(),o=cn(),u=ke(),t=Be(),S=u||t,[r,A]=g.useState(!1),[j,p]=g.useState({}),{totalPages:Q=0,totalElements:L=0}=(I==null?void 0:I.pageable)||{},Y=(a,z)=>{y(a,z==="ASC"?"DESC":"ASC")},B=a=>{k(a)},P=a=>e.jsx(rt,{className:"queryName",onClick:()=>{_.push(`/queries/${a==null?void 0:a.id}`)},children:(a==null?void 0:a.name)||"Untitled Query"}),X=a=>Ae(a==null?void 0:a.modified),q=a=>a&&e.jsx(dt,{tags:a==null?void 0:a.tags}),G=a=>{p(a),A(!0)},J=a=>e.jsxs(Ke,{onClick:()=>G(a),className:"queryText",children:[e.jsx("span",{className:"text",children:a.queryText}),e.jsx(V,{tooltip:"Preview",children:e.jsx(Ce,{})})]}),ee=({userId:a})=>Ut(a),te=()=>{p({}),A(!1)},ne=()=>w-m-230||300,Z=a=>e.jsxs(e.Fragment,{children:[!x&&e.jsx(V,{onClick:()=>G(a),tooltip:i.VIEW_QUERY,children:e.jsx(Ce,{})}),x&&e.jsx(V,{onClick:()=>{_.push(`/queries/${a.id}`)},tooltip:i.VIEW_IN_EDITOR,children:e.jsx(be,{})})]}),W=()=>e.jsxs(e.Fragment,{children:[((s==null?void 0:s.tagValue)||(s==null?void 0:s.searchPattern))&&e.jsx(et,{popularTags:O,queryParams:s,loading:E,onTagChange:f,resetTags:C}),e.jsx(Le,{imgPath:gt,imgPathWebp:ht,title:!(s!=null&&s.tagValue)&&!(s!=null&&s.searchPattern)?i.NO_ORG_QUERY_FOUND:i.NO_RESULT_FOUND_ON_FILTER,className:"emptyBlock"})]}),$=()=>e.jsx(Me,{title:N,children:N});return Q===0&&!S&&!N?W():N?$():e.jsxs("div",{children:[e.jsx(et,{popularTags:O,queryParams:s,loading:E,onTagChange:f,resetTags:C}),e.jsx(ze,{open:r,queryPreview:j,id:j==null?void 0:j.id,text:j==null?void 0:j.queryText,onClose:te}),e.jsx(Ve,{data:o,columns:wt,isAction:!0,actionComponent:a=>Z(a),actionColumnName:"Actions",rowRender:[{dataKey:"userId",func:ee},{dataKey:"name",func:P},{dataKey:"modified",func:X},{dataKey:"tags",func:q},{dataKey:"queryText",func:J}],loading:S,rowSize:75,bodyHeight:ne(),onItemsSort:Y,sortBy:(s==null?void 0:s.sortBy)||"",sortOrder:(s==null?void 0:s.sortOrder)||"",nonSortableColumns:{tags:!0}}),(S?!0:(o==null?void 0:o.length)!==0)&&e.jsx(Ye,{onChange:B,count:Q,page:(s==null?void 0:s.pageNo)||0,onPageChange:K,totalElements:L,onPageSizeChange:R,isGotoPage:!0,isPageSize:!0,pageSize:(s==null?void 0:s.pageSize)||0,defaultSize:d})]})}const mn=({tab:s})=>{var ue,xe;const y=Te(),{search:K}=At(),R=it(n=>n.isLoggedIn),f=g.useRef(null),C=g.useRef(null),d=new URLSearchParams(K),_=(d==null?void 0:d.get("sortBy"))||"",x=(d==null?void 0:d.get("sortOrder"))||"",O=(d==null?void 0:d.get("searchPattern"))||"",D=(d==null?void 0:d.get("visibility"))||"",{height:E,headerHeight:w,width:m}=ye(),N=lt(),I=ct(),[o,u]=g.useState({}),[t,S]=g.useState({from:"",to:"",duration:0}),[r,A]=g.useState(Lt.trending),[j,p]=g.useState(""),[Q,L]=g.useState(null),Y=()=>{let n={..._e(o)};s===T.myQueries&&(n={...n,scope:Oe.private}),s===T.myOrgQuery&&(n={...n,scope:Oe.subscription,visibility:h.subscription}),delete n.isRecent,n=je.stringify({...n},{arrayFormat:"bracket"}),y.push(`/${s==null?void 0:s.toLowerCase()}?${n}`),s===T.queryHistory?pn({params:n,abortController:C,isRecent:(o==null?void 0:o.isRecent)==="true"}):s===T.myQueries?fn({params:n,isLoggedIn:R,abortController:C}):Sn({params:n,isLoggedIn:R,abortController:C})};g.useEffect(()=>{let n=_;n||(n="modified"),s===T.queryHistory&&n==="modified"&&(n="timestamp"),u({pageSize:d!=null&&d.get("pageSize")?Number(d==null?void 0:d.get("pageSize")):50,pageNo:d!=null&&d.get("pageNo")?Number(d==null?void 0:d.get("pageNo")):1,sortOrder:x||"DESC",sortBy:n||"",visibility:D,searchPattern:O||"",isRecent:s===T.queryHistory?"true":""})},[s]),g.useEffect(()=>{var n;fe.isEmpty(o)||(ln(!0),C!=null&&C.current&&((n=C==null?void 0:C.current)==null||n.abort()),setTimeout(Y,200))},[o,r]),g.useEffect(()=>{t!=null&&t.from&&(t!=null&&t.to)&&u(n=>({...n,pageNo:1,from:t.from,to:t.to}))},[t]);const B=n=>{var U,c;const l=n.target.value;(U=f==null?void 0:f.current)!=null&&U.value&&((c=f==null?void 0:f.current)==null?void 0:c.value)!==""&&(f.current.value="");let v={..._e({...o,pageSize:50,pageNo:1,searchPattern:"",visibility:l===T.myOrgQuery?h.subscription:"",scope:l===T.myOrgQuery?Oe.subscription:"",sortBy:"",sortOrder:"",isRecent:l===T.queryHistory?"false":""})};if(l===T.views){y.push(`/${l}`);return}v=je.stringify({...v},{arrayFormat:"bracket"}),y.push(`/${l==null?void 0:l.toLowerCase()}?${v}`),S({from:"",to:"",duration:0})},P=async()=>{let{pageNo:n=1}=o;n-=(N==null?void 0:N.length)===1&&(o!=null&&o.pageNo)&&(o==null?void 0:o.pageNo)>1?1:0,u(l=>({...l,pageNo:n}))},X=(n,l)=>{En(n,()=>{Kt(n),P()},l)},q=n=>{var v,U,c;let l=((c=(U=(v=n==null?void 0:n.target)==null?void 0:v.value)==null?void 0:U.toString())==null?void 0:c.trim())||"";l=Vt(l),u(H=>({...H,pageNo:1,searchPattern:l||""}))},G=n=>{var v;const l=(v=n==null?void 0:n.target)==null?void 0:v.value;u(U=>({...U,pageNo:1,visibility:l}))},J=fe.debounce(q,500),ee=n=>{u(l=>({...l,pageNo:1,tagValue:l.tagValue===(n==null?void 0:n.value)?"":n==null?void 0:n.value}))},te=()=>{o!=null&&o.tagValue&&u(n=>({...n,pageNo:1,tagValue:""}))},ne=E-w||500,Z=()=>{var n,l;return s===T.myQueries?!fe.isEmpty(N)||!!((n=o==null?void 0:o.searchPattern)!=null&&n.length):s===T.queryHistory?!fe.isEmpty(I)||!!((l=o==null?void 0:o.searchPattern)!=null&&l.length):!1},W=(n,l)=>{n&&l&&u(v=>({...v,pageNo:1,sortOrder:l,sortBy:n}))},$=n=>{u(l=>({...l,pageNo:n}))},a=n=>{u(l=>({...l,pageNo:n}))},z=n=>{u(l=>({...l,pageSize:n,pageNo:1}))},se=()=>{f.current&&(f.current.value=""),u(n=>({...n,pageNo:1,searchPattern:""}))},ae=n=>{u(l=>({...l,isRecent:n,from:"",to:"",searchPattern:""})),p(""),S({from:"",to:"",duration:0})},oe=n=>{S(l=>({...l,...n}))},Re=n=>{p(n),L(null)},he=n=>{var U;let l=((U=n==null?void 0:n.target)==null?void 0:U.value)||0;if(l=Number(l),Ie.filter(c=>c.value===l).length){const{from:c,to:H}=Yt(Number(l));S({from:c,to:H,duration:l})}},me=async n=>{const l=je.stringify(_e({...o}));n===h.public?y.push(de.exploreQuery(l)):n===h.subscription?y.push(de.myOrgQuery(l)):y.push(de.myqueries(l))};return e.jsx(g.Suspense,{fallback:rn,children:e.jsx(dn,{height:ne,children:e.jsxs("main",{className:"mainContent",children:[Z()&&m<ce.breakpoints.values.md&&e.jsx(M,{variant:"text",className:"createMobileBtn",children:e.jsx(Ne,{to:"/queries/new?tabID=1",onClick:n=>{n.ctrlKey||n.metaKey||n.altKey||n.shiftKey||n.button||n.defaultPrevented||Xe(1)},children:e.jsx(Je,{})})}),e.jsxs("div",{className:"boxContent",children:[m<ce.breakpoints.values.md?e.jsx(tt,{className:"pageMobileToolbar",children:e.jsx("div",{className:"pageMobileTopBar",children:e.jsxs(gn,{children:[e.jsx(De,{value:s,onChange:B,children:Mt.map(n=>e.jsx(hn,{value:n.value,children:n.label},n.value))}),e.jsxs(nt,{className:"searchField",children:[e.jsx(He,{placeholder:i.SEARCH_ELIPSIS_CONTEXT(i.QUERIES),onChange:J,defaultValue:(o==null?void 0:o.searchPattern)||"",inputRef:f}),e.jsx("span",{className:"searchIcon",children:(o==null?void 0:o.searchPattern)!==""?e.jsx(st,{fontSize:"small",className:"clearSearch",onClick:se}):e.jsx(Ze,{})})]}),s===T.myQueries&&e.jsx(ot,{visibility:o==null?void 0:o.visibility,onFilterChange:G})]})})}):e.jsxs(tt,{className:"pageToolbar",children:[e.jsxs(kt,{value:s,exclusive:!0,onChange:B,children:[R&&e.jsx(Se,{size:"small",className:"tabButton",value:"myQueries","aria-label":"My Queries",children:i.MY_SAVED_QUERIES}),R&&e.jsx(Se,{size:"small",className:"tabButton",value:"subscription","aria-label":"My Org Queries",children:i.MY_ORG_QUERIES}),R&&e.jsx(Se,{size:"small",className:"tabButton",value:"queryHistory","aria-label":"Query history",children:`${i.QUERY_HISTORY}`}),R&&e.jsx(Se,{size:"small",className:"tabButton",value:"views","aria-label":"Views",children:i.VIEWS})]}),e.jsxs("div",{className:"toolbarRight",children:[e.jsxs(nt,{className:"searchField",children:[e.jsx(He,{placeholder:i.SEARCH_ELIPSIS_CONTEXT(i.QUERIES),onChange:J,defaultValue:(o==null?void 0:o.searchPattern)||"",inputRef:f}),e.jsx("span",{className:"searchIcon",children:(o==null?void 0:o.searchPattern)!==""?e.jsx(st,{fontSize:"small",className:"clearSearch",onClick:se}):e.jsx(Ze,{})})]}),s===T.myQueries&&e.jsx(ot,{visibility:o==null?void 0:o.visibility,onFilterChange:G}),Z()&&e.jsx(M,{color:"primary",variant:"contained",className:"createQueryBtn",children:e.jsxs(Ne,{to:"/queries/new?tabID=1",onClick:n=>{n.ctrlKey||n.metaKey||n.altKey||n.shiftKey||n.button||n.defaultPrevented||Xe(1)},children:[e.jsx("span",{className:"iconLeft addIcon",children:e.jsx(Je,{})}),i.CREATE_NEW_QUERY]})})]})]}),s===T.queryHistory&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"filterToolbar",children:[e.jsxs("div",{className:"toggleBlock",children:[e.jsxs(at,{variant:"contained",className:"isRecentToggle",children:[e.jsx(M,{variant:"contained",onClick:()=>(o==null?void 0:o.isRecent)==="false"&&ae("true"),color:(o==null?void 0:o.isRecent)==="true"?"primary":"secondary",children:i.CURRENT_HISTORY}),e.jsx(M,{variant:"contained",onClick:()=>{(o==null?void 0:o.isRecent)==="true"&&ae("false")},color:(o==null?void 0:o.isRecent)==="false"?"primary":"secondary",children:i.HISTORICAL_HISTORY})]}),(o==null?void 0:o.isRecent)==="true"&&e.jsx(ge,{message:i.CURRENT_QUERY_TEXT}),(o==null?void 0:o.isRecent)==="false"&&!(t!=null&&t.from)&&!(t!=null&&t.to)&&e.jsx(ge,{message:i.HISTORICAL_WITHOUT_FILTER_QUERY_TEXT}),(o==null?void 0:o.isRecent)==="false"&&(t==null?void 0:t.from)&&(t==null?void 0:t.to)&&e.jsx(ge,{message:i.HISTORICAL_QUERY_TEXT(Ue.utc(t==null?void 0:t.from).local().format("D MMM"),Ue.utc(t==null?void 0:t.to).local().format("D MMM"))})]}),e.jsx("div",{className:"filterBlock",children:(o==null?void 0:o.isRecent)==="false"&&e.jsxs(e.Fragment,{children:[j==="Duration"&&m>ce.breakpoints.values.md&&e.jsx("div",{className:"durationSelect",children:e.jsxs(De,{name:"analytics",value:t==null?void 0:t.duration,onChange:n=>{he(n)},label:i.USAGE_OF_LAST,children:[e.jsx(le,{value:0,className:"selectPlaceholder",children:i.SELECT_DURATION}),(ue=Ie)==null?void 0:ue.map(n=>e.jsx(le,{value:n==null?void 0:n.value,selected:(n==null?void 0:n.value)===(t==null?void 0:t.duration),children:e.jsx("div",{className:"optionText",children:n.label})},n==null?void 0:n.value))]})}),j==="Range"&&m>ce.breakpoints.values.md&&e.jsxs(e.Fragment,{children:[e.jsx(Ee,{selectedDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",onDateChange:n=>{oe({from:new Date(n).toISOString()})},startDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",endDate:t!=null&&t.to?new Date(t==null?void 0:t.to):"",shouldConvert:!0,label:i.FROM,maxDate:t!=null&&t.to?new Date(t==null?void 0:t.to):new Date,selectsStart:!0}),e.jsx(Ee,{selectedDate:t!=null&&t.to?new Date(t==null?void 0:t.to):"",onDateChange:n=>{oe({to:new Date(n).toISOString()})},minDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",maxDate:new Date,label:i.TO,startDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",endDate:t!=null&&t.to?new Date(t==null?void 0:t.to):"",selectsEnd:!0,addForward:!0,shouldConvert:!0})]}),(t==null?void 0:t.from)&&(t==null?void 0:t.to)&&e.jsx(V,{tooltip:i.RESET_FILTER,onClick:()=>ae("false"),className:"resetBtn",children:e.jsx(un,{})}),e.jsx(V,{tooltip:i.FILTER,onClick:n=>L(n.currentTarget),className:"filterBtn",children:e.jsx(xn,{})}),e.jsx(Bt,{anchorEl:Q,open:!!Q,onClose:()=>L(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:zt.map(({value:n})=>e.jsx(le,{selected:n===j,onClick:()=>Re(n),children:n},n))})]})})]}),m<ce.breakpoints.values.md&&e.jsxs("div",{className:"responsiveFilter",children:[j==="Duration"&&e.jsx("div",{className:"durationSelect",children:e.jsxs(De,{name:"analytics",value:t==null?void 0:t.duration,onChange:n=>{he(n)},label:i.USAGE_OF_LAST,children:[e.jsx(le,{value:0,className:"selectPlaceholder",children:i.SELECT_DURATION}),(xe=Ie)==null?void 0:xe.map(n=>e.jsx(le,{value:n==null?void 0:n.value,selected:(n==null?void 0:n.value)===(t==null?void 0:t.duration),children:e.jsx("div",{className:"optionText",children:n.label})},n==null?void 0:n.value))]})}),j==="Range"&&e.jsxs(e.Fragment,{children:[e.jsx(Ee,{selectedDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",onDateChange:n=>{oe({from:new Date(n).toISOString()})},startDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",endDate:t!=null&&t.to?new Date(t==null?void 0:t.to):"",shouldConvert:!0,label:i.FROM,maxDate:t!=null&&t.to?new Date(t==null?void 0:t.to):new Date,selectsStart:!0}),e.jsx(Ee,{selectedDate:t!=null&&t.to?new Date(t==null?void 0:t.to):"",onDateChange:n=>{oe({to:new Date(n).toISOString()})},minDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",maxDate:new Date,label:i.TO,startDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",endDate:t!=null&&t.to?new Date(t==null?void 0:t.to):"",selectsEnd:!0,addForward:!0,shouldConvert:!0})]})]})]}),s===T.myQueries&&e.jsx(yn,{queryParams:o,setPageNumber:$,setSortBy:W,onPageChange:a,onPageSizeChange:z,deleteQuery:X,defaultSize:50,handlePublishCallback:me}),s===T.myOrgQuery&&e.jsx(Rn,{queryParams:o,setPageNumber:$,setSortBy:W,onPageChange:a,onPageSizeChange:z,deleteQuery:X,onTagChange:ee,resetTags:te,defaultSize:50}),s===T.queryHistory&&e.jsx(Tn,{queryParams:o,setPageNumber:$,setSortBy:W,onPageChange:a,onPageSizeChange:z,defaultSize:50})]})]})})})},_n=Ht.memo(mn);export{_n as default};
|
|
1
|
+
import{iD as Ue,oP as Et,r as g,a9 as Te,k as e,an as Qe,b8 as i,eg as We,oQ as jt,ed as Ae,oR as Ct,oS as Nt,cV as Ce,ew as be,eX as Le,am as Ne,mV as $e,dL as Me,dW as ve,oT as Tt,oU as bt,oV as yt,eI as h,e$ as at,aa as Rt,dM as de,f1 as mt,bx as Qt,o6 as vt,a_ as Dt,eK as It,bd as it,c_ as _t,cM as je,fn as Ot,oW as wt,fg as Ut,R as Ht,as as At,fr as Lt,oo as T,au as fe,dv as ce,fF as Xe,eY as Je,bH as De,op as Mt,eV as Ze,fA as kt,fB as Se,ad as le,cE as Ie,aX as Bt,cF as zt,eU as _e,eT as Oe,fC as Vt,cI as Yt,oX as Kt}from"./vendor-charts-a85b2946.js";import{u as ye,b as Gt,c as Wt,d as ct,e as ke,f as Be,r as Fe,g as ze,C as Pe,h as qe,M as $t,V as Ve,P as Ye,i as Xt,H as Jt,j as Ke,I as V,B as M,k as Zt,l as Ft,m as Pt,n as He,N as we,o as ge,L as qt,p as en,s as re,q as tn,t as nn,v as lt,w as rt,T as dt,x as sn,y as gt,z as ht,A as on,D as an,F as cn,G as et,J as ln,O as rn,K as dn,R as tt,S as gn,W as hn,U as nt,X as st,Y as ot,Z as Ee,_ as un,$ as xn,a0 as pn,a1 as fn,a2 as Sn,a3 as En}from"./index-f575fb85.js";import"./vendor-editor-3dd5e143.js";import"./vendor-three-43ec9d9f.js";const jn="/assets/emptyHistory-39807386.png",Cn="/assets/emptyHistory-e09c1ac9.webp",Nn="/assets/heartbeat-d012a4c0.png";Ue.extend(Et);function Tn({queryParams:s,setSortBy:k,setPageNumber:y,onPageChange:K,onPageSizeChange:R,defaultSize:f}){var l,v,U;const{height:C,headerHeight:d}=ye(),[_,x]=g.useState(!1),[O,D]=g.useState([]),[E,w]=g.useState(null),[m,N]=g.useState({areaChartConfig:[],lineChartConfig:[]}),[I,o]=g.useState(0),u=(l=Object.keys(m))==null?void 0:l.length,t=Gt(),S=Wt(),r=ct(),A=ke(),j=Be(),p=A||j,{totalPages:Q=0,totalElements:L=0}=(S==null?void 0:S.pageable)||{},Y=Te();g.useEffect(()=>()=>Fe(),[]),g.useEffect(()=>{var c,H,F,ie,Ge;if((c=r==null?void 0:r.content)!=null&&c.length){const ut=(H=r==null?void 0:r.content)==null?void 0:H.map(b=>b==null?void 0:b.queryType),pe={};(ut??[]).forEach(b=>{pe[b]?pe[b]+=1:pe[b]=1});const xt=(F=Object.entries(pe))==null?void 0:F.map(([b,St])=>({Source:b,Trafic:St}));D(xt);const pt=(ie=r==null?void 0:r.content)==null?void 0:ie.map(b=>({Timestamp:b.timestamp,Usage:b.usage,Runtime:b.runtime})),ft=(Ge=r==null?void 0:r.content)==null?void 0:Ge.map(b=>({Timestamp:b.timestamp,Usage:b.usage,DataVolume:b.responseSize}));N({areaChartConfig:pt,lineChartConfig:ft}),(s==null?void 0:s.isRecent)==="false"&&o(0)}else D([])},[r==null?void 0:r.content,s]);const B=c=>y(c),P=(c,H)=>{if(c==="systemHeartbeat"||c==="CPUSkew")return;const F=H==="ASC"?"DESC":"ASC";Fe(),k(c,F)},X=c=>{Y.push("/queries/new?tabID=1"),$e(c)},q=c=>{w(c),x(!0)},G=()=>{w(null),x(!1)},J=({timestamp:c})=>Ae(c),ee=({runtime:c})=>Ct(c),te=({responseSize:c=0})=>Nt(c),ne=({cpuskew:c="59%"})=>e.jsx(Xt,{children:c}),Z=({systemHeartbeat:c="58"})=>e.jsxs(Jt,{children:[e.jsx("img",{src:Nn,alt:"system-heartbeat"}),e.jsx("span",{children:c})]}),W=c=>e.jsx("span",{className:"text",children:c.queryType?c.queryType:"-"}),$=c=>e.jsx("span",{className:"text",children:c!=null&&c.usage?c.usage:"-"}),a=c=>e.jsxs(Ke,{onClick:()=>q(c),className:"queryText",children:[e.jsx("span",{className:"text",children:c.sqlText}),e.jsx(V,{tooltip:"Preview",children:e.jsx(Ce,{})})]}),z=c=>e.jsx(V,{onClick:()=>{X(c)},tooltip:i.VIEW_IN_EDITOR,children:e.jsx(be,{})}),se=()=>e.jsx(Le,{imgPath:jn,imgPathWebp:Cn,title:!(s!=null&&s.tagName)&&!(s!=null&&s.searchKeyword)?i.EMPTY_QUERY_HISTORY:i.NO_RESULT_FOUND_ON_FILTER,children:!(s!=null&&s.tagName)&&!(s!=null&&s.searchKeyword)&&e.jsx(Ne,{to:"/queries/new?tabID=1",children:e.jsx(M,{variant:"contained",color:"primary",size:"large",children:i.CREATE_NEW_QUERY})})}),ae=()=>C-d-230||300,oe=()=>{E&&$e(E)},Re=()=>e.jsx(Me,{title:t,children:t});if((S==null?void 0:S.totalElements)===0)return se();if(t)return Re();const he=()=>{o(c=>c+1)},me=()=>{o(c=>c-1)},ue=()=>{o(0)},xe=()=>{o(u-1)},n=()=>{var ie;let c,H,F;switch(I){case 1:I===1&&(c="Usage and Data Volume Variation over time",H=ve.column_chart,F=yt);break;default:c="Usage and Runtime Trends Over Time",H=ve.area_chart,F=bt}return console.log("queryHistory",r.content),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"cardHead",children:[e.jsx("span",{className:"cardHeadTitle",children:c}),e.jsx("span",{className:"cardHeadCount",children:(ie=r==null?void 0:r.content)==null?void 0:ie.length})]}),e.jsx("div",{className:"cardBody",children:e.jsx(We,{isRunning:p,config:qe({data:H===ve.area_chart?m.areaChartConfig:m.lineChartConfig,chartConfigurationData:F}).config,type:H})})]})};return e.jsxs(e.Fragment,{children:[e.jsx(ze,{open:_,id:E==null?void 0:E.savedQueryId,text:E==null?void 0:E.sqlText,onClose:G,onClickView:oe,isHistory:!0}),(p||((v=r==null?void 0:r.content)==null?void 0:v.length)>0)&&(s==null?void 0:s.isRecent)==="false"&&e.jsxs(Qe,{container:!0,spacing:{xs:1,sm:3},children:[e.jsx(Qe,{item:!0,sm:5,xs:12,children:e.jsxs(Pe,{children:[e.jsxs("div",{className:"cardHead",children:[e.jsx("span",{className:"cardHeadTitle",children:i.TOTAL_QUERIES}),e.jsx("span",{className:"cardHeadCount",children:(U=r==null?void 0:r.content)==null?void 0:U.length})]}),e.jsx("div",{className:"cardBody",children:e.jsx(We,{isRunning:p,config:qe({data:O,chartConfigurationData:Tt}).config,type:"pie_chart"})})]})}),e.jsx(Qe,{item:!0,sm:7,xs:12,children:e.jsxs(Pe,{children:[n(),!p&&e.jsx($t,{maxSteps:u,activeStep:I,handleFirst:ue,handleLast:xe,handleNext:he,handlePrev:me})]})})]}),e.jsx(Ve,{data:r==null?void 0:r.content,columns:jt,isAction:!0,actionComponent:c=>z(c),loading:p,rowRender:[{dataKey:"sqlText",func:a},{dataKey:"timestamp",func:J},{dataKey:"runtime",func:ee},{dataKey:"responseSize",func:te},{dataKey:"systemHeartbeat",func:Z},{dataKey:"CPUSkew",func:ne},{dataKey:"queryType",func:W},{dataKey:"usage",func:$}],rowSize:75,bodyHeight:ae(),onItemsSort:P,sortBy:s==null?void 0:s.sortBy,sortOrder:(s==null?void 0:s.sortOrder)||""}),(p?!0:(r==null?void 0:r.length)!==0)&&e.jsx(Ye,{onChange:B,count:Q,page:s.pageNo,onPageChange:K,totalElements:L,onPageSizeChange:R,isGotoPage:!0,isPageSize:!0,pageSize:s.pageSize,defaultSize:f})]})}const bn=s=>{const{row:k,handleClose:y,handlePublishCallback:K,open:R}=s,{id:f,queryName:C,visibility:d,slug:_}=k||{},[x,O]=g.useState(""),[D,E]=g.useState(!1),[w,m]=g.useState(!1),[N,I]=g.useState(!1),o=Zt()||(k==null?void 0:k.visibility),u=g.useRef(null),t=d===h.public;g.useEffect(()=>{if(R&&d===h.public){const p=window.location.origin+de.queriesSlug(f,_);O(p)}else O(""),I(!1),u.current=null},[R]);const S=p=>{var Y,B;const Q=((B=(Y=p==null?void 0:p.target)==null?void 0:Y.value)==null?void 0:B.trim())||"",L=(Q==null?void 0:Q.length)>0&&mt(Q);E(L),Q!==x&&O(Q)},r=async()=>{m(!0),await en(f,C,x,o,K)===i.RESPONSE_SUCCESS_STATUS&&y(),m(!1)},A=p=>{switch(p){case h.public:re(h.public);break;case h.private:re(h.private);break;case h.subscription:re(h.subscription);break;default:re(h.private)}},j=()=>{Qt(x).then(()=>{I(!0)})};return e.jsx(Ft,{title:i.QUERY_PUBLISH,visible:R,maxWidth:"sm",onClose:y,children:e.jsxs(Pt,{children:[e.jsxs("div",{className:"visibilityCheck",children:[e.jsx("div",{className:"label",children:"Choose the visibility for your query"}),e.jsxs(at,{variant:"contained",className:`isPublicCheck ${d===h.public&&"disabled"}`,children:[e.jsx(M,{variant:"contained",onClick:()=>{A(h.private)},color:o===h.public||o===h.subscription?"secondary":"primary",disabled:d===h.public,children:i.PRIVATE}),e.jsx(M,{variant:"contained",onClick:()=>{A(h.subscription)},color:o===h.subscription?"primary":"secondary",disabled:d===h.public,children:i.PRIVATE_TO_MY_ORG}),e.jsx(M,{variant:"contained",onClick:()=>{A(h.public)},color:o===h.public?"primary":"secondary",children:i.PUBLIC})]})]}),o===h.public&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"slugInput",children:e.jsx(He,{autoFocus:!0,label:"Unique Query Name",required:!0,placeholder:"Enter slug name",ishelpertext:1,helperText:!t&&`${x==null?void 0:x.length}/${we}`,value:x,warningText:!t&&i.MAX_LENGTH_ERROR("slug name",we),hasMax:!0,maxValue:we,onChange:S,errorText:D&&i.VIEW_NAME_ERROR("Slug"),ref:u,inputProps:{readOnly:t},endAdornment:_?e.jsx(Rt,{position:"end",children:e.jsx(V,{onClick:()=>window.open(window.location.origin+de.queriesSlug(f,_),"_blank"),children:e.jsx(be,{})})}):null})}),t&&e.jsx(ge,{message:i.PUBLISHED_TEXT("query")}),o===h.public&&!t&&e.jsx(ge,{message:i.PUBLISH_CONFIRM_MESSAGE("Query")})]}),e.jsxs("div",{className:"btnRow",children:[e.jsx(M,{disabled:w,variant:"contained",color:"secondary",onClick:y,className:"formBtn cancel",children:i.CANCEL}),!t&&e.jsx(M,{disabled:D||(x==null?void 0:x.length)>=50||w||o===h.public&&!(x!=null&&x.trim()),variant:"contained",color:"primary",onClick:r,className:"formBtn submit",children:w?e.jsx("img",{src:qt,alt:"loading",height:36}):i.SUBMIT}),t&&e.jsx(M,{type:"button",variant:"contained",color:"primary",onClick:j,children:N?i.COPIED:i.COPY_LINK})]})]})})};function yn({queryParams:s,setPageNumber:k,setSortBy:y,onPageChange:K,onPageSizeChange:R,deleteQuery:f,defaultSize:C,handlePublishCallback:d}){const _=Te(),{height:x,headerHeight:O}=ye(),D=tn(),E=nn(),{totalPages:w=0,totalElements:m=0}=(E==null?void 0:E.pageable)||{},N=lt(),I=ke(),o=Be(),u=I||o,[t,S]=g.useState(!1),[r,A]=g.useState({}),[j,p]=g.useState(!1),[Q,L]=g.useState({}),Y=(a,z)=>{y(a,z==="ASC"?"DESC":"ASC")},B=a=>k(a),P=a=>e.jsx(rt,{className:"queryName",onClick:()=>{_.push(`/queries/${a.id}`)},children:(a==null?void 0:a.name)||"Untitled Query"}),X=a=>a&&Ae(a==null?void 0:a.modified),q=a=>a&&e.jsx(dt,{tags:a==null?void 0:a.tags}),G=a=>{A(a),S(!0)},J=a=>e.jsxs(Ke,{onClick:()=>G(a),className:"queryText",children:[e.jsx("span",{className:"text",children:a.queryText}),e.jsx(V,{tooltip:"Preview",children:e.jsx(Ce,{})})]}),ee=()=>x-O-170||300,te=()=>{p(!1),L({}),re("")},ne=a=>e.jsxs(e.Fragment,{children:[e.jsx(Dt,{label:(a==null?void 0:a.visibility)===h.public?i.PUBLISHED:i.PUBLISH("Query"),children:e.jsx("span",{className:"publishBtn",children:e.jsx(V,{onClick:()=>{p(!0),L(a)},children:e.jsx(It,{})})})}),e.jsx(V,{onClick:()=>{_.push(`/queries/${a.id}`)},tooltip:"View",children:e.jsx(be,{})}),e.jsx(sn,{icon:!0,confirmButtonMessage:i.YES,cancelButtonMessage:i.NO,disabled:a.visibility===h.public,tooltip:i.DELETE(""),title:i.DELETE("Query"),confirmMessage:i.DELETE_CONFIRM_MESSAGE(`'${a.name||""}' query`),description:i.DELETE_QUERY_DESCRIPTION,onConfirm:z=>{z.stopPropagation(),f(a.id,a.name)}},"expire")]}),Z=()=>e.jsx(Le,{imgPath:gt,imgPathWebp:ht,title:!(s!=null&&s.tagName)&&!(s!=null&&s.searchPattern)&&!(s!=null&&s.status)?i.NO_QUERY_FOUND:i.NO_RESULT_FOUND_ON_FILTER,className:"emptyBlock",children:!(s!=null&&s.tagName)&&!(s!=null&&s.searchPattern)&&e.jsx(Ne,{to:"/queries/new?tabID=1",children:e.jsx(M,{variant:"contained",color:"primary",size:"large",children:i.CREATE_NEW_QUERY})})}),W=()=>e.jsx(Me,{title:D,children:D});if(w===0&&!u&&!D)return Z();if(D)return W();const $=()=>{A({}),S(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(ze,{open:t,id:r==null?void 0:r.id,text:r==null?void 0:r.queryText,queryPreview:r,onClose:$}),e.jsx(Ve,{data:N,columns:vt,isAction:!0,actionComponent:ne,actionColumnName:"Actions",rowRender:[{dataKey:"name",func:P},{dataKey:"modified",func:X},{dataKey:"tags",func:q},{dataKey:"queryText",func:J}],loading:u,rowSize:75,bodyHeight:ee(),onItemsSort:Y,sortBy:(s==null?void 0:s.sortBy)||"",sortOrder:(s==null?void 0:s.sortOrder)||"",nonSortableColumns:{tags:!0}}),(u?!0:(N==null?void 0:N.length)!==0)&&e.jsx("div",{className:"queryPagePagination",children:e.jsx(Ye,{onChange:B,count:w,page:(s==null?void 0:s.pageNo)||0,onPageChange:K,totalElements:m,onPageSizeChange:R,isGotoPage:!0,isPageSize:!0,pageSize:(s==null?void 0:s.pageSize)||0,defaultSize:C})}),e.jsx(bn,{open:j,handleClose:te,row:Q,handlePublishCallback:d})]})}function Rn({queryParams:s,setPageNumber:k,setSortBy:y,onPageChange:K,onPageSizeChange:R,onTagChange:f,resetTags:C,defaultSize:d}){const _=Te(),x=it(a=>a.isLoggedIn),{data:O,error:D}=_t.useGetPopularTags(je.stringify({entityType:Ot.SAVEDQUERY_TAG_TYPE}),x),E=!O&&!D,{height:w,headerHeight:m}=ye(),N=on(),I=an(),o=cn(),u=ke(),t=Be(),S=u||t,[r,A]=g.useState(!1),[j,p]=g.useState({}),{totalPages:Q=0,totalElements:L=0}=(I==null?void 0:I.pageable)||{},Y=(a,z)=>{y(a,z==="ASC"?"DESC":"ASC")},B=a=>{k(a)},P=a=>e.jsx(rt,{className:"queryName",onClick:()=>{_.push(`/queries/${a==null?void 0:a.id}`)},children:(a==null?void 0:a.name)||"Untitled Query"}),X=a=>Ae(a==null?void 0:a.modified),q=a=>a&&e.jsx(dt,{tags:a==null?void 0:a.tags}),G=a=>{p(a),A(!0)},J=a=>e.jsxs(Ke,{onClick:()=>G(a),className:"queryText",children:[e.jsx("span",{className:"text",children:a.queryText}),e.jsx(V,{tooltip:"Preview",children:e.jsx(Ce,{})})]}),ee=({userId:a})=>Ut(a),te=()=>{p({}),A(!1)},ne=()=>w-m-230||300,Z=a=>e.jsxs(e.Fragment,{children:[!x&&e.jsx(V,{onClick:()=>G(a),tooltip:i.VIEW_QUERY,children:e.jsx(Ce,{})}),x&&e.jsx(V,{onClick:()=>{_.push(`/queries/${a.id}`)},tooltip:i.VIEW_IN_EDITOR,children:e.jsx(be,{})})]}),W=()=>e.jsxs(e.Fragment,{children:[((s==null?void 0:s.tagValue)||(s==null?void 0:s.searchPattern))&&e.jsx(et,{popularTags:O,queryParams:s,loading:E,onTagChange:f,resetTags:C}),e.jsx(Le,{imgPath:gt,imgPathWebp:ht,title:!(s!=null&&s.tagValue)&&!(s!=null&&s.searchPattern)?i.NO_ORG_QUERY_FOUND:i.NO_RESULT_FOUND_ON_FILTER,className:"emptyBlock"})]}),$=()=>e.jsx(Me,{title:N,children:N});return Q===0&&!S&&!N?W():N?$():e.jsxs("div",{children:[e.jsx(et,{popularTags:O,queryParams:s,loading:E,onTagChange:f,resetTags:C}),e.jsx(ze,{open:r,queryPreview:j,id:j==null?void 0:j.id,text:j==null?void 0:j.queryText,onClose:te}),e.jsx(Ve,{data:o,columns:wt,isAction:!0,actionComponent:a=>Z(a),actionColumnName:"Actions",rowRender:[{dataKey:"userId",func:ee},{dataKey:"name",func:P},{dataKey:"modified",func:X},{dataKey:"tags",func:q},{dataKey:"queryText",func:J}],loading:S,rowSize:75,bodyHeight:ne(),onItemsSort:Y,sortBy:(s==null?void 0:s.sortBy)||"",sortOrder:(s==null?void 0:s.sortOrder)||"",nonSortableColumns:{tags:!0}}),(S?!0:(o==null?void 0:o.length)!==0)&&e.jsx(Ye,{onChange:B,count:Q,page:(s==null?void 0:s.pageNo)||0,onPageChange:K,totalElements:L,onPageSizeChange:R,isGotoPage:!0,isPageSize:!0,pageSize:(s==null?void 0:s.pageSize)||0,defaultSize:d})]})}const mn=({tab:s})=>{var ue,xe;const y=Te(),{search:K}=At(),R=it(n=>n.isLoggedIn),f=g.useRef(null),C=g.useRef(null),d=new URLSearchParams(K),_=(d==null?void 0:d.get("sortBy"))||"",x=(d==null?void 0:d.get("sortOrder"))||"",O=(d==null?void 0:d.get("searchPattern"))||"",D=(d==null?void 0:d.get("visibility"))||"",{height:E,headerHeight:w,width:m}=ye(),N=lt(),I=ct(),[o,u]=g.useState({}),[t,S]=g.useState({from:"",to:"",duration:0}),[r,A]=g.useState(Lt.trending),[j,p]=g.useState(""),[Q,L]=g.useState(null),Y=()=>{let n={..._e(o)};s===T.myQueries&&(n={...n,scope:Oe.private}),s===T.myOrgQuery&&(n={...n,scope:Oe.subscription,visibility:h.subscription}),delete n.isRecent,n=je.stringify({...n},{arrayFormat:"bracket"}),y.push(`/${s==null?void 0:s.toLowerCase()}?${n}`),s===T.queryHistory?pn({params:n,abortController:C,isRecent:(o==null?void 0:o.isRecent)==="true"}):s===T.myQueries?fn({params:n,isLoggedIn:R,abortController:C}):Sn({params:n,isLoggedIn:R,abortController:C})};g.useEffect(()=>{let n=_;n||(n="modified"),s===T.queryHistory&&n==="modified"&&(n="timestamp"),u({pageSize:d!=null&&d.get("pageSize")?Number(d==null?void 0:d.get("pageSize")):50,pageNo:d!=null&&d.get("pageNo")?Number(d==null?void 0:d.get("pageNo")):1,sortOrder:x||"DESC",sortBy:n||"",visibility:D,searchPattern:O||"",isRecent:s===T.queryHistory?"true":""})},[s]),g.useEffect(()=>{var n;fe.isEmpty(o)||(ln(!0),C!=null&&C.current&&((n=C==null?void 0:C.current)==null||n.abort()),setTimeout(Y,200))},[o,r]),g.useEffect(()=>{t!=null&&t.from&&(t!=null&&t.to)&&u(n=>({...n,pageNo:1,from:t.from,to:t.to}))},[t]);const B=n=>{var U,c;const l=n.target.value;(U=f==null?void 0:f.current)!=null&&U.value&&((c=f==null?void 0:f.current)==null?void 0:c.value)!==""&&(f.current.value="");let v={..._e({...o,pageSize:50,pageNo:1,searchPattern:"",visibility:l===T.myOrgQuery?h.subscription:"",scope:l===T.myOrgQuery?Oe.subscription:"",sortBy:"",sortOrder:"",isRecent:l===T.queryHistory?"false":""})};if(l===T.views){y.push(`/${l}`);return}v=je.stringify({...v},{arrayFormat:"bracket"}),y.push(`/${l==null?void 0:l.toLowerCase()}?${v}`),S({from:"",to:"",duration:0})},P=async()=>{let{pageNo:n=1}=o;n-=(N==null?void 0:N.length)===1&&(o!=null&&o.pageNo)&&(o==null?void 0:o.pageNo)>1?1:0,u(l=>({...l,pageNo:n}))},X=(n,l)=>{En(n,()=>{Kt(n),P()},l)},q=n=>{var v,U,c;let l=((c=(U=(v=n==null?void 0:n.target)==null?void 0:v.value)==null?void 0:U.toString())==null?void 0:c.trim())||"";l=Vt(l),u(H=>({...H,pageNo:1,searchPattern:l||""}))},G=n=>{var v;const l=(v=n==null?void 0:n.target)==null?void 0:v.value;u(U=>({...U,pageNo:1,visibility:l}))},J=fe.debounce(q,500),ee=n=>{u(l=>({...l,pageNo:1,tagValue:l.tagValue===(n==null?void 0:n.value)?"":n==null?void 0:n.value}))},te=()=>{o!=null&&o.tagValue&&u(n=>({...n,pageNo:1,tagValue:""}))},ne=E-w||500,Z=()=>{var n,l;return s===T.myQueries?!fe.isEmpty(N)||!!((n=o==null?void 0:o.searchPattern)!=null&&n.length):s===T.queryHistory?!fe.isEmpty(I)||!!((l=o==null?void 0:o.searchPattern)!=null&&l.length):!1},W=(n,l)=>{n&&l&&u(v=>({...v,pageNo:1,sortOrder:l,sortBy:n}))},$=n=>{u(l=>({...l,pageNo:n}))},a=n=>{u(l=>({...l,pageNo:n}))},z=n=>{u(l=>({...l,pageSize:n,pageNo:1}))},se=()=>{f.current&&(f.current.value=""),u(n=>({...n,pageNo:1,searchPattern:""}))},ae=n=>{u(l=>({...l,isRecent:n,from:"",to:"",searchPattern:""})),p(""),S({from:"",to:"",duration:0})},oe=n=>{S(l=>({...l,...n}))},Re=n=>{p(n),L(null)},he=n=>{var U;let l=((U=n==null?void 0:n.target)==null?void 0:U.value)||0;if(l=Number(l),Ie.filter(c=>c.value===l).length){const{from:c,to:H}=Yt(Number(l));S({from:c,to:H,duration:l})}},me=async n=>{const l=je.stringify(_e({...o}));n===h.public?y.push(de.exploreQuery(l)):n===h.subscription?y.push(de.myOrgQuery(l)):y.push(de.myqueries(l))};return e.jsx(g.Suspense,{fallback:rn,children:e.jsx(dn,{height:ne,children:e.jsxs("main",{className:"mainContent",children:[Z()&&m<ce.breakpoints.values.md&&e.jsx(M,{variant:"text",className:"createMobileBtn",children:e.jsx(Ne,{to:"/queries/new?tabID=1",onClick:n=>{n.ctrlKey||n.metaKey||n.altKey||n.shiftKey||n.button||n.defaultPrevented||Xe(1)},children:e.jsx(Je,{})})}),e.jsxs("div",{className:"boxContent",children:[m<ce.breakpoints.values.md?e.jsx(tt,{className:"pageMobileToolbar",children:e.jsx("div",{className:"pageMobileTopBar",children:e.jsxs(gn,{children:[e.jsx(De,{value:s,onChange:B,children:Mt.map(n=>e.jsx(hn,{value:n.value,children:n.label},n.value))}),e.jsxs(nt,{className:"searchField",children:[e.jsx(He,{placeholder:i.SEARCH_ELIPSIS_CONTEXT(i.QUERIES),onChange:J,defaultValue:(o==null?void 0:o.searchPattern)||"",inputRef:f}),e.jsx("span",{className:"searchIcon",children:(o==null?void 0:o.searchPattern)!==""?e.jsx(st,{fontSize:"small",className:"clearSearch",onClick:se}):e.jsx(Ze,{})})]}),s===T.myQueries&&e.jsx(ot,{visibility:o==null?void 0:o.visibility,onFilterChange:G})]})})}):e.jsxs(tt,{className:"pageToolbar",children:[e.jsxs(kt,{value:s,exclusive:!0,onChange:B,children:[R&&e.jsx(Se,{size:"small",className:"tabButton",value:"myQueries","aria-label":"My Queries",children:i.MY_SAVED_QUERIES}),R&&e.jsx(Se,{size:"small",className:"tabButton",value:"subscription","aria-label":"My Org Queries",children:i.MY_ORG_QUERIES}),R&&e.jsx(Se,{size:"small",className:"tabButton",value:"queryHistory","aria-label":"Query history",children:`${i.QUERY_HISTORY}`}),R&&e.jsx(Se,{size:"small",className:"tabButton",value:"views","aria-label":"Views",children:i.VIEWS})]}),e.jsxs("div",{className:"toolbarRight",children:[e.jsxs(nt,{className:"searchField",children:[e.jsx(He,{placeholder:i.SEARCH_ELIPSIS_CONTEXT(i.QUERIES),onChange:J,defaultValue:(o==null?void 0:o.searchPattern)||"",inputRef:f}),e.jsx("span",{className:"searchIcon",children:(o==null?void 0:o.searchPattern)!==""?e.jsx(st,{fontSize:"small",className:"clearSearch",onClick:se}):e.jsx(Ze,{})})]}),s===T.myQueries&&e.jsx(ot,{visibility:o==null?void 0:o.visibility,onFilterChange:G}),Z()&&e.jsx(M,{color:"primary",variant:"contained",className:"createQueryBtn",children:e.jsxs(Ne,{to:"/queries/new?tabID=1",onClick:n=>{n.ctrlKey||n.metaKey||n.altKey||n.shiftKey||n.button||n.defaultPrevented||Xe(1)},children:[e.jsx("span",{className:"iconLeft addIcon",children:e.jsx(Je,{})}),i.CREATE_NEW_QUERY]})})]})]}),s===T.queryHistory&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"filterToolbar",children:[e.jsxs("div",{className:"toggleBlock",children:[e.jsxs(at,{variant:"contained",className:"isRecentToggle",children:[e.jsx(M,{variant:"contained",onClick:()=>(o==null?void 0:o.isRecent)==="false"&&ae("true"),color:(o==null?void 0:o.isRecent)==="true"?"primary":"secondary",children:i.CURRENT_HISTORY}),e.jsx(M,{variant:"contained",onClick:()=>{(o==null?void 0:o.isRecent)==="true"&&ae("false")},color:(o==null?void 0:o.isRecent)==="false"?"primary":"secondary",children:i.HISTORICAL_HISTORY})]}),(o==null?void 0:o.isRecent)==="true"&&e.jsx(ge,{message:i.CURRENT_QUERY_TEXT}),(o==null?void 0:o.isRecent)==="false"&&!(t!=null&&t.from)&&!(t!=null&&t.to)&&e.jsx(ge,{message:i.HISTORICAL_WITHOUT_FILTER_QUERY_TEXT}),(o==null?void 0:o.isRecent)==="false"&&(t==null?void 0:t.from)&&(t==null?void 0:t.to)&&e.jsx(ge,{message:i.HISTORICAL_QUERY_TEXT(Ue.utc(t==null?void 0:t.from).local().format("D MMM"),Ue.utc(t==null?void 0:t.to).local().format("D MMM"))})]}),e.jsx("div",{className:"filterBlock",children:(o==null?void 0:o.isRecent)==="false"&&e.jsxs(e.Fragment,{children:[j==="Duration"&&m>ce.breakpoints.values.md&&e.jsx("div",{className:"durationSelect",children:e.jsxs(De,{name:"analytics",value:t==null?void 0:t.duration,onChange:n=>{he(n)},label:i.USAGE_OF_LAST,children:[e.jsx(le,{value:0,className:"selectPlaceholder",children:i.SELECT_DURATION}),(ue=Ie)==null?void 0:ue.map(n=>e.jsx(le,{value:n==null?void 0:n.value,selected:(n==null?void 0:n.value)===(t==null?void 0:t.duration),children:e.jsx("div",{className:"optionText",children:n.label})},n==null?void 0:n.value))]})}),j==="Range"&&m>ce.breakpoints.values.md&&e.jsxs(e.Fragment,{children:[e.jsx(Ee,{selectedDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",onDateChange:n=>{oe({from:new Date(n).toISOString()})},startDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",endDate:t!=null&&t.to?new Date(t==null?void 0:t.to):"",shouldConvert:!0,label:i.FROM,maxDate:t!=null&&t.to?new Date(t==null?void 0:t.to):new Date,selectsStart:!0}),e.jsx(Ee,{selectedDate:t!=null&&t.to?new Date(t==null?void 0:t.to):"",onDateChange:n=>{oe({to:new Date(n).toISOString()})},minDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",maxDate:new Date,label:i.TO,startDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",endDate:t!=null&&t.to?new Date(t==null?void 0:t.to):"",selectsEnd:!0,addForward:!0,shouldConvert:!0})]}),(t==null?void 0:t.from)&&(t==null?void 0:t.to)&&e.jsx(V,{tooltip:i.RESET_FILTER,onClick:()=>ae("false"),className:"resetBtn",children:e.jsx(un,{})}),e.jsx(V,{tooltip:i.FILTER,onClick:n=>L(n.currentTarget),className:"filterBtn",children:e.jsx(xn,{})}),e.jsx(Bt,{anchorEl:Q,open:!!Q,onClose:()=>L(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:zt.map(({value:n})=>e.jsx(le,{selected:n===j,onClick:()=>Re(n),children:n},n))})]})})]}),m<ce.breakpoints.values.md&&e.jsxs("div",{className:"responsiveFilter",children:[j==="Duration"&&e.jsx("div",{className:"durationSelect",children:e.jsxs(De,{name:"analytics",value:t==null?void 0:t.duration,onChange:n=>{he(n)},label:i.USAGE_OF_LAST,children:[e.jsx(le,{value:0,className:"selectPlaceholder",children:i.SELECT_DURATION}),(xe=Ie)==null?void 0:xe.map(n=>e.jsx(le,{value:n==null?void 0:n.value,selected:(n==null?void 0:n.value)===(t==null?void 0:t.duration),children:e.jsx("div",{className:"optionText",children:n.label})},n==null?void 0:n.value))]})}),j==="Range"&&e.jsxs(e.Fragment,{children:[e.jsx(Ee,{selectedDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",onDateChange:n=>{oe({from:new Date(n).toISOString()})},startDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",endDate:t!=null&&t.to?new Date(t==null?void 0:t.to):"",shouldConvert:!0,label:i.FROM,maxDate:t!=null&&t.to?new Date(t==null?void 0:t.to):new Date,selectsStart:!0}),e.jsx(Ee,{selectedDate:t!=null&&t.to?new Date(t==null?void 0:t.to):"",onDateChange:n=>{oe({to:new Date(n).toISOString()})},minDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",maxDate:new Date,label:i.TO,startDate:t!=null&&t.from?new Date(t==null?void 0:t.from):"",endDate:t!=null&&t.to?new Date(t==null?void 0:t.to):"",selectsEnd:!0,addForward:!0,shouldConvert:!0})]})]})]}),s===T.myQueries&&e.jsx(yn,{queryParams:o,setPageNumber:$,setSortBy:W,onPageChange:a,onPageSizeChange:z,deleteQuery:X,defaultSize:50,handlePublishCallback:me}),s===T.myOrgQuery&&e.jsx(Rn,{queryParams:o,setPageNumber:$,setSortBy:W,onPageChange:a,onPageSizeChange:z,deleteQuery:X,onTagChange:ee,resetTags:te,defaultSize:50}),s===T.queryHistory&&e.jsx(Tn,{queryParams:o,setPageNumber:$,setSortBy:W,onPageChange:a,onPageSizeChange:z,defaultSize:50})]})]})})})},_n=Ht.memo(mn);export{_n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as r,r as t}from"./vendor-charts-a85b2946.js";import{O as o,Q as a}from"./index-
|
|
1
|
+
import{k as r,r as t}from"./vendor-charts-a85b2946.js";import{O as o,Q as a}from"./index-f575fb85.js";import"./vendor-editor-3dd5e143.js";import"./vendor-three-43ec9d9f.js";function m(){return r.jsx(t.Suspense,{fallback:o,children:r.jsx(a,{})})}export{m as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a9 as N,r as n,k as e,jm as V,G as E,an as g,ma as P,bA as v,bB as O,bp as S,br as p,b8 as l,bC as C,oY as I,oZ as D,o_ as F,o$ as k,p0 as L,p1 as q,iO as A,jn as M,p2 as _}from"./vendor-charts-a85b2946.js";import{a4 as B,a5 as W,u as $,O as G}from"./index-
|
|
1
|
+
import{a9 as N,r as n,k as e,jm as V,G as E,an as g,ma as P,bA as v,bB as O,bp as S,br as p,b8 as l,bC as C,oY as I,oZ as D,o_ as F,o$ as k,p0 as L,p1 as q,iO as A,jn as M,p2 as _}from"./vendor-charts-a85b2946.js";import{a4 as B,a5 as W,u as $,O as G}from"./index-f575fb85.js";import"./vendor-editor-3dd5e143.js";import"./vendor-three-43ec9d9f.js";const U=[{id:"kafka_stream",type:"custom",title:"New kafka Stream",subtitle:"Indexed data",positionX:0,positionY:0,sourcePosition:"right",targetPosition:"right"},{id:"Ethereum_transactions",type:"custom",title:"Ethereum Transactions",subtitle:"Indexed data",positionX:420,positionY:0,sourcePosition:"right",targetPosition:"right"},{id:"create_new_table",type:"custom",title:"Create a New Table",subtitle:"Indexed data",positionX:1260,positionY:0,sourcePosition:"right",targetPosition:"left"}],H=[{id:"e1-1",source:1,target:2},{id:"e1-2",source:2,target:3},{id:"e1-3",source:3,target:4},{id:"e1-4",source:4,target:5}],j={nodesDataSearch:U,edgesDataSearchUnused:H},x=[{prompt:"Write sql query",promptId:6,actionType:2,View:"Open query editor vuew",viewRoute:"/pipeline/model?promptId=6",isFirst:!0},{prompt:"Explore tables from uniswap",promptId:6,actionType:5,View:"Open query editor vuew",viewRoute:"/pipeline/model",isFirst:!0},{prompt:"Load streams from kafka",promptId:6,actionType:5,View:"Open query editor vuew",viewRoute:"/pipeline/model",isFirst:!0},{prompt:"Explore blockchain data tables available",promptId:6,actionType:5,View:"Open query editor vuew",viewRoute:"/pipeline/model",isFirst:!0},{prompt:"Write a slack api integration in python",promptId:6,actionType:5,View:"Open query editor vuew",viewRoute:"/pipeline/model",isFirst:!0},{prompt:"Show ethereum schema",promptId:1,actionType:1,View:"open ethereum data model view",viewRoute:"/pipeline/model?promptId=1&selectedChain=ethereum&view=data-sets",isFirst:!0},{prompt:"Show binance schema",promptId:2,actionType:1,View:"open bnb data model view",viewRoute:"/pipeline/model?promptId=2&selectedChain=binance&view=data-sets"},{prompt:"View avalanche schema",promptId:3,actionType:1,View:"open bnb data model view",viewRoute:"/pipeline/model?promptId=3&selectedChain=avalanche&view=data-sets"},{prompt:"Explore binance schema",promptId:4,actionType:1,View:"open bnb data model view",viewRoute:"/pipeline/model?promptId=4&selectedChain=binance&view=data-sets"},{prompt:"Explore Table Transaction from ethereum Schema",promptId:5,actionType:1,View:"open etherium data model view with transaction table and its connected table",viewRoute:"/pipeline/model?promptId=5&selectedChain=ethereum&table=TRANSACTION&view=data-sets"},{prompt:"Run a query",promptId:7,actionType:2,View:"Open query editor vuew",viewRoute:"/pipeline/model?promptId=6"},{prompt:"Explore a query",promptId:8,actionType:2,View:"Open query editor vuew",viewRoute:"/pipeline/model?promptId=8"},{prompt:"Create table",promptId:14,actionType:2,View:"Open query editor view with DDL",viewRoute:"/pipeline/model?promptId=14"},{prompt:"Show data model",promptId:9,actionType:2,View:"Open data model view",viewRoute:"/pipeline/model?promptId=9",isFirst:!0},{prompt:"View data model",promptId:10,actionType:2,View:"Open data model view",viewRoute:"/pipeline/model?promptId=10"},{prompt:"Explore data model",promptId:15,actionType:2,View:"Open data model view",viewRoute:"/pipeline/model?promptId=15"},{prompt:"Python Script 1",promptId:11,actionType:4,View:"Open python script 1",viewRoute:"/pipeline/model?actionId=2&promptId=8"},{prompt:"Python Script 2",promptId:12,actionType:4,View:"Open python script 2",viewRoute:"/pipeline/model?actionId=2&promptId=8"},{prompt:"Python Script 3",promptId:13,actionType:4,View:"Open python script 3",viewRoute:"/pipeline/model?actionId=2&promptId=8"},{prompt:"Write a python script",promptId:14,actionType:4,View:"Open python script",viewRoute:"/pipeline/model?promptId=14",isFirst:!0}],Y=()=>{const a=N(),r=n.useRef(!0),[d,i]=n.useState([]),[u,c]=n.useState("");n.useEffect(()=>()=>{r.current=!1},[]);const w=t=>{let s=[];t?x==null||x.forEach(o=>{var m,h,T,f;((h=(m=o==null?void 0:o.prompt)==null?void 0:m.toLowerCase())!=null&&h.includes(t==null?void 0:t.toLowerCase())||(f=t==null?void 0:t.toLowerCase())!=null&&f.includes((T=o.prompt)==null?void 0:T.toLowerCase()))&&s.push({title:o.prompt,value:o.prompt,data:o})}):s=x.filter(o=>o.isFirst).map(o=>({title:o.prompt,value:o.prompt,data:o})),i([...s])},b=t=>{r.current&&(c(t),w(t))},R=t=>{var s,o,m,h;r.current&&c(t==null?void 0:t.value),(((s=t==null?void 0:t.data)==null?void 0:s.promptId)===14||((o=t==null?void 0:t.data)==null?void 0:o.promptId)===6)&&(((m=t==null?void 0:t.data)==null?void 0:m.promptId)===6&&V("Execute_Query",!1),a.push((h=t==null?void 0:t.data)==null?void 0:h.viewRoute))};return e.jsx(B,{options:d,handleChange:b,onSelectValue:R,value:u,onFocus:()=>{w(u)},onBlur:()=>{setTimeout(()=>{r.current&&i([])},300)}})},X=E.div`
|
|
2
2
|
margin-top: 50px;
|
|
3
3
|
.commonTitleStyle {
|
|
4
4
|
font-size: ${a=>a.theme.custom.heading.h2};
|