Skip to content

Commit af6ad2b

Browse files
committed
fix: 🐛 add retro compatibility for 8.24.2
1 parent ff3011d commit af6ad2b

File tree

2 files changed

+34
-19
lines changed

2 files changed

+34
-19
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@cpn-console/observability-plugin",
33
"type": "module",
4-
"version": "0.1.3",
4+
"version": "0.1.2-patch-1",
55
"description": "Loki plugin for DSO console",
66
"exports": {
77
".": {

src/infos.ts

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,39 @@ const imageData = Buffer.from((readFileSync(join(import.meta.dirname, '../files/
88

99
const infos = {
1010
name: 'observability',
11-
to: ({ project }) => [
12-
{
13-
to: `${getConfig().grafanaUrl}/prod-${compressUUID(project.id)}`,
14-
description: 'Production',
15-
},
16-
{
17-
to: `${getConfig().grafanaUrl}/prod-${project.slug}`,
18-
description: 'Production ancien',
19-
},
20-
{
21-
to: `${getConfig().grafanaUrl}/hprod-${compressUUID(project.id)}`,
22-
description: 'Hors production',
23-
},
24-
{
25-
to: `${getConfig().grafanaUrl}/hprod-${project.slug}`,
26-
description: 'Hors production ancien',
27-
},
28-
],
11+
// @ts-ignore retro compatibility
12+
to: ({ project, projectId, organization }) => {
13+
const params = {
14+
id: '',
15+
slug: '',
16+
}
17+
const grafanaUrl = getConfig().grafanaUrl
18+
if (typeof project === 'string' && typeof organization === 'string') {
19+
params.id = projectId
20+
params.slug = `${project}-${organization}`
21+
} else {
22+
params.id = project.id
23+
params.slug = project.slug
24+
}
25+
return [
26+
{
27+
to: `${grafanaUrl}/prod-${compressUUID(params.id)}`,
28+
description: 'Production',
29+
},
30+
{
31+
to: `${grafanaUrl}/prod-${params.slug}`,
32+
description: 'Production ancien',
33+
},
34+
{
35+
to: `${grafanaUrl}/hprod-${compressUUID(params.id)}`,
36+
description: 'Hors production',
37+
},
38+
{
39+
to: `${grafanaUrl}/hprod-${params.slug}`,
40+
description: 'Hors production ancien',
41+
},
42+
]
43+
},
2944
title: 'Grafana',
3045
imgSrc: `data:image/png;base64,${imageData}`,
3146
description: 'Grafana est un outil de métrique et de logs',

0 commit comments

Comments
 (0)