@@ -8,24 +8,45 @@ const imageData = Buffer.from((readFileSync(join(import.meta.dirname, '../files/
88
99const 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+ let isInfV9 = false
14+ const params = {
15+ id : '' ,
16+ slug : '' ,
17+ }
18+ const grafanaUrl = getConfig ( ) . grafanaUrl
19+ if ( typeof project === 'string' && typeof organization === 'string' ) {
20+ params . id = projectId
21+ params . slug = `${ organization } -${ project } `
22+ isInfV9 = true
23+ } else {
24+ params . id = project . id
25+ params . slug = project . slug
26+ }
27+ return [
28+ {
29+ to : `${ grafanaUrl } /prod-${ compressUUID ( String ( params . id ) ) } ` ,
30+ title : isInfV9 ? 'Production' : undefined ,
31+ description : 'Production' ,
32+ } ,
33+ {
34+ to : `${ grafanaUrl } /prod-${ params . slug } ` ,
35+ title : isInfV9 ? 'Production ancien' : undefined ,
36+ description : 'Production ancien' ,
37+ } ,
38+ {
39+ to : `${ grafanaUrl } /hprod-${ compressUUID ( String ( params . id ) ) } ` ,
40+ title : isInfV9 ? 'Hors production' : undefined ,
41+ description : 'Hors production' ,
42+ } ,
43+ {
44+ to : `${ grafanaUrl } /hprod-${ params . slug } ` ,
45+ title : isInfV9 ? 'Hors production ancien' : undefined ,
46+ description : 'Hors production ancien' ,
47+ } ,
48+ ]
49+ } ,
2950 title : 'Grafana' ,
3051 imgSrc : `data:image/png;base64,${ imageData } ` ,
3152 description : 'Grafana est un outil de métrique et de logs' ,
0 commit comments