"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4620],{"./public/app/core/components/PageActionBar/PageActionBar.tsx":(e,a,s)=>{s.d(a,{Z:()=>n});var t=s("./node_modules/react/index.js"),r=s("./packages/grafana-ui/src/index.ts"),o=s("./node_modules/react/jsx-runtime.js");class n extends t.PureComponent{render(){const{searchQuery:e,linkButton:a,setSearchQuery:s,target:t,placeholder:n="Search by name or type"}=this.props,c={href:null==a?void 0:a.href,disabled:null==a?void 0:a.disabled};return t&&(c.target=t),(0,o.jsxs)("div",{className:"page-action-bar",children:[(0,o.jsx)("div",{className:"gf-form gf-form--grow",children:(0,o.jsx)(r.FilterInput,{value:e,onChange:s,placeholder:n})}),a&&(0,o.jsx)(r.LinkButton,Object.assign({},c,{children:a.title}))]})}}},"./public/app/features/datasources/DataSourcesListPage.tsx":(e,a,s)=>{s.r(a),s.d(a,{DataSourcesListPage:()=>C,default:()=>k});var t,r=s("./node_modules/react/index.js"),o=s("./node_modules/react-redux/es/index.js"),n=s("./public/app/core/core.ts"),c=s("./public/app/core/components/Page/Page.tsx"),d=s("./public/app/core/components/PageActionBar/PageActionBar.tsx"),u=s("./public/app/core/components/EmptyListCTA/EmptyListCTA.tsx"),i=s("./packages/grafana-ui/src/index.ts"),l=s("./node_modules/@emotion/css/dist/emotion-css.esm.js"),p=s("./node_modules/react/jsx-runtime.js");const h=({dataSources:e,layoutMode:a})=>{const s=(0,i.useStyles)(g);return(0,p.jsx)("ul",{className:s.list,children:e.map(((e,a)=>(0,p.jsx)("li",{children:(0,p.jsxs)(i.Card,{heading:e.name,href:`datasources/edit/${e.uid}`,children:[(0,p.jsx)(i.Card.Figure,{children:(0,p.jsx)("img",{src:e.typeLogoUrl,alt:e.name})}),(0,p.jsx)(i.Card.Meta,{children:[e.typeName,e.url,e.isDefault&&(t||(t=(0,p.jsx)(i.Tag,{name:"default",colorIndex:1},"default-tag")))]})]})},e.id)))})},g=()=>({list:l.css`
      list-style: none;
    `});var m=s("./public/app/types/index.ts"),x=s("./public/app/features/datasources/state/actions.ts"),b=s("./public/app/core/selectors/navModel.ts"),f=s("./public/app/features/datasources/state/selectors.ts"),j=s("./public/app/features/datasources/state/reducers.ts");const S={loadDataSources:x.bZ,setDataSourcesSearchQuery:j.zT,setDataSourcesLayoutMode:j.Dy},y=(0,o.connect)((function(e){return{navModel:(0,b.h)(e.navIndex,"datasources"),dataSources:(0,f.mt)(e.dataSources),layoutMode:(0,f.pc)(e.dataSources),dataSourcesCount:(0,f.r7)(e.dataSources),searchQuery:(0,f.IO)(e.dataSources),hasFetched:e.dataSources.hasFetched}}),S),v={title:"No data sources defined",buttonIcon:"database",buttonLink:"datasources/new",buttonTitle:"Add data source",proTip:"You can also define data sources through configuration files.",proTipLink:"http://docs.grafana.org/administration/provisioning/#datasources?utm_source=grafana_ds_list",proTipLinkTitle:"Learn more",proTipTarget:"_blank"};class C extends r.PureComponent{componentDidMount(){this.props.loadDataSources()}render(){const{dataSources:e,dataSourcesCount:a,navModel:s,layoutMode:t,searchQuery:r,setDataSourcesSearchQuery:o,hasFetched:i}=this.props,l=n.Vt.hasPermission(m.bW.DataSourcesCreate)&&n.Vt.hasPermission(m.bW.DataSourcesWrite),g={href:"datasources/new",title:"Add data source",disabled:!l},x=Object.assign({},v,{buttonDisabled:!l});return(0,p.jsx)(c.Z,{navModel:s,children:(0,p.jsx)(c.Z.Contents,{isLoading:!i,children:(0,p.jsxs)(p.Fragment,{children:[i&&0===a&&(0,p.jsx)(u.Z,Object.assign({},x)),i&&a>0&&[(0,p.jsx)(d.Z,{searchQuery:r,setSearchQuery:e=>o(e),linkButton:g},"action-bar"),(0,p.jsx)(h,{dataSources:e,layoutMode:t},"list")]]})})})}}const k=y(C)}}]);
//# sourceMappingURL=DataSourcesListPage.8128b05ac04b15cbf98d.js.map