"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[94],{75260:(Y,B,n)=>{n.d(B,{SX:()=>u,IF:()=>N,oZ:()=>h,xh:()=>$});var l=n(66111),e=n(59250),y=n(19985);function u({error:o}){const m=P(o);return l.createElement(y.C,{icon:"exclamation-triangle",text:"Disabled",color:"red",tooltip:m})}function P(o){switch(o){case e.w2.modifiedSignature:return"Plugin disabled due to modified content";case e.w2.invalidSignature:return"Plugin disabled due to invalid plugin signature";case e.w2.missingSignature:return"Plugin disabled due to missing plugin signature";case null:case void 0:return"Plugin disabled";default:return`Plugin disabled due to unknown error${o?`: ${o}`:""}`}}var g=n(72648),p=n(9892);const f=o=>p.css`
  background: ${o.colors.background.primary};
  border-color: ${o.colors.border.strong};
  color: ${o.colors.text.secondary};
`;function h(){const o=(0,g.wW)(f);return l.createElement(y.C,{text:"Installed",color:"orange",className:o})}var I=n(66121),b=n(52081),x=n(51613),L=n(31403);function N({plugin:o}){const m=(0,g.wW)(f),C=T=>{T.preventDefault(),window.open(`https://grafana.com/grafana/plugins/${o.id}?utm_source=grafana_catalog_learn_more`,"_blank","noopener,noreferrer")};return(0,I.v)("enterprise.plugins")?l.createElement(y.C,{text:"Enterprise",color:"blue"}):l.createElement(b.Lh,null,l.createElement(x.o,{status:o.signature}),l.createElement(y.C,{icon:"lock","aria-label":"lock icon",text:"Enterprise",color:"blue",className:m}),l.createElement(L.zx,{size:"sm",fill:"text",icon:"external-link-alt",onClick:C},"Learn more"))}function $({plugin:o}){const m=(0,g.wW)(E);return o.hasUpdate&&!o.isCore&&o.type!==e.zV.renderer?l.createElement("p",{className:m.hasUpdate},"Update available!"):null}const E=o=>({hasUpdate:p.css`
      color: ${o.colors.text.secondary};
      font-size: ${o.typography.bodySmall.fontSize};
      margin-bottom: 0;
    `})},21701:(Y,B,n)=>{n.r(B),n.d(B,{default:()=>s});var l=n(9892),e=n(66111),y=n(56895),u=n(37932),P=n(35645),g=n(72648),p=n(24799),f=n(8581),h=n(2594),I=n(61860),b=n(61744),x=n(8412),L=n(86245),N=n(86475),$=n(27876),E=n(21048),o=n(48996),m=n(39904),C=n(52081),T=n(51613),S=n(75260);function K({plugin:t}){return t.isEnterprise?e.createElement(C.Lh,{height:"auto",wrap:!0},e.createElement(S.IF,{plugin:t}),t.isDisabled&&e.createElement(S.SX,{error:t.error}),e.createElement(S.xh,{plugin:t})):e.createElement(C.Lh,{height:"auto",wrap:!0},e.createElement(T.o,{status:t.signature}),t.isDisabled&&e.createElement(S.SX,{error:t.error}),t.isInstalled&&e.createElement(S.oZ,null),e.createElement(S.xh,{plugin:t}))}function M({alt:t,className:c,src:i,height:r}){return e.createElement("img",{src:i,className:c,alt:t,loading:"lazy",height:r})}const G="48px";function Q({plugin:t,pathName:c,displayMode:i=o.lL.Grid}){const r=(0,g.wW)(Z),d=i===o.lL.List;return e.createElement("a",{href:`${c}/${t.id}`,className:(0,l.cx)(r.container,{[r.list]:d})},e.createElement(M,{src:t.info.logos.small,className:r.pluginLogo,height:G,alt:""}),e.createElement("h2",{className:(0,l.cx)(r.name,"plugin-name")},t.name),e.createElement("div",{className:(0,l.cx)(r.content,"plugin-content")},e.createElement("p",null,"By ",t.orgName),e.createElement(K,{plugin:t})),e.createElement("div",{className:r.pluginType},t.type&&e.createElement(m.J,{name:o.Co[t.type],title:`${t.type} plugin`})))}const Z=t=>({container:l.css`
      display: grid;
      grid-template-columns: ${G} 1fr ${t.spacing(3)};
      grid-template-rows: auto;
      gap: ${t.spacing(2)};
      grid-auto-flow: row;
      background: ${t.colors.background.secondary};
      border-radius: ${t.shape.borderRadius()};
      padding: ${t.spacing(3)};
      transition: ${t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short})};

      &:hover {
        background: ${t.colors.emphasize(t.colors.background.secondary,.03)};
      }
    `,list:l.css`
      row-gap: 0px;

      > img {
        align-self: start;
      }

      > .plugin-content {
        min-height: 0px;
        grid-area: 2 / 2 / 4 / 3;

        > p {
          margin: ${t.spacing(0,0,.5,0)};
        }
      }

      > .plugin-name {
        align-self: center;
        grid-area: 1 / 2 / 2 / 3;
      }
    `,pluginType:l.css`
      grid-area: 1 / 3 / 2 / 4;
      color: ${t.colors.text.secondary};
    `,pluginLogo:l.css`
      grid-area: 1 / 1 / 3 / 2;
      max-width: 100%;
      align-self: center;
      object-fit: contain;
    `,content:l.css`
      grid-area: 3 / 1 / 4 / 3;
      color: ${t.colors.text.secondary};
    `,name:l.css`
      grid-area: 1 / 2 / 3 / 3;
      align-self: center;
      font-size: ${t.typography.h4.fontSize};
      color: ${t.colors.text.primary};
      margin: 0;
    `}),H=({plugins:t,displayMode:c})=>{const i=c===o.lL.List,r=(0,g.wW)(R),{pathname:d}=(0,y.TH)(),J=P.v.appSubUrl+(d.endsWith("/")?d.slice(0,-1):d);return e.createElement("div",{className:(0,l.cx)(r.container,{[r.list]:i}),"data-testid":"plugin-list"},t.map(D=>e.createElement(Q,{key:D.id,plugin:D,pathName:J,displayMode:c})))},R=t=>({container:l.css`
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
      gap: ${t.spacing(3)};
    `,list:l.css`
      grid-template-columns: 1fr;
    `});var j=n(93006),O=n(14747);const w=(t,c=0,i=[])=>{const r=(0,e.useRef)(!0),d=[...i,r];return(0,j.Z)(()=>{if(r.current){r.current=!1;return}return t()},c,d)},A=({value:t,onSearch:c})=>{const[i,r]=(0,e.useState)(t);return w(()=>c(i??""),500,[i]),e.createElement(O.H,{value:i,onKeyDown:d=>{(d.key==="Enter"||d.keyCode===13)&&c(d.currentTarget.value)},placeholder:"Search Grafana plugins",onChange:d=>{r(d)},width:46})};var V=n(59210);const X=()=>({push:({query:t})=>{u.E1.partial(t)}});var F=n(74509);function s({route:t}){const c=(0,y.TH)(),i=(0,u.Ox)(c.search),r=(0,$.useSelector)(v=>(0,L.ht)(v.navIndex,"plugins")),{displayMode:d,setDisplayMode:J}=(0,F.iY)(),D=(0,g.wW)(a),U=X(),se=(0,F.y9)(),k=i.q||"",z=i.filterBy||"installed",W=i.filterByType||"all",q=i.sortBy||V.Nh.nameAsc,{isLoading:ne,error:_,plugins:ae}=(0,F.Pj)({keyword:k,type:W!=="all"?W:void 0,isInstalled:z==="installed"?!0:void 0,isCore:z==="installed"?void 0:!1},q),ee=[{value:"all",label:"All"},{value:"installed",label:"Installed"}],oe=v=>{U.push({query:{sortBy:v.value}})},te=v=>{U.push({query:{filterBy:v}})},le=v=>{U.push({query:{filterByType:v.value}})},re=v=>{U.push({query:{filterBy:z,filterByType:W,q:v}})};if(_)return console.error(_.message),null;const ce=P.v.featureToggles.dataConnectionsConsole?e.createElement("div",null,"Extend the Grafana experience with panel plugins and apps. To find more data sources go to"," ",e.createElement("a",{className:"external-link",href:`${N.Z.AddNewConnection}?cat=data-source`},"Connections"),"."):e.createElement("div",null,"Extend the Grafana experience with panel plugins and apps.");return e.createElement(x.T,{navModel:r,subTitle:ce},e.createElement(x.T.Contents,null,e.createElement(E.L,{wrap:!0},e.createElement(p.g,{label:"Search"},e.createElement(A,{value:k,onSearch:re})),e.createElement(E.L,{wrap:!0,className:D.actionBar},e.createElement(p.g,{label:"Type"},e.createElement(f.Ph,{"aria-label":"Plugin type filter",value:W,onChange:le,width:18,options:[{value:"all",label:"All"},{value:"datasource",label:"Data sources"},{value:"panel",label:"Panels"},{value:"app",label:"Applications"}]})),se?e.createElement(p.g,{label:"State"},e.createElement(h.S,{value:z,onChange:te,options:ee})):e.createElement(I.u,{content:"This filter has been disabled because the Grafana server cannot access grafana.com",placement:"top"},e.createElement("div",null,e.createElement(p.g,{label:"State"},e.createElement(h.S,{disabled:!0,value:z,onChange:te,options:ee})))),e.createElement(p.g,{label:"Sort"},e.createElement(f.Ph,{"aria-label":"Sort Plugins List",width:24,value:q,onChange:oe,options:[{value:"nameAsc",label:"By name (A-Z)"},{value:"nameDesc",label:"By name (Z-A)"},{value:"updated",label:"By updated date"},{value:"published",label:"By published date"},{value:"downloads",label:"By downloads"}]})),e.createElement(p.g,{label:"View"},e.createElement(h.S,{className:D.displayAs,value:d,onChange:J,options:[{value:o.lL.Grid,icon:"table",description:"Display plugins in a grid layout"},{value:o.lL.List,icon:"list-ul",description:"Display plugins in list"}]})))),e.createElement("div",{className:D.listWrap},ne?e.createElement(b.u,{className:l.css`
                margin-bottom: 0;
              `,text:"Loading results"}):e.createElement(H,{plugins:ae,displayMode:d}))))}const a=t=>({actionBar:l.css`
    ${t.breakpoints.up("xl")} {
      margin-left: auto;
    }
  `,listWrap:l.css`
    margin-top: ${t.spacing(2)};
  `,displayAs:l.css`
    svg {
      margin-right: 0;
    }
  `})},74509:(Y,B,n)=>{n.d(B,{iY:()=>F,bt:()=>j,ZV:()=>R,Pj:()=>T,UQ:()=>M,bJ:()=>S,x3:()=>G,IS:()=>O,y9:()=>H,S1:()=>Z,wq:()=>w,kH:()=>Q});var l=n(66111),e=n(27876),y=n(59210),u=n(85805),P=n(66552),g=n(90158),p=n(79086),f=n(48996);const h=s=>s.plugins,I=(0,g.P1)(h,({items:s})=>s),b=(0,g.P1)(h,({settings:s})=>s.displayMode),{selectAll:x,selectById:L}=P.CD.getSelectors(I),N=s=>(0,g.P1)(x,a=>{const t=s.keyword?(0,p.x6)(s.keyword.toLowerCase()):"";return a.filter(c=>{const i=[c.name,c.orgName].filter(Boolean).map(r=>r.toLowerCase());return!(t&&!i.some(r=>r.includes(t))||s.type&&c.type!==s.type||s.isInstalled!==void 0&&c.isInstalled!==s.isInstalled||s.isCore!==void 0&&c.isCore!==s.isCore||s.isEnterprise!==void 0&&c.isEnterprise!==s.isEnterprise)})}),$=(0,g.P1)(x,s=>s?s.filter(a=>Boolean(a.error)).map(a=>({pluginId:a.id,errorCode:a.error})):[]),E=s=>(0,g.P1)(h,({requests:a={}})=>a[s]),o=s=>(0,g.P1)(E(s),a=>a?.status===f.eE.Pending),m=s=>(0,g.P1)(E(s),a=>a?.status===f.eE.Rejected?a?.error:null),C=s=>(0,g.P1)(E(s),a=>a===void 0),T=(s,a=y.Nh.nameAsc)=>{A();const t=(0,l.useMemo)(()=>N(s),[s]),c=(0,e.useSelector)(t),{isLoading:i,error:r}=R(),d=(0,y.AA)(c,a);return{isLoading:i,error:r,plugins:d}},S=s=>(A(),X(s),(0,e.useSelector)(a=>L(a,s))),K=s=>(V(),useSelector(a=>selectById(a,s))),M=()=>(A(),(0,e.useSelector)($)),G=()=>{const s=(0,e.useDispatch)();return(a,t,c)=>s((0,u.N9)({id:a,version:t,isUpdating:c}))},Q=()=>{const s=(0,e.useDispatch)();return()=>s((0,u.bQ)())},Z=()=>{const s=(0,e.useDispatch)();return a=>s((0,u.Tz)(a))},H=()=>(0,e.useSelector)(m(u.tQ.typePrefix))===null,R=()=>{const s=(0,e.useSelector)(o(u.Qd.typePrefix)),a=(0,e.useSelector)(m(u.Qd.typePrefix));return{isLoading:s,error:a}},j=()=>{const s=(0,e.useSelector)(o(u.DD.typePrefix)),a=(0,e.useSelector)(m(u.DD.typePrefix));return{isLoading:s,error:a}},O=()=>{const s=(0,e.useSelector)(o(u.N9.typePrefix)),a=(0,e.useSelector)(m(u.N9.typePrefix));return{isInstalling:s,error:a}},w=()=>{const s=(0,e.useSelector)(o(u.Tz.typePrefix)),a=(0,e.useSelector)(m(u.Tz.typePrefix));return{isUninstalling:s,error:a}},A=()=>{const s=(0,e.useDispatch)(),a=(0,e.useSelector)(C(u.Qd.typePrefix));(0,l.useEffect)(()=>{a&&s((0,u.Qd)())},[])},V=()=>{const s=useDispatch(),a=useSelector(selectIsRequestNotFetched(fetchAllLocal.typePrefix));useEffect(()=>{a&&s(fetchAllLocal())},[])},X=s=>{const a=(0,e.useDispatch)(),t=(0,e.useSelector)(r=>L(r,s)),i=!(0,e.useSelector)(o(u.DD.typePrefix))&&t&&!t.details;(0,l.useEffect)(()=>{i&&a((0,u.DD)(s))},[t])},F=()=>{const s=(0,e.useDispatch)();return{displayMode:(0,e.useSelector)(b),setDisplayMode:t=>s((0,P.UC)(t))}}}}]);

//# sourceMappingURL=PluginListPage.5d0fe04bea1ab7591772.js.map