@perses-dev/loki-plugin 0.1.2 → 0.2.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-manifest.json CHANGED
@@ -5,11 +5,11 @@
5
5
  "name": "Loki",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "0.1.2",
8
+ "buildVersion": "0.2.0",
9
9
  "buildName": "@perses-dev/loki-plugin"
10
10
  },
11
11
  "remoteEntry": {
12
- "name": "__mf/js/Loki.3789d265.js",
12
+ "name": "__mf/js/Loki.b0aaf34e.js",
13
13
  "path": "",
14
14
  "type": "global"
15
15
  },
@@ -22,7 +22,7 @@
22
22
  "globalName": "Loki",
23
23
  "pluginVersion": "0.19.1",
24
24
  "prefetchInterface": false,
25
- "publicPath": "/plugins/Loki/"
25
+ "getPublicPath": "function() { const prefix = window.PERSES_PLUGIN_ASSETS_PATH || window.PERSES_APP_CONFIG?.api_prefix || \"\"; return prefix + \"/plugins/Loki/\"; }"
26
26
  },
27
27
  "shared": [
28
28
  {
@@ -343,21 +343,20 @@
343
343
  "__mf/js/async/__federation_expose_LokiDatasource.875ecaed.js"
344
344
  ],
345
345
  "async": [
346
- "__mf/js/async/3849.c4035be2.js",
346
+ "__mf/js/async/282.3d82e785.js",
347
347
  "__mf/js/async/2448.6a132c1c.js",
348
+ "__mf/js/async/8537.dc791586.js",
349
+ "__mf/js/async/4687.1af57d71.js",
350
+ "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.9789679e.js",
348
351
  "__mf/js/async/1540.6b797827.js",
352
+ "__mf/js/async/5780.d837c3cd.js",
353
+ "__mf/js/async/__federation_expose_LokiLogQuery.ab63332a.js",
354
+ "__mf/js/async/3849.c4035be2.js",
349
355
  "__mf/js/async/6664.078084ff.js",
350
356
  "__mf/js/async/4168.645bbaa1.js",
351
357
  "__mf/js/async/6569.f33ecbef.js",
352
358
  "__mf/js/async/__federation_expose_LogsTable.0bf7a331.js",
353
- "__mf/js/async/282.3d82e785.js",
354
- "__mf/js/async/5780.d837c3cd.js",
355
- "__mf/js/async/8537.dc791586.js",
356
- "__mf/js/async/4687.1af57d71.js",
357
- "__mf/js/async/__federation_expose_LokiLogQuery.b5fd8404.js",
358
359
  "__mf/js/async/592.269748ce.js",
359
- "__mf/js/async/3413.6dd92cfd.js",
360
- "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.8e1af800.js",
361
360
  "__mf/js/async/7376.0459aaf7.js",
362
361
  "__mf/js/async/5876.5618763d.js",
363
362
  "__mf/js/async/4693.ba67a5aa.js",
@@ -387,11 +386,11 @@
387
386
  "assets": {
388
387
  "js": {
389
388
  "sync": [
389
+ "__mf/js/async/282.3d82e785.js",
390
390
  "__mf/js/async/2448.6a132c1c.js",
391
391
  "__mf/js/async/8537.dc791586.js",
392
392
  "__mf/js/async/4687.1af57d71.js",
393
- "__mf/js/async/3413.6dd92cfd.js",
394
- "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.8e1af800.js"
393
+ "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.9789679e.js"
395
394
  ],
396
395
  "async": [
397
396
  "__mf/js/async/4238.ac5f0a30.js",
@@ -403,13 +402,13 @@
403
402
  "__mf/js/async/4168.645bbaa1.js",
404
403
  "__mf/js/async/6569.f33ecbef.js",
405
404
  "__mf/js/async/__federation_expose_LogsTable.0bf7a331.js",
405
+ "__mf/js/async/592.269748ce.js",
406
+ "__mf/js/async/7376.0459aaf7.js",
406
407
  "__mf/js/async/282.3d82e785.js",
407
408
  "__mf/js/async/5780.d837c3cd.js",
408
409
  "__mf/js/async/8537.dc791586.js",
409
410
  "__mf/js/async/4687.1af57d71.js",
410
- "__mf/js/async/__federation_expose_LokiLogQuery.b5fd8404.js",
411
- "__mf/js/async/592.269748ce.js",
412
- "__mf/js/async/7376.0459aaf7.js",
411
+ "__mf/js/async/__federation_expose_LokiLogQuery.ab63332a.js",
413
412
  "__mf/js/async/5876.5618763d.js",
414
413
  "__mf/js/async/4693.ba67a5aa.js",
415
414
  "__mf/js/async/3431.2270637c.js",
@@ -442,7 +441,7 @@
442
441
  "__mf/js/async/5780.d837c3cd.js",
443
442
  "__mf/js/async/8537.dc791586.js",
444
443
  "__mf/js/async/4687.1af57d71.js",
445
- "__mf/js/async/__federation_expose_LokiLogQuery.b5fd8404.js"
444
+ "__mf/js/async/__federation_expose_LokiLogQuery.ab63332a.js"
446
445
  ],
447
446
  "async": [
448
447
  "__mf/js/async/3849.c4035be2.js",
@@ -457,10 +456,10 @@
457
456
  "__mf/js/async/5876.5618763d.js",
458
457
  "__mf/js/async/4693.ba67a5aa.js",
459
458
  "__mf/js/async/3431.2270637c.js",
459
+ "__mf/js/async/282.3d82e785.js",
460
460
  "__mf/js/async/8537.dc791586.js",
461
461
  "__mf/js/async/4687.1af57d71.js",
462
- "__mf/js/async/3413.6dd92cfd.js",
463
- "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.8e1af800.js",
462
+ "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.9789679e.js",
464
463
  "__mf/js/async/9654.575f5449.js",
465
464
  "__mf/js/async/4238.ac5f0a30.js",
466
465
  "__mf/js/async/3224.b1170acc.js",
@@ -500,18 +499,17 @@
500
499
  "__mf/js/async/3224.b1170acc.js",
501
500
  "__mf/js/async/282.3d82e785.js",
502
501
  "__mf/js/async/2448.6a132c1c.js",
503
- "__mf/js/async/1540.6b797827.js",
504
- "__mf/js/async/5780.d837c3cd.js",
505
502
  "__mf/js/async/8537.dc791586.js",
506
503
  "__mf/js/async/4687.1af57d71.js",
507
- "__mf/js/async/__federation_expose_LokiLogQuery.b5fd8404.js",
504
+ "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.9789679e.js",
505
+ "__mf/js/async/1540.6b797827.js",
506
+ "__mf/js/async/5780.d837c3cd.js",
507
+ "__mf/js/async/__federation_expose_LokiLogQuery.ab63332a.js",
508
508
  "__mf/js/async/592.269748ce.js",
509
509
  "__mf/js/async/7376.0459aaf7.js",
510
510
  "__mf/js/async/5876.5618763d.js",
511
511
  "__mf/js/async/9654.575f5449.js",
512
512
  "__mf/js/async/4693.ba67a5aa.js",
513
- "__mf/js/async/3413.6dd92cfd.js",
514
- "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.8e1af800.js",
515
513
  "__mf/js/async/2292.35c2eeec.js"
516
514
  ]
517
515
  },
package/mf-stats.json CHANGED
@@ -5,11 +5,11 @@
5
5
  "name": "Loki",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "0.1.2",
8
+ "buildVersion": "0.2.0",
9
9
  "buildName": "@perses-dev/loki-plugin"
10
10
  },
11
11
  "remoteEntry": {
12
- "name": "__mf/js/Loki.3789d265.js",
12
+ "name": "__mf/js/Loki.b0aaf34e.js",
13
13
  "path": "",
14
14
  "type": "global"
15
15
  },
@@ -22,7 +22,7 @@
22
22
  "globalName": "Loki",
23
23
  "pluginVersion": "0.19.1",
24
24
  "prefetchInterface": false,
25
- "publicPath": "/plugins/Loki/"
25
+ "getPublicPath": "function() { const prefix = window.PERSES_PLUGIN_ASSETS_PATH || window.PERSES_APP_CONFIG?.api_prefix || \"\"; return prefix + \"/plugins/Loki/\"; }"
26
26
  },
27
27
  "shared": [
28
28
  {
@@ -394,21 +394,20 @@
394
394
  "__mf/js/async/__federation_expose_LokiDatasource.875ecaed.js"
395
395
  ],
396
396
  "async": [
397
- "__mf/js/async/3849.c4035be2.js",
397
+ "__mf/js/async/282.3d82e785.js",
398
398
  "__mf/js/async/2448.6a132c1c.js",
399
+ "__mf/js/async/8537.dc791586.js",
400
+ "__mf/js/async/4687.1af57d71.js",
401
+ "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.9789679e.js",
399
402
  "__mf/js/async/1540.6b797827.js",
403
+ "__mf/js/async/5780.d837c3cd.js",
404
+ "__mf/js/async/__federation_expose_LokiLogQuery.ab63332a.js",
405
+ "__mf/js/async/3849.c4035be2.js",
400
406
  "__mf/js/async/6664.078084ff.js",
401
407
  "__mf/js/async/4168.645bbaa1.js",
402
408
  "__mf/js/async/6569.f33ecbef.js",
403
409
  "__mf/js/async/__federation_expose_LogsTable.0bf7a331.js",
404
- "__mf/js/async/282.3d82e785.js",
405
- "__mf/js/async/5780.d837c3cd.js",
406
- "__mf/js/async/8537.dc791586.js",
407
- "__mf/js/async/4687.1af57d71.js",
408
- "__mf/js/async/__federation_expose_LokiLogQuery.b5fd8404.js",
409
410
  "__mf/js/async/592.269748ce.js",
410
- "__mf/js/async/3413.6dd92cfd.js",
411
- "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.8e1af800.js",
412
411
  "__mf/js/async/7376.0459aaf7.js",
413
412
  "__mf/js/async/5876.5618763d.js",
414
413
  "__mf/js/async/4693.ba67a5aa.js",
@@ -440,11 +439,11 @@
440
439
  "assets": {
441
440
  "js": {
442
441
  "sync": [
442
+ "__mf/js/async/282.3d82e785.js",
443
443
  "__mf/js/async/2448.6a132c1c.js",
444
444
  "__mf/js/async/8537.dc791586.js",
445
445
  "__mf/js/async/4687.1af57d71.js",
446
- "__mf/js/async/3413.6dd92cfd.js",
447
- "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.8e1af800.js"
446
+ "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.9789679e.js"
448
447
  ],
449
448
  "async": [
450
449
  "__mf/js/async/4238.ac5f0a30.js",
@@ -456,13 +455,13 @@
456
455
  "__mf/js/async/4168.645bbaa1.js",
457
456
  "__mf/js/async/6569.f33ecbef.js",
458
457
  "__mf/js/async/__federation_expose_LogsTable.0bf7a331.js",
458
+ "__mf/js/async/592.269748ce.js",
459
+ "__mf/js/async/7376.0459aaf7.js",
459
460
  "__mf/js/async/282.3d82e785.js",
460
461
  "__mf/js/async/5780.d837c3cd.js",
461
462
  "__mf/js/async/8537.dc791586.js",
462
463
  "__mf/js/async/4687.1af57d71.js",
463
- "__mf/js/async/__federation_expose_LokiLogQuery.b5fd8404.js",
464
- "__mf/js/async/592.269748ce.js",
465
- "__mf/js/async/7376.0459aaf7.js",
464
+ "__mf/js/async/__federation_expose_LokiLogQuery.ab63332a.js",
466
465
  "__mf/js/async/5876.5618763d.js",
467
466
  "__mf/js/async/4693.ba67a5aa.js",
468
467
  "__mf/js/async/3431.2270637c.js",
@@ -497,7 +496,7 @@
497
496
  "__mf/js/async/5780.d837c3cd.js",
498
497
  "__mf/js/async/8537.dc791586.js",
499
498
  "__mf/js/async/4687.1af57d71.js",
500
- "__mf/js/async/__federation_expose_LokiLogQuery.b5fd8404.js"
499
+ "__mf/js/async/__federation_expose_LokiLogQuery.ab63332a.js"
501
500
  ],
502
501
  "async": [
503
502
  "__mf/js/async/3849.c4035be2.js",
@@ -512,10 +511,10 @@
512
511
  "__mf/js/async/5876.5618763d.js",
513
512
  "__mf/js/async/4693.ba67a5aa.js",
514
513
  "__mf/js/async/3431.2270637c.js",
514
+ "__mf/js/async/282.3d82e785.js",
515
515
  "__mf/js/async/8537.dc791586.js",
516
516
  "__mf/js/async/4687.1af57d71.js",
517
- "__mf/js/async/3413.6dd92cfd.js",
518
- "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.8e1af800.js",
517
+ "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.9789679e.js",
519
518
  "__mf/js/async/9654.575f5449.js",
520
519
  "__mf/js/async/4238.ac5f0a30.js",
521
520
  "__mf/js/async/3224.b1170acc.js",
@@ -557,18 +556,17 @@
557
556
  "__mf/js/async/3224.b1170acc.js",
558
557
  "__mf/js/async/282.3d82e785.js",
559
558
  "__mf/js/async/2448.6a132c1c.js",
560
- "__mf/js/async/1540.6b797827.js",
561
- "__mf/js/async/5780.d837c3cd.js",
562
559
  "__mf/js/async/8537.dc791586.js",
563
560
  "__mf/js/async/4687.1af57d71.js",
564
- "__mf/js/async/__federation_expose_LokiLogQuery.b5fd8404.js",
561
+ "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.9789679e.js",
562
+ "__mf/js/async/1540.6b797827.js",
563
+ "__mf/js/async/5780.d837c3cd.js",
564
+ "__mf/js/async/__federation_expose_LokiLogQuery.ab63332a.js",
565
565
  "__mf/js/async/592.269748ce.js",
566
566
  "__mf/js/async/7376.0459aaf7.js",
567
567
  "__mf/js/async/5876.5618763d.js",
568
568
  "__mf/js/async/9654.575f5449.js",
569
569
  "__mf/js/async/4693.ba67a5aa.js",
570
- "__mf/js/async/3413.6dd92cfd.js",
571
- "__mf/js/async/__federation_expose_LokiTimeSeriesQuery.8e1af800.js",
572
570
  "__mf/js/async/2292.35c2eeec.js"
573
571
  ]
574
572
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/loki-plugin",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "scripts": {
5
5
  "dev": "rsbuild dev",
6
6
  "build": "npm run build-mf && concurrently \"npm:build:*\"",
@@ -85,4 +85,4 @@
85
85
  }
86
86
  ]
87
87
  }
88
- }
88
+ }
@@ -1 +0,0 @@
1
- "use strict";(self.chunk_Loki=self.chunk_Loki||[]).push([["3413"],{33567:function(e,s,r){r.d(s,{Z:()=>t});function t({props:e,states:s,muiFormControl:r}){return s.reduce((s,t)=>(s[t]=e[t],r&&void 0===e[t]&&(s[t]=r[t]),s),{})}},23626:function(e,s,r){r.d(s,{Z:()=>y});var t=r(54538),a=r(90496),o=r(82267),n=r(33567),d=r(36683),l=r(51640),i=r(12709),p=r(82319),u=r(90433),m=r(51751),c=r(15143),f=r(24246);let M=(0,i.ZP)("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,s)=>{let{ownerState:r}=e;return[s.root,"secondary"===r.color&&s.colorSecondary,r.filled&&s.filled]}})((0,p.Z)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter((0,u.Z)()).map(([s])=>({props:{color:s},style:{[`&.${c.Z.focused}`]:{color:(e.vars||e).palette[s].main}}})),{props:{},style:{[`&.${c.Z.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${c.Z.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),x=(0,i.ZP)("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,s)=>s.asterisk})((0,p.Z)(({theme:e})=>({[`&.${c.Z.error}`]:{color:(e.vars||e).palette.error.main}}))),y=t.forwardRef(function(e,s){let r=(0,m.i)({props:e,name:"MuiFormLabel"}),{children:t,className:i,color:p,component:u="label",disabled:y,error:h,filled:v,focused:S,required:Z,...k}=r,b=(0,d.Z)(),w=(0,n.Z)({props:r,muiFormControl:b,states:["color","required","focused","disabled","error","filled"]}),$={...r,color:w.color||"primary",component:u,disabled:w.disabled,error:w.error,filled:w.filled,focused:w.focused,required:w.required},I=(e=>{let{classes:s,color:r,focused:t,disabled:a,error:n,filled:d,required:i}=e,p={root:["root",`color${(0,l.Z)(r)}`,a&&"disabled",n&&"error",d&&"filled",t&&"focused",i&&"required"],asterisk:["asterisk",n&&"error"]};return(0,o.Z)(p,c.M,s)})($);return(0,f.jsxs)(M,{as:u,ownerState:$,className:(0,a.Z)(I.root,i),ref:s,...k,children:[t,w.required&&(0,f.jsxs)(x,{ownerState:$,"aria-hidden":!0,className:I.asterisk,children:[" ","*"]})]})})},15143:function(e,s,r){r.d(s,{M:()=>o,Z:()=>n});var t=r(44124),a=r(6749);function o(e){return(0,a.ZP)("MuiFormLabel",e)}let n=(0,t.Z)("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"])},68808:function(e,s,r){r.d(s,{Z:()=>S});var t=r(54538),a=r(82267),o=r(90496),n=r(33567),d=r(36683),l=r(23626),i=r(15143),p=r(51640),u=r(73037),m=r(12709),c=r(82319),f=r(51751),M=r(44124),x=r(6749);function y(e){return(0,x.ZP)("MuiInputLabel",e)}(0,M.Z)("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);var h=r(24246);let v=(0,m.ZP)(l.Z,{shouldForwardProp:e=>(0,u.Z)(e)||"classes"===e,name:"MuiInputLabel",slot:"Root",overridesResolver:(e,s)=>{let{ownerState:r}=e;return[{[`& .${i.Z.asterisk}`]:s.asterisk},s.root,r.formControl&&s.formControl,"small"===r.size&&s.sizeSmall,r.shrink&&s.shrink,!r.disableAnimation&&s.animated,r.focused&&s.focused,s[r.variant]]}})((0,c.Z)(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:e})=>e.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:e})=>e.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:e,ownerState:s})=>"filled"===e&&s.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:e,ownerState:s,size:r})=>"filled"===e&&s.shrink&&"small"===r,style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:e,ownerState:s})=>"outlined"===e&&s.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),S=t.forwardRef(function(e,s){let r=(0,f.i)({name:"MuiInputLabel",props:e}),{disableAnimation:t=!1,margin:l,shrink:i,variant:u,className:m,...c}=r,M=(0,d.Z)(),x=i;void 0===x&&M&&(x=M.filled||M.focused||M.adornedStart);let S=(0,n.Z)({props:r,muiFormControl:M,states:["size","variant","required","focused"]}),Z={...r,disableAnimation:t,formControl:M,shrink:x,size:S.size,variant:S.variant,required:S.required,focused:S.focused},k=(e=>{let{classes:s,formControl:r,size:t,shrink:o,disableAnimation:n,variant:d,required:l}=e,i={root:["root",r&&"formControl",!n&&"animated",o&&"shrink",t&&"normal"!==t&&`size${(0,p.Z)(t)}`,d],asterisk:[l&&"asterisk"]},u=(0,a.Z)(i,y,s);return{...s,...u}})(Z);return(0,h.jsx)(v,{"data-shrink":x,ref:s,className:(0,o.Z)(k.root,m),...c,ownerState:Z,classes:k})})},29085:function(e,s,r){r.d(s,{AO:()=>f,Gt:()=>p,Ib:()=>l,LU:()=>m,T9:()=>d,YF:()=>M,fs:()=>i,oK:()=>u,q0:()=>o,s3:()=>a,sG:()=>n});var t=r(20461);function a(e){return void 0!==e.pastDuration}function o(e){return void 0!==e.start&&void 0!==e.end}function n(e){let s=e.end??new Date;return{start:(0,t.sub)(s,l(e.pastDuration)),end:s}}let d=/^(?:(\d+)y)?(?:(\d+)w)?(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?(?:(\d+)ms)?$/;function l(e){let s=d.exec(e);if(null===s)throw Error(`Invalid duration string '${e}'`);return{years:parseInt(s[1]??"0"),months:0,weeks:parseInt(s[2]??"0"),days:parseInt(s[3]??"0"),hours:parseInt(s[4]??"0"),minutes:parseInt(s[5]??"0"),seconds:parseInt(s[6]??"0")+parseInt(s[7]??"0")/1e3}}function i(e){return""!==e&&d.test(e)}function p(e){return u(e.end.valueOf()-e.start.valueOf())}function u(e){let s=Math.trunc(e/31536e6);s>0&&(e-=31536e6*s);let r=Math.trunc(e/6048e5);r>0&&(e-=6048e5*r);let t=Math.trunc(e/864e5);t>0&&(e-=864e5*t);let a=Math.trunc(e/36e5);a>0&&(e-=36e5*a);let o=Math.trunc(e/6e4);return o>0&&(e-=6e4*o),{years:s,months:0,weeks:r,days:t,hours:a,minutes:o,seconds:e/1e3}}function m(e){let s=[];if(e.years&&s.push(`${e.years}y`),e.weeks&&s.push(`${e.weeks}w`),e.days&&s.push(`${e.days}d`),e.hours&&s.push(`${e.hours}h`),e.minutes&&s.push(`${e.minutes}m`),e.seconds){let r=Math.trunc(e.seconds);r&&s.push(`${r}s`);let t=Math.round((e.seconds-r)*1e3);t&&s.push(`${t}ms`)}return s.join("")}let c=[{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 f(e){for(let{maxMs:s,roundedStepMs:r}of c)if(e<s)return r;return 15e3}function M(e,s){return f(Math.floor((e.end.valueOf()-e.start.valueOf())/s))}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.chunk_Loki=self.chunk_Loki||[]).push([["2705"],{47568:function(e,t,r){r.d(t,{h:()=>d});var a=r(24246),o=r(54538),n=r(94776),i=r(97313),l=r(61262),s=r(40495),u=r(94197);let c=(0,u.Gv)({LineComment:u.pJ.comment,"Identifier StreamSelector":u.pJ.labelName,"LabelName LabelMatcher":u.pJ.labelName,String:u.pJ.string,"Number Float Duration":u.pJ.number,"LogRangeAggregation VectorAggregation":u.pJ.function(u.pJ.keyword),"And Or Unless":u.pJ.logicOperator,"Eq Neq Re Nre Gt Lt Gte Lte":u.pJ.compareOperator,"Add Sub Mul Div Mod Pow":u.pJ.arithmeticOperator,Pipe:u.pJ.operator,"By Without":u.pJ.keyword,"( )":u.pJ.paren,"[ ]":u.pJ.squareBracket,"{ }":u.pJ.brace,"⚠":u.pJ.invalid});function d(e){let t=(0,n.Z)(),r="dark"===t.palette.mode,u=(0,o.useMemo)(()=>[l.qp.define({parser:s.E2.configure({props:[c]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}})],[]),d=(0,o.useMemo)(()=>{let e="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return i.tk.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.ZP,{...e,theme:r?"dark":"light",basicSetup:{lineNumbers:!1,highlightActiveLine:!1,highlightActiveLineGutter:!1,foldGutter:!1,syntaxHighlighting:!0},extensions:[i.tk.lineWrapping,u,d],placeholder:'Example: {job="my-service"} |= "error"'})}},2570:function(e,t,r){r.d(t,{bK:()=>a}),r(87570);let a="LokiDatasource"},82201:function(e,t,r){r.d(t,{M:()=>a,Q:()=>o});let a="LokiDatasource",o={kind:a}},74756:function(e,t,r){r.r(t),r.d(t,{LokiLogQuery:()=>k,getLokiLogData:()=>n,LokiLogQueryEditor:()=>b});var a=r(87570),o=r(82201);let n=async(e,t)=>{if(!e.query)return{logs:{entries:[],totalCount:0},timeRange:{start:t.timeRange.start,end:t.timeRange.end}};let r=(0,a.replaceVariables)(e.query,t.variableState),n=await t.datasourceStore.getDatasourceClient(e.datasource??o.Q),{start:i,end:l}=t.timeRange,s=await n.queryRange({query:r,start:i.getTime().toString(),end:l.getTime().toString(),direction:e.direction});return"streams"===s.data.resultType?{logs:function(e){let t=[];return e.forEach(e=>{e.values.forEach(r=>{let[a,o]=r;t.push({timestamp:Number(a)/1e9,line:o,labels:e.stream})})}),{entries:t,totalCount:t.length}}(s.data.result),timeRange:{start:i,end:l},metadata:{executedQueryString:r}}:{logs:{entries:[],totalCount:0},timeRange:{start:i,end:l}}};var i=r(24246),l=r(25283),s=r(68808),u=r(5404),c=r(98346),d=r(54538),g=r(75586),p=r(64010),m=r(47568),h=r(2570);function b(e){let{onChange:t,value:r}=e,{datasource:n}=r,b=n??o.Q,k=(0,a.useDatasourceSelectValueToSelector)(b,h.bK),[x,f]=(0,d.useState)(r.query);(0,d.useEffect)(()=>{f(r.query)},[r.query]);let y=(0,d.useCallback)(e=>{f(e)},[]),L=(0,d.useCallback)(e=>{t({...r,query:e})},[t,r]);return(0,i.jsxs)(l.Z,{spacing:1.5,paddingBottom:1,children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(s.Z,{sx:{display:"block",marginBottom:"4px",fontWeight:500},children:"Datasource"}),(0,i.jsx)(a.DatasourceSelect,{datasourcePluginKind:o.M,value:k,onChange:e=>{if(!(0,a.isVariableDatasource)(e)&&e.kind===o.M)return void t({...r,datasource:e});throw Error("Got unexpected non LokiQuery datasource selection")},label:"Loki Datasource",notched:!0})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(s.Z,{sx:{display:"block",marginBottom:"4px",fontWeight:500},children:"LogQL Query"}),(0,i.jsx)(m.h,{value:x,onChange:y,onBlur:()=>L(x),onKeyDown:e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),L(x))},placeholder:'Enter LogQL query (e.g. {job="mysql"} |= "error")'})]}),(0,i.jsx)("div",{children:(0,i.jsx)(p.OptionsEditorControl,{label:"Order",control:(0,i.jsxs)(u.Z,{exclusive:!0,value:(null==r?void 0:r.direction)??"backward",onChange:(e,a)=>t((0,g.Uy)(r,e=>{e.direction=a})),sx:{height:"36px",marginLeft:"10px",width:"max-content"},children:[(0,i.jsx)(c.Z,{"aria-label":"backward",value:"backward",sx:{fontWeight:500},children:"Newest first"}),(0,i.jsx)(c.Z,{"aria-label":"forward",value:"forward",sx:{fontWeight:500},children:"Oldest first"})]})})})]})}let k={getLogData:n,OptionsEditorComponent:b,createInitialOptions:()=>({query:""}),dependsOn:e=>({variables:[...new Set([...(0,a.parseVariables)(e.query)])]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.chunk_Loki=self.chunk_Loki||[]).push([["1966"],{47568:function(e,t,r){r.d(t,{h:()=>d});var a=r(24246),i=r(54538),n=r(94776),o=r(97313),s=r(61262),l=r(40495),u=r(94197);let c=(0,u.Gv)({LineComment:u.pJ.comment,"Identifier StreamSelector":u.pJ.labelName,"LabelName LabelMatcher":u.pJ.labelName,String:u.pJ.string,"Number Float Duration":u.pJ.number,"LogRangeAggregation VectorAggregation":u.pJ.function(u.pJ.keyword),"And Or Unless":u.pJ.logicOperator,"Eq Neq Re Nre Gt Lt Gte Lte":u.pJ.compareOperator,"Add Sub Mul Div Mod Pow":u.pJ.arithmeticOperator,Pipe:u.pJ.operator,"By Without":u.pJ.keyword,"( )":u.pJ.paren,"[ ]":u.pJ.squareBracket,"{ }":u.pJ.brace,"⚠":u.pJ.invalid});function d(e){let t=(0,n.Z)(),r="dark"===t.palette.mode,u=(0,i.useMemo)(()=>[s.qp.define({parser:l.E2.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 o.tk.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)(o.ZP,{...e,theme:r?"dark":"light",basicSetup:{lineNumbers:!1,highlightActiveLine:!1,highlightActiveLineGutter:!1,foldGutter:!1,syntaxHighlighting:!0},extensions:[o.tk.lineWrapping,u,d],placeholder:'Example: {job="my-service"} |= "error"'})}},2570:function(e,t,r){r.d(t,{bK:()=>a}),r(87570);let a="LokiDatasource"},82201:function(e,t,r){r.d(t,{M:()=>a,Q:()=>i});let a="LokiDatasource",i={kind:a}},70150:function(e,t,r){r.r(t),r.d(t,{LokiQueryEditor:()=>m,LokiTimeSeriesQuery:()=>h,getLokiTimeSeriesData:()=>s});var a=r(29085),i=r(87570),n=r(20461),o=r(82201);let s=async(e,t)=>{if(!e.query)return{series:[],timeRange:{start:t.timeRange.start,end:t.timeRange.end},stepMs:15e3};let r=(0,i.replaceVariables)(e.query,t.variableState),s=await t.datasourceStore.getDatasourceClient(e.datasource??o.Q),{start:l,end:u}=t.timeRange,c=e.step?function(e){if(!e)return;let t=(0,a.Ib)(e);return Math.floor((0,n.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,i=(t-e)/1e3/1e4;return i>1&&(i=Math.ceil(i)),Math.max(a/1e3,r,i)}(l.getTime(),u.getTime(),c,t.suggestedStepMs),p=d<60?`${Math.round(d)}s`:d<3600?`${Math.round(d/60)}m`:`${Math.round(d/3600)}h`,g=1e3*d,m=await s.queryRange({query:r,start:l.getTime().toString(),end:u.getTime().toString(),step:p});return"matrix"===m.data.resultType?{series:m.data.result.map(e=>({name:Object.entries(e.metric).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:e.metric})),timeRange:{start:l,end:u},stepMs:g,metadata:{executedQueryString:r}}:{series:[],timeRange:{start:l,end:u},stepMs:g}};var l=r(24246),u=r(25283),c=r(68808),d=r(54538),p=r(47568),g=r(2570);function m(e){let{onChange:t,value:r}=e,{datasource:a}=r,n=a??o.Q,s=(0,i.useDatasourceSelectValueToSelector)(n,g.bK),[m,h]=(0,d.useState)(r.query);(0,d.useEffect)(()=>{h(r.query)},[r.query]);let b=(0,d.useCallback)(e=>{h(e)},[]),k=(0,d.useCallback)(e=>{t({...r,query:e})},[t,r]);return(0,l.jsxs)(u.Z,{spacing:1.5,paddingBottom:1,children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(c.Z,{sx:{display:"block",marginBottom:"4px",fontWeight:500},children:"Datasource"}),(0,l.jsx)(i.DatasourceSelect,{datasourcePluginKind:o.M,value:s,onChange:e=>{if(!(0,i.isVariableDatasource)(e)&&e.kind===o.M)return void t({...r,datasource:e});throw Error("Got unexpected non LokiQuery datasource selection")},label:"Loki Datasource",notched:!0})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(c.Z,{sx:{display:"block",marginBottom:"4px",fontWeight:500},children:"LogQL Query"}),(0,l.jsx)(p.h,{value:m,onChange:b,onBlur:()=>k(m),onKeyDown:e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),k(m))},placeholder:'Enter LogQL query (e.g. {job="mysql"} |= "error")'})]})]})}let h={getTimeSeriesData:s,OptionsEditorComponent:m,createInitialOptions:()=>({query:""}),dependsOn:e=>({variables:[...new Set([...(0,i.parseVariables)(e.query)])]})}}}]);