@perses-dev/victorialogs-plugin 0.5.0-beta.4 → 0.5.0-beta.6
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/{VictoriaLogs.0e9b354b.js → VictoriaLogs.4c495bed.js} +3 -3
- package/__mf/js/async/{1616.f1eccc4c.js → 1616.82d4415e.js} +1 -1
- package/__mf/js/async/{198.62d932b8.js → 198.eaf0c6e9.js} +2 -2
- package/__mf/js/async/{2043.88a30296.js → 2043.c7890092.js} +2 -2
- package/__mf/js/async/{2377.5748307c.js → 2377.4d92bfcb.js} +1 -1
- package/__mf/js/async/{2786.4c8d0152.js → 2786.773d9359.js} +2 -2
- package/__mf/js/async/{2901.5a873d2d.js → 2901.608f45ff.js} +1 -1
- package/__mf/js/async/3068.988451f7.js +88 -0
- package/__mf/js/async/{3286.85ae05a3.js → 3286.c737c09b.js} +1 -1
- package/__mf/js/async/{392.2d34662e.js → 392.6731d83c.js} +2 -2
- package/__mf/js/async/{4077.49dfb154.js → 4077.a42401ce.js} +1 -1
- package/__mf/js/async/{4121.cfe4b322.js → 4121.770269c0.js} +2 -2
- package/__mf/js/async/{4248.30f8bd6d.js → 4248.91e6cc6e.js} +1 -1
- package/__mf/js/async/{4496.db305e0f.js → 4496.9fae4748.js} +1 -1
- package/__mf/js/async/{4960.68a75c2b.js → 4960.cb8a05de.js} +2 -2
- package/__mf/js/async/{5019.e765213b.js → 5019.ac272b15.js} +1 -1
- package/__mf/js/async/{5071.1b1ab449.js → 5071.560c053a.js} +1 -1
- package/__mf/js/async/537.1c481610.js +7 -0
- package/__mf/js/async/{5440.e7e6eeba.js → 5440.09f0226b.js} +2 -2
- package/__mf/js/async/{5587.e6c8c9cb.js → 5587.64d39b17.js} +1 -1
- package/__mf/js/async/{5706.74e30cc1.js → 5706.75b5373a.js} +1 -1
- package/__mf/js/async/{6274.f2baa565.js → 6274.d7d67416.js} +2 -2
- package/__mf/js/async/{6854.7f44cdf5.js → 6854.1894c973.js} +1 -1
- package/__mf/js/async/{7192.d01de220.js → 7192.ed537c4a.js} +1 -1
- package/__mf/js/async/{7740.83fe7f7a.js → 7740.0ea3301c.js} +2 -2
- package/__mf/js/async/{7817.f44cbee0.js → 7817.f8e5f9c1.js} +2 -2
- package/__mf/js/async/{7862.198947f4.js → 7862.7dae5507.js} +2 -2
- package/__mf/js/async/{7968.608789bf.js → 7968.01e0eae9.js} +1 -1
- package/__mf/js/async/{7978.0522ea0c.js → 7978.3243a72e.js} +1 -1
- package/__mf/js/async/8253.cd3d4c47.js +37 -0
- package/__mf/js/async/{8356.fd841d9a.js → 8356.a177b6d1.js} +1 -1
- package/__mf/js/async/{8470.02ee5a12.js → 8470.45505eb5.js} +2 -2
- package/__mf/js/async/8555.1f58e1a5.js +52 -0
- package/__mf/js/async/{873.ffe1cd58.js → 873.dc975fe1.js} +1 -1
- package/__mf/js/async/{9207.0bc63081.js → 9207.037948df.js} +1 -1
- package/__mf/js/async/{9235.aef57230.js → 9235.a48b3e89.js} +1 -1
- package/__mf/js/async/{941.1ea1b3b3.js → 941.cce123a8.js} +2 -2
- package/__mf/js/async/{9440.e728b28c.js → 9440.af442e76.js} +2 -2
- package/__mf/js/async/{9588.71b86749.js → 9588.4997a7af.js} +1 -1
- package/__mf/js/async/{__federation_expose_VictoriaLogsDatasource.f77ef699.js → __federation_expose_VictoriaLogsDatasource.9377181e.js} +2 -2
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldNamesVariable.129a25d1.js +2 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldValuesVariable.06a1024e.js +2 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsLogQuery.b36ca46c.js +1 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsTimeSeriesQuery.cd896f43.js +1 -0
- package/__mf/js/{main.5ca3e852.js → main.b2110334.js} +2 -2
- package/lib/setup-tests.js +7 -0
- package/lib/setup-tests.js.map +1 -1
- package/mf-manifest.json +135 -135
- package/mf-stats.json +135 -135
- package/package.json +6 -6
- package/__mf/js/async/1185.16755014.js +0 -7
- package/__mf/js/async/2830.f98b832e.js +0 -22
- package/__mf/js/async/560.276a458f.js +0 -37
- package/__mf/js/async/7607.3676d944.js +0 -52
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldNamesVariable.21dca4df.js +0 -2
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldValuesVariable.8097b38a.js +0 -2
- package/__mf/js/async/__federation_expose_VictoriaLogsLogQuery.579e7589.js +0 -1
- package/__mf/js/async/__federation_expose_VictoriaLogsTimeSeriesQuery.48740ac8.js +0 -1
- /package/__mf/css/async/{1185.85c2cbf6.css → 537.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{198.62d932b8.js.LICENSE.txt → 198.eaf0c6e9.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2043.88a30296.js.LICENSE.txt → 2043.c7890092.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2786.4c8d0152.js.LICENSE.txt → 2786.773d9359.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2830.f98b832e.js.LICENSE.txt → 3068.988451f7.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.2d34662e.js.LICENSE.txt → 392.6731d83c.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4121.cfe4b322.js.LICENSE.txt → 4121.770269c0.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4960.68a75c2b.js.LICENSE.txt → 4960.cb8a05de.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{1185.16755014.js.LICENSE.txt → 537.1c481610.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5440.e7e6eeba.js.LICENSE.txt → 5440.09f0226b.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.f2baa565.js.LICENSE.txt → 6274.d7d67416.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{7817.f44cbee0.js.LICENSE.txt → 7817.f8e5f9c1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{7862.198947f4.js.LICENSE.txt → 7862.7dae5507.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.02ee5a12.js.LICENSE.txt → 8470.45505eb5.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.1ea1b3b3.js.LICENSE.txt → 941.cce123a8.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{9440.e728b28c.js.LICENSE.txt → 9440.af442e76.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_VictoriaLogsDatasource.f77ef699.js.LICENSE.txt → __federation_expose_VictoriaLogsDatasource.9377181e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_VictoriaLogsFieldNamesVariable.21dca4df.js.LICENSE.txt → __federation_expose_VictoriaLogsFieldNamesVariable.129a25d1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_VictoriaLogsFieldValuesVariable.8097b38a.js.LICENSE.txt → __federation_expose_VictoriaLogsFieldValuesVariable.06a1024e.js.LICENSE.txt} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see __federation_expose_VictoriaLogsFieldNamesVariable.21dca4df.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.chunk_VictoriaLogs_0_5_0_beta_4=self.chunk_VictoriaLogs_0_5_0_beta_4||[]).push([["3859"],{2192(e,a,r){var t=r(70451),o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function n(e,a,r){var t,s={},n=null,c=null;for(t in void 0!==r&&(n=""+r),void 0!==a.key&&(n=""+a.key),void 0!==a.ref&&(c=a.ref),a)i.call(a,t)&&!u.hasOwnProperty(t)&&(s[t]=a[t]);if(e&&e.defaultProps)for(t in a=e.defaultProps)void 0===s[t]&&(s[t]=a[t]);return{$$typeof:o,type:e,key:n,ref:c,props:s,_owner:l.current}}a.Fragment=s,a.jsx=n,a.jsxs=n},62540(e,a,r){e.exports=r(2192)},50095(e,a,r){r.d(a,{H6:()=>l,m_:()=>o,fZ:()=>i,jx:()=>s});var t=r(98873);let o="VictoriaLogsDatasource",s={kind:o};function i(e){return!(0,t.isVariableDatasource)(e)&&void 0===e.name}function l(e){return(0,t.isVariableDatasource)(e)||e.kind===o}},92229(e,a,r){r.d(a,{Iq:()=>s,RG:()=>i,gZ:()=>l});var t=r(98873),o=r(91807);let s=e=>e?e.map(e=>({value:e.value,label:e.value})):[];function i(e){let{start:a,end:r}=e;return{start:a.toISOString(),end:r.toISOString()}}function l(e,a){let{absoluteTimeRange:{start:r,end:s}}=(0,t.useTimeRange)(),{data:i}=(0,t.useDatasourceClient)(a),l=!!i&&!!e;return(0,o.useQuery)({enabled:l,queryKey:["datasource",a.name,"query",e],queryFn:async()=>await i.fieldNames({start:r.toISOString(),end:s.toISOString(),query:e})})}},84704(e,a,r){r.r(a),r.d(a,{VictoriaLogsFieldNamesVariable:()=>_});var t=r(98873),o=r(50095),s=r(92229),i=r(62540),l=r(315),u=r(67987),n=r(93648),c=r(38662),d=r(70451);let _={getVariableOptions:async(e,a)=>{let r=(0,t.datasourceSelectValueToSelector)(e.datasource??o.jx,a.variables,await a.datasourceStore.listDatasourceSelectItems(o.m_))??o.jx,i=await a.datasourceStore.getDatasourceClient(r),l=(0,s.RG)(a.timeRange),u=(0,t.replaceVariables)(e.query,a.variables),{values:n}=u?await i.fieldNames({query:u,...l}):{values:[]};return{data:(0,s.Iq)(n)}},dependsOn:e=>({variables:[...(0,t.parseVariables)(e.query),...e.datasource&&(0,t.isVariableDatasource)(e.datasource)?(0,t.parseVariables)(e.datasource):[]]}),OptionsEditorComponent:function(e){let{onChange:a,value:r,value:{datasource:s,query:_}}=e,p=s??o.jx,y=(0,t.useDatasourceSelectValueToSelector)(p,o.m_),b=(0,d.useCallback)(e=>{if((0,t.isVariableDatasource)(e)||(0,o.H6)(e))return void a((0,c.produce)(r,a=>{a.datasource=!(0,t.isVariableDatasource)(e)&&(0,o.fZ)(e)?void 0:e}));throw Error("Got unexpected non-VictoriaLogs datasource selector")},[a,r]),f=(0,d.useCallback)(e=>{a((0,c.produce)(r,a=>{a.query=e.target.value}))},[a,r]);return(0,i.jsxs)(l.A,{spacing:2,children:[(0,i.jsx)(u.A,{margin:"dense",children:(0,i.jsx)(t.DatasourceSelect,{datasourcePluginKind:"VictoriaLogsDatasource",value:y,onChange:b,disabled:e.isReadonly,labelId:"victorialogs-datasource-field",label:"VictoriaLogs Datasource"})}),(0,i.jsx)(n.A,{label:"Query",InputLabelProps:{shrink:!!e.isReadonly||void 0},InputProps:{readOnly:e.isReadonly},value:_,onChange:f})]})},createInitialOptions:()=>({query:""})}}}]);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see __federation_expose_VictoriaLogsFieldValuesVariable.8097b38a.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.chunk_VictoriaLogs_0_5_0_beta_4=self.chunk_VictoriaLogs_0_5_0_beta_4||[]).push([["4209"],{2192(e,a,r){var t=r(70451),o=Symbol.for("react.element"),l=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n={key:!0,ref:!0,__self:!0,__source:!0};function u(e,a,r){var t,l={},u=null,c=null;for(t in void 0!==r&&(u=""+r),void 0!==a.key&&(u=""+a.key),void 0!==a.ref&&(c=a.ref),a)i.call(a,t)&&!n.hasOwnProperty(t)&&(l[t]=a[t]);if(e&&e.defaultProps)for(t in a=e.defaultProps)void 0===l[t]&&(l[t]=a[t]);return{$$typeof:o,type:e,key:u,ref:c,props:l,_owner:s.current}}a.Fragment=l,a.jsx=u,a.jsxs=u},62540(e,a,r){e.exports=r(2192)},50095(e,a,r){r.d(a,{H6:()=>s,m_:()=>o,fZ:()=>i,jx:()=>l});var t=r(98873);let o="VictoriaLogsDatasource",l={kind:o};function i(e){return!(0,t.isVariableDatasource)(e)&&void 0===e.name}function s(e){return(0,t.isVariableDatasource)(e)||e.kind===o}},92229(e,a,r){r.d(a,{Iq:()=>l,RG:()=>i,gZ:()=>s});var t=r(98873),o=r(91807);let l=e=>e?e.map(e=>({value:e.value,label:e.value})):[];function i(e){let{start:a,end:r}=e;return{start:a.toISOString(),end:r.toISOString()}}function s(e,a){let{absoluteTimeRange:{start:r,end:l}}=(0,t.useTimeRange)(),{data:i}=(0,t.useDatasourceClient)(a),s=!!i&&!!e;return(0,o.useQuery)({enabled:s,queryKey:["datasource",a.name,"query",e],queryFn:async()=>await i.fieldNames({start:r.toISOString(),end:l.toISOString(),query:e})})}},85624(e,a,r){r.r(a),r.d(a,{VictoriaLogsFieldValuesVariable:()=>p});var t=r(98873),o=r(50095),l=r(92229),i=r(62540),s=r(315),n=r(67987),u=r(31271),c=r(93648),d=r(38662),f=r(70451);let p={getVariableOptions:async(e,a)=>{let r=(0,t.datasourceSelectValueToSelector)(e.datasource??o.jx,a.variables,await a.datasourceStore.listDatasourceSelectItems(o.m_))??o.jx,i=await a.datasourceStore.getDatasourceClient(r),s=(0,t.replaceVariables)(e.query,a.variables),n=(0,l.RG)(a.timeRange),{values:u}=s?await i.fieldValues({field:(0,t.replaceVariables)(e.field,a.variables),query:s,...n}):{values:[]};return{data:(0,l.Iq)(u)}},dependsOn:e=>({variables:[...(0,t.parseVariables)(e.query),...(0,t.parseVariables)(e.field),...e.datasource&&(0,t.isVariableDatasource)(e.datasource)?(0,t.parseVariables)(e.datasource):[]]}),OptionsEditorComponent:function(e){let{onChange:a,value:r,value:{datasource:p,query:b,field:v}}=e,g=p??o.jx,y=(0,t.useDatasourceSelectValueToSelector)(g,o.m_),{data:_,isLoading:V}=(0,l.gZ)(b,y),S=(0,f.useCallback)(e=>{if((0,t.isVariableDatasource)(e)||(0,o.H6)(e))return void a((0,d.produce)(r,a=>{a.datasource=!(0,t.isVariableDatasource)(e)&&(0,o.fZ)(e)?void 0:e}));throw Error("Got unexpected non-VictoriaLogs datasource selector")},[a,r]),m=(0,f.useCallback)(e=>{a((0,d.produce)(r,a=>{a.query=e.target.value}))},[a,r]),O=(0,f.useCallback)((e,t)=>{a((0,d.produce)(r,e=>{e.field=t||""}))},[a,r]),j=(0,f.useMemo)(()=>(null==_?void 0:_.values.map(e=>e.value))||[],[_]);return(0,i.jsxs)(s.A,{spacing:2,children:[(0,i.jsx)(n.A,{margin:"dense",children:(0,i.jsx)(t.DatasourceSelect,{datasourcePluginKind:"VictoriaLogsDatasource",value:g,onChange:S,readOnly:e.isReadonly,labelId:"victorialogs-datasource-field",label:"VictoriaLogs Datasource"})}),(0,i.jsx)(u.A,{freeSolo:!0,disableClearable:!0,value:v,loading:V,options:j,renderInput:e=>(0,i.jsx)(c.A,{...e,required:!0,label:"Field Name",variant:"outlined"}),onChange:O}),(0,i.jsx)(c.A,{required:!0,label:"Query",InputLabelProps:{shrink:!!e.isReadonly||void 0},InputProps:{readOnly:e.isReadonly},value:b,onChange:m})]})},createInitialOptions:()=>({field:"",query:""})}},68102(e,a,r){r.d(a,{A:()=>t});function t(){return(t=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var t in r)({}).hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(null,arguments)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.chunk_VictoriaLogs_0_5_0_beta_4=self.chunk_VictoriaLogs_0_5_0_beta_4||[]).push([["6545"],{6465(e,t,r){r.d(t,{m:()=>g});var a=r(62540),o=r(56599),i=r(29068),n=r(70451),s=r(63960),l=r(6365),u=r(31650);let c=(0,u.pn)({LineComment:u._A.comment,"Identifier StreamSelector":u._A.labelName,"LabelName LabelMatcher":u._A.labelName,String:u._A.string,"Number Float Duration":u._A.number,"LogRangeAggregation VectorAggregation":u._A.function(u._A.keyword),"And Or Unless":u._A.logicOperator,"Eq Neq Re Nre Gt Lt Gte Lte":u._A.compareOperator,"Add Sub Mul Div Mod Pow":u._A.arithmeticOperator,Pipe:u._A.operator,"By Without":u._A.keyword,"( )":u._A.paren,"[ ]":u._A.squareBracket,"{ }":u._A.brace,"⚠":u._A.invalid});function g(e){let t=(0,o.A)(),r="dark"===t.palette.mode,u=(0,n.useMemo)(()=>[s.bj.define({parser:l.K3.configure({props:[c]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}})],[]),g=(0,n.useMemo)(()=>{let e="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return i.Lz.theme({"&":{backgroundColor:"transparent !important",border:`1px solid ${e}`,borderRadius:`${t.shape.borderRadius}px`},"&.cm-focused.cm-editor":{outline:"none"},".cm-content":{padding:"8px"}})},[t]);return(0,a.jsx)(i.Ay,{...e,theme:r?"dark":"light",basicSetup:{lineNumbers:!1,highlightActiveLine:!1,highlightActiveLineGutter:!1,foldGutter:!1,syntaxHighlighting:!0},extensions:[i.Lz.lineWrapping,u,g],placeholder:'Example: {job="my-service"} |= "error"'})}},50095(e,t,r){r.d(t,{H6:()=>s,m_:()=>o,fZ:()=>n,jx:()=>i});var a=r(98873);let o="VictoriaLogsDatasource",i={kind:o};function n(e){return!(0,a.isVariableDatasource)(e)&&void 0===e.name}function s(e){return(0,a.isVariableDatasource)(e)||e.kind===o}},7140(e,t,r){r.d(t,{N:()=>a,S:()=>o});let a="VictoriaLogsDatasource",o={kind:a}},49008(e,t,r){r.r(t),r.d(t,{VictoriaLogsLogQueryEditor:()=>m,getVictoriaLogsLogData:()=>i,VictoriaLogsLogQuery:()=>p});var a=r(98873),o=r(7140);let i=async(e,t)=>{var r,i;let n;if(!e.query)return{logs:{entries:[],totalCount:0},timeRange:{start:t.timeRange.start,end:t.timeRange.end}};let s=(0,a.replaceVariables)(e.query,t.variableState),l=await t.datasourceStore.getDatasourceClient(e.datasource??o.S),{start:u,end:c}=t.timeRange;return{logs:(r=await l.streamQueryRange({query:s,start:u.toISOString(),end:c.toISOString()}),i=c.getTime().toString(),n=[],r.forEach(e=>{let{_msg:t,_time:r,...a}=e,o=r||t?Date.parse(r):i;n.push({timestamp:Number(o)/1e3,line:t||"",labels:a})}),{entries:n,totalCount:n.length}),timeRange:{start:u,end:c},metadata:{executedQueryString:s}}};var n=r(62540),s=r(315),l=r(54227),u=r(38395),c=r(70451),g=r(6465),d=r(50095);function m(e){let{onChange:t,value:r}=e,{datasource:i}=r,m=i??o.S,p=(0,a.useDatasourceSelectValueToSelector)(m,d.m_),[b,h]=(0,c.useState)(r.query);(0,c.useEffect)(()=>{h(r.query)},[r.query]);let y=(0,c.useCallback)(e=>{h(e)},[]),_=(0,c.useCallback)(e=>{t({...r,query:e})},[t,r]);return(0,n.jsxs)(s.A,{spacing:1.5,paddingBottom:1,children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(l.A,{sx:{display:"block",marginBottom:"4px",fontWeight:500},children:"Datasource"}),(0,n.jsx)(a.DatasourceSelect,{datasourcePluginKind:o.N,value:p,onChange:e=>{if(!(0,a.isVariableDatasource)(e)&&e.kind===o.N)return void t({...r,datasource:e});throw Error("Got unexpected non VictoriaLogsQuery datasource selection")},label:"VictoriaLogs Datasource",notched:!0})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(l.A,{sx:{display:"block",marginBottom:"4px",fontWeight:500},children:"LogsQL Query"}),(0,n.jsx)(g.m,{value:b,onChange:y,onBlur:()=>_(b),onKeyDown:(0,u.createModEnterHandler)(()=>_(b)),placeholder:'Enter LogsQL query (e.g. {job="mysql"} |= "error")'})]})]})}let p={getLogData:i,OptionsEditorComponent:m,createInitialOptions:()=>({query:""}),dependsOn:e=>({variables:[...new Set((0,a.parseVariables)(e.query))]}),createVolumeQuery:(e,t)=>{if(!e.query||!e.query.trim())return null;let r=(0,a.calculateVolumeInterval)(t.timeRange.end.getTime()-t.timeRange.start.getTime());return{kind:"TimeSeriesQuery",spec:{plugin:{kind:"VictoriaLogsTimeSeriesQuery",spec:{query:`${e.query} | stats by (_time:${r}, _stream) count() as volume`,datasource:e.datasource,step:r}}}}}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.chunk_VictoriaLogs_0_5_0_beta_4=self.chunk_VictoriaLogs_0_5_0_beta_4||[]).push([["7843"],{6465(e,t,r){r.d(t,{m:()=>d});var a=r(62540),n=r(56599),s=r(29068),i=r(70451),o=r(63960),u=r(6365),l=r(31650);let c=(0,l.pn)({LineComment:l._A.comment,"Identifier StreamSelector":l._A.labelName,"LabelName LabelMatcher":l._A.labelName,String:l._A.string,"Number Float Duration":l._A.number,"LogRangeAggregation VectorAggregation":l._A.function(l._A.keyword),"And Or Unless":l._A.logicOperator,"Eq Neq Re Nre Gt Lt Gte Lte":l._A.compareOperator,"Add Sub Mul Div Mod Pow":l._A.arithmeticOperator,Pipe:l._A.operator,"By Without":l._A.keyword,"( )":l._A.paren,"[ ]":l._A.squareBracket,"{ }":l._A.brace,"⚠":l._A.invalid});function d(e){let t=(0,n.A)(),r="dark"===t.palette.mode,l=(0,i.useMemo)(()=>[o.bj.define({parser:u.K3.configure({props:[c]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}})],[]),d=(0,i.useMemo)(()=>{let e="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return s.Lz.theme({"&":{backgroundColor:"transparent !important",border:`1px solid ${e}`,borderRadius:`${t.shape.borderRadius}px`},"&.cm-focused.cm-editor":{outline:"none"},".cm-content":{padding:"8px"}})},[t]);return(0,a.jsx)(s.Ay,{...e,theme:r?"dark":"light",basicSetup:{lineNumbers:!1,highlightActiveLine:!1,highlightActiveLineGutter:!1,foldGutter:!1,syntaxHighlighting:!0},extensions:[s.Lz.lineWrapping,l,d],placeholder:'Example: {job="my-service"} |= "error"'})}},50095(e,t,r){r.d(t,{H6:()=>o,m_:()=>n,fZ:()=>i,jx:()=>s});var a=r(98873);let n="VictoriaLogsDatasource",s={kind:n};function i(e){return!(0,a.isVariableDatasource)(e)&&void 0===e.name}function o(e){return(0,a.isVariableDatasource)(e)||e.kind===n}},7140(e,t,r){r.d(t,{N:()=>a,S:()=>n});let a="VictoriaLogsDatasource",n={kind:a}},43198(e,t,r){r.r(t),r.d(t,{VictoriaLogsQueryEditor:()=>h,VictoriaLogsTimeSeriesQuery:()=>b,getVictoriaLogsTimeSeriesData:()=>o});var a=r(98873),n=r(88685),s=r(94461),i=r(7140);let o=async(e,t)=>{if(!e.query)return{series:[],timeRange:{start:t.timeRange.start,end:t.timeRange.end},stepMs:15e3};let r=(0,a.replaceVariables)(e.query,t.variableState),o=await t.datasourceStore.getDatasourceClient(e.datasource??i.S),{start:u,end:l}=t.timeRange,c=e.step?function(e){if(!e)return;let t=(0,n.pW)(e);return Math.floor((0,s.milliseconds)(t)/1e3)}(e.step)??15:15,d=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:15,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=(t-e)/1e3/1e4;return n>1&&(n=Math.ceil(n)),Math.max(a/1e3,r,n)}(u.getTime(),l.getTime(),c,t.suggestedStepMs),m=d<60?`${Math.round(d)}s`:d<3600?`${Math.round(d/60)}m`:`${Math.round(d/3600)}h`,g=await o.statsQueryRange({query:r,step:m,start:u.toISOString(),end:l.toISOString()});if("error"===g.status)throw Error(g.error);return{series:g.data.result.map(e=>{let t={...e.metric};if(delete t._stream,delete t.__name__,e.metric._stream){let r=e.metric._stream.match(/{([^}]+)}/);r&&r[1]&&r[1].split(",").forEach(e=>{let[r,a]=e.split("=").map(e=>e.trim().replace(/^"|"$/g,""));r&&a&&(t[r]=a)})}return{name:Object.entries(t).map(e=>{let[t,r]=e;return`${t}=${r}`}).join(", "),values:e.values.map(e=>{let[t,r]=e;return[1e3*Number(t),Number(r)]}),labels:t}}),timeRange:{start:u,end:l},stepMs:1e3*d,metadata:{executedQueryString:r}}};var u=r(62540),l=r(315),c=r(54227),d=r(38395),m=r(70451),g=r(6465),p=r(50095);function h(e){let{onChange:t,value:r}=e,{datasource:n}=r,s=n??i.S,o=(0,a.useDatasourceSelectValueToSelector)(s,p.m_),[h,b]=(0,m.useState)(r.query);(0,m.useEffect)(()=>{b(r.query)},[r.query]);let _=(0,m.useCallback)(e=>{b(e)},[]),y=(0,m.useCallback)(e=>{t({...r,query:e})},[t,r]);return(0,u.jsxs)(l.A,{spacing:1.5,paddingBottom:1,children:[(0,u.jsxs)("div",{children:[(0,u.jsx)(c.A,{sx:{display:"block",marginBottom:"4px",fontWeight:500},children:"Datasource"}),(0,u.jsx)(a.DatasourceSelect,{datasourcePluginKind:i.N,value:o,onChange:e=>{if(!(0,a.isVariableDatasource)(e)&&e.kind===i.N)return void t({...r,datasource:e});throw Error("Got unexpected non VictoriaLogsQuery datasource selection")},label:"VictoriaLogs Datasource",notched:!0})]}),(0,u.jsxs)("div",{children:[(0,u.jsx)(c.A,{sx:{display:"block",marginBottom:"4px",fontWeight:500},children:"LogsQL Query"}),(0,u.jsx)(g.m,{value:h,onChange:_,onBlur:()=>y(h),onKeyDown:(0,d.createModEnterHandler)(()=>y(h)),placeholder:'Enter LogsQL query (e.g. {job="mysql"} |= "error")'})]})]})}let b={getTimeSeriesData:o,OptionsEditorComponent:h,createInitialOptions:()=>({query:""}),dependsOn:e=>({variables:[...new Set((0,a.parseVariables)(e.query))]})}},88685(e,t,r){r.d(t,{FM:()=>d,HA:()=>s,HZ:()=>a,Mk:()=>i,a3:()=>c,g3:()=>l,pW:()=>u,x8:()=>n});let a=36e5,n=864e5,s=6048e5,i=31536e6,o=/^(?:(\d+)y)?(?:(\d+)w)?(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?(?:(\d+)ms)?$/;function u(e){let t=o.exec(e);if(null===t)throw Error(`Invalid duration string '${e}'`);return{years:parseInt(t[1]??"0"),months:0,weeks:parseInt(t[2]??"0"),days:parseInt(t[3]??"0"),hours:parseInt(t[4]??"0"),minutes:parseInt(t[5]??"0"),seconds:parseInt(t[6]??"0")+parseInt(t[7]??"0")/1e3}}function l(e){return""!==e&&o.test(e)}function c(e){let t=[];if(e.years&&t.push(`${e.years}y`),e.weeks&&t.push(`${e.weeks}w`),e.days&&t.push(`${e.days}d`),e.hours&&t.push(`${e.hours}h`),e.minutes&&t.push(`${e.minutes}m`),e.seconds){let r=Math.trunc(e.seconds);r&&t.push(`${r}s`);let a=Math.round((e.seconds-r)*1e3);a&&t.push(`${a}ms`)}return t.join("")}function d(e){var t;let r,o,u,l,c;return(r=Math.trunc((t=e.end.valueOf()-e.start.valueOf())/i))>0&&(t-=r*i),(o=Math.trunc(t/s))>0&&(t-=o*s),(u=Math.trunc(t/n))>0&&(t-=u*n),(l=Math.trunc(t/a))>0&&(t-=l*a),(c=Math.trunc(t/6e4))>0&&(t-=6e4*c),{years:r,months:0,weeks:o,days:u,hours:l,minutes:c,seconds:t/1e3}}}}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|