@perses-dev/timeseries-table-plugin 0.12.0-rc.0 → 0.12.0
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/__mf/js/{TimeSeriesTable.28876c4d.js → TimeSeriesTable.a46d4c0c.js} +7 -7
- package/__mf/js/async/{187.cbd1a5b7.js → 187.e7610888.js} +2 -2
- package/__mf/js/async/546.453f730a.js +3 -0
- package/__mf/js/async/842.bc227066.js +1 -0
- package/__mf/js/async/{984.5f40d108.js → 984.894a30f6.js} +5 -5
- package/__mf/js/async/__federation_expose_TimeSeriesTable.00ffd570.js +1 -0
- package/__mf/js/{main.c0ac9809.js → main.aa88f2d9.js} +2 -2
- package/mf-manifest.json +15 -15
- package/mf-stats.json +15 -15
- package/package.json +5 -5
- package/__mf/js/async/320.dda80622.js +0 -3
- package/__mf/js/async/842.124d6acb.js +0 -1
- package/__mf/js/async/__federation_expose_TimeSeriesTable.072ea59b.js +0 -1
- /package/__mf/js/async/{187.cbd1a5b7.js.LICENSE.txt → 187.e7610888.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{984.5f40d108.js.LICENSE.txt → 984.894a30f6.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.chunk_TimeSeriesTable=self.chunk_TimeSeriesTable||[]).push([["842"],{40625(e,a,n){n.r(a),n.d(a,{ONE_WEEK_IN_MS:()=>u,querySpecSchema:()=>C,annotationDisplaySchema:()=>R,buildPanelSpecSchema:()=>K,resolvePanelRef:()=>Y,variableDefinitionSchema:()=>es,variableTextSchema:()=>en,isTimeSeriesValueTuple:()=>j,otlpresourcev1:()=>i,parseDurationString:()=>c,isValidQueryPluginType:()=>_,ONE_YEAR_IN_MS:()=>p,DURATION_REGEX:()=>d,createPanelRef:()=>v,getSuggestedStepMs:()=>x,otlpcommonv1:()=>t,variableListSpecSchema:()=>X,variableDisplaySchema:()=>W,DEFAULT_ALL_VALUE:()=>"$__all",ONE_HOUR_IN_MS:()=>r,getPanelKeyFromRef:()=>g,ONE_MINUTE_IN_MS:()=>6e4,intervalToDuration:()=>M,convertTimeToDuration:()=>h,isDurationString:()=>m,panelSpecSchema:()=>q,buildVariableDefinitionSchema:()=>el,otlptracev1:()=>s,annotationSpecSchema:()=>$,buildDatasourceSpecSchema:()=>L,panelDisplaySpec:()=>U,panelDefinitionSchema:()=>F,buildVariableListSchema:()=>ee,datasourceSpecSchema:()=>z,buildVariableSpecSchema:()=>ei,isAbsoluteTimeRange:()=>f,ONE_SECOND_IN_MS:()=>1e3,displaySchema:()=>w,panelEditorSchema:()=>G,variableListSchema:()=>Z,isValidTraceId:()=>T,roundStepInterval:()=>b,variableTextSpecSchema:()=>ea,durationValidationSchema:()=>P,toAbsoluteTimeRange:()=>k,buildVariableListSpecSchema:()=>J,buildAnnotationSpecSchema:()=>N,buildPanelDefinitionSchema:()=>B,isRelativeTimeRange:()=>y,linkSchema:()=>Q,variableSpecSchema:()=>et,formatDuration:()=>S,buildPanelEditorSchema:()=>H,ONE_DAY_IN_MS:()=>o,pluginSchema:()=>A});var t={};n.r(t);var i={};n.r(i);var s={};n.r(s),n.d(s,{StatusCodeError:()=>O,StatusCodeOk:()=>E,StatusCodeUnset:()=>D});var l=n(94461);let r=36e5,o=864e5,u=6048e5,p=31536e6,d=/^(?:(\d+)y)?(?:(\d+)w)?(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?(?:(\d+)ms)?$/;function c(e){let a=d.exec(e);if(null===a)throw Error(`Invalid duration string '${e}'`);return{years:parseInt(a[1]??"0"),months:0,weeks:parseInt(a[2]??"0"),days:parseInt(a[3]??"0"),hours:parseInt(a[4]??"0"),minutes:parseInt(a[5]??"0"),seconds:parseInt(a[6]??"0")+parseInt(a[7]??"0")/1e3}}function m(e){return""!==e&&d.test(e)}function S(e){let a=[];if(e.years&&a.push(`${e.years}y`),e.weeks&&a.push(`${e.weeks}w`),e.days&&a.push(`${e.days}d`),e.hours&&a.push(`${e.hours}h`),e.minutes&&a.push(`${e.minutes}m`),e.seconds){let n=Math.trunc(e.seconds);n&&a.push(`${n}s`);let t=Math.round((e.seconds-n)*1e3);t&&a.push(`${t}ms`)}return a.join("")}function M(e){return h(e.end.valueOf()-e.start.valueOf())}function h(e){let a=Math.trunc(e/p);a>0&&(e-=a*p);let n=Math.trunc(e/u);n>0&&(e-=n*u);let t=Math.trunc(e/o);t>0&&(e-=t*o);let i=Math.trunc(e/r);i>0&&(e-=i*r);let s=Math.trunc(e/6e4);return s>0&&(e-=6e4*s),{years:a,months:0,weeks:n,days:t,hours:i,minutes:s,seconds:e/1e3}}function y(e){return void 0!==e.pastDuration}function f(e){return void 0!==e.start&&void 0!==e.end}function k(e){let a=e.end??new Date;return{start:(0,l.sub)(a,c(e.pastDuration)),end:a}}let I=[{maxMs:15,roundedStepMs:10,display:"0.01s"},{maxMs:35,roundedStepMs:20,display:"0.02s"},{maxMs:75,roundedStepMs:50,display:"0.05s"},{maxMs:150,roundedStepMs:100,display:"0.1s"},{maxMs:350,roundedStepMs:200,display:"0.2s"},{maxMs:750,roundedStepMs:500,display:"0.5s"},{maxMs:1500,roundedStepMs:1e3,display:"1s"},{maxMs:3500,roundedStepMs:2e3,display:"2s"},{maxMs:7500,roundedStepMs:5e3,display:"5s"},{maxMs:12500,roundedStepMs:1e4,display:"10s"},{maxMs:17500,roundedStepMs:15e3,display:"15s"},{maxMs:25e3,roundedStepMs:2e4,display:"20s"},{maxMs:45e3,roundedStepMs:3e4,display:"30s"},{maxMs:9e4,roundedStepMs:6e4,display:"1m"},{maxMs:21e4,roundedStepMs:12e4,display:"2m"},{maxMs:45e4,roundedStepMs:3e5,display:"5m"},{maxMs:75e4,roundedStepMs:6e5,display:"10m"},{maxMs:75e4,roundedStepMs:9e5,display:"15m"},{maxMs:15e5,roundedStepMs:12e5,display:"20m"},{maxMs:27e5,roundedStepMs:18e5,display:"30m"},{maxMs:54e5,roundedStepMs:36e5,display:"1h"},{maxMs:9e6,roundedStepMs:72e5,display:"2h"},{maxMs:162e5,roundedStepMs:108e5,display:"3h"},{maxMs:324e5,roundedStepMs:216e5,display:"6h"},{maxMs:864e5,roundedStepMs:432e5,display:"12h"},{maxMs:6048e5,roundedStepMs:864e5,display:"1d"},{maxMs:18144e5,roundedStepMs:6048e5,display:"1w"},{maxMs:36288e5,roundedStepMs:2592e6,display:"30d"},{maxMs:63072e6,roundedStepMs:31536e6,display:"1y"}];function b(e){for(let{maxMs:a,roundedStepMs:n}of I)if(e<a)return n;return 15e3}function x(e,a){return b(Math.floor((e.end.valueOf()-e.start.valueOf())/a))}function Y(e,a){let n=g(a),t=e.panels[n];if(void 0===t)throw Error(`Could not resolve panels reference ${a.$ref}`);return t}function g(e){return e.$ref.substring(14)}function v(e){return{$ref:`#/spec/panels/${e}`}}function _(e){return["TimeSeriesQuery","TraceQuery","ProfileQuery","LogQuery","AlertsQuery","SilencesQuery"].includes(e)}function j(e){return 2===e.length}function T(e){return/^[0-9a-fA-F]+$/.test(e)}let D="STATUS_CODE_UNSET",E="STATUS_CODE_OK",O="STATUS_CODE_ERROR";var V=n(59140);let A=V.Ik({kind:V.Yj().min(1,"Required"),spec:V.g1(V.Yj(),V.bz())}),R=V.Ik({name:V.Yj(),description:V.Yj().optional(),hidden:V.zM().optional(),color:V.Yj().optional()});function N(e){return V.Ik({display:R,plugin:e})}let $=V.Ik({display:R,plugin:A}),w=V.Ik({name:V.Yj().optional(),description:V.Yj().optional()}),z=V.Ik({display:w.optional(),default:V.zM(),plugin:A});function L(e){return V.Ik({display:w.optional(),default:V.zM(),plugin:e})}let P=V.Yj().min(1,"Required").regex(d,"Must be a valid duration string"),U=V.Ik({name:V.Yj().optional(),description:V.Yj().optional()}),C=V.Ik({kind:V.Yj().min(1),spec:V.Ik({name:V.Yj().optional(),plugin:A})}),Q=V.Ik({name:V.Yj().optional(),url:V.Yj().min(1),tooltip:V.Yj().optional(),renderVariables:V.zM().optional(),targetBlank:V.zM().optional()}),q=V.Ik({display:U.optional(),plugin:A,queries:V.YO(C).optional(),links:V.YO(Q).optional()});function K(e){return V.Ik({display:U.optional(),plugin:e,queries:V.YO(C).optional(),links:V.YO(Q).optional()})}let F=V.Ik({kind:V.eu("Panel"),spec:q});function B(e){return V.Ik({kind:V.eu("Panel"),spec:K(e)})}let G=V.Ik({groupId:V.ai(),panelDefinition:F});function H(e){return V.Ik({groupId:V.ai(),panelDefinition:B(e)})}let W=V.Ik({name:V.Yj().optional(),description:V.Yj().optional(),hidden:V.zM().optional()}),X=V.Ik({name:V.Yj().min(1),display:W.optional(),defaultValue:V.Yj().or(V.YO(V.Yj())).optional(),allowAllValue:V.zM(),allowMultiple:V.zM(),customAllValue:V.Yj().optional(),capturingRegexp:V.Yj().optional(),sort:V.k5(["none","alphabetical-asc","alphabetical-desc","numerical-asc","numerical-desc","alphabetical-ci-asc","alphabetical-ci-desc"]).optional(),plugin:A});function J(e){return V.Ik({name:V.Yj().min(1),display:W.optional(),defaultValue:V.Yj().or(V.YO(V.Yj())).optional(),allowAllValue:V.zM(),allowMultiple:V.zM(),customAllValue:V.Yj().optional(),capturingRegexp:V.Yj().optional(),sort:V.k5(["none","alphabetical-asc","alphabetical-desc","numerical-asc","numerical-desc","alphabetical-ci-asc","alphabetical-ci-desc"]).optional(),plugin:e})}let Z=V.Ik({kind:V.eu("ListVariable"),spec:X});function ee(e){return V.Ik({kind:V.eu("ListVariable"),spec:J(e)})}let ea=V.Ik({name:V.Yj().min(1),display:W.optional(),value:V.Yj(),constant:V.zM().optional()}),en=V.Ik({kind:V.eu("TextVariable"),spec:ea}),et=V.gM("kind",[en,Z]);function ei(e){return V.KC([en,ee(e)])}let es=et;function el(e){return V.gM("kind",[V.Ik({kind:V.eu("ListVariable"),spec:J(e)}),V.Ik({kind:V.eu("TextVariable"),spec:ea})])}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.chunk_TimeSeriesTable=self.chunk_TimeSeriesTable||[]).push([["25"],{2770(e,n,t){t.r(n),t.d(n,{TimeSeriesTable:()=>T});var s=t(62540),l=t(74628),i=t(3862),r=t(88091),a=t(34007),o=t(91394),c=t(70561),d=t(3399),h=t(45271),u=t(42927),x=t(5139),m=t(315),p=t(21860),j=t(39420),g=t(70451),A=t(13850),f=t.n(A);function v(e){let{kind:n,spec:t,queryResults:l}=e,{ref:r,width:a=1,height:o=1}=f()();return(0,s.jsx)("div",{ref:r,style:{height:"100%"},children:(0,s.jsx)(i.ErrorBoundary,{FallbackComponent:i.ErrorAlert,children:(0,s.jsx)(p.PanelPluginLoader,{kind:n,contentDimensions:{width:a,height:o},spec:t,queryResults:l})})})}function b(e){let{name:n,labels:t,formattedName:l,isFormatted:i}=e;return i&&t&&Object.keys(t).length>0?(0,s.jsx)(y,{labels:t}):(0,s.jsx)(r.A,{sx:{textWrap:"auto"},children:l??n})}function y(e){let{labels:n}=e,{infoSnackbar:t}=(0,i.useSnackbar)(),l=[],a=!0;function o(e){let n=e.currentTarget.innerText||"";navigator.clipboard.writeText(n.trim()).then(()=>{t(`Copied label matcher: ${n}`)}).catch(e=>{console.error(`unable to copy text: ${e}`)})}for(let e in n)"__name__"!==e&&(l.push((0,s.jsxs)("span",{children:[!a&&", ",(0,s.jsxs)(r.A,{display:"inline",component:"span",sx:{"&:hover":{cursor:"pointer",textDecoration:"underline"}},onClick:o,title:"Click to copy label matcher",children:[(0,s.jsx)("strong",{children:e}),"=",(0,s.jsxs)("span",{children:['"',n[e],'"']})]})]},e)),a&&(a=!1));return(0,s.jsxs)(r.A,{sx:{textWrap:"auto"},children:[n?n.__name__:"","{",l,"}"]})}function S(e){var n,t,s,l;return{...e.labels,name:e.name,formattedName:e.formattedName,value:null==(t=e.values)||null==(n=t[0])?void 0:n[1],timestamp:null==(l=e.values)||null==(s=l[0])?void 0:s[0]}}let C=e=>{var n;let{queryResults:t,spec:A}=e,f=(0,j.useAllVariableValues)(),y=(0,g.useMemo)(()=>t.flatMap(e=>e.data).flatMap(e=>(null==e?void 0:e.series)||[]),[t]),C=(null==(n=A.selection)?void 0:n.enabled)??!1,{selectionMap:T,setSelection:w,clearSelection:_,toggleSelection:I}=(0,i.useSelection)(),$=A.actions?A.actions:void 0,M=(0,g.useMemo)(()=>(null==$?void 0:$.enabled)&&$.displayWithItem?$.actionsList:[],[null==$?void 0:$.enabled,null==$?void 0:$.displayWithItem,null==$?void 0:$.actionsList]),{getItemActionButtons:N,confirmDialog:O,actionButtons:P}=(0,p.useSelectionItemActions)({actions:M,variableState:f}),q=P&&P.length>0,D=(0,g.useMemo)(()=>0!==y.length&&y.every((e,n)=>T.has(n.toString())),[y,T]),E=(0,g.useMemo)(()=>{if(0===y.length)return!1;let e=y.filter((e,n)=>T.has(n.toString())).length;return e>0&&e<y.length},[y,T]),R=(0,g.useCallback)(()=>{D?_():w(y.map((e,n)=>({id:n.toString(),item:S(e)})))},[D,y,w,_]),W=(0,g.useCallback)((e,n)=>{I(S(e),n.toString())},[I]),F=(0,g.useMemo)(()=>y.map((e,n)=>({ts:e,idx:n,rowData:S(e)})),[y]);return t&&(null==y?void 0:y.length)?(0,s.jsxs)(s.Fragment,{children:[O,y.length>=1e3&&(0,s.jsxs)(a.A,{severity:"warning",children:["Showing more than ",1e3," series, turning off label formatting for performance reasons."]}),(0,s.jsxs)(o.A,{className:"data-table",children:[C&&y.length>0&&(0,s.jsx)(c.A,{children:(0,s.jsxs)(d.A,{children:[(0,s.jsx)(h.A,{padding:"checkbox",children:(0,s.jsx)(u.A,{indeterminate:E,checked:D,onChange:R,inputProps:{"aria-label":"select all series"}})}),(0,s.jsx)(h.A,{children:"Series"}),(0,s.jsx)(h.A,{children:"Value"}),q&&(0,s.jsx)(h.A,{children:"Actions"})]})}),(0,s.jsx)(x.A,{children:F.map(e=>{var n;let{ts:i,idx:a,rowData:o}=e,c=((null==(n=i.values)?void 0:n.length)??0)>1,x=i.values?i.values.map((e,n)=>(0,s.jsxs)(r.A,{children:[e[1]," ",c&&(0,s.jsxs)("span",{children:["@",e[0]]})]},n)):[],p=null;if(i.histograms&&i.histograms.length>0){let e={...t[0],data:{...t[0].data,series:[t[0].data.series[a]]}};p=i.histograms.map((n,t)=>(0,s.jsxs)(m.A,{alignItems:"center",children:[(0,s.jsx)(l.A,{width:400,height:200,children:(0,s.jsx)(v,{kind:"HistogramChart",spec:{unit:"decimal",width:400,height:200},queryResults:[e]})}),(0,s.jsxs)(m.A,{flexDirection:"row",justifyContent:"space-between",width:"100%",children:[(0,s.jsxs)(r.A,{children:["Total count: ",n[1].count]}),(0,s.jsxs)(r.A,{children:["Sum: ",n[1].sum]})]}),k(n[1])]},-t))}let j=a.toString(),g=T.has(j),A=y.length<1e3;return(0,s.jsxs)(d.A,{style:{whiteSpace:"pre"},children:[C&&(0,s.jsx)(h.A,{padding:"checkbox",children:(0,s.jsx)(u.A,{checked:g,onChange:()=>W(i,a),inputProps:{"aria-label":`select series ${a}`}})}),(0,s.jsx)(h.A,{children:(0,s.jsx)(b,{name:i.name,formattedName:i.formattedName,labels:i.labels,isFormatted:A})}),(0,s.jsx)(h.A,{children:i.histograms?p:x}),q&&(0,s.jsx)(h.A,{children:(0,s.jsx)(l.A,{sx:{display:"flex",gap:1},children:N({id:j,data:o})})})]},a)})})]})]}):(0,s.jsx)(l.A,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,s.jsx)(r.A,{children:"No data"})})},k=e=>{var n;return(0,s.jsxs)(o.A,{children:[(0,s.jsx)(c.A,{children:(0,s.jsx)(d.A,{children:(0,s.jsx)(h.A,{style:{textAlign:"center"},colSpan:2,children:"Histogram Sample"})})}),(0,s.jsxs)(x.A,{children:[(0,s.jsxs)(d.A,{children:[(0,s.jsx)(h.A,{children:"Range"}),(0,s.jsx)(h.A,{children:"Count"})]}),null==(n=e.buckets)?void 0:n.map((e,n)=>(0,s.jsxs)(d.A,{children:[(0,s.jsx)(h.A,{children:(e=>{let[n,t,s]=e;return`${3===n||1===n?"[":"("}${t} -> ${s}${3===n||0===n?"]":")"}`})(e)}),(0,s.jsx)(h.A,{children:e[3]})]},n))]})]})},T={PanelComponent:function(e){let{contentDimensions:n,queryResults:t,spec:r}=e,a=(0,i.useChartsTheme)().container.padding.default;return(0,s.jsx)(l.A,{style:{height:(null==n?void 0:n.height)??0},sx:{padding:`${a}px`,overflowY:"scroll"},children:(0,s.jsx)(C,{queryResults:t,spec:r})})},supportedQueryTypes:["TimeSeriesQuery"],queryOptions:{mode:"instant"},panelOptionsEditorComponents:[{label:"Item Actions",content:function(e){let{value:n,onChange:t}=e;return(0,s.jsx)(j.ItemSelectionActionsEditor,{actionOptions:n.actions,onChangeActions:function(e){t({...n,actions:e})},selectionOptions:n.selection,onChangeSelection:function(e){t({...n,selection:e})}})}}],createInitialOptions:()=>({})}}}]);
|
|
File without changes
|
|
File without changes
|