"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[3076],{56187:(K,T,n)=>{n.d(T,{Z:()=>E});var o=n(39953),e=n(12190),h=n(4919);function g({dashboards:D,onImport:I,onRemove:P}){function S(m){return m.revision!==m.importedRevision?"Update":"Re-import"}return o.createElement("table",{className:"filter-table"},o.createElement("tbody",null,D.map((m,B)=>o.createElement("tr",{key:`${m.dashboardId}-${B}`},o.createElement("td",{className:"width-1"},o.createElement(e.J,{name:"apps"})),o.createElement("td",null,m.imported?o.createElement("a",{href:m.importedUrl},m.title):o.createElement("span",null,m.title)),o.createElement("td",{style:{textAlign:"right"}},m.imported?o.createElement(h.zx,{variant:"secondary",size:"sm",onClick:()=>I(m,!0)},S(m)):o.createElement(h.zx,{variant:"secondary",size:"sm",onClick:()=>I(m,!1)},"Import"),m.imported&&o.createElement(h.zx,{"aria-label":"Delete dashboard",icon:"trash-alt",variant:"destructive",size:"sm",onClick:()=>P(m)}))))))}const E=g},39826:(K,T,n)=>{n.d(T,{Nq:()=>M,Do:()=>$,SX:()=>g,IF:()=>G,oZ:()=>S,xh:()=>A});var o=n(39953),e=n(30670),h=n(12608);function g({error:v}){const W=E(v);return o.createElement(h.C,{icon:"exclamation-triangle",text:"Disabled",color:"red",tooltip:W})}function E(v){switch(v){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${v?`: ${v}`:""}`}}var D=n(82803),I=n(41407);const P=v=>(0,I.css)`
  background: ${v.colors.background.primary};
  border-color: ${v.colors.border.strong};
  color: ${v.colors.text.secondary};
`;function S(){const v=(0,D.wW)(P);return o.createElement(h.C,{text:"Installed",color:"orange",className:v})}var m=n(13475),B=n(12223),z=n(45802),w=n(4919);function G({plugin:v}){const W=(0,D.wW)(P),c=k=>{k.preventDefault(),window.open(`https://grafana.com/grafana/plugins/${v.id}?utm_source=grafana_catalog_learn_more`,"_blank","noopener,noreferrer")};return(0,m.v)("enterprise.plugins")?o.createElement(h.C,{text:"Enterprise",color:"blue"}):o.createElement(B.Lh,null,o.createElement(z.o,{status:v.signature}),o.createElement(h.C,{icon:"lock","aria-label":"lock icon",text:"Enterprise",color:"blue",className:W}),o.createElement(w.zx,{size:"sm",fill:"text",icon:"external-link-alt",onClick:c},"Learn more"))}function A({plugin:v}){const W=(0,D.wW)(R);return o.createElement("p",{className:W.hasUpdate},"Update available!")}const R=v=>({hasUpdate:(0,I.css)`
      color: ${v.colors.text.secondary};
      font-size: ${v.typography.bodySmall.fontSize};
      margin-bottom: 0;
    `});function M(){return o.createElement(h.C,{icon:"exclamation-triangle",text:"Angular",color:"orange",tooltip:"This plugin uses deprecated functionality, support for which is being removed."})}function $(){return o.createElement(h.C,{icon:"exclamation-triangle",text:"Deprecated",color:"orange",tooltip:"This plugin is deprecated and no longer receives updates."})}},21266:(K,T,n)=>{n.d(T,{a:()=>h});var o=n(39953),e=n(84766);const h=({text:g="Loading..."})=>o.createElement("div",{className:"page-loader-wrapper"},o.createElement(e.u,{text:g}))},13076:(K,T,n)=>{n.d(T,{Q:()=>it});var o=n(41407),e=n(39953),h=n(53721),g=n(32688),E=n(82803),D=n(90201),I=n(33155),P=n(12223),S=n(13253),m=n(57721),B=n(87819),z=n(21266),w=n(8651),G=n(48069),A=n(51411);const R=({versions:t=[],installedVersion:s})=>{const a=(0,E.wW)(M),r=(0,A.RU)(t);return t.length===0?e.createElement("p",null,"No version history was found."):e.createElement("table",{className:a.table},e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Version"),e.createElement("th",null,"Last updated"),e.createElement("th",null,"Grafana Dependency"))),e.createElement("tbody",null,t.map(l=>{const u=s===l.version;return e.createElement("tr",{key:l.version},u?e.createElement("td",{className:a.currentVersion},l.version," (installed version)"):l.version===r?.version?e.createElement("td",null,l.version," (latest compatible version)"):e.createElement("td",null,l.version),e.createElement("td",{className:u?a.currentVersion:""},(0,G.E8)(l.createdAt)),e.createElement("td",{className:u?a.currentVersion:""},l.grafanaDependency||"N/A"))})))},M=t=>({container:(0,o.css)`
    padding: ${t.spacing(2,4,3)};
  `,table:(0,o.css)`
    table-layout: fixed;
    width: 100%;
    td,
    th {
      padding: ${t.spacing()} 0;
    }
    th {
      font-size: ${t.typography.h5.fontSize};
    }
  `,currentVersion:(0,o.css)`
    font-weight: ${t.typography.fontWeightBold};
  `});var $=n(20653),v=n(82433);const W=t=>(0,$.Z)(async()=>t&&t.isInstalled&&!t.isDisabled?(0,v.O)(t.id):null,[t?.id,t?.isInstalled,t?.isDisabled]);var c=n(31931),k=n(86832),ee=n(14255),j=n(4148),te=n(52275),N=n(4919);class ne extends e.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,k.extend)({enabled:this.model.enabled,pinned:this.model.pinned,jsonData:this.model.jsonData,secureJsonData:this.model.secureJsonData},{});return(0,j.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,ee.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,k.cloneDeep)(this.props.app.meta);const a=(0,te.w)(),r='<plugin-component type="app-config-ctrl"></plugin-component>',l={ctrl:this,isAppConfigCtrl:!0},u=a.load(this.element,l,r);this.setState({angularCtrl:u})}render(){const s=this.model,a=(0,o.css)({marginRight:"8px"});return e.createElement("div",null,e.createElement("div",{ref:r=>this.element=r}),e.createElement("br",null),e.createElement("br",null),s&&e.createElement("div",{className:"gf-form"},!s.enabled&&e.createElement(N.zx,{variant:"primary",onClick:this.enable,className:a},"Enable"),s.enabled&&e.createElement(N.zx,{variant:"primary",onClick:this.update,className:a},"Update"),s.enabled&&e.createElement(N.zx,{variant:"destructive",onClick:this.disable,className:a},"Disable")))}}var J=n(71519),H=n(21308),ae=n(56187);class se extends e.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:u}=this.props,f={pluginId:l.id,path:a.path,overwrite:r,inputs:u?[{name:"*",type:"datasource",pluginId:u.meta.id,value:u.name}]:[]};return(0,j.i)().post("/api/dashboards/import",f).then(y=>{H.h$.emit(J.SI.alertSuccess,["Dashboard Imported",a.title]),(0,k.extend)(a,y),this.setState({dashboards:[...this.state.dashboards]})})},this.remove=a=>{(0,j.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,j.i)().get(`/api/plugins/${s}/dashboards`).then(a=>{this.setState({dashboards:a,loading:!1})})}render(){const{loading:s,dashboards:a}=this.state;return s?e.createElement("div",null,"loading..."):!a||!a.length?e.createElement("div",null,"No dashboards are included with this plugin"):e.createElement("div",{className:"gf-form-group"},e.createElement(ae.Z,{dashboards:a,onImport:this.import,onRemove:this.remove}))}}var re=n(19977),X=n(63302),le=n(28409),ie=n(11906),oe=n(25467),ce=n(17231);function i({plugin:t}){const s=(0,E.wW)(d),a=(0,e.useMemo)(()=>({query:"*",panel_type:t.id,kind:["panel"]}),[t]),r=(0,$.Z)(()=>(0,ce.getGrafanaSearcher)().search(a),[a]),l=r.value;return l?.totalRows?e.createElement("div",{className:s.wrap},e.createElement("div",{className:s.info},t.name," is used ",e.createElement("b",null,l.totalRows)," times."),e.createElement(re.Z,null,({width:u,height:f})=>e.createElement(oe.Q,{response:l,width:u,height:f,clearSelection:()=>{},keyboardEvents:(0,X.of)(),onTagSelected:()=>{}}))):r.loading?e.createElement(le.$,null):g.config.featureToggles.panelTitleSearch?e.createElement(ie.Z,{title:`${t.name} is not used in any dashboards yet`,buttonIcon:"plus",buttonTitle:"Create Dashboard",buttonLink:`dashboard/new?panelType=${t.id}&editPanel=1`}):e.createElement(I.b,{title:"Missing feature toggle: panelTitleSearch"},"Plugin usage requires the new search index to find usage across dashboards")}const d=t=>({wrap:(0,o.css)`
      width: 100%;
      height: 100%;
    `,info:(0,o.css)`
      padding-bottom: 30px;
    `});function C({plugin:t,queryParams:s,pageId:a}){const r=(0,E.wW)(b),{value:l}=W(t);if(a===c.tu.OVERVIEW)return e.createElement("div",{className:(0,o.cx)(r.readme,r.container),dangerouslySetInnerHTML:{__html:t.details?.readme??"No plugin help or readme markdown file was found"}});if(a===c.tu.VERSIONS)return e.createElement("div",{className:r.container},e.createElement(R,{versions:t.details?.versions,installedVersion:t.installedVersion}));if(a===c.tu.CONFIG&&l?.angularConfigCtrl)return e.createElement("div",{className:r.container},e.createElement(ne,{app:l}));if(l?.configPages){for(const u of l.configPages)if(a===u.id)return e.createElement("div",{className:r.container},e.createElement(w.b,{meta:l.meta},e.createElement(u.body,{plugin:l,query:s})))}return a===c.tu.USAGE&&l?e.createElement("div",{className:r.container},e.createElement(i,{plugin:l?.meta})):a===c.tu.DASHBOARDS&&l?e.createElement("div",{className:r.container},e.createElement(se,{plugin:l?.meta})):e.createElement("div",{className:r.container},e.createElement("p",null,"Page not found."))}const b=t=>({container:(0,o.css)``,readme:(0,o.css)`
    & img {
      max-width: 100%;
    }

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

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

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

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

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

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

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

      table,
      th,
      td {
        border: 1px solid ${t.colors.border.medium};
        border-collapse: collapse;
      }
    }
  `});var p=n(30670),O=n(28888);function ue({className:t,plugin:s}){return s.isDisabled?e.createElement(I.b,{severity:"error",title:"Plugin disabled",className:t,"aria-label":O.wl.pages.PluginPage.disabledInfo},be(s.error),e.createElement("p",null,"Please contact your server administrator to get this resolved."),e.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 be(t){switch(t){case p.w2.modifiedSignature:return e.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 p.w2.invalidSignature:return e.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 p.w2.missingSignature:return e.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 e.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 Ie({className:t,plugin:s}){const a=s.signature===p.Xy.valid,r=s.signature===p.Xy.internal,l=s.isDisabled&&xe(s.error);return a||r||l?null:e.createElement(I.b,{severity:"warning",title:"Invalid plugin signature","aria-label":O.wl.pages.PluginPage.signatureInfo,className:t},e.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."),e.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 xe(t){switch(t){case p.w2.invalidSignature:case p.w2.missingSignature:case p.w2.modifiedSignature:return!0;default:return!1}}const Ne=(t,s)=>{const{loading:a,error:r,value:l}=W(t),{pathname:u}=(0,h.TH)(),f=Ce(t,l),y=!!t?.isPublished,x=s||f,F=(0,e.useMemo)(()=>{const q=t&&H.Vt.hasPermissionInMetadata(m.AccessControlAction.PluginsWrite,t),U=[];if(y&&U.push({text:c.xc.VERSIONS,id:c.tu.VERSIONS,icon:"history",url:`${u}?page=${c.tu.VERSIONS}`,active:c.tu.VERSIONS===x}),!l||(g.config.featureToggles.panelTitleSearch&&l.meta.type===p.zV.panel&&U.push({text:c.xc.USAGE,icon:"list-ul",id:c.tu.USAGE,url:`${u}?page=${c.tu.USAGE}`,active:c.tu.USAGE===x}),!q))return U;if(l.meta.type===p.zV.app){if(l.angularConfigCtrl&&U.push({text:"Config",icon:"cog",id:c.tu.CONFIG,url:`${u}?page=${c.tu.CONFIG}`,active:c.tu.CONFIG===x}),l.configPages)for(const V of l.configPages)U.push({text:V.title,icon:V.icon,id:V.id,url:`${u}?page=${V.id}`,active:V.id===x});l.meta.includes?.find(V=>V.type===p.$_.dashboard)&&U.push({text:"Dashboards",icon:"apps",id:c.tu.DASHBOARDS,url:`${u}?page=${c.tu.DASHBOARDS}`,active:c.tu.DASHBOARDS===x})}return U},[t,l,u,y,x]),Z={text:t?.name??"",img:t?.info.logos.small,children:[{text:c.xc.OVERVIEW,icon:"file-alt",id:c.tu.OVERVIEW,url:`${u}?page=${c.tu.OVERVIEW}`,active:c.tu.OVERVIEW===x},...F]};return{error:r,loading:a,navModel:Z,activePageId:x}};function Ce(t,s){return!t||!s||!H.Vt.hasPermissionInMetadata(m.AccessControlAction.PluginsWrite,t)||s.meta.type!==p.zV.app?c.tu.OVERVIEW:s.angularConfigCtrl?c.tu.CONFIG:s.configPages?.length?s.configPages[0].id:c.tu.OVERVIEW}var Y=n(12190),Ae=n(5811);function Te({plugin:t}){const{value:s}=W(t);if(!s||!H.Vt.hasPermissionInMetadata(m.AccessControlAction.PluginsWrite,t))return null;const{enabled:a,jsonData:r}=s?.meta,l=()=>me(t.id,{enabled:!0,pinned:!0,jsonData:r}),u=()=>{me(t.id,{enabled:!1,pinned:!1,jsonData:r})};return e.createElement(e.Fragment,null,!a&&e.createElement(N.zx,{variant:"primary",onClick:l},"Enable"),a&&e.createElement(N.zx,{variant:"destructive",onClick:u},"Disable"))}const me=async(t,s)=>{try{await(0,Ae.P6)(t,s),window.location.reload()}catch(a){console.error("Error while updating the plugin",a)}};var ge=n(60998),Le=n(14479);function Ue({plugin:t}){const s=(0,m.useDispatch)(),a=(0,ge.d7)(),r=(0,e.useCallback)(()=>{const l={name:t.name,id:t.id};s((0,ge.J_)(l,a.Edit))},[s,t,a]);return(0,Le.Gg)()?e.createElement(N.zx,{variant:"primary",onClick:r},"Add new data source"):null}function Re({plugin:t}){if(!t.isInstalled||t.isDisabled)return null;switch(t.type){case p.zV.datasource:return e.createElement(Ue,{plugin:t});case p.zV.app:return e.createElement(Te,{plugin:t});default:return null}}var $e=n(13475),L=n(27440);const We=({plugin:t,pluginStatus:s,latestCompatibleVersion:a})=>{const r=(0,E.wW)(Ve),l=g.config.pluginAdminExternalManageEnabled,u=H.Vt.hasPermission(m.AccessControlAction.PluginsInstall),f=(0,L.y9)(),y=!!a;return t.type===p.zV.renderer?e.createElement("div",{className:r.message},"Renderer plugins cannot be managed by the Plugin Catalog."):t.type===p.zV.secretsmanager?e.createElement("div",{className:r.message},"Secrets manager plugins cannot be managed by the Plugin Catalog."):t.isEnterprise&&!(0,$e.v)("enterprise.plugins")?e.createElement(P.Lh,{height:"auto",align:"center"},e.createElement("span",{className:r.message},"No valid Grafana Enterprise license detected."),e.createElement(N.Qj,{href:`${(0,A.Uj)(t.id)}?utm_source=grafana_catalog_learn_more`,target:"_blank",rel:"noopener noreferrer",size:"sm",fill:"text",icon:"external-link-alt"},"Learn more")):t.isDev?e.createElement("div",{className:r.message},"This is a development build of the plugin and can't be uninstalled."):!u&&!l?e.createElement("div",{className:r.message},Me(s)):t.isPublished?y?f?null:e.createElement("div",{className:r.message},"The install controls have been disabled because the Grafana server cannot access grafana.com."):e.createElement("div",{className:r.message},e.createElement(Y.J,{name:"exclamation-triangle"}),"\xA0This plugin doesn't support your version of Grafana."):e.createElement("div",{className:r.message},e.createElement(Y.J,{name:"exclamation-triangle"})," This plugin is not published to"," ",e.createElement("a",{href:"https://www.grafana.com/plugins",target:"__blank",rel:"noreferrer"},"grafana.com/plugins")," ","and can't be managed via the catalog.")},Ve=t=>({message:(0,o.css)`
      color: ${t.colors.text.secondary};
    `});function Me(t){switch(t){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 Oe=n(13601),Be=n(32840),de=n(28833),we=n(67650),Fe=n(71707),fe=n(72639);const ze=t=>{(0,fe.ff)("grafana_plugin_install_clicked",t)},Ge=t=>{(0,fe.ff)("grafana_plugin_uninstall_clicked",t)};function ke({plugin:t,pluginStatus:s,latestCompatibleVersion:a,hasInstallWarning:r,setNeedReload:l}){const u=(0,m.useDispatch)(),[f]=(0,we.K)(),y=(0,h.TH)(),{isInstalling:x,error:F}=(0,L.IS)(),{isUninstalling:Z,error:q}=(0,L.wq)(),U=(0,L.x3)(),V=(0,L.S1)(),Q=(0,L.kH)(),ut=(0,L.or)(),[dt,ve]=(0,e.useState)(!1),mt=()=>ve(!0),ye=()=>ve(!1),Pe=Z?"Uninstalling":"Uninstall",De={plugin_id:t.id,plugin_type:t.type,path:y.pathname};(0,e.useEffect)(()=>()=>{Q()},[]);const gt=async()=>{ze(De);const _=await U(t.id,a?.version);await ut(t.id),!F&&!("error"in _)&&(de.Z.emit(J.SI.alertSuccess,[`Installed ${t.name}`]),t.type==="app"&&l?.(!0))},Se=async()=>{if(ye(),Ge(De),await V(t.id),!q){const _=f.page;_!==c.tu.OVERVIEW&&_!==c.tu.VERSIONS&&Oe.E1.replace(`${y.pathname}?page=${c.tu.OVERVIEW}`),de.Z.emit(J.SI.alertSuccess,[`Uninstalled ${t.name}`]),t.type==="app"&&(u((0,Fe.Lk)({pluginID:t.id})),l?.(!1))}},ft=async()=>{await U(t.id,a?.version,!0),F||de.Z.emit(J.SI.alertSuccess,[`Updated ${t.name}`])};if(s===c.vF.UNINSTALL)return e.createElement(e.Fragment,null,e.createElement(Be.s,{isOpen:dt,title:`Uninstall ${t.name}`,body:"Are you sure you want to uninstall this plugin?",confirmText:"Confirm",icon:"exclamation-triangle",onConfirm:Se,onDismiss:ye}),e.createElement(P.Lh,{align:"flex-start",width:"auto",height:"auto"},e.createElement(N.zx,{variant:"destructive",disabled:Z,onClick:mt},Pe)));if(!t.isPublished||r)return null;if(s===c.vF.UPDATE)return e.createElement(P.Lh,{align:"flex-start",width:"auto",height:"auto"},e.createElement(N.zx,{disabled:x,onClick:ft},x?"Updating":"Update"),e.createElement(N.zx,{variant:"destructive",disabled:Z,onClick:Se},Pe));const pt=x||F||!g.config.angularSupportEnabled&&t.angularDetected;return e.createElement(N.zx,{disabled:pt,onClick:gt},x?"Installing":"Install")}function He({pluginId:t,pluginStatus:s,angularDetected:a}){const r=`${(0,A.Uj)(t)}/?tab=installation`;return s===c.vF.UPDATE?e.createElement(P.Lh,{height:"auto"},e.createElement(N.Qj,{href:r,target:"_blank",rel:"noopener noreferrer"},"Update via grafana.com"),e.createElement(N.Qj,{variant:"destructive",href:r,target:"_blank",rel:"noopener noreferrer"},"Uninstall via grafana.com")):s===c.vF.UNINSTALL?e.createElement(N.Qj,{variant:"destructive",href:r,target:"_blank",rel:"noopener noreferrer"},"Uninstall via grafana.com"):e.createElement(N.Qj,{disabled:!g.config.angularSupportEnabled&&a,href:r,target:"_blank",rel:"noopener noreferrer"},"Install via grafana.com")}const Ze=({plugin:t})=>{const s=(0,E.wW)(Qe),a=(0,L.y9)(),r=(0,A.RU)(t?.details?.versions),[l,u]=(0,e.useState)(!1);if(!t)return null;const f=(0,A.HT)(t,a,r),y=g.config.pluginAdminExternalManageEnabled,x=t.isInstalled?t.hasUpdate?c.vF.UPDATE:c.vF.UNINSTALL:c.vF.INSTALL,F=t.isCore||t.isDisabled||!(0,A.fG)();return e.createElement(P.wc,null,e.createElement(P.Lh,null,!F&&e.createElement(e.Fragment,null,y&&!f?e.createElement(He,{pluginId:t.id,pluginStatus:x,angularDetected:t.angularDetected}):e.createElement(ke,{plugin:t,latestCompatibleVersion:r,pluginStatus:x,setNeedReload:u,hasInstallWarning:f})),e.createElement(Re,{plugin:t})),l&&e.createElement(P.Lh,null,e.createElement(Y.J,{name:"exclamation-triangle"}),e.createElement("span",{className:s.message},"Refresh the page to see the changes")))},Qe=t=>({message:(0,o.css)`
      color: ${t.colors.text.secondary};
    `}),Ke=({plugin:t})=>{const s=(0,L.y9)(),a=(0,E.wW)(je),{error:r}=(0,L.IS)();if(!t)return null;const l=(0,A.RU)(t.details?.versions),u=t.isInstalled?t.hasUpdate?c.vF.UPDATE:c.vF.UNINSTALL:c.vF.INSTALL;return e.createElement("div",{className:a.subtitle},r&&e.createElement(I.b,{title:"message"in r?r.message:""},typeof r=="string"?r:r.error),t?.description&&e.createElement("div",null,t?.description),t?.details?.links&&t.details.links.length>0&&e.createElement("span",null,t.details.links.map((f,y)=>e.createElement(e.Fragment,{key:y},y>0&&" | ",e.createElement("a",{href:f.url,className:"external-link"},f.name)))),(0,A.HT)(t,s,l)&&e.createElement(We,{plugin:t,pluginStatus:u,latestCompatibleVersion:l}))},je=t=>({subtitle:(0,o.css)`
      display: flex;
      flex-direction: column;
      gap: ${t.spacing(1)};
    `});var Je=n(39826),Ye=n(27366);function Xe({plugin:t,latestCompatibleVersion:s,className:a}){const r=(0,E.wW)(qe),l=t.details?.pluginDependencies,u=t.isInstalled?t.details?.grafanaDependency:s?.grafanaDependency||t.details?.grafanaDependency;return!u&&(!l||!l.length)?null:e.createElement(Ye.K,{gap:1},!!u&&e.createElement("div",{className:r.depBadge},e.createElement(Y.J,{name:"grafana",className:r.icon}),"Grafana ",u),l&&l.length>0&&e.createElement("div",null,l.map(y=>e.createElement("span",{className:r.depBadge,key:y.name},e.createElement(Y.J,{name:c.Co[y.type],className:r.icon}),y.name," ",y.version))))}const qe=t=>({dependencyTitle:(0,o.css)`
      margin-right: ${t.spacing(.5)};

      &::after {
        content: '';
        padding: 0;
      }
    `,depBadge:(0,o.css)({display:"flex",alignItems:"flex-start"}),icon:(0,o.css)`
      color: ${t.colors.text.secondary};
      margin-right: ${t.spacing(.5)};
    `});var _e=n(45802),et=n(12608);const pe={[p._Z.grafana]:"grafana",[p._Z.commercial]:"shield",[p._Z.community]:"shield",DEFAULT:"shield-exclamation"};function tt({signatureType:t,signatureOrg:s=""}){const a=(0,E.wW)(Ee);if(!t&&!s)return null;const r=t===p._Z.grafana?"Grafana Labs":(0,k.capitalize)(t),l=pe[t||""]||pe.DEFAULT;return e.createElement(e.Fragment,null,e.createElement(he,null,e.createElement("div",{className:a.detailsWrapper},e.createElement("strong",{className:a.strong},"Level:\xA0"),e.createElement(Y.J,{size:"xs",name:l}),"\xA0",r)),e.createElement(he,null,e.createElement("strong",{className:a.strong},"Signed by:")," ",s))}const he=({children:t})=>{const s=(0,E.wW)(Ee);return e.createElement(et.C,{color:"green",className:s.badge,text:t})},Ee=t=>({badge:(0,o.css)`
    background-color: ${t.colors.background.canvas};
    border-color: ${t.colors.border.strong};
    color: ${t.colors.text.secondary};
    white-space: nowrap;
  `,detailsWrapper:(0,o.css)`
    align-items: center;
    display: flex;
  `,strong:(0,o.css)`
    color: ${t.colors.text.primary};
  `,icon:(0,o.css)`
    margin-right: ${t.spacing(.5)};
  `});function nt({plugin:t}){const s=(0,E.wW)(at),a=t.signature===p.Xy.valid;return e.createElement("div",{className:s.container},e.createElement("a",{href:"https://grafana.com/docs/grafana/latest/plugins/plugin-signatures/",target:"_blank",rel:"noreferrer",className:s.link},e.createElement(_e.o,{status:t.signature})),a&&e.createElement(tt,{signatureType:t.signatureType,signatureOrg:t.signatureOrg}))}const at=t=>({container:(0,o.css)`
      display: flex;
      flex-wrap: wrap;
      gap: ${t.spacing(.5)};
    `,link:(0,o.css)`
      display: inline-flex;
      align-items: center;
    `}),st=t=>{const s=[];if(!t)return s;const a=(0,A.RU)(t.details?.versions),r=t.installedVersion||a?.version;r&&s.push({label:"Version",value:r}),t.orgName&&s.push({label:"From",value:t.orgName}),(!t.signatureType||t.signatureType===p._Z.community||t.signatureType===p._Z.commercial)&&t.downloads>0&&s.push({label:"Downloads",value:new Intl.NumberFormat().format(t.downloads)});const u=t.details?.pluginDependencies;return!(t.isInstalled?t.details?.grafanaDependency:a?.grafanaDependency||t.details?.grafanaDependency)&&(!u||!u.length)||s.push({label:"Dependencies",value:e.createElement(Xe,{plugin:t,latestCompatibleVersion:a})}),t.isDisabled&&s.push({label:"Status",value:e.createElement(Je.SX,{error:t.error})}),s.push({label:"Signature",value:e.createElement(nt,{plugin:t})}),s},ht=t=>({subtitle:css`
      display: flex;
      flex-direction: column;
      gap: ${t.spacing(1)};
    `}),rt=t=>{const s=st(t);return{actions:e.createElement(Ze,{plugin:t}),info:s,subtitle:e.createElement(Ke,{plugin:t})}};function lt(t){const{className:s,plugin:a}=t,[r,l]=(0,e.useState)(!1),u=a.isDeprecated&&!r;let f=`This ${a.type} plugin is deprecated and has been removed from the catalog. No further updates will be made to the
  plugin.`;return a.details?.statusContext&&(f+=` More information: ${a.details.statusContext}`),u?e.createElement(I.b,{severity:"warning",title:"Deprecated",className:s,onRemove:()=>l(!0)},e.createElement("p",null,f)):null}function it({pluginId:t,navId:s="plugins",notFoundComponent:a=e.createElement(ct,null),notFoundNavModel:r={text:"Unknown plugin",subTitle:"The requested ID does not belong to any plugin",active:!0}}){const l=(0,h.TH)(),u=new URLSearchParams(l.search),f=(0,L.bJ)(t),{navModel:y,activePageId:x}=Ne(f,u.get("page")),{actions:F,info:Z,subtitle:q}=rt(f),{isLoading:U}=(0,L.ZV)(),{isLoading:V}=(0,L.bt)(),Q=(0,E.wW)(ot);return U||V?e.createElement(S.T,{navId:s,pageNav:{text:"",active:!0}},e.createElement(z.a,null)):f?e.createElement(S.T,{navId:s,pageNav:y,actions:F,subTitle:q,info:Z},e.createElement(S.T.Contents,null,e.createElement(D.I,{className:Q.tabContent},f.angularDetected&&e.createElement(B.Y,{className:Q.alert,angularSupportEnabled:g.config?.angularSupportEnabled,pluginId:f.id,pluginType:f.type,showPluginDetailsLink:!1,interactionElementId:"plugin-details-page"}),e.createElement(Ie,{plugin:f,className:Q.alert}),e.createElement(ue,{plugin:f,className:Q.alert}),e.createElement(lt,{plugin:f,className:Q.alert}),e.createElement(C,{queryParams:Object.fromEntries(u),plugin:f,pageId:x})))):e.createElement(S.T,{navId:s,pageNav:r},a)}const ot=t=>({alert:(0,o.css)`
      margin-bottom: ${t.spacing(2)};
    `,subtitle:(0,o.css)`
      display: flex;
      flex-direction: column;
      gap: ${t.spacing(1)};
    `,tabContent:(0,o.css)`
      overflow: auto;
      height: 100%;
    `});function ct(){return e.createElement(P.Ar,{justify:"center",align:"center"},e.createElement(I.b,{severity:m.AppNotificationSeverity.Warning,title:"Plugin not found"},"That plugin cannot be found. Please check the url is correct or ",e.createElement("br",null),"go to the ",e.createElement("a",{href:"/plugins"},"plugin catalog"),"."))}},14479:(K,T,n)=>{n.d(T,{Gg:()=>D,RN:()=>E});var o=n(50820),e=n(97125),h=n(57721);function g(){return config.bootData.user.isGrafanaAdmin}function E(){return e.contextSrv.hasRole("Admin")}function D(){return e.contextSrv.hasPermission(h.AccessControlAction.DataSourcesCreate)&&e.contextSrv.hasPermission(h.AccessControlAction.DataSourcesWrite)}},27440:(K,T,n)=>{n.d(T,{iY:()=>ce,or:()=>oe,bt:()=>ae,ZV:()=>H,Pj:()=>W,UQ:()=>ee,bJ:()=>c,x3:()=>j,IS:()=>se,y9:()=>ne,S1:()=>N,wq:()=>re,kH:()=>te});var o=n(39953),e=n(57721),h=n(51411),g=n(31063),E=n(2263),D=n(38874),I=n(55705),P=n(31931);const S=i=>i.plugins,m=(0,D.P1)(S,({items:i})=>i),B=(0,D.P1)(S,({settings:i})=>i.displayMode),{selectAll:z,selectById:w}=E.CD.getSelectors(m),G=i=>(0,D.P1)(z,d=>{const C=i.keyword?(0,I.x6)(i.keyword.toLowerCase()):"";return d.filter(b=>{const p=[b.name,b.orgName].filter(Boolean).map(O=>O.toLowerCase());return!(C&&!p.some(O=>O.includes(C))||i.type&&b.type!==i.type||i.isInstalled!==void 0&&b.isInstalled!==i.isInstalled||i.isCore!==void 0&&b.isCore!==i.isCore||i.isEnterprise!==void 0&&b.isEnterprise!==i.isEnterprise)})}),A=i=>(0,D.P1)(z,d=>{const C=[];for(const b of d)b.error&&(!i||b.type===i)&&C.push({pluginId:b.id,errorCode:b.error,pluginType:b.type});return C}),R=i=>(0,D.P1)(S,({requests:d={}})=>d[i]),M=i=>(0,D.P1)(R(i),d=>d?.status===P.eE.Pending),$=i=>(0,D.P1)(R(i),d=>d?.status===P.eE.Rejected?d?.error:null),v=i=>(0,D.P1)(R(i),d=>d===void 0),W=(i,d=h.Nh.nameAsc)=>{X();const C=(0,o.useMemo)(()=>G(i),[i]),b=(0,e.useSelector)(C),{isLoading:p,error:O}=J(),ue=(0,h.AA)(b,d);return{isLoading:p,error:O,plugins:ue}},c=i=>(X(),ie(i),(0,e.useSelector)(d=>w(d,i))),k=i=>(le(),useSelector(d=>selectById(d,i))),ee=i=>(X(),(0,e.useSelector)(A(i))),j=()=>{const i=(0,e.useDispatch)();return(d,C,b)=>i((0,g.N9)({id:d,version:C,isUpdating:b}))},te=()=>{const i=(0,e.useDispatch)();return()=>i((0,g.bQ)())},N=()=>{const i=(0,e.useDispatch)();return d=>i((0,g.Tz)(d))},ne=()=>(0,e.useSelector)($(g.tQ.typePrefix))===null,J=()=>{const i=(0,e.useSelector)(M("plugins/fetchLocal")),d=(0,e.useSelector)($("plugins/fetchLocal"));return{isLoading:i,error:d}},H=()=>{const i=(0,e.useSelector)(M(g.Qd.typePrefix)),d=(0,e.useSelector)($(g.Qd.typePrefix));return{isLoading:i,error:d}},ae=()=>{const i=(0,e.useSelector)(M(g.DD.typePrefix)),d=(0,e.useSelector)($(g.DD.typePrefix));return{isLoading:i,error:d}},se=()=>{const i=(0,e.useSelector)(M(g.N9.typePrefix)),d=(0,e.useSelector)($(g.N9.typePrefix));return{isInstalling:i,error:d}},re=()=>{const i=(0,e.useSelector)(M(g.Tz.typePrefix)),d=(0,e.useSelector)($(g.Tz.typePrefix));return{isUninstalling:i,error:d}},X=()=>{const i=(0,e.useDispatch)(),d=(0,e.useSelector)(v(g.Qd.typePrefix));(0,o.useEffect)(()=>{d&&i((0,g.Qd)())},[])},le=()=>{const i=useDispatch(),d=useSelector(selectIsRequestNotFetched(fetchAllLocal.typePrefix));useEffect(()=>{d&&i(fetchAllLocal())},[])},ie=i=>{const d=(0,e.useDispatch)(),C=(0,e.useSelector)(O=>w(O,i)),p=!(0,e.useSelector)(M(g.DD.typePrefix))&&C&&!C.details;(0,o.useEffect)(()=>{p&&d((0,g.DD)(i))},[C])},oe=()=>{const i=(0,e.useDispatch)();return d=>i((0,g.DD)(d))},ce=()=>{const i=(0,e.useDispatch)();return{displayMode:(0,e.useSelector)(B),setDisplayMode:C=>i((0,E.UC)(C))}}},87819:(K,T,n)=>{n.d(T,{Y:()=>D});var o=n(39953),e=n(30670),h=n(72639),g=n(33155);function E(I,P){let S;switch(I){case e.zV.app:S="app plugin";break;case e.zV.panel:S="panel plugin";break;case e.zV.datasource:S="data source plugin";break;default:S="plugin"}let m=`This ${S} uses a deprecated, legacy platform based on AngularJS and `;return P===void 0?m+" may be incompatible depending on your Grafana configuration.":P?m+" will stop working in future releases of Grafana.":m+" is incompatible with your current Grafana configuration."}function D(I){const{className:P,angularSupportEnabled:S,pluginId:m,pluginType:B,showPluginDetailsLink:z,interactionElementId:w}=I,[G,A]=(0,o.useState)(!1),R={};return m&&(R.pluginId=m),w&&(R.elementId=w),G?null:o.createElement(g.b,{severity:"warning",title:"Angular plugin",className:P,onRemove:()=>A(!0)},o.createElement("p",null,E(B,S)),o.createElement("div",{className:"markdown-html"},o.createElement("ul",null,o.createElement("li",null,o.createElement("a",{href:"https://grafana.com/docs/grafana/latest/developers/angular_deprecation/",className:"external-link",target:"_blank",rel:"noreferrer",onClick:()=>{(0,h.ff)("angular_deprecation_docs_clicked",R)}},"Read our deprecation notice and migration advice.")),z&&m?o.createElement("li",null,o.createElement("a",{href:`plugins/${encodeURIComponent(m)}`,className:"external-link",target:"_blank",rel:"noreferrer"},"View plugin details")):null)))}}}]);

//# sourceMappingURL=3076.a8c2e80a4f3a5e920fde.js.map