@@ -8,24 +8,39 @@ 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+ 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