"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4253],{86218:(L,f,a)=>{a.d(f,{x:()=>W});var e=a(66111),v=a(14747),m=a(31403),h=a(2555),r=a(9892),g=a(59250),y=a(68183),S=a(72648),P=a(17784),C=a(56766),A=a(52081),D=a(51613),T=a(74509);function I(){const t=(0,T.UQ)(),{isLoading:n}=(0,T.ZV)(),s=(0,S.wW)(M);return n||t.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(C.a,{items:t,className:s.list,renderItem:o=>e.createElement("div",{className:s.wrapper},e.createElement(A.Lh,{spacing:"sm",justify:"flex-start",align:"center"},e.createElement("strong",null,o.pluginId),e.createElement(D.o,{status:x(o.errorCode),className:s.badge})))})))}function x(t){switch(t){case g.w2.invalidSignature:return g.Xy.invalid;case g.w2.missingSignature:return g.Xy.missing;case g.w2.modifiedSignature:return g.Xy.modified;default:return g.Xy.missing}}function M(t){return{list:(0,r.css)({listStyleType:"circle"}),wrapper:(0,r.css)({marginTop:t.spacing(1)}),badge:(0,r.css)({marginTop:0})}}var p=a(27876),F=a(35645),B=a(86475),d=a(72948);function O({onClick:t,dataSourcePlugin:n}){const s=n.module==="phantom",o=!s&&!n.unlicensed,i=n.info?.links?.length>0?n.info.links[0]:null,u=i?.target??"_blank",l=(0,S.wW)(w);return e.createElement(d.Z,{className:(0,r.cx)(l.card,"card-parent"),onClick:o?t:()=>{}},e.createElement(d.Z.Heading,{className:l.heading,"aria-label":y.wl.pages.AddDataSource.dataSourcePluginsV2(n.name)},n.name),e.createElement(d.Z.Figure,{align:"center",className:l.figure},e.createElement("img",{className:l.logo,src:n.info.logos.small,alt:""})),e.createElement(d.Z.Description,{className:l.description},n.info.description),!s&&e.createElement(d.Z.Meta,{className:l.meta},e.createElement(D.o,{status:n.signature})),e.createElement(d.Z.Actions,{className:l.actions},i&&e.createElement(m.Qj,{"aria-label":`${n.name}, learn more.`,href:`${i.url}?utm_source=grafana_add_ds`,onClick:c=>c.stopPropagation(),rel:"noopener",target:u,variant:"secondary"},i.name)))}function w(t){return{heading:(0,r.css)({fontSize:t.v1.typography.heading.h5,fontWeight:"inherit"}),figure:(0,r.css)({width:"inherit",marginRight:"0px","> img":{width:t.spacing(7)}}),meta:(0,r.css)({marginTop:"6px",position:"relative"}),description:(0,r.css)({margin:"0px",fontSize:t.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:t.v1.spacing.lg,marginLeft:t.v1.spacing.sm,width:t.spacing(7),maxHeight:t.spacing(7)})}}function N({dataSourcePlugins:t,onClickDataSourceType:n}){return!t||!t.length?null:e.createElement(C.a,{items:t,getItemKey:s=>s.id.toString(),renderItem:s=>e.createElement(O,{dataSourcePlugin:s,onClick:()=>n(s)}),className:r.css`
        > li {
          margin-bottom: 2px;
        }
      `})}function R({categories:t,onClickDataSourceType:n}){const s=F.v.featureToggles.dataConnectionsConsole?`${B.Z.AddNewConnection}?cat=data-source`:"/plugins?filterBy=all&filterByType=datasource&utm_source=grafana_add_ds";return e.createElement(e.Fragment,null,t.map(({id:o,title:i,plugins:u})=>e.createElement("div",{className:"add-data-source-category",key:o},e.createElement("div",{className:"add-data-source-category__header",id:o},i),e.createElement(N,{dataSourcePlugins:u,onClickDataSourceType:n}))),e.createElement("div",{className:"add-data-source-more"},e.createElement(m.Qj,{variant:"secondary",href:s,target:"_self",rel:"noopener"},"Find more data source plugins")))}var E=a(25e3);function W(){(0,E.OU)();const t=(0,p.useDispatch)(),n=(0,p.useSelector)(c=>(0,E.I5)(c.dataSources)),s=(0,p.useSelector)(c=>c.dataSources.dataSourceTypeSearchQuery),o=(0,p.useSelector)(c=>c.dataSources.isLoadingDataSourcePlugins),i=(0,p.useSelector)(c=>c.dataSources.categories),u=(0,E.nH)(),l=c=>t((0,E.Ht)(c));return e.createElement(Z,{dataSources:n,dataSourceCategories:i,searchQuery:s,isLoading:o,onAddDataSource:u,onSetSearchQuery:l})}function Z({dataSources:t,dataSourceCategories:n,searchQuery:s,isLoading:o,onAddDataSource:i,onSetSearchQuery:u}){const l=(0,E.d7)();return o?e.createElement(h.Z,null):e.createElement(e.Fragment,null,e.createElement("div",{className:"page-action-bar"},e.createElement(v.H,{value:s,onChange:u,placeholder:"Filter by name or type"}),e.createElement("div",{className:"page-action-bar__spacer"}),e.createElement(m.Qj,{href:l.List,fill:"outline",variant:"secondary",icon:"arrow-left"},"Cancel")),!s&&e.createElement(I,null),e.createElement("div",null,s&&e.createElement(N,{dataSourcePlugins:t,onClickDataSourceType:i}),!s&&e.createElement(R,{categories:n,onClickDataSourceType:i})))}},70594:(L,f,a)=>{a.r(f),a.d(f,{NewDataSourcePage:()=>r,default:()=>g});var e=a(66111),v=a(8412),m=a(86218),h=a(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 g=r}}]);

//# sourceMappingURL=NewDataSourcePage.7131ebad901ac0c054ef.js.map