"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[6747],{44034:(Q,L,n)=>{n.d(L,{Z:()=>C});var i=n(66111),t=n(39904),h=n(31403);function g({dashboards:d,onImport:b,onRemove:M}){function D(S){return S.revision!==S.importedRevision?"Update":"Re-import"}return i.createElement("table",{className:"filter-table"},i.createElement("tbody",null,d.map((S,V)=>i.createElement("tr",{key:`${S.dashboardId}-${V}`},i.createElement("td",{className:"width-1"},i.createElement(t.J,{name:"apps"})),i.createElement("td",null,S.imported?i.createElement("a",{href:S.importedUrl},S.title):i.createElement("span",null,S.title)),i.createElement("td",{style:{textAlign:"right"}},S.imported?i.createElement(h.zx,{variant:"secondary",size:"sm",onClick:()=>b(S,!0)},D(S)):i.createElement(h.zx,{variant:"secondary",size:"sm",onClick:()=>b(S,!1)},"Import"),S.imported&&i.createElement(h.zx,{"aria-label":"Delete dashboard",icon:"trash-alt",variant:"destructive",size:"sm",onClick:()=>M(S)}))))))}const C=g},59332:(Q,L,n)=>{n.d(L,{V:()=>h});var i=n(66111),t=n(3597);const h=(0,i.createContext)(t.n)},24231:(Q,L,n)=>{n.d(L,{E:()=>Y,IA:()=>ae,MF:()=>Z,OU:()=>N,Qs:()=>I,YY:()=>H,_l:()=>q,d7:()=>j,hw:()=>k,nH:()=>c,q6:()=>ne,qj:()=>w,wi:()=>E,wl:()=>G,zJ:()=>z});var i=n(66111),t=n(70431),h=n(18271),g=n(77582),C=n(86245),d=n(27876),b=n(45984),M=n(85597),D=n(96488),S=n(59332),V=n(79508),K=n(41632),A=n(93769);const Y=f=>{const p=(0,d.useDispatch)();(0,i.useEffect)(()=>(p((0,D.M9)(f)),function(){p((0,t.e)({cleanupAction:x=>x.dataSourceSettings=K.fk}))}),[f,p])},k=f=>{const p=(0,d.useDispatch)(),T=j();return()=>p((0,D.kY)(f,T.Edit))},z=()=>{const f=(0,d.useDispatch)(),p=(0,d.useSelector)(x=>x.dataSources.isLoadingDataSources),T=(0,d.useSelector)(x=>x.dataSources.dataSources);return(0,i.useEffect)(()=>{f((0,D.bZ)())},[f]),{isLoading:p,dataSources:T}},E=f=>{const p=(0,d.useDispatch)();(0,i.useEffect)(()=>{p((0,D.gv)(f))},[p,f])},N=()=>{const f=(0,d.useDispatch)();(0,i.useEffect)(()=>{f((0,D.Kj)())},[f])},c=()=>{const f=(0,d.useDispatch)(),p=j();return T=>{f((0,D.J_)(T,p.Edit))}},w=()=>{const f=(0,d.useDispatch)();return async p=>f((0,D.oe)(p))},ne=()=>{const f=(0,d.useDispatch)(),{name:p}=(0,d.useSelector)(T=>T.dataSources.dataSource);return()=>{h.Z.publish(new b.VJ({title:"Delete",text:`Are you sure you want to delete the "${p}" data source?`,yesText:"Delete",icon:"trash-alt",onConfirm:()=>f((0,D.F5)())}))}},G=f=>(0,d.useSelector)(p=>(0,A.f6)(p.dataSources,f)),ae=f=>{const p=G(f);return(0,M.iU)(p)},I=f=>(0,d.useSelector)(p=>(0,A.G4)(p.dataSources,f)),q=()=>(0,d.useSelector)(f=>f.dataSourceSettings),Z=(f,p)=>{const T=G(f),{plugin:x,loadError:J,loading:se}=q(),_=(0,d.useSelector)(u=>u.navIndex),o=p?`datasource-${p}-${f}`:`datasource-settings-${f}`;if(J){const u={text:J,subTitle:"Data Source Error",icon:"exclamation-triangle"};return{node:u,main:u}}return se||!x?(0,C.ht)(_,o,(0,V.xG)("settings")):(0,C.ht)(_,o,(0,V.nI)((0,V.B1)(T,x),p||"settings"))},H=f=>{const p=G(f),T=p.readOnly===!0,x=g.Vt.hasPermissionInMetadata(d.AccessControlAction.DataSourcesWrite,p),J=g.Vt.hasPermissionInMetadata(d.AccessControlAction.DataSourcesDelete,p);return{readOnly:T,hasWriteRights:x,hasDeleteRights:J}},j=()=>(0,i.useContext)(S.V)},25e3:(Q,L,n)=>{n.d(L,{BX:()=>C.BX,E:()=>h.E,Ht:()=>C.Ht,I5:()=>d.I5,IA:()=>d.IA,IO:()=>d.IO,J_:()=>i.J_,MF:()=>h.MF,Nu:()=>C.Nu,OU:()=>h.OU,Qs:()=>h.Qs,Rz:()=>h.IA,Vj:()=>t.V,YY:()=>h.YY,_l:()=>h._l,d7:()=>h.d7,hw:()=>h.hw,mt:()=>d.mt,nH:()=>h.nH,q6:()=>h.q6,qj:()=>h.qj,r7:()=>d.r7,rl:()=>C.rl,wi:()=>h.wi,wl:()=>h.wl,yr:()=>C.yr,zJ:()=>h.zJ,zT:()=>C.zT});var i=n(96488),t=n(59332),h=n(24231),g=n(79508),C=n(41632),d=n(93769)},75260:(Q,L,n)=>{n.d(L,{SX:()=>g,IF:()=>Y,oZ:()=>D,xh:()=>k});var i=n(66111),t=n(59250),h=n(19985);function g({error:E}){const N=C(E);return i.createElement(h.C,{icon:"exclamation-triangle",text:"Disabled",color:"red",tooltip:N})}function C(E){switch(E){case t.w2.modifiedSignature:return"Plugin disabled due to modified content";case t.w2.invalidSignature:return"Plugin disabled due to invalid plugin signature";case t.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${E?`: ${E}`:""}`}}var d=n(72648),b=n(9892);const M=E=>b.css`
  background: ${E.colors.background.primary};
  border-color: ${E.colors.border.strong};
  color: ${E.colors.text.secondary};
`;function D(){const E=(0,d.wW)(M);return i.createElement(h.C,{text:"Installed",color:"orange",className:E})}var S=n(66121),V=n(52081),K=n(51613),A=n(31403);function Y({plugin:E}){const N=(0,d.wW)(M),c=w=>{w.preventDefault(),window.open(`https://grafana.com/grafana/plugins/${E.id}?utm_source=grafana_catalog_learn_more`,"_blank","noopener,noreferrer")};return(0,S.v)("enterprise.plugins")?i.createElement(h.C,{text:"Enterprise",color:"blue"}):i.createElement(V.Lh,null,i.createElement(K.o,{status:E.signature}),i.createElement(h.C,{icon:"lock","aria-label":"lock icon",text:"Enterprise",color:"blue",className:N}),i.createElement(A.zx,{size:"sm",fill:"text",icon:"external-link-alt",onClick:c},"Learn more"))}function k({plugin:E}){const N=(0,d.wW)(z);return E.hasUpdate&&!E.isCore&&E.type!==t.zV.renderer?i.createElement("p",{className:N.hasUpdate},"Update available!"):null}const z=E=>({hasUpdate:b.css`
      color: ${E.colors.text.secondary};
      font-size: ${E.typography.bodySmall.fontSize};
      margin-bottom: 0;
    `})},43714:(Q,L,n)=>{n.d(L,{a:()=>h});var i=n(66111),t=n(61744);const h=({text:g="Loading..."})=>i.createElement("div",{className:"page-loader-wrapper"},i.createElement(t.u,{text:g}))},56747:(Q,L,n)=>{n.d(L,{Q:()=>rt});var i=n(9892),t=n(66111),h=n(56895),g=n(72648),C=n(94893),d=n(45253),b=n(52081),M=n(8412),D=n(27876),S=n(43714),V=n(75363),K=n(77258),A=n(59210);const Y=({versions:e=[],installedVersion:s})=>{const a=(0,g.wW)(k),r=(0,A.RU)(e);return e.length===0?t.createElement("p",null,"No version history was found."):t.createElement("table",{className:a.table},t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",null,"Version"),t.createElement("th",null,"Last updated"))),t.createElement("tbody",null,e.map(l=>{const m=s===l.version;return t.createElement("tr",{key:l.version},m?t.createElement("td",{className:a.currentVersion},l.version," (installed version)"):l.version===r?.version?t.createElement("td",null,l.version," (latest compatible version)"):t.createElement("td",null,l.version),t.createElement("td",{className:m?a.currentVersion:""},(0,K.E8)(l.createdAt)))})))},k=e=>({container:i.css`
    padding: ${e.spacing(2,4,3)};
  `,table:i.css`
    table-layout: fixed;
    width: 100%;
    td,
    th {
      padding: ${e.spacing()} 0;
    }
    th {
      font-size: ${e.typography.h5.fontSize};
    }
  `,currentVersion:i.css`
    font-weight: ${e.typography.fontWeightBold};
  `});var z=n(59679),E=n(55111);const N=e=>(0,z.Z)(async()=>e&&e.isInstalled&&!e.isDisabled?(0,E.O)(e.id):null,[e?.id,e?.isInstalled,e?.isDisabled]);var c=n(48996),w=n(82897),ne=n(55024),G=n(54899),ae=n(11484),I=n(31403);class q extends t.PureComponent{constructor(s){super(s),this.element=null,this.preUpdateHook=()=>Promise.resolve(),this.postUpdateHook=()=>Promise.resolve(),this.update=()=>{const a=this.model.id;this.preUpdateHook().then(()=>{const r=(0,w.extend)({enabled:this.model.enabled,pinned:this.model.pinned,jsonData:this.model.jsonData,secureJsonData:this.model.secureJsonData},{});return(0,G.i)().post(`/api/plugins/${a}/settings`,r)}).then(this.postUpdateHook).then(r=>{window.location.href=window.location.href})},this.setPreUpdateHook=a=>{this.preUpdateHook=a},this.setPostUpdateHook=a=>{this.postUpdateHook=a},this.importDashboards=()=>((0,ne.d)("AppConfig","importDashboards()"),Promise.resolve()),this.enable=()=>{this.model.enabled=!0,this.model.pinned=!0,this.update()},this.disable=()=>{this.model.enabled=!1,this.model.pinned=!1,this.update()},this.state={angularCtrl:null,refresh:0}}componentDidMount(){setTimeout(()=>{this.setState({refresh:this.state.refresh+1})},5)}componentDidUpdate(s){if(!this.element||this.state.angularCtrl)return;this.model=(0,w.cloneDeep)(this.props.app.meta);const a=(0,ae.w)(),r='<plugin-component type="app-config-ctrl"></plugin-component>',l={ctrl:this,isAppConfigCtrl:!0},m=a.load(this.element,l,r);this.setState({angularCtrl:m})}render(){const s=this.model,a=(0,i.css)({marginRight:"8px"});return t.createElement("div",null,t.createElement("div",{ref:r=>this.element=r}),t.createElement("br",null),t.createElement("br",null),s&&t.createElement("div",{className:"gf-form"},!s.enabled&&t.createElement(I.zx,{variant:"primary",onClick:this.enable,className:a},"Enable"),s.enabled&&t.createElement(I.zx,{variant:"primary",onClick:this.update,className:a},"Update"),s.enabled&&t.createElement(I.zx,{variant:"destructive",onClick:this.disable,className:a},"Disable")))}}var Z=n(4063),H=n(77582),j=n(44034);class f extends t.PureComponent{constructor(s){super(s),this.importAll=()=>{this.importNext(0)},this.importNext=a=>{const{dashboards:r}=this.state;return this.import(r[a],!0).then(()=>a+1<r.length?new Promise(l=>{setTimeout(()=>{this.importNext(a+1).then(()=>{l()})},500)}):Promise.resolve())},this.import=(a,r)=>{const{plugin:l,datasource:m}=this.props,y={pluginId:l.id,path:a.path,overwrite:r,inputs:[]};return m&&y.inputs.push({name:"*",type:"datasource",pluginId:m.meta.id,value:m.name}),(0,G.i)().post("/api/dashboards/import",y).then(P=>{H.h$.emit(Z.SI.alertSuccess,["Dashboard Imported",a.title]),(0,w.extend)(a,P),this.setState({dashboards:[...this.state.dashboards]})})},this.remove=a=>{(0,G.i)().delete("/api/dashboards/uid/"+a.uid).then(()=>{a.imported=!1,this.setState({dashboards:[...this.state.dashboards]})})},this.state={loading:!0,dashboards:[]}}async componentDidMount(){const s=this.props.plugin.id;(0,G.i)().get(`/api/plugins/${s}/dashboards`).then(a=>{this.setState({dashboards:a,loading:!1})})}render(){const{loading:s,dashboards:a}=this.state;return s?t.createElement("div",null,"loading..."):!a||!a.length?t.createElement("div",null,"No dashboards are included with this plugin"):t.createElement("div",{className:"gf-form-group"},t.createElement(j.Z,{dashboards:a,onImport:this.import,onRemove:this.remove}))}}var p=n(89050),T=n(59980),x=n(35645),J=n(67487),se=n(69142),_=n(16526),o=n(82e3);function u({plugin:e}){const s=(0,g.wW)(O),a=(0,t.useMemo)(()=>({query:"*",panel_type:e.id,kind:["panel"]}),[e]),r=(0,z.Z)(()=>(0,o.getGrafanaSearcher)().search(a),[a]),l=r.value;return l?.totalRows?t.createElement("div",{className:s.wrap},t.createElement("div",{className:s.info},e.name," is used ",t.createElement("b",null,l.totalRows)," times."),t.createElement(p.Z,null,({width:m,height:y})=>t.createElement(_.Q,{response:l,width:m,height:y,clearSelection:()=>{},keyboardEvents:(0,T.of)(),onTagSelected:()=>{}}))):r.loading?t.createElement(J.$,null):x.v.featureToggles.panelTitleSearch?t.createElement(se.Z,{title:`${e.name} is not used in any dashboards yet`,buttonIcon:"plus",buttonTitle:"Create Dashboard",buttonLink:`dashboard/new?panelType=${e.id}&editPanel=1`}):t.createElement(d.b,{title:"Missing feature toggle: panelTitleSearch"},"Plugin usage requires the new search index to find usage across dashboards")}const O=e=>({wrap:i.css`
      width: 100%;
      height: 100%;
    `,info:i.css`
      padding-bottom: 30px;
    `});function R({plugin:e,queryParams:s,pageId:a}){const r=(0,g.wW)(X),{value:l}=N(e);if(a===c.tu.OVERVIEW)return t.createElement("div",{className:(0,i.cx)(r.readme,r.container),dangerouslySetInnerHTML:{__html:e.details?.readme??"No plugin help or readme markdown file was found"}});if(a===c.tu.VERSIONS)return t.createElement("div",{className:r.container},t.createElement(Y,{versions:e.details?.versions,installedVersion:e.installedVersion}));if(a===c.tu.CONFIG&&l?.angularConfigCtrl)return t.createElement("div",{className:r.container},t.createElement(q,{app:l}));if(l?.configPages){for(const m of l.configPages)if(a===m.id)return t.createElement("div",{className:r.container},t.createElement(V.b,{meta:l.meta},t.createElement(m.body,{plugin:l,query:s})))}return a===c.tu.USAGE&&l?t.createElement("div",{className:r.container},t.createElement(u,{plugin:l?.meta})):a===c.tu.DASHBOARDS&&l?t.createElement("div",{className:r.container},t.createElement(f,{plugin:l?.meta})):t.createElement("div",{className:r.container},t.createElement("p",null,"Page not found."))}const X=e=>({container:i.css``,readme:i.css`
    & img {
      max-width: 100%;
    }

    h1,
    h2,
    h3 {
      margin-top: ${e.spacing(3)};
      margin-bottom: ${e.spacing(2)};
    }

    *:first-child {
      margin-top: 0;
    }

    li {
      margin-left: ${e.spacing(2)};
      & > p {
        margin: ${e.spacing()} 0;
      }
    }

    a {
      color: ${e.colors.text.link};

      &:hover {
        color: ${e.colors.text.link};
        text-decoration: underline;
      }
    }

    table {
      table-layout: fixed;
      width: 100%;

      td,
      th {
        overflow-x: auto;
        padding: ${e.spacing(.5)} ${e.spacing(1)};
      }

      table,
      th,
      td {
        border: 1px solid ${e.colors.border.medium};
        border-collapse: collapse;
      }
    }
  `});var v=n(59250),ie=n(68183);function Se({className:e,plugin:s}){return s.isDisabled?t.createElement(d.b,{severity:"error",title:"Plugin disabled",className:e,"aria-label":ie.wl.pages.PluginPage.disabledInfo},Ie(s.error),t.createElement("p",null,"Please contact your server administrator to get this resolved."),t.createElement("a",{href:"https://grafana.com/docs/grafana/latest/administration/cli/#plugins-commands",className:"external-link",target:"_blank",rel:"noreferrer"},"Read more about managing plugins")):null}function Ie(e){switch(e){case v.w2.modifiedSignature:return t.createElement("p",null,"Grafana Labs checks each plugin to verify that it has a valid digital signature. While doing this, we discovered that the content of this plugin does not match its signature. We can not guarantee the trustworthy of this plugin and have therefore disabled it. We recommend you to reinstall the plugin to make sure you are running a verified version of this plugin.");case v.w2.invalidSignature:return t.createElement("p",null,"Grafana Labs checks each plugin to verify that it has a valid digital signature. While doing this, we discovered that it was invalid. We can not guarantee the trustworthy of this plugin and have therefore disabled it. We recommend you to reinstall the plugin to make sure you are running a verified version of this plugin.");case v.w2.missingSignature:return t.createElement("p",null,"Grafana Labs checks each plugin to verify that it has a valid digital signature. While doing this, we discovered that there is no signature for this plugin. We can not guarantee the trustworthy of this plugin and have therefore disabled it. We recommend you to reinstall the plugin to make sure you are running a verified version of this plugin.");default:return t.createElement("p",null,"We failed to run this plugin due to an unkown reason and have therefore disabled it. We recommend you to reinstall the plugin to make sure you are running a working version of this plugin.")}}function xe({className:e,plugin:s}){const a=s.signature===v.Xy.valid,r=s.signature===v.Xy.internal,l=s.isDisabled&&Ce(s.error);return a||r||l?null:t.createElement(d.b,{severity:"warning",title:"Invalid plugin signature","aria-label":ie.wl.pages.PluginPage.signatureInfo,className:e},t.createElement("p",null,"Grafana Labs checks each plugin to verify that it has a valid digital signature. Plugin signature verification is part of our security measures to ensure plugins are safe and trustworthy. Grafana Labs can\u2019t guarantee the integrity of this unsigned plugin. Ask the plugin author to request it to be signed."),t.createElement("a",{href:"https://grafana.com/docs/grafana/latest/plugins/plugin-signatures/",className:"external-link",target:"_blank",rel:"noreferrer"},"Read more about plugins signing."))}function Ce(e){switch(e){case v.w2.invalidSignature:case v.w2.missingSignature:case v.w2.modifiedSignature:return!0;default:return!1}}var re=n(84532);const be=(e,s)=>{const{loading:a,error:r,value:l}=N(e),{pathname:m}=(0,h.TH)(),y=Ae(e,l),P=m.substring(0,m.lastIndexOf("/")),F=Boolean(e?.isPublished),U=s||y,oe=(0,t.useMemo)(()=>{const le=e&&H.Vt.hasAccessInMetadata(D.AccessControlAction.PluginsWrite,e,(0,re.RN)()),$=[];if(F&&$.push({text:c.xc.VERSIONS,id:c.tu.VERSIONS,icon:"history",url:`${m}?page=${c.tu.VERSIONS}`,active:c.tu.VERSIONS===U}),!l||(x.v.featureToggles.panelTitleSearch&&l.meta.type===v.zV.panel&&$.push({text:c.xc.USAGE,icon:"list-ul",id:c.tu.USAGE,url:`${m}?page=${c.tu.USAGE}`,active:c.tu.USAGE===U}),!le))return $;if(l.meta.type===v.zV.app){if(l.angularConfigCtrl&&$.push({text:"Config",icon:"cog",id:c.tu.CONFIG,url:`${m}?page=${c.tu.CONFIG}`,active:c.tu.CONFIG===U}),l.configPages)for(const W of l.configPages)$.push({text:W.title,icon:W.icon,id:W.id,url:`${m}?page=${W.id}`,active:W.id===U});l.meta.includes?.find(W=>W.type===v.$_.dashboard)&&$.push({text:"Dashboards",icon:"apps",id:c.tu.DASHBOARDS,url:`${m}?page=${c.tu.DASHBOARDS}`,active:c.tu.DASHBOARDS===U})}return $},[e,l,m,F,U]),te={text:e?.name??"",img:e?.info.logos.small,breadcrumbs:[{title:"Plugins",url:P}],children:[{text:c.xc.OVERVIEW,icon:"file-alt",id:c.tu.OVERVIEW,url:`${m}?page=${c.tu.OVERVIEW}`,active:c.tu.OVERVIEW===U},...oe]};return{error:r,loading:a,navModel:te,activePageId:U}};function Ae(e,s){return!e||!s||!H.Vt.hasAccessInMetadata(D.AccessControlAction.PluginsWrite,e,(0,re.RN)())||s.meta.type!==v.zV.app?c.tu.OVERVIEW:s.angularConfigCtrl?c.tu.CONFIG:s.configPages?.length?s.configPages[0].id:c.tu.OVERVIEW}var ee=n(39904),Ne=n(73354);function Te({plugin:e}){const{value:s}=N(e);if(!s||!H.Vt.hasAccessInMetadata(D.AccessControlAction.PluginsWrite,e,(0,re.RN)()))return null;const{enabled:a,jsonData:r}=s?.meta,l=()=>de(e.id,{enabled:!0,pinned:!0,jsonData:r}),m=()=>{de(e.id,{enabled:!1,pinned:!1,jsonData:r})};return t.createElement(t.Fragment,null,!a&&t.createElement(I.zx,{variant:"primary",onClick:l},"Enable"),a&&t.createElement(I.zx,{variant:"destructive",onClick:m},"Disable"))}const de=async(e,s)=>{try{await(0,Ne.P6)(e,s),window.location.reload()}catch(a){console.error("Error while updating the plugin",a)}};var me=n(25e3);function Ue({plugin:e}){const s=(0,D.useDispatch)(),a=(0,me.d7)(),r=(0,t.useCallback)(()=>{const l={name:e.name,id:e.id};s((0,me.J_)(l,a.Edit))},[s,e,a]);return(0,re.Gg)()?t.createElement(I.zx,{variant:"primary",onClick:r},"Create a ",e.name," data source"):null}function Le({plugin:e}){if(!e.isInstalled||e.isDisabled)return null;switch(e.type){case v.zV.datasource:return t.createElement(Ue,{plugin:e});case v.zV.app:return t.createElement(Te,{plugin:e});default:return null}}var Me=n(66121),B=n(74509);const Oe=({plugin:e,pluginStatus:s,latestCompatibleVersion:a})=>{const r=(0,g.wW)(Re),l=x.v.pluginAdminExternalManageEnabled,m=H.Vt.hasAccess(D.AccessControlAction.PluginsInstall,(0,re.bO)()),y=(0,B.y9)(),P=Boolean(a);return e.type===v.zV.renderer?t.createElement("div",{className:r.message},"Renderer plugins cannot be managed by the Plugin Catalog."):e.type===v.zV.secretsmanager?t.createElement("div",{className:r.message},"Secrets manager plugins cannot be managed by the Plugin Catalog."):e.isEnterprise&&!(0,Me.v)("enterprise.plugins")?t.createElement(b.Lh,{height:"auto",align:"center"},t.createElement("span",{className:r.message},"No valid Grafana Enterprise license detected."),t.createElement(I.Qj,{href:`${(0,A.Uj)(e.id)}?utm_source=grafana_catalog_learn_more`,target:"_blank",rel:"noopener noreferrer",size:"sm",fill:"text",icon:"external-link-alt"},"Learn more")):e.isDev?t.createElement("div",{className:r.message},"This is a development build of the plugin and can't be uninstalled."):!m&&!l?t.createElement("div",{className:r.message},We(s)):e.isPublished?P?y?null:t.createElement("div",{className:r.message},"The install controls have been disabled because the Grafana server cannot access grafana.com."):t.createElement("div",{className:r.message},t.createElement(ee.J,{name:"exclamation-triangle"}),"\xA0This plugin doesn't support your version of Grafana."):t.createElement("div",{className:r.message},t.createElement(ee.J,{name:"exclamation-triangle"})," This plugin is not published to"," ",t.createElement("a",{href:"https://www.grafana.com/plugins",target:"__blank",rel:"noreferrer"},"grafana.com/plugins")," ","and can't be managed via the catalog.")},Re=e=>({message:i.css`
      color: ${e.colors.text.secondary};
    `});function We(e){switch(e){case c.vF.INSTALL:case c.vF.REINSTALL:return"You do not have permission to install this plugin.";case c.vF.UNINSTALL:return"You do not have permission to uninstall this plugin.";case c.vF.UPDATE:return"You do not have permission to update this plugin.";default:return"You do not have permission to manage this plugin."}}var Be=n(37932),$e=n(98102),ue=n(18271),Ve=n(96044),Fe=n(61962),ge=n(41818);const ze=e=>{(0,ge.ff)("grafana_plugin_install_clicked",e)},we=e=>{(0,ge.ff)("grafana_plugin_uninstall_clicked",e)};function Ge({plugin:e,pluginStatus:s,latestCompatibleVersion:a,setNeedReload:r}){const l=(0,D.useDispatch)(),[m]=(0,Ve.K)(),y=(0,h.TH)(),{isInstalling:P,error:F}=(0,B.IS)(),{isUninstalling:U,error:oe}=(0,B.wq)(),te=(0,B.x3)(),le=(0,B.S1)(),$=(0,B.kH)(),[W,Ee]=(0,t.useState)(!1),it=()=>Ee(!0),ve=()=>Ee(!1),ye=U?"Uninstalling":"Uninstall",De={plugin_id:e.id,plugin_type:e.type,path:y.pathname};(0,t.useEffect)(()=>()=>{$()},[]);const ct=async()=>{ze(De);const ce=await te(e.id,a?.version);!F&&!("error"in ce)&&(ue.Z.emit(Z.SI.alertSuccess,[`Installed ${e.name}`]),e.type==="app"&&r(!0))},Pe=async()=>{if(ve(),we(De),await le(e.id),!oe){const ce=m.page;ce!==c.tu.OVERVIEW&&ce!==c.tu.VERSIONS&&Be.E1.replace(`${y.pathname}?page=${c.tu.OVERVIEW}`),ue.Z.emit(Z.SI.alertSuccess,[`Uninstalled ${e.name}`]),e.type==="app"&&(l((0,Fe.Lk)({pluginID:e.id})),r(!1))}},ut=async()=>{await te(e.id,a?.version,!0),F||ue.Z.emit(Z.SI.alertSuccess,[`Updated ${e.name}`])};return s===c.vF.UNINSTALL?t.createElement(t.Fragment,null,t.createElement($e.s,{isOpen:W,title:`Uninstall ${e.name}`,body:"Are you sure you want to uninstall this plugin?",confirmText:"Confirm",icon:"exclamation-triangle",onConfirm:Pe,onDismiss:ve}),t.createElement(b.Lh,{align:"flex-start",width:"auto",height:"auto"},t.createElement(I.zx,{variant:"destructive",disabled:U,onClick:it},ye))):s===c.vF.UPDATE?t.createElement(b.Lh,{align:"flex-start",width:"auto",height:"auto"},t.createElement(I.zx,{disabled:P,onClick:ut},P?"Updating":"Update"),t.createElement(I.zx,{variant:"destructive",disabled:U,onClick:Pe},ye)):t.createElement(I.zx,{disabled:P||F,onClick:ct},P?"Installing":"Install")}function He({pluginId:e,pluginStatus:s}){const a=`${(0,A.Uj)(e)}/?tab=installation`;return s===c.vF.UPDATE?t.createElement(b.Lh,{height:"auto"},t.createElement(I.Qj,{href:a,target:"_blank",rel:"noopener noreferrer"},"Update via grafana.com"),t.createElement(I.Qj,{variant:"destructive",href:a,target:"_blank",rel:"noopener noreferrer"},"Uninstall via grafana.com")):s===c.vF.UNINSTALL?t.createElement(I.Qj,{variant:"destructive",href:a,target:"_blank",rel:"noopener noreferrer"},"Uninstall via grafana.com"):t.createElement(I.Qj,{href:a,target:"_blank",rel:"noopener noreferrer"},"Install via grafana.com")}const Ke=({plugin:e})=>{const s=(0,g.wW)(Ze),a=(0,B.y9)(),r=(0,A.RU)(e?.details?.versions),[l,m]=(0,t.useState)(!1);if(!e)return null;const y=(0,A.HT)(e,a,r),P=x.v.pluginAdminExternalManageEnabled,F=e.isInstalled?e.hasUpdate?c.vF.UPDATE:c.vF.UNINSTALL:c.vF.INSTALL,U=e.isCore||e.isDisabled||!(0,A.fG)()||y;return t.createElement(b.wc,null,t.createElement(b.Lh,null,!U&&t.createElement(t.Fragment,null,P?t.createElement(He,{pluginId:e.id,pluginStatus:F}):t.createElement(Ge,{plugin:e,latestCompatibleVersion:r,pluginStatus:F,setNeedReload:m})),t.createElement(Le,{plugin:e})),l&&t.createElement(b.Lh,null,t.createElement(ee.J,{name:"exclamation-triangle"}),t.createElement("span",{className:s.message},"Refresh the page to see the changes")))},Ze=e=>({message:i.css`
      color: ${e.colors.text.secondary};
    `}),je=({plugin:e})=>{const s=(0,B.y9)(),a=(0,g.wW)(Je),{error:r}=(0,B.IS)();if(!e)return null;const l=(0,A.RU)(e.details?.versions),m=e.isInstalled?e.hasUpdate?c.vF.UPDATE:c.vF.UNINSTALL:c.vF.INSTALL;return t.createElement("div",{className:a.subtitle},r&&t.createElement(d.b,{title:"message"in r?r.message:""},typeof r=="string"?r:r.error),e?.description&&t.createElement("div",null,e?.description),e?.details?.links&&e.details.links.length>0&&t.createElement("span",null,e.details.links.map((y,P)=>t.createElement(t.Fragment,{key:P},P>0&&" | ",t.createElement("a",{href:y.url,className:"external-link"},y.name)))),(0,A.HT)(e,s,l)&&t.createElement(Oe,{plugin:e,pluginStatus:m,latestCompatibleVersion:l}))},Je=e=>({subtitle:i.css`
      display: flex;
      flex-direction: column;
      gap: ${e.spacing(1)};
    `});var Qe=n(75260),Ye=n(26418);function ke({plugin:e,latestCompatibleVersion:s,className:a}){const r=(0,g.wW)(Xe),l=e.details?.pluginDependencies,m=e.isInstalled?e.details?.grafanaDependency:s?.grafanaDependency||e.details?.grafanaDependency;return!m&&(!l||!l.length)?null:t.createElement(Ye.Stack,{gap:1},Boolean(m)&&t.createElement("div",{className:r.depBadge},t.createElement(ee.J,{name:"grafana",className:r.icon}),"Grafana ",m),l&&l.length>0&&t.createElement("div",null,l.map(P=>t.createElement("span",{className:r.depBadge,key:P.name},t.createElement(ee.J,{name:c.Co[P.type],className:r.icon}),P.name," ",P.version))))}const Xe=e=>({dependencyTitle:i.css`
      margin-right: ${e.spacing(.5)};

      &::after {
        content: '';
        padding: 0;
      }
    `,depBadge:(0,i.css)({display:"flex",alignItems:"flex-start"}),icon:i.css`
      color: ${e.colors.text.secondary};
      margin-right: ${e.spacing(.5)};
    `});var qe=n(51613),_e=n(19985);const he={[v._Z.grafana]:"grafana",[v._Z.commercial]:"shield",[v._Z.community]:"shield",DEFAULT:"shield-exclamation"};function et({signatureType:e,signatureOrg:s=""}){const a=(0,g.wW)(pe);if(!e&&!s)return null;const r=e===v._Z.grafana?"Grafana Labs":(0,w.capitalize)(e),l=he[e||""]||he.DEFAULT;return t.createElement(t.Fragment,null,t.createElement(fe,null,t.createElement("div",{className:a.detailsWrapper},t.createElement("strong",{className:a.strong},"Level:\xA0"),t.createElement(ee.J,{size:"xs",name:l}),"\xA0",r)),t.createElement(fe,null,t.createElement("strong",{className:a.strong},"Signed by:")," ",s))}const fe=({children:e})=>{const s=(0,g.wW)(pe);return t.createElement(_e.C,{color:"green",className:s.badge,text:e})},pe=e=>({badge:i.css`
    background-color: ${e.colors.background.canvas};
    border-color: ${e.colors.border.strong};
    color: ${e.colors.text.secondary};
    white-space: nowrap;
  `,detailsWrapper:i.css`
    align-items: center;
    display: flex;
  `,strong:i.css`
    color: ${e.colors.text.primary};
  `,icon:i.css`
    margin-right: ${e.spacing(.5)};
  `});function tt({plugin:e}){const s=(0,g.wW)(nt),a=e.signature===v.Xy.valid;return t.createElement("div",{className:s.container},t.createElement("a",{href:"https://grafana.com/docs/grafana/latest/plugins/plugin-signatures/",target:"_blank",rel:"noreferrer",className:s.link},t.createElement(qe.o,{status:e.signature})),a&&t.createElement(et,{signatureType:e.signatureType,signatureOrg:e.signatureOrg}))}const nt=e=>({container:i.css`
      display: flex;
      flex-wrap: wrap;
      gap: ${e.spacing(.5)};
    `,link:i.css`
      display: inline-flex;
      align-items: center;
    `}),at=e=>{const s=[];if(!e)return s;const a=(0,A.RU)(e.details?.versions),r=e.installedVersion||a?.version;Boolean(r)&&s.push({label:"Version",value:r}),Boolean(e.orgName)&&s.push({label:"From",value:e.orgName}),(!e.signatureType||e.signatureType===v._Z.community||e.signatureType===v._Z.commercial)&&Boolean(e.downloads>0)&&s.push({label:"Downloads",value:new Intl.NumberFormat().format(e.downloads)});const m=e.details?.pluginDependencies;return!(e.isInstalled?e.details?.grafanaDependency:a?.grafanaDependency||e.details?.grafanaDependency)&&(!m||!m.length)||s.push({label:"Dependencies",value:t.createElement(ke,{plugin:e,latestCompatibleVersion:a})}),e.isDisabled&&s.push({label:"Status",value:t.createElement(Qe.SX,{error:e.error})}),s.push({label:"Signature",value:t.createElement(tt,{plugin:e})}),s},dt=e=>({subtitle:css`
      display: flex;
      flex-direction: column;
      gap: ${e.spacing(1)};
    `}),st=e=>{const s=at(e);return{actions:t.createElement(Ke,{plugin:e}),info:s,subtitle:t.createElement(je,{plugin:e})}};function rt({pluginId:e,navId:s="plugins",notFoundComponent:a=t.createElement(lt,null),notFoundNavModel:r={text:"Unknown plugin",subTitle:"The requested ID does not belong to any plugin",active:!0}}){const l=(0,h.TH)(),m=new URLSearchParams(l.search),y=(0,B.bJ)(e),{navModel:P,activePageId:F}=be(y,m.get("page")),{actions:U,info:oe,subtitle:te}=st(y),{isLoading:le}=(0,B.ZV)(),{isLoading:$}=(0,B.bt)(),W=(0,g.wW)(ot);return le||$?t.createElement(M.T,{navId:s,pageNav:{text:"",active:!0}},t.createElement(S.a,null)):y?t.createElement(M.T,{navId:s,pageNav:P,actions:U,subTitle:te,info:oe},t.createElement(M.T.Contents,null,t.createElement(C.I,{className:W.tabContent},t.createElement(xe,{plugin:y,className:W.alert}),t.createElement(Se,{plugin:y,className:W.alert}),t.createElement(R,{queryParams:Object.fromEntries(m),plugin:y,pageId:F})))):t.createElement(M.T,{navId:s,pageNav:r},a)}const ot=e=>({alert:i.css`
      margin-bottom: ${e.spacing(2)};
    `,subtitle:i.css`
      display: flex;
      flex-direction: column;
      gap: ${e.spacing(1)};
    `,tabContent:i.css`
      overflow: auto;
      height: 100%;
    `});function lt(){return t.createElement(b.Ar,{justify:"center",align:"center"},t.createElement(d.b,{severity:D.AppNotificationSeverity.Warning,title:"Plugin not found"},"That plugin cannot be found. Please check the url is correct or ",t.createElement("br",null),"go to the ",t.createElement("a",{href:"/plugins"},"plugin catalog"),"."))}},74509:(Q,L,n)=>{n.d(L,{iY:()=>_,bt:()=>f,ZV:()=>j,Pj:()=>w,UQ:()=>ae,bJ:()=>ne,x3:()=>I,IS:()=>p,y9:()=>H,S1:()=>Z,wq:()=>T,kH:()=>q});var i=n(66111),t=n(27876),h=n(59210),g=n(85805),C=n(66552),d=n(90158),b=n(79086),M=n(48996);const D=o=>o.plugins,S=(0,d.P1)(D,({items:o})=>o),V=(0,d.P1)(D,({settings:o})=>o.displayMode),{selectAll:K,selectById:A}=C.CD.getSelectors(S),Y=o=>(0,d.P1)(K,u=>{const O=o.keyword?(0,b.x6)(o.keyword.toLowerCase()):"";return u.filter(R=>{const X=[R.name,R.orgName].filter(Boolean).map(v=>v.toLowerCase());return!(O&&!X.some(v=>v.includes(O))||o.type&&R.type!==o.type||o.isInstalled!==void 0&&R.isInstalled!==o.isInstalled||o.isCore!==void 0&&R.isCore!==o.isCore||o.isEnterprise!==void 0&&R.isEnterprise!==o.isEnterprise)})}),k=(0,d.P1)(K,o=>o?o.filter(u=>Boolean(u.error)).map(u=>({pluginId:u.id,errorCode:u.error})):[]),z=o=>(0,d.P1)(D,({requests:u={}})=>u[o]),E=o=>(0,d.P1)(z(o),u=>u?.status===M.eE.Pending),N=o=>(0,d.P1)(z(o),u=>u?.status===M.eE.Rejected?u?.error:null),c=o=>(0,d.P1)(z(o),u=>u===void 0),w=(o,u=h.Nh.nameAsc)=>{x();const O=(0,i.useMemo)(()=>Y(o),[o]),R=(0,t.useSelector)(O),{isLoading:X,error:v}=j(),ie=(0,h.AA)(R,u);return{isLoading:X,error:v,plugins:ie}},ne=o=>(x(),se(o),(0,t.useSelector)(u=>A(u,o))),G=o=>(J(),useSelector(u=>selectById(u,o))),ae=()=>(x(),(0,t.useSelector)(k)),I=()=>{const o=(0,t.useDispatch)();return(u,O,R)=>o((0,g.N9)({id:u,version:O,isUpdating:R}))},q=()=>{const o=(0,t.useDispatch)();return()=>o((0,g.bQ)())},Z=()=>{const o=(0,t.useDispatch)();return u=>o((0,g.Tz)(u))},H=()=>(0,t.useSelector)(N(g.tQ.typePrefix))===null,j=()=>{const o=(0,t.useSelector)(E(g.Qd.typePrefix)),u=(0,t.useSelector)(N(g.Qd.typePrefix));return{isLoading:o,error:u}},f=()=>{const o=(0,t.useSelector)(E(g.DD.typePrefix)),u=(0,t.useSelector)(N(g.DD.typePrefix));return{isLoading:o,error:u}},p=()=>{const o=(0,t.useSelector)(E(g.N9.typePrefix)),u=(0,t.useSelector)(N(g.N9.typePrefix));return{isInstalling:o,error:u}},T=()=>{const o=(0,t.useSelector)(E(g.Tz.typePrefix)),u=(0,t.useSelector)(N(g.Tz.typePrefix));return{isUninstalling:o,error:u}},x=()=>{const o=(0,t.useDispatch)(),u=(0,t.useSelector)(c(g.Qd.typePrefix));(0,i.useEffect)(()=>{u&&o((0,g.Qd)())},[])},J=()=>{const o=useDispatch(),u=useSelector(selectIsRequestNotFetched(fetchAllLocal.typePrefix));useEffect(()=>{u&&o(fetchAllLocal())},[])},se=o=>{const u=(0,t.useDispatch)(),O=(0,t.useSelector)(v=>A(v,o)),X=!(0,t.useSelector)(E(g.DD.typePrefix))&&O&&!O.details;(0,i.useEffect)(()=>{X&&u((0,g.DD)(o))},[O])},_=()=>{const o=(0,t.useDispatch)();return{displayMode:(0,t.useSelector)(V),setDisplayMode:O=>o((0,C.UC)(O))}}}}]);

//# sourceMappingURL=6747.d4286a17484259c1086e.js.map