CloudAdminPage.53112753380f843c0d2e.js.map 3.1 KB

1
  1. {"version":3,"file":"CloudAdminPage.53112753380f843c0d2e.js","mappings":"6IAOO,MAAMA,EAAeC,IAC1B,MAAMC,GAAWC,EAAAA,EAAAA,cAAaC,GAAsBA,EAAMF,WAC1D,OAAOG,EAAAA,EAAAA,GAAYH,EAAUD,K,+HCEhB,SAASK,IACtB,MAAMC,GAAWP,EAAAA,EAAAA,GAAY,eACtBQ,EAAOC,IAAYC,EAAAA,EAAAA,UAAgC,KACnDC,EAAOC,IAAYF,EAAAA,EAAAA,YACpBG,GAASC,EAAAA,EAAAA,WAAUC,GAezB,OAbAC,EAAAA,EAAAA,YAAU,MACRC,EAAAA,EAAAA,iBACGC,IAAK,0BACLC,MAAMC,IACLX,EAASW,EAAKC,iBAEfC,OAAOC,IACFA,EAAEH,MACJR,EAASY,KAAKC,UAAUF,EAAEH,KAAM,KAAM,SAG3C,KAGD,SAAC,IAAD,CAAMb,SAAUA,EAAhB,UACE,UAAC,aAAD,WACGI,IAAS,yBAAMA,KACdH,IAAS,4DACVA,GACCA,EAAMkB,KAAKC,IAEP,4BACE,wBAAKA,EAAEC,OACP,gBAAKC,UAAWhB,EAAOiB,IAAvB,SAA6BN,KAAKC,UAAUE,EAAEI,SAAU,KAAM,OAFtDJ,EAAEC,YAW1B,MAAMb,EAAaiB,IACV,CACLF,IAAKG,EAAAA,GAAI","sources":["webpack://grafana/./public/app/core/hooks/useNavModel.ts","webpack://grafana/./public/app/features/live/pages/CloudAdminPage.tsx"],"sourcesContent":["import { useSelector } from 'react-redux';\n\nimport { NavModel } from '@grafana/data';\nimport { StoreState } from 'app/types/store';\n\nimport { getNavModel } from '../selectors/navModel';\n\nexport const useNavModel = (id: string): NavModel => {\n const navIndex = useSelector((state: StoreState) => state.navIndex);\n return getNavModel(navIndex, id);\n};\n","import { css } from '@emotion/css';\nimport React, { useEffect, useState } from 'react';\n\nimport { GrafanaTheme } from '@grafana/data';\nimport { getBackendSrv } from '@grafana/runtime';\nimport { useStyles } from '@grafana/ui';\nimport Page from 'app/core/components/Page/Page';\nimport { useNavModel } from 'app/core/hooks/useNavModel';\n\nimport { GrafanaCloudBackend } from './types';\n\nexport default function CloudAdminPage() {\n const navModel = useNavModel('live-cloud');\n const [cloud, setCloud] = useState<GrafanaCloudBackend[]>([]);\n const [error, setError] = useState<string>();\n const styles = useStyles(getStyles);\n\n useEffect(() => {\n getBackendSrv()\n .get(`api/live/write-configs`)\n .then((data) => {\n setCloud(data.writeConfigs);\n })\n .catch((e) => {\n if (e.data) {\n setError(JSON.stringify(e.data, null, 2));\n }\n });\n }, []);\n\n return (\n <Page navModel={navModel}>\n <Page.Contents>\n {error && <pre>{error}</pre>}\n {!cloud && <>Loading cloud definitions</>}\n {cloud &&\n cloud.map((v) => {\n return (\n <div key={v.uid}>\n <h2>{v.uid}</h2>\n <pre className={styles.row}>{JSON.stringify(v.settings, null, 2)}</pre>\n </div>\n );\n })}\n </Page.Contents>\n </Page>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme) => {\n return {\n row: css`\n cursor: pointer;\n `,\n };\n};\n"],"names":["useNavModel","id","navIndex","useSelector","state","getNavModel","CloudAdminPage","navModel","cloud","setCloud","useState","error","setError","styles","useStyles","getStyles","useEffect","getBackendSrv","get","then","data","writeConfigs","catch","e","JSON","stringify","map","v","uid","className","row","settings","theme","css"],"sourceRoot":""}