"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[2929],{"./public/app/features/datasources/DashboardsTable.tsx":(a,e,s)=>{s.d(e,{Z:()=>n});s("../../opt/drone/yarncache/react-npm-17.0.2-99ba37d931-b254cc17ce.zip/node_modules/react/index.js");var t,r=s("./packages/grafana-ui/src/index.ts"),o=s("../../opt/drone/yarncache/react-npm-17.0.2-99ba37d931-b254cc17ce.zip/node_modules/react/jsx-runtime.js");const n=a=>{let{dashboards:e,onImport:s,onRemove:n}=a;function d(a){return a.revision!==a.importedRevision?"Update":"Re-import"}return(0,o.jsx)("table",{className:"filter-table",children:(0,o.jsx)("tbody",{children:e.map(((a,e)=>(0,o.jsxs)("tr",{children:[t||(t=(0,o.jsx)("td",{className:"width-1",children:(0,o.jsx)(r.Icon,{name:"apps"})})),(0,o.jsx)("td",{children:a.imported?(0,o.jsx)("a",{href:a.importedUrl,children:a.title}):(0,o.jsx)("span",{children:a.title})}),(0,o.jsxs)("td",{style:{textAlign:"right"},children:[a.imported?(0,o.jsx)(r.Button,{variant:"secondary",size:"sm",onClick:()=>s(a,!0),children:d(a)}):(0,o.jsx)(r.Button,{variant:"secondary",size:"sm",onClick:()=>s(a,!1),children:"Import"}),a.imported&&(0,o.jsx)(r.Button,{icon:"trash-alt",variant:"destructive",size:"sm",onClick:()=>n(a)})]})]},`${a.dashboardId}-${e}`)))})})}},"./public/app/features/datasources/DataSourceDashboards.tsx":(a,e,s)=>{s.r(e),s.d(e,{DataSourceDashboards:()=>x,default:()=>v});var t=s("../../opt/drone/yarncache/react-npm-17.0.2-99ba37d931-b254cc17ce.zip/node_modules/react/index.js"),r=s("./.yarn/__virtual__/react-redux-virtual-7ad20a440e/3/opt/drone/yarncache/react-redux-npm-7.2.6-134f5ed64d-0bf142ce0d.zip/node_modules/react-redux/es/index.js"),o=s("./public/app/core/components/Page/Page.tsx"),n=s("./public/app/features/datasources/DashboardsTable.tsx"),d=s("./public/app/core/selectors/navModel.ts"),c=s("./public/app/features/datasources/state/actions.ts"),i=s("./public/app/features/plugins/admin/state/actions.ts"),p=s("./public/app/features/dashboard/state/actions.ts"),u=s("./public/app/features/datasources/state/selectors.ts"),l=s("../../opt/drone/yarncache/react-npm-17.0.2-99ba37d931-b254cc17ce.zip/node_modules/react/jsx-runtime.js");function h(a,e,s){return e in a?Object.defineProperty(a,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[e]=s,a}const b={importDashboard:p.$j,loadDataSource:c.gv,loadPluginDashboards:i.m3,removeDashboard:p.fG},m=(0,r.connect)((function(a,e){const s=e.match.params.uid;return{navModel:(0,d.h)(a.navIndex,`datasource-dashboards-${s}`),dashboards:a.plugins.dashboards,dataSource:(0,u.f6)(a.dataSources,s),isLoading:a.plugins.isLoadingPluginDashboards,dataSourceId:s}}),b);class x extends t.PureComponent{constructor(){super(...arguments),h(this,"onImport",((a,e)=>{const{dataSource:s,importDashboard:t}=this.props,r={pluginId:a.pluginId,path:a.path,overwrite:e,inputs:[]};s&&r.inputs.push({name:"*",type:"datasource",pluginId:s.type,value:s.name}),t(r,a.title)})),h(this,"onRemove",(a=>{this.props.removeDashboard(a.uid)}))}async componentDidMount(){const{loadDataSource:a,dataSourceId:e}=this.props;await a(e),this.props.loadPluginDashboards()}render(){const{dashboards:a,navModel:e,isLoading:s}=this.props;return(0,l.jsx)(o.Z,{navModel:e,children:(0,l.jsx)(o.Z.Contents,{isLoading:s,children:(0,l.jsx)(n.Z,{dashboards:a,onImport:(a,e)=>this.onImport(a,e),onRemove:a=>this.onRemove(a)})})})}}const v=m(x)}}]);
//# sourceMappingURL=DataSourceDashboards.cd4ada1146b53ad3284f.js.map