"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4253],{86218:(L,f,t)=>{t.d(f,{x:()=>R});var e=t(68404),v=t(14747),m=t(31403),h=t(2555),r=t(52423),c=t(24699),y=t(68183),S=t(72648),P=t(17784),D=t(56766),A=t(52081),C=t(51613),T=t(74509);function x(){const a=(0,T.UQ)(),{isLoading:s}=(0,T.ZV)(),n=(0,S.wW)(F);return s||a.length===0?null:e.createElement(P.v,{"aria-label":y.wl.pages.PluginsList.signatureErrorNotice,severity:"warning",urlTitle:"Read more about plugin signing",url:"https://grafana.com/docs/grafana/latest/plugins/plugin-signatures/"},e.createElement("div",null,e.createElement("p",null,"Unsigned plugins were found during plugin initialization. Grafana Labs cannot guarantee the integrity of these plugins. We recommend only using signed plugins."),"The following plugins are disabled and not shown in the list below:",e.createElement(D.a,{items:a,className:n.list,renderItem:i=>e.createElement("div",{className:n.wrapper},e.createElement(A.Lh,{spacing:"sm",justify:"flex-start",align:"center"},e.createElement("strong",null,i.pluginId),e.createElement(C.o,{status:I(i.errorCode),className:n.badge})))})))}function I(a){switch(a){case c.w2.invalidSignature:return c.Xy.invalid;case c.w2.missingSignature:return c.Xy.missing;case c.w2.modifiedSignature:return c.Xy.modified;default:return c.Xy.missing}}function F(a){return{list:(0,r.css)({listStyleType:"circle"}),wrapper:(0,r.css)({marginTop:a.spacing(1)}),badge:(0,r.css)({marginTop:0})}}var d=t(81168),u=t(72948);function M({onClick:a,dataSourcePlugin:s}){const n=s.module==="phantom",i=!n&&!s.unlicensed,l=s.info?.links?.length>0?s.info.links[0]:null,o=(0,S.wW)(w);return e.createElement(u.Z,{className:(0,r.cx)(o.card,"card-parent"),onClick:i?a:()=>{}},e.createElement(u.Z.Heading,{className:o.heading,"aria-label":y.wl.pages.AddDataSource.dataSourcePluginsV2(s.name)},s.name),e.createElement(u.Z.Figure,{align:"center",className:o.figure},e.createElement("img",{className:o.logo,src:s.info.logos.small,alt:""})),e.createElement(u.Z.Description,{className:o.description},s.info.description),!n&&e.createElement(u.Z.Meta,{className:o.meta},e.createElement(C.o,{status:s.signature})),e.createElement(u.Z.Actions,{className:o.actions},l&&e.createElement(m.Qj,{"aria-label":`${s.name}, learn more.`,href:`${l.url}?utm_source=grafana_add_ds`,icon:"external-link-alt",onClick:E=>E.stopPropagation(),rel:"noopener",target:"_blank",variant:"secondary"},l.name)))}function w(a){return{heading:(0,r.css)({fontSize:a.v1.typography.heading.h5,fontWeight:"inherit"}),figure:(0,r.css)({width:"inherit",marginRight:"0px","> img":{width:a.spacing(7)}}),meta:(0,r.css)({marginTop:"6px",position:"relative"}),description:(0,r.css)({margin:"0px",fontSize:a.typography.size.sm}),actions:(0,r.css)({position:"relative",alignSelf:"center",marginTop:"0px",opacity:0,".card-parent:hover &, .card-parent:focus-within &":{opacity:1}}),card:(0,r.css)({gridTemplateAreas:`
        "Figure   Heading   Actions"
        "Figure Description Actions"
        "Figure    Meta     Actions"
        "Figure     -       Actions"`}),logo:(0,r.css)({marginRight:a.v1.spacing.lg,marginLeft:a.v1.spacing.sm,width:a.spacing(7),maxHeight:a.spacing(7)})}}function N({dataSourcePlugins:a,onClickDataSourceType:s}){return!a||!a.length?null:e.createElement(D.a,{items:a,getItemKey:n=>n.id.toString(),renderItem:n=>e.createElement(M,{dataSourcePlugin:n,onClick:()=>s(n)}),className:r.css`
        > li {
          margin-bottom: 2px;
        }
      `})}function O({categories:a,onClickDataSourceType:s}){return e.createElement(e.Fragment,null,a.map(({id:n,title:i,plugins:l})=>e.createElement("div",{className:"add-data-source-category",key:n},e.createElement("div",{className:"add-data-source-category__header",id:n},i),e.createElement(N,{dataSourcePlugins:l,onClickDataSourceType:s}))),e.createElement("div",{className:"add-data-source-more"},e.createElement(m.Qj,{variant:"secondary",href:"https://grafana.com/plugins?type=datasource&utm_source=grafana_add_ds",target:"_blank",rel:"noopener"},"Find more data source plugins on grafana.com")))}var p=t(25e3);function R(){(0,p.OU)();const a=(0,d.useDispatch)(),s=(0,d.useSelector)(g=>(0,p.I5)(g.dataSources)),n=(0,d.useSelector)(g=>g.dataSources.dataSourceTypeSearchQuery),i=(0,d.useSelector)(g=>g.dataSources.isLoadingDataSourcePlugins),l=(0,d.useSelector)(g=>g.dataSources.categories),o=(0,p.nH)(),E=g=>a((0,p.Ht)(g));return e.createElement(W,{dataSources:s,dataSourceCategories:l,searchQuery:n,isLoading:i,onAddDataSource:o,onSetSearchQuery:E})}function W({dataSources:a,dataSourceCategories:s,searchQuery:n,isLoading:i,onAddDataSource:l,onSetSearchQuery:o}){const E=(0,p.d7)();return i?e.createElement(h.Z,null):e.createElement(e.Fragment,null,e.createElement("div",{className:"page-action-bar"},e.createElement(v.H,{value:n,onChange:o,placeholder:"Filter by name or type"}),e.createElement("div",{className:"page-action-bar__spacer"}),e.createElement(m.Qj,{href:E.List,fill:"outline",variant:"secondary",icon:"arrow-left"},"Cancel")),!n&&e.createElement(x,null),e.createElement("div",null,n&&e.createElement(N,{dataSourcePlugins:a,onClickDataSourceType:l}),!n&&e.createElement(O,{categories:s,onClickDataSourceType:l})))}},70594:(L,f,t)=>{t.r(f),t.d(f,{NewDataSourcePage:()=>r,default:()=>c});var e=t(68404),v=t(79396),m=t(86218),h=t(3597);function r(){const y={icon:"database",id:"datasource-new",text:"Add data source",url:h.n.New,subTitle:"Choose a data source type"};return e.createElement(v.T,{navId:"datasources",pageNav:y},e.createElement(v.T.Contents,null,e.createElement(m.x,null)))}const c=r}}]);

//# sourceMappingURL=NewDataSourcePage.2ed350cb7db266fd7259.js.map