@spaceandtimelabs/dapp-mi-space-time 0.1.7-233 → 0.1.7-235
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-c6de6f4d.js → ErdWrapper-2f10ca6c.js} +1 -1
- package/build/assets/{Queries-aaee790a.js → Queries-5acef70b.js} +1 -1
- package/build/assets/QueryEditorWrapper-d2f3e681.js +1 -0
- package/build/assets/{index-4d7a6a22.js → index-3fad70e3.js} +1 -1
- package/build/assets/{index-5896d184.js → index-3fe5da26.js} +1 -1
- package/build/assets/{index-817d0990.js → index-972e7e8c.js} +4 -4
- package/build/assets/{index-ac624050.js → index-d76613fe.js} +1 -1
- package/build/assets/{vendor-charts-042ad4ee.js → vendor-charts-662c1123.js} +1123 -1123
- package/build/assets/{vendor-editor-59fa3adc.js → vendor-editor-79c6d611.js} +1 -1
- package/build/assets/{vendor-three-66c5c4f3.js → vendor-three-9599e951.js} +1 -1
- package/build/index.html +4 -4
- package/package.json +1 -1
- package/build/assets/QueryEditorWrapper-6eec5174.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{lK as o,k as e,r as t}from"./vendor-charts-
|
|
1
|
+
import{lK as o,k as e,r as t}from"./vendor-charts-662c1123.js";import{u as n,O as s,E as d,a as p}from"./index-972e7e8c.js";import"./vendor-editor-79c6d611.js";import"./vendor-three-9599e951.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{iA as Ue,oJ as Et,r as h,a8 as be,k as e,aj as Qe,b7 as i,ee as We,oK as jt,eb as Ae,oL as Ct,oM as Nt,cU as Ce,eu as Te,eV as Le,ai as Ne,mQ as $e,dJ as Me,dU as ve,oN as bt,oO as Tt,oP as yt,eG as g,eZ as at,a9 as Rt,dK as de,e$ as mt,bw as Qt,o1 as vt,aX as Dt,eI as It,bc as it,cZ as _t,cL as je,fl as Ot,oQ as wt,fe as Ut,R as Ht,ap as At,fp as Lt,oj as b,ar as fe,dt as ce,fD as Xe,eW as Je,bG as De,ok as Mt,eT as Ze,fy as kt,fz as Se,b2 as le,cD as Ie,aU as Bt,cE as zt,eS as _e,eR as Oe,fA as Vt,cH as Kt,oR as Yt}from"./vendor-charts-042ad4ee.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 Ke,i as Xt,H as Jt,j as Ye,I as V,B as M,k as Zt,l as Ft,m as Pt,n as He,N as we,o as he,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 ht,z as gt,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 hn,W as gn,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-817d0990.js";import"./vendor-editor-59fa3adc.js";import"./vendor-three-66c5c4f3.js";const jn="/assets/emptyHistory-39807386.png",Cn="/assets/emptyHistory-e09c1ac9.webp",Nn="/assets/heartbeat-d012a4c0.png";Ue.extend(Et);function bn({queryParams:s,setSortBy:k,setPageNumber:y,onPageChange:Y,onPageSizeChange:R,defaultSize:f}){var l,v,U;const{height:C,headerHeight:d}=ye(),[_,x]=h.useState(!1),[O,D]=h.useState([]),[E,w]=h.useState(null),[m,N]=h.useState({areaChartConfig:[],lineChartConfig:[]}),[I,o]=h.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)||{},K=be();h.useEffect(()=>()=>Fe(),[]),h.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(T=>T==null?void 0:T.queryType),pe={};(ut??[]).forEach(T=>{pe[T]?pe[T]+=1:pe[T]=1});const xt=(F=Object.entries(pe))==null?void 0:F.map(([T,St])=>({Source:T,Trafic:St}));D(xt);const pt=(ie=r==null?void 0:r.content)==null?void 0:ie.map(T=>({Timestamp:T.timestamp,Usage:T.usage,Runtime:T.runtime})),ft=(Ge=r==null?void 0:r.content)==null?void 0:Ge.map(T=>({Timestamp:T.timestamp,Usage:T.usage,DataVolume:T.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=>{K.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(Ye,{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(Te,{})}),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 ge=()=>{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=Tt}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:bt}).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:ge,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(Ke,{onChange:B,count:Q,page:s.pageNo,onPageChange:Y,totalElements:L,onPageSizeChange:R,isGotoPage:!0,isPageSize:!0,pageSize:s.pageSize,defaultSize:f})]})}const Tn=s=>{const{row:k,handleClose:y,handlePublishCallback:Y,open:R}=s,{id:f,queryName:C,visibility:d,slug:_}=k||{},[x,O]=h.useState(""),[D,E]=h.useState(!1),[w,m]=h.useState(!1),[N,I]=h.useState(!1),o=Zt()||(k==null?void 0:k.visibility),u=h.useRef(null),t=d===g.public;h.useEffect(()=>{if(R&&d===g.public){const p=window.location.origin+de.queriesSlug(f,_);O(p)}else O(""),I(!1),u.current=null},[R]);const S=p=>{var K,B;const Q=((B=(K=p==null?void 0:p.target)==null?void 0:K.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,Y)===i.RESPONSE_SUCCESS_STATUS&&y(),m(!1)},A=p=>{switch(p){case g.public:re(g.public);break;case g.private:re(g.private);break;case g.subscription:re(g.subscription);break;default:re(g.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===g.public&&"disabled"}`,children:[e.jsx(M,{variant:"contained",onClick:()=>{A(g.private)},color:o===g.public||o===g.subscription?"secondary":"primary",disabled:d===g.public,children:i.PRIVATE}),e.jsx(M,{variant:"contained",onClick:()=>{A(g.subscription)},color:o===g.subscription?"primary":"secondary",disabled:d===g.public,children:i.PRIVATE_TO_MY_ORG}),e.jsx(M,{variant:"contained",onClick:()=>{A(g.public)},color:o===g.public?"primary":"secondary",children:i.PUBLIC})]})]}),o===g.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(Te,{})})}):null})}),t&&e.jsx(he,{message:i.PUBLISHED_TEXT("query")}),o===g.public&&!t&&e.jsx(he,{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===g.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:Y,onPageSizeChange:R,deleteQuery:f,defaultSize:C,handlePublishCallback:d}){const _=be(),{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]=h.useState(!1),[r,A]=h.useState({}),[j,p]=h.useState(!1),[Q,L]=h.useState({}),K=(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(Ye,{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)===g.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(Te,{})}),e.jsx(sn,{icon:!0,confirmButtonMessage:i.YES,cancelButtonMessage:i.NO,disabled:a.visibility===g.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:ht,imgPathWebp:gt,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:K,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(Ke,{onChange:B,count:w,page:(s==null?void 0:s.pageNo)||0,onPageChange:Y,totalElements:m,onPageSizeChange:R,isGotoPage:!0,isPageSize:!0,pageSize:(s==null?void 0:s.pageSize)||0,defaultSize:C})}),e.jsx(Tn,{open:j,handleClose:te,row:Q,handlePublishCallback:d})]})}function Rn({queryParams:s,setPageNumber:k,setSortBy:y,onPageChange:Y,onPageSizeChange:R,onTagChange:f,resetTags:C,defaultSize:d}){const _=be(),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]=h.useState(!1),[j,p]=h.useState({}),{totalPages:Q=0,totalElements:L=0}=(I==null?void 0:I.pageable)||{},K=(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(Ye,{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(Te,{})})]}),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:ht,imgPathWebp:gt,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:K,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(Ke,{onChange:B,count:Q,page:(s==null?void 0:s.pageNo)||0,onPageChange:Y,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=be(),{search:Y}=At(),R=it(n=>n.isLoggedIn),f=h.useRef(null),C=h.useRef(null),d=new URLSearchParams(Y),_=(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]=h.useState({}),[t,S]=h.useState({from:"",to:"",duration:0}),[r,A]=h.useState(Lt.trending),[j,p]=h.useState(""),[Q,L]=h.useState(null),K=()=>{let n={..._e(o)};s===b.myQueries&&(n={...n,scope:Oe.private}),s===b.myOrgQuery&&(n={...n,scope:Oe.subscription,visibility:g.subscription}),delete n.isRecent,n=je.stringify({...n},{arrayFormat:"bracket"}),y.push(`/${s==null?void 0:s.toLowerCase()}?${n}`),s===b.queryHistory?pn({params:n,abortController:C,isRecent:(o==null?void 0:o.isRecent)==="true"}):s===b.myQueries?fn({params:n,isLoggedIn:R,abortController:C}):Sn({params:n,isLoggedIn:R,abortController:C})};h.useEffect(()=>{let n=_;n||(n="modified"),s===b.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===b.queryHistory?"true":""})},[s]),h.useEffect(()=>{var n;fe.isEmpty(o)||(ln(!0),C!=null&&C.current&&((n=C==null?void 0:C.current)==null||n.abort()),setTimeout(K,200))},[o,r]),h.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===b.myOrgQuery?g.subscription:"",scope:l===b.myOrgQuery?Oe.subscription:"",sortBy:"",sortOrder:"",isRecent:l===b.queryHistory?"false":""})};if(l===b.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,()=>{Yt(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===b.myQueries?!fe.isEmpty(N)||!!((n=o==null?void 0:o.searchPattern)!=null&&n.length):s===b.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)},ge=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}=Kt(Number(l));S({from:c,to:H,duration:l})}},me=async n=>{const l=je.stringify(_e({...o}));n===g.public?y.push(de.exploreQuery(l)):n===g.subscription?y.push(de.myOrgQuery(l)):y.push(de.myqueries(l))};return e.jsx(h.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(hn,{children:[e.jsx(De,{value:s,onChange:B,children:Mt.map(n=>e.jsx(gn,{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===b.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===b.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===b.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(he,{message:i.CURRENT_QUERY_TEXT}),(o==null?void 0:o.isRecent)==="false"&&!(t!=null&&t.from)&&!(t!=null&&t.to)&&e.jsx(he,{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(he,{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=>{ge(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=>{ge(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===b.myQueries&&e.jsx(yn,{queryParams:o,setPageNumber:$,setSortBy:W,onPageChange:a,onPageSizeChange:z,deleteQuery:X,defaultSize:50,handlePublishCallback:me}),s===b.myOrgQuery&&e.jsx(Rn,{queryParams:o,setPageNumber:$,setSortBy:W,onPageChange:a,onPageSizeChange:z,deleteQuery:X,onTagChange:ee,resetTags:te,defaultSize:50}),s===b.queryHistory&&e.jsx(bn,{queryParams:o,setPageNumber:$,setSortBy:W,onPageChange:a,onPageSizeChange:z,defaultSize:50})]})]})})})},_n=Ht.memo(mn);export{_n as default};
|
|
1
|
+
import{iA as Ue,oJ as Et,r as h,a8 as be,k as e,aj as Qe,b7 as i,ee as We,oK as jt,eb as Ae,oL as Ct,oM as Nt,cU as Ce,eu as Te,eV as Le,ai as Ne,mQ as $e,dJ as Me,dU as ve,oN as bt,oO as Tt,oP as yt,eG as g,eZ as at,a9 as Rt,dK as de,e$ as mt,bw as Qt,o1 as vt,aX as Dt,eI as It,bc as it,cZ as _t,cL as je,fl as Ot,oQ as wt,fe as Ut,R as Ht,ap as At,fp as Lt,oj as b,ar as fe,dt as ce,fD as Xe,eW as Je,bG as De,ok as Mt,eT as Ze,fy as kt,fz as Se,b2 as le,cD as Ie,aU as Bt,cE as zt,eS as _e,eR as Oe,fA as Vt,cH as Kt,oR as Yt}from"./vendor-charts-662c1123.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 Ke,i as Xt,H as Jt,j as Ye,I as V,B as M,k as Zt,l as Ft,m as Pt,n as He,N as we,o as he,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 ht,z as gt,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 hn,W as gn,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-972e7e8c.js";import"./vendor-editor-79c6d611.js";import"./vendor-three-9599e951.js";const jn="/assets/emptyHistory-39807386.png",Cn="/assets/emptyHistory-e09c1ac9.webp",Nn="/assets/heartbeat-d012a4c0.png";Ue.extend(Et);function bn({queryParams:s,setSortBy:k,setPageNumber:y,onPageChange:Y,onPageSizeChange:R,defaultSize:f}){var l,v,U;const{height:C,headerHeight:d}=ye(),[_,x]=h.useState(!1),[O,D]=h.useState([]),[E,w]=h.useState(null),[m,N]=h.useState({areaChartConfig:[],lineChartConfig:[]}),[I,o]=h.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)||{},K=be();h.useEffect(()=>()=>Fe(),[]),h.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(T=>T==null?void 0:T.queryType),pe={};(ut??[]).forEach(T=>{pe[T]?pe[T]+=1:pe[T]=1});const xt=(F=Object.entries(pe))==null?void 0:F.map(([T,St])=>({Source:T,Trafic:St}));D(xt);const pt=(ie=r==null?void 0:r.content)==null?void 0:ie.map(T=>({Timestamp:T.timestamp,Usage:T.usage,Runtime:T.runtime})),ft=(Ge=r==null?void 0:r.content)==null?void 0:Ge.map(T=>({Timestamp:T.timestamp,Usage:T.usage,DataVolume:T.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=>{K.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(Ye,{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(Te,{})}),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 ge=()=>{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=Tt}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:bt}).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:ge,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(Ke,{onChange:B,count:Q,page:s.pageNo,onPageChange:Y,totalElements:L,onPageSizeChange:R,isGotoPage:!0,isPageSize:!0,pageSize:s.pageSize,defaultSize:f})]})}const Tn=s=>{const{row:k,handleClose:y,handlePublishCallback:Y,open:R}=s,{id:f,queryName:C,visibility:d,slug:_}=k||{},[x,O]=h.useState(""),[D,E]=h.useState(!1),[w,m]=h.useState(!1),[N,I]=h.useState(!1),o=Zt()||(k==null?void 0:k.visibility),u=h.useRef(null),t=d===g.public;h.useEffect(()=>{if(R&&d===g.public){const p=window.location.origin+de.queriesSlug(f,_);O(p)}else O(""),I(!1),u.current=null},[R]);const S=p=>{var K,B;const Q=((B=(K=p==null?void 0:p.target)==null?void 0:K.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,Y)===i.RESPONSE_SUCCESS_STATUS&&y(),m(!1)},A=p=>{switch(p){case g.public:re(g.public);break;case g.private:re(g.private);break;case g.subscription:re(g.subscription);break;default:re(g.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===g.public&&"disabled"}`,children:[e.jsx(M,{variant:"contained",onClick:()=>{A(g.private)},color:o===g.public||o===g.subscription?"secondary":"primary",disabled:d===g.public,children:i.PRIVATE}),e.jsx(M,{variant:"contained",onClick:()=>{A(g.subscription)},color:o===g.subscription?"primary":"secondary",disabled:d===g.public,children:i.PRIVATE_TO_MY_ORG}),e.jsx(M,{variant:"contained",onClick:()=>{A(g.public)},color:o===g.public?"primary":"secondary",children:i.PUBLIC})]})]}),o===g.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(Te,{})})}):null})}),t&&e.jsx(he,{message:i.PUBLISHED_TEXT("query")}),o===g.public&&!t&&e.jsx(he,{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===g.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:Y,onPageSizeChange:R,deleteQuery:f,defaultSize:C,handlePublishCallback:d}){const _=be(),{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]=h.useState(!1),[r,A]=h.useState({}),[j,p]=h.useState(!1),[Q,L]=h.useState({}),K=(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(Ye,{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)===g.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(Te,{})}),e.jsx(sn,{icon:!0,confirmButtonMessage:i.YES,cancelButtonMessage:i.NO,disabled:a.visibility===g.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:ht,imgPathWebp:gt,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:K,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(Ke,{onChange:B,count:w,page:(s==null?void 0:s.pageNo)||0,onPageChange:Y,totalElements:m,onPageSizeChange:R,isGotoPage:!0,isPageSize:!0,pageSize:(s==null?void 0:s.pageSize)||0,defaultSize:C})}),e.jsx(Tn,{open:j,handleClose:te,row:Q,handlePublishCallback:d})]})}function Rn({queryParams:s,setPageNumber:k,setSortBy:y,onPageChange:Y,onPageSizeChange:R,onTagChange:f,resetTags:C,defaultSize:d}){const _=be(),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]=h.useState(!1),[j,p]=h.useState({}),{totalPages:Q=0,totalElements:L=0}=(I==null?void 0:I.pageable)||{},K=(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(Ye,{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(Te,{})})]}),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:ht,imgPathWebp:gt,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:K,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(Ke,{onChange:B,count:Q,page:(s==null?void 0:s.pageNo)||0,onPageChange:Y,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=be(),{search:Y}=At(),R=it(n=>n.isLoggedIn),f=h.useRef(null),C=h.useRef(null),d=new URLSearchParams(Y),_=(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]=h.useState({}),[t,S]=h.useState({from:"",to:"",duration:0}),[r,A]=h.useState(Lt.trending),[j,p]=h.useState(""),[Q,L]=h.useState(null),K=()=>{let n={..._e(o)};s===b.myQueries&&(n={...n,scope:Oe.private}),s===b.myOrgQuery&&(n={...n,scope:Oe.subscription,visibility:g.subscription}),delete n.isRecent,n=je.stringify({...n},{arrayFormat:"bracket"}),y.push(`/${s==null?void 0:s.toLowerCase()}?${n}`),s===b.queryHistory?pn({params:n,abortController:C,isRecent:(o==null?void 0:o.isRecent)==="true"}):s===b.myQueries?fn({params:n,isLoggedIn:R,abortController:C}):Sn({params:n,isLoggedIn:R,abortController:C})};h.useEffect(()=>{let n=_;n||(n="modified"),s===b.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===b.queryHistory?"true":""})},[s]),h.useEffect(()=>{var n;fe.isEmpty(o)||(ln(!0),C!=null&&C.current&&((n=C==null?void 0:C.current)==null||n.abort()),setTimeout(K,200))},[o,r]),h.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===b.myOrgQuery?g.subscription:"",scope:l===b.myOrgQuery?Oe.subscription:"",sortBy:"",sortOrder:"",isRecent:l===b.queryHistory?"false":""})};if(l===b.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,()=>{Yt(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===b.myQueries?!fe.isEmpty(N)||!!((n=o==null?void 0:o.searchPattern)!=null&&n.length):s===b.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)},ge=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}=Kt(Number(l));S({from:c,to:H,duration:l})}},me=async n=>{const l=je.stringify(_e({...o}));n===g.public?y.push(de.exploreQuery(l)):n===g.subscription?y.push(de.myOrgQuery(l)):y.push(de.myqueries(l))};return e.jsx(h.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(hn,{children:[e.jsx(De,{value:s,onChange:B,children:Mt.map(n=>e.jsx(gn,{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===b.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===b.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===b.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(he,{message:i.CURRENT_QUERY_TEXT}),(o==null?void 0:o.isRecent)==="false"&&!(t!=null&&t.from)&&!(t!=null&&t.to)&&e.jsx(he,{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(he,{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=>{ge(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=>{ge(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===b.myQueries&&e.jsx(yn,{queryParams:o,setPageNumber:$,setSortBy:W,onPageChange:a,onPageSizeChange:z,deleteQuery:X,defaultSize:50,handlePublishCallback:me}),s===b.myOrgQuery&&e.jsx(Rn,{queryParams:o,setPageNumber:$,setSortBy:W,onPageChange:a,onPageSizeChange:z,deleteQuery:X,onTagChange:ee,resetTags:te,defaultSize:50}),s===b.queryHistory&&e.jsx(bn,{queryParams:o,setPageNumber:$,setSortBy:W,onPageChange:a,onPageSizeChange:z,defaultSize:50})]})]})})})},_n=Ht.memo(mn);export{_n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as r,r as t}from"./vendor-charts-662c1123.js";import{O as o,Q as a}from"./index-972e7e8c.js";import"./vendor-editor-79c6d611.js";import"./vendor-three-9599e951.js";function m(){return r.jsx(t.Suspense,{fallback:o,children:r.jsx(a,{})})}export{m as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a8 as V,r as n,k as e,jj as N,G as E,aj as g,m6 as P,bz as v,bA as O,bo as S,bq as p,b7 as l,bB as C,oS as I,oT as D,oU as k,oV as F,oW as L,oX as q,iL as A,jk as M,oY as B}from"./vendor-charts-
|
|
1
|
+
import{a8 as V,r as n,k as e,jj as N,G as E,aj as g,m6 as P,bz as v,bA as O,bo as S,bq as p,b7 as l,bB as C,oS as I,oT as D,oU as k,oV as F,oW as L,oX as q,iL as A,jk as M,oY as B}from"./vendor-charts-662c1123.js";import{a4 as W,a5 as _,u as U,O as G}from"./index-972e7e8c.js";import"./vendor-editor-79c6d611.js";import"./vendor-three-9599e951.js";const $=[{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:$,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}],X=()=>{const a=V(),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&&N("Execute_Query",!1),a.push((h=t==null?void 0:t.data)==null?void 0:h.viewRoute))};return e.jsx(W,{options:d,handleChange:b,onSelectValue:R,value:u,onFocus:()=>{w(u)},onBlur:()=>{setTimeout(()=>{r.current&&i([])},300)}})},Y=E.div`
|
|
2
2
|
margin-top: 50px;
|
|
3
3
|
.commonTitleStyle {
|
|
4
4
|
font-size: ${a=>a.theme.custom.heading.h2};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{oZ as m,B as R,o_ as h,o$ as V,a5 as B}from"./vendor-charts-
|
|
1
|
+
import{oZ as m,B as R,o_ as h,o$ as V,a5 as B}from"./vendor-charts-662c1123.js";const o=m({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),N={state:o,subscribe(e){return h(o,()=>e(o))},push(e,t){e!==o.view&&(o.view=e,t&&(o.data=t),o.history.push(e))},reset(e){o.view=e,o.history=[e]},replace(e){o.history.length>1&&(o.history[o.history.length-1]=e,o.view=e)},goBack(){if(o.history.length>1){o.history.pop();const[e]=o.history.slice(-1);o.view=e}},setData(e){o.data=e}},a={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return a.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return a.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(a.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!a.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const i=R.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const c=new URL(n);return c.searchParams.set("startapp",i),c.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(a.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(a.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=N.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},H=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),r=m({enabled:H,userSessionId:"",events:[],connectedWalletId:void 0}),K={state:r,subscribe(e){return h(r.events,()=>e(V(r.events[r.events.length-1])))},initialize(){r.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(r.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){r.connectedWalletId=e},click(e){if(r.enabled){const t={type:"CLICK",name:e.name,userSessionId:r.userSessionId,timestamp:Date.now(),data:e};r.events.push(t)}},track(e){if(r.enabled){const t={type:"TRACK",name:e.name,userSessionId:r.userSessionId,timestamp:Date.now(),data:e};r.events.push(t)}},view(e){if(r.enabled){const t={type:"VIEW",name:e.name,userSessionId:r.userSessionId,timestamp:Date.now(),data:e};r.events.push(t)}}},u=m({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),d={state:u,subscribe(e){return h(u,()=>e(u))},setChains(e){u.chains=e},setWalletConnectUri(e){u.walletConnectUri=e},setIsCustomDesktop(e){u.isCustomDesktop=e},setIsCustomMobile(e){u.isCustomMobile=e},setIsDataLoaded(e){u.isDataLoaded=e},setIsUiLoaded(e){u.isUiLoaded=e},setIsAuth(e){u.isAuth=e}},w=m({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),C={state:w,subscribe(e){return h(w,()=>e(w))},setConfig(e){var t,s;K.initialize(),d.setChains(e.chains),d.setIsAuth(!!e.enableAuthMode),d.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),d.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),a.setModalVersionInStorage(),Object.assign(w,e)}};var z=Object.defineProperty,M=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,U=(e,t,s)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,F=(e,t)=>{for(var s in t||(t={}))q.call(t,s)&&U(e,s,t[s]);if(M)for(var s of M(t))J.call(t,s)&&U(e,s,t[s]);return e};const L="https://explorer-api.walletconnect.com",O="wcm",A="js-2.7.0";async function W(e,t){const s=F({sdkType:O,sdkVersion:A},t),n=new URL(e,L);return n.searchParams.append("projectId",C.state.projectId),Object.entries(s).forEach(([i,c])=>{c&&n.searchParams.append(i,String(c))}),(await fetch(n)).json()}const f={async getDesktopListings(e){return W("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return W("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return W("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return W("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${L}/w3m/v1/getWalletImage/${e}?projectId=${C.state.projectId}&sdkType=${O}&sdkVersion=${A}`},getAssetImageUrl(e){return`${L}/w3m/v1/getAssetImage/${e}?projectId=${C.state.projectId}&sdkType=${O}&sdkVersion=${A}`}};var Y=Object.defineProperty,D=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,$=(e,t,s)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Q=(e,t)=>{for(var s in t||(t={}))Z.call(t,s)&&$(e,s,t[s]);if(D)for(var s of D(t))G.call(t,s)&&$(e,s,t[s]);return e};const S=a.isMobile(),p=m({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ae={state:p,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=C.state;if(e==="NONE"||t==="ALL"&&!e)return p.recomendedWallets;if(a.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await f.getAllListings(n),i=Object.values(l);i.sort((c,v)=>{const y=e.indexOf(c.id),_=e.indexOf(v.id);return y-_}),p.recomendedWallets=i}else{const{chains:s,isAuth:n}=d.state,l=s==null?void 0:s.join(","),i=a.isArray(t),c={page:1,sdks:n?"auth_v1":void 0,entries:a.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:i?t.join(","):void 0},{listings:v}=S?await f.getMobileListings(c):await f.getDesktopListings(c);p.recomendedWallets=Object.values(v)}return p.recomendedWallets},async getWallets(e){const t=Q({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=C.state,{recomendedWallets:l}=p;if(n==="ALL")return p.wallets;l.length?t.excludedIds=l.map(x=>x.id).join(","):a.isArray(s)&&(t.excludedIds=s.join(",")),a.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),d.state.isAuth&&(t.sdks="auth_v1");const{page:i,search:c}=e,{listings:v,total:y}=S?await f.getMobileListings(t):await f.getDesktopListings(t),_=Object.values(v),P=c?"search":"wallets";return p[P]={listings:[...p[P].listings,..._],total:y,page:i??1},{listings:_,total:y}},getWalletImageUrl(e){return f.getWalletImageUrl(e)},getAssetImageUrl(e){return f.getAssetImageUrl(e)},resetSearch(){p.search={listings:[],total:0,page:1}}},I=m({open:!1}),E={state:I,subscribe(e){return h(I,()=>e(I))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=d.state;if(a.removeWalletConnectDeepLink(),d.setWalletConnectUri(e==null?void 0:e.uri),d.setChains(e==null?void 0:e.chains),N.reset("ConnectWallet"),s&&n)I.open=!0,t();else{const l=setInterval(()=>{const i=d.state;i.isUiLoaded&&i.isDataLoaded&&(clearInterval(l),I.open=!0,t())},200)}})},close(){I.open=!1}};var X=Object.defineProperty,T=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,j=(e,t,s)=>t in e?X(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,se=(e,t)=>{for(var s in t||(t={}))ee.call(t,s)&&j(e,s,t[s]);if(T)for(var s of T(t))te.call(t,s)&&j(e,s,t[s]);return e};function ne(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const b=m({themeMode:ne()?"dark":"light"}),k={state:b,subscribe(e){return h(b,()=>e(b))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(b.themeMode=t),s&&(b.themeVariables=se({},s))}},g=m({open:!1,message:"",variant:"success"}),ie={state:g,subscribe(e){return h(g,()=>e(g))},openToast(e,t){g.open=!0,g.message=e,g.variant=t},closeToast(){g.open=!1}};class oe{constructor(t){this.openModal=E.open,this.closeModal=E.close,this.subscribeModal=E.subscribe,this.setTheme=k.setThemeConfig,k.setThemeConfig(t),C.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await B(()=>import("./index-d76613fe.js"),["assets/index-d76613fe.js","assets/vendor-charts-662c1123.js"]);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),d.setIsUiLoaded(!0)}}}const le=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:oe},Symbol.toStringTag,{value:"Module"}));export{a as C,ae as E,E as M,d as O,N as R,k as T,ie as a,K as b,C as c,le as i};
|