"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[1919],{49516:(e,a,r)=>{r.d(a,{ZP:()=>o,hF:()=>s,rb:()=>i});var n=r(41670),t=r.n(n);const s=t().module("grafana.core",["ngRoute"]),i=[s,t().module("grafana.controllers",[]),t().module("grafana.directives",[]),t().module("grafana.factories",[]),t().module("grafana.services",[]),t().module("grafana.filters",[]),t().module("grafana.routes",[])],o=s},92854:(e,a,r)=>{r.d(a,{GO:()=>o,rR:()=>i});var n=r(49516),t=r(72e3);class s{constructor(){var e,a,r;r=void 0,(a="navItems")in(e=this)?Object.defineProperty(e,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[a]=r,this.navItems=t.ZP.bootData.navTree}getCfgNode(){return this.navItems.find((e=>"cfg"===e.id))}getNav(){var e;let a=this.navItems;const r={breadcrumbs:[]};for(var n=arguments.length,t=new Array(n),s=0;s<n;s++)t[s]=arguments[s];for(const e of t){if("number"==typeof e){r.main=r.breadcrumbs[e];break}const n=a.find((a=>a.id===e));var i;if(n)r.breadcrumbs.push(n),r.node=n,r.main=n,a=null!==(i=n.children)&&void 0!==i?i:[]}if(null!==(e=r.main)&&void 0!==e&&e.children)for(const e of r.main.children){var o;e.active=e.url===(null===(o=r.node)||void 0===o?void 0:o.url)}return r}getNotFoundNav(){return i()}}function i(){return o("Page not found","404 Error")}function o(e,a){const r={text:e,subTitle:a,icon:"exclamation-triangle"};return{node:r,main:r}}s.$inject=[],n.ZP.service("navModelSrv",s)},49332:(e,a,r)=>{r.d(a,{Z:()=>o});var n=r(76687),t=r(3357),s=r(55312),i=r(52010);class o extends n.PureComponent{render(){const{searchQuery:e,linkButton:a,setSearchQuery:r,target:n,placeholder:o="Search by name or type"}=this.props,c={href:null==a?void 0:a.href,disabled:null==a?void 0:a.disabled};return n&&(c.target=n),(0,i.jsxs)("div",{className:"page-action-bar",children:[(0,i.jsx)("div",{className:"gf-form gf-form--grow",children:(0,i.jsx)(t.H,{value:e,onChange:r,placeholder:o})}),a&&(0,i.jsx)(s.Qj,Object.assign({},c,{children:a.title}))]})}}},92320:(e,a,r)=>{r.r(a),r.d(a,{default:()=>Z});var n=r(76687),t=r(63322),s=r(28781),i=r(69902),o=r(60324),c=r(74284),l=r(14463),d=r(352);var u=r(77813),g=r(27668),p=r(92854),h=r(58601),m=r(38989),f=r(37729),v=r(1714),x=r(66240);var j,y=r(52010);const S=e=>{let{id:a,basePath:r}=e;const[i,o]=(0,n.useState)(null),{value:c,error:l,loading:d}=(e=>(0,m.Z)((async()=>{const a=await(0,v.a)(e);if(!a)throw new Error(`Unknown plugin: "${e}"`);if(a.type!==f.zV.app)throw new Error(`Plugin must be an app (currently "${a.type}")`);if(!a.enabled)throw new Error(`Application "${e}" is not enabled`);return await(0,x.Av)(a)})))(a),u=(0,t.UO)(),{pathname:g}=(0,t.TH)();return l?(0,y.jsx)(s.T.Header,{navItem:(0,p.GO)(l.message,l.stack).main}):(0,y.jsxs)(y.Fragment,{children:[d&&(j||(j=(0,y.jsx)(h.Z,{}))),i&&(0,y.jsx)(s.T.Header,{navItem:i.main}),!d&&c&&c.root&&(0,y.jsx)(c.root,{meta:c.meta,basename:r||g,onNavChanged:o,query:u,path:g})]})};function b(){const e=(0,g.wW)(P);return(0,y.jsx)("div",{className:e.container,children:(0,y.jsx)(S,{id:l.D,basePath:l.Z6.CloudIntegrations})})}const P=e=>({container:u.css`
    position: relative;
  `});var w,D,N=r(14304);function C(e){const a=e.match.params.uid,r=new URLSearchParams(e.location.search).get("page");return(0,y.jsx)(N.H,{uid:a,pageId:r})}function T(){return w||(w=(0,y.jsx)("div",{children:"The list of plugins is under development"}))}function Z(){const e=(()=>{var e;const{pathname:a}=(0,t.TH)(),r=(0,d.v9)((e=>e.navIndex)),n=r[l.D3],s=n,i=e=>a===`/${l.D3}`&&"data-connections-datasources"===e.id,o=e=>a.startsWith(e.url||"");return s.children=null===(e=s.children)||void 0===e?void 0:e.map((e=>Object.assign({},e,{active:o(e)||i(e)}))),{node:n,main:s}})();return(0,y.jsx)(c.Vj.Provider,{value:{New:l.Z6.DataSourcesNew,List:l.Z6.DataSources,Edit:l.Z6.DataSourcesEdit,Dashboards:l.Z6.DataSourcesDashboards},children:(0,y.jsx)(s.T,{navModel:e,children:(0,y.jsx)(s.T.Contents,{children:(0,y.jsxs)(t.rs,{children:[(0,y.jsx)(t.AW,{path:l.Z6.DataSourcesNew,component:o.x}),(0,y.jsx)(t.AW,{path:l.Z6.DataSourcesEdit,component:C}),(0,y.jsx)(t.AW,{path:l.Z6.DataSources,component:i.c}),(0,y.jsx)(t.AW,{path:l.Z6.Plugins,component:T}),(0,y.jsx)(t.AW,{path:l.Z6.CloudIntegrations,component:b}),D||(D=(0,y.jsx)(t.AW,{component:i.c}))]})})})})}},69902:(e,a,r)=>{r.d(a,{c:()=>y});var n,t,s,i=r(77813),o=r(76687),c=r(27668),l=r(3351),d=r(29327),u=r(97726),g=r(58601),p=r(31271),h=r(352),m=r(74284),f=r(49332),v=r(52010);function x(){const e=(0,h.I0)(),a=(0,o.useCallback)((a=>e((0,m.zT)(a))),[e]),r=(0,h.v9)((e=>{let{dataSources:a}=e;return(0,m.IO)(a)})),n=p.Vt.hasPermission(h.bW.DataSourcesCreate);return(0,v.jsx)(j,{searchQuery:r,setSearchQuery:a,canCreateDataSource:n})}function j(e){let{searchQuery:a,setSearchQuery:r,canCreateDataSource:n}=e;const t={href:(0,m.d7)().New,title:"Add data source",disabled:!n};return(0,v.jsx)(f.Z,{searchQuery:a,setSearchQuery:r,linkButton:t},"action-bar")}function y(){(0,m.zJ)();const e=(0,h.v9)((e=>(0,m.mt)(e.dataSources))),a=(0,h.v9)((e=>{let{dataSources:a}=e;return(0,m.r7)(a)})),r=(0,h.v9)((e=>{let{dataSources:a}=e;return a.hasFetched})),n=p.Vt.hasPermission(h.bW.DataSourcesCreate);return(0,v.jsx)(S,{dataSources:e,dataSourcesCount:a,isLoading:!r,hasCreateRights:n})}function S(e){let{dataSources:a,dataSourcesCount:r,isLoading:i,hasCreateRights:o}=e;const p=(0,c.yK)(b),h=(0,m.d7)();return i?n||(n=(0,v.jsx)(g.Z,{})):0===r?(0,v.jsx)(u.Z,{buttonDisabled:!o,title:"No data sources defined",buttonIcon:"database",buttonLink:h.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"}):(0,v.jsxs)(v.Fragment,{children:[t||(t=(0,v.jsx)(x,{})),(0,v.jsx)("ul",{className:p.list,children:a.map((e=>(0,v.jsx)("li",{children:(0,v.jsxs)(l.Z,{href:h.Edit.replace(/:uid/gi,e.uid),children:[(0,v.jsx)(l.Z.Heading,{children:e.name}),(0,v.jsx)(l.Z.Figure,{children:(0,v.jsx)("img",{src:e.typeLogoUrl,alt:"",height:"40px",width:"40px",className:p.logo})}),(0,v.jsx)(l.Z.Meta,{children:[e.typeName,e.url,e.isDefault&&(s||(s=(0,v.jsx)(d.V,{name:"default",colorIndex:1},"default-tag")))]})]})},e.uid)))})]})}const b=()=>({list:(0,i.css)({listStyle:"none",display:"grid"}),logo:(0,i.css)({objectFit:"contain"})})},60324:(e,a,r)=>{r.d(a,{x:()=>I});r(76687);var n,t=r(3357),s=r(55312),i=r(58601),o=r(77813),c=r(37729),l=r(28441),d=r(27668),u=r(69298),g=r(29796),p=r(7053),h=r(9197),m=r(31317),f=r(52010);function v(){const e=(0,m.UQ)(),{isLoading:a}=(0,m.ZV)(),r=(0,d.Fg)();return a||0===e.length?null:(0,f.jsx)(u.v,{"aria-label":l.wl.pages.PluginsList.signatureErrorNotice,severity:"warning",urlTitle:"Read more about plugin signing",url:"https://grafana.com/docs/grafana/latest/plugins/plugin-signatures/",children:(0,f.jsxs)("div",{children:[n||(n=(0,f.jsx)("p",{children:"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:",(0,f.jsx)(g.a,{items:e,className:o.css`
            list-style-type: circle;
          `,renderItem:e=>(0,f.jsx)("div",{className:o.css`
                margin-top: ${r.spacing.sm};
              `,children:(0,f.jsxs)(p.Lh,{spacing:"sm",justify:"flex-start",align:"center",children:[(0,f.jsx)("strong",{children:e.pluginId}),(0,f.jsx)(h.o,{status:x(e.errorCode),className:o.css`
                    margin-top: 0;
                  `})]})})})]})})}function x(e){switch(e){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}}var j,y=r(352),S=r(3351);function b(e){var a,r;let{onClick:n,dataSourcePlugin:t}=e;const i="phantom"===t.module,c=!i&&!t.unlicensed,u=(null===(a=t.info)||void 0===a||null===(r=a.links)||void 0===r?void 0:r.length)>0?t.info.links[0]:null,g=(0,d.wW)(P);return(0,f.jsxs)(S.Z,{className:(0,o.cx)(g.card,"card-parent"),onClick:c?n:()=>{},children:[(0,f.jsx)(S.Z.Heading,{className:g.heading,"aria-label":l.wl.pages.AddDataSource.dataSourcePluginsV2(t.name),children:t.name}),(0,f.jsx)(S.Z.Figure,{align:"center",className:g.figure,children:(0,f.jsx)("img",{className:g.logo,src:t.info.logos.small,alt:""})}),(0,f.jsx)(S.Z.Description,{className:g.description,children:t.info.description}),!i&&(0,f.jsx)(S.Z.Meta,{className:g.meta,children:(0,f.jsx)(h.o,{status:t.signature})}),(0,f.jsx)(S.Z.Actions,{className:g.actions,children:u&&(0,f.jsx)(s.Qj,{"aria-label":`${t.name}, learn more.`,href:`${u.url}?utm_source=grafana_add_ds`,icon:"external-link-alt",onClick:e=>e.stopPropagation(),rel:"noopener",target:"_blank",variant:"secondary",children:u.name})})]})}function P(e){return{heading:(0,o.css)({fontSize:e.v1.typography.heading.h5,fontWeight:"inherit"}),figure:(0,o.css)({width:"inherit",marginRight:"0px","> img":{width:e.spacing(7)}}),meta:(0,o.css)({marginTop:"6px",position:"relative"}),description:(0,o.css)({margin:"0px",fontSize:e.typography.size.sm}),actions:(0,o.css)({position:"relative",alignSelf:"center",marginTop:"0px",opacity:0,".card-parent:hover &, .card-parent:focus-within &":{opacity:1}}),card:(0,o.css)({gridTemplateAreas:'\n        "Figure   Heading   Actions"\n        "Figure Description Actions"\n        "Figure    Meta     Actions"\n        "Figure     -       Actions"'}),logo:(0,o.css)({marginRight:e.v1.spacing.lg,marginLeft:e.v1.spacing.sm,width:e.spacing(7),maxHeight:e.spacing(7)})}}function w(e){let{dataSourcePlugins:a,onClickDataSourceType:r}=e;return a&&a.length?(0,f.jsx)(g.a,{items:a,getItemKey:e=>e.id.toString(),renderItem:e=>(0,f.jsx)(b,{dataSourcePlugin:e,onClick:()=>r(e)}),className:o.css`
        > li {
          margin-bottom: 2px;
        }
      `}):null}function D(e){let{categories:a,onClickDataSourceType:r}=e;return(0,f.jsxs)(f.Fragment,{children:[a.map((e=>{let{id:a,title:n,plugins:t}=e;return(0,f.jsxs)("div",{className:"add-data-source-category",children:[(0,f.jsx)("div",{className:"add-data-source-category__header",id:a,children:n}),(0,f.jsx)(w,{dataSourcePlugins:t,onClickDataSourceType:r})]},a)})),j||(j=(0,f.jsx)("div",{className:"add-data-source-more",children:(0,f.jsx)(s.Qj,{variant:"secondary",href:"https://grafana.com/plugins?type=datasource&utm_source=grafana_add_ds",target:"_blank",rel:"noopener",children:"Find more data source plugins on grafana.com"})}))]})}var N,C,T,Z=r(74284);function I(){(0,Z.OU)();const e=(0,y.I0)(),a=(0,y.v9)((e=>(0,Z.I5)(e.dataSources))),r=(0,y.v9)((e=>e.dataSources.dataSourceTypeSearchQuery)),n=(0,y.v9)((e=>e.dataSources.isLoadingDataSources)),t=(0,y.v9)((e=>e.dataSources.categories)),s=(0,Z.nH)();return(0,f.jsx)(k,{dataSources:a,dataSourceCategories:t,searchQuery:r,isLoading:n,onAddDataSource:s,onSetSearchQuery:a=>e((0,Z.Ht)(a))})}function k(e){let{dataSources:a,dataSourceCategories:r,searchQuery:n,isLoading:o,onAddDataSource:c,onSetSearchQuery:l}=e;const d=(0,Z.d7)();return o?N||(N=(0,f.jsx)(i.Z,{})):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"page-action-bar",children:[(0,f.jsx)(t.H,{value:n,onChange:l,placeholder:"Filter by name or type"}),C||(C=(0,f.jsx)("div",{className:"page-action-bar__spacer"})),(0,f.jsx)(s.Qj,{href:d.List,fill:"outline",variant:"secondary",icon:"arrow-left",children:"Cancel"})]}),!n&&(T||(T=(0,f.jsx)(v,{}))),(0,f.jsxs)("div",{children:[n&&(0,f.jsx)(w,{dataSourcePlugins:a,onClickDataSourceType:c}),!n&&(0,f.jsx)(D,{categories:r,onClickDataSourceType:c})]})]})}},31317:(e,a,r)=>{r.d(a,{iY:()=>Q,bt:()=>Z,ZV:()=>T,GE:()=>b,UQ:()=>w,bJ:()=>P,x3:()=>D,IS:()=>I,y9:()=>C,S1:()=>N,wq:()=>k});var n=r(76687),t=r(352),s=r(75829),i=r(82458),o=r(57433),c=r(8973),l=r(32397),d=r(34324);const u=e=>e.plugins,g=(0,c.P1)(u,(e=>{let{items:a}=e;return a})),p=(0,c.P1)(u,(e=>{let{settings:a}=e;return a.displayMode})),{selectAll:h,selectById:m}=o.CD.getSelectors(g),f=(e,a)=>(0,c.P1)((e=>(0,c.P1)(h,(a=>a.filter((a=>"installed"===e?a.isInstalled:!a.isCore)))))(e),(e=>e.filter((e=>"all"===a||e.type===a)))),v=(e,a,r)=>(0,c.P1)(f(a,r),(e=>(0,c.P1)(h,(a=>""===e?[]:a.filter((a=>{const r=[];return a.name&&r.push(a.name.toLowerCase()),a.orgName&&r.push(a.orgName.toLowerCase()),r.some((a=>a.includes((0,l.x6)(e).toLowerCase())))})))))(e),((a,r)=>""===e?a:r)),x=(0,c.P1)(h,(e=>e?e.filter((e=>Boolean(e.error))).map((e=>({pluginId:e.id,errorCode:e.error}))):[])),j=e=>(0,c.P1)(u,(a=>{let{requests:r={}}=a;return r[e]})),y=e=>(0,c.P1)(j(e),(e=>(null==e?void 0:e.status)===d.eE.Pending)),S=e=>(0,c.P1)(j(e),(e=>(null==e?void 0:e.status)===d.eE.Rejected?null==e?void 0:e.error:null)),b=e=>{let{query:a="",filterBy:r="installed",filterByType:n="all",sortBy:i=s.Nh.nameAsc}=e;L();const o=(0,t.v9)(v(a,r,n)),{isLoading:c,error:l}=T();return{isLoading:c,error:l,plugins:(0,s.AA)(o,i)}},P=e=>(L(),A(e),(0,t.v9)((a=>m(a,e)))),w=()=>(L(),(0,t.v9)(x)),D=()=>{const e=(0,t.I0)();return(a,r,n)=>e((0,i.N9)({id:a,version:r,isUpdating:n}))},N=()=>{const e=(0,t.I0)();return a=>e((0,i.Tz)(a))},C=()=>null===(0,t.v9)(S(i.tQ.typePrefix)),T=()=>({isLoading:(0,t.v9)(y(i.Qd.typePrefix)),error:(0,t.v9)(S(i.Qd.typePrefix))}),Z=()=>({isLoading:(0,t.v9)(y(i.DD.typePrefix)),error:(0,t.v9)(S(i.DD.typePrefix))}),I=()=>({isInstalling:(0,t.v9)(y(i.N9.typePrefix)),error:(0,t.v9)(S(i.N9.typePrefix))}),k=()=>({isUninstalling:(0,t.v9)(y(i.Tz.typePrefix)),error:(0,t.v9)(S(i.Tz.typePrefix))}),L=()=>{const e=(0,t.I0)(),a=(0,t.v9)((r=i.Qd.typePrefix,(0,c.P1)(j(r),(e=>void 0===e))));var r;(0,n.useEffect)((()=>{a&&e((0,i.Qd)())}),[])},A=e=>{const a=(0,t.I0)(),r=(0,t.v9)((a=>m(a,e))),s=!(0,t.v9)(y(i.DD.typePrefix))&&r&&!r.details;(0,n.useEffect)((()=>{s&&a((0,i.DD)(e))}),[r])},Q=()=>{const e=(0,t.I0)();return{displayMode:(0,t.v9)(p),setDisplayMode:a=>e((0,o.UC)(a))}}}}]);
//# sourceMappingURL=DataConnectionsPage.73c9600e2297b78b02f6.js.map