"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7795],{73624:(F,C,s)=>{s.d(C,{Z:()=>E});var i=s(27702),t=s(73453),p=s(66670);function b({dashboards:A,onImport:P,onRemove:h}){function y(d){return d.revision!==d.importedRevision?"Update":"Re-import"}return i.createElement("table",{className:"filter-table"},i.createElement("tbody",null,A.map((d,U)=>i.createElement("tr",{key:`${d.dashboardId}-${U}`},i.createElement("td",{className:"width-1"},i.createElement(t.J,{name:"apps"})),i.createElement("td",null,d.imported?i.createElement("a",{href:d.importedUrl},d.title):i.createElement("span",null,d.title)),i.createElement("td",{style:{textAlign:"right"}},d.imported?i.createElement(p.zx,{variant:"secondary",size:"sm",onClick:()=>P(d,!0)},y(d)):i.createElement(p.zx,{variant:"secondary",size:"sm",onClick:()=>P(d,!1)},"Import"),d.imported&&i.createElement(p.zx,{"aria-label":"Delete dashboard",icon:"trash-alt",variant:"destructive",size:"sm",onClick:()=>h(d)}))))))}const E=b},76901:(F,C,s)=>{s.d(C,{Nq:()=>K,SX:()=>b,IF:()=>O,oZ:()=>y,xh:()=>N});var i=s(27702),t=s(9232),p=s(25357);function b({error:f}){const L=E(f);return i.createElement(p.C,{icon:"exclamation-triangle",text:"Disabled",color:"red",tooltip:L})}function E(f){switch(f){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${f?`: ${f}`:""}`}}var A=s(66310),P=s(42844);const h=f=>(0,P.css)`
  background: ${f.colors.background.primary};
  border-color: ${f.colors.border.strong};
  color: ${f.colors.text.secondary};
`;function y(){const f=(0,A.wW)(h);return i.createElement(p.C,{text:"Installed",color:"orange",className:f})}var d=s(80978),U=s(64022),W=s(97918),w=s(66670);function O({plugin:f}){const L=(0,A.wW)(h),B=o=>{o.preventDefault(),window.open(`https://grafana.com/grafana/plugins/${f.id}?utm_source=grafana_catalog_learn_more`,"_blank","noopener,noreferrer")};return(0,d.v)("enterprise.plugins")?i.createElement(p.C,{text:"Enterprise",color:"blue"}):i.createElement(U.Lh,null,i.createElement(W.o,{status:f.signature}),i.createElement(p.C,{icon:"lock","aria-label":"lock icon",text:"Enterprise",color:"blue",className:L}),i.createElement(w.zx,{size:"sm",fill:"text",icon:"external-link-alt",onClick:B},"Learn more"))}function N({plugin:f}){const L=(0,A.wW)(J);return i.createElement("p",{className:L.hasUpdate},"Update available!")}const J=f=>({hasUpdate:(0,P.css)`
      color: ${f.colors.text.secondary};
      font-size: ${f.typography.bodySmall.fontSize};
      margin-bottom: 0;
    `});function K(){return i.createElement(p.C,{icon:"exclamation-triangle",text:"Angular",color:"orange",tooltip:"This plugin uses deprecated functionality, support for which is being removed."})}},67704:(F,C,s)=>{s.d(C,{a:()=>p});var i=s(27702),t=s(52419);const p=({text:b="Loading..."})=>i.createElement("div",{className:"page-loader-wrapper"},i.createElement(t.u,{text:b}))},97795:(F,C,s)=>{s.d(C,{Q:()=>lt});var i=s(42844),t=s(27702),p=s(7662),b=s(34667),E=s(66310),A=s(4432),P=s(63439),h=s(64022),y=s(44644),d=s(18771),U=s(64626),W=s(67704),w=s(90665),O=s(60956),N=s(67972);const J=({versions:e=[],installedVersion:a})=>{const n=(0,E.wW)(K),r=(0,N.RU)(e);return e.length===0?t.createElement("p",null,"No version history was found."):t.createElement("table",{className:n.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 c=a===l.version;return t.createElement("tr",{key:l.version},c?t.createElement("td",{className:n.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:c?n.currentVersion:""},(0,O.E8)(l.createdAt)))})))},K=e=>({container:(0,i.css)`
    padding: ${e.spacing(2,4,3)};
  `,table:(0,i.css)`
    table-layout: fixed;
    width: 100%;
    td,
    th {
      padding: ${e.spacing()} 0;
    }
    th {
      font-size: ${e.typography.h5.fontSize};
    }
  `,currentVersion:(0,i.css)`
    font-weight: ${e.typography.fontWeightBold};
  `});var f=s(25111),L=s(37843);const B=e=>(0,f.Z)(async()=>e&&e.isInstalled&&!e.isDisabled?(0,L.O)(e.id):null,[e?.id,e?.isInstalled,e?.isDisabled]);var o=s(95948),G=s(89949),oe=s(58939),H=s(73289),ce=s(9772),D=s(66670);class de extends t.PureComponent{constructor(a){super(a),this.element=null,this.preUpdateHook=()=>Promise.resolve(),this.postUpdateHook=()=>Promise.resolve(),this.update=()=>{const n=this.model.id;this.preUpdateHook().then(()=>{const r=(0,G.extend)({enabled:this.model.enabled,pinned:this.model.pinned,jsonData:this.model.jsonData,secureJsonData:this.model.secureJsonData},{});return(0,H.i)().post(`/api/plugins/${n}/settings`,r)}).then(this.postUpdateHook).then(r=>{window.location.href=window.location.href})},this.setPreUpdateHook=n=>{this.preUpdateHook=n},this.setPostUpdateHook=n=>{this.postUpdateHook=n},this.importDashboards=()=>((0,oe.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(a){if(!this.element||this.state.angularCtrl)return;this.model=(0,G.cloneDeep)(this.props.app.meta);const n=(0,ce.w)(),r='<plugin-component type="app-config-ctrl"></plugin-component>',l={ctrl:this,isAppConfigCtrl:!0},c=n.load(this.element,l,r);this.setState({angularCtrl:c})}render(){const a=this.model,n=(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),a&&t.createElement("div",{className:"gf-form"},!a.enabled&&t.createElement(D.zx,{variant:"primary",onClick:this.enable,className:n},"Enable"),a.enabled&&t.createElement(D.zx,{variant:"primary",onClick:this.update,className:n},"Update"),a.enabled&&t.createElement(D.zx,{variant:"destructive",onClick:this.disable,className:n},"Disable")))}}var Z=s(3935),M=s(66574),ue=s(73624);class me extends t.PureComponent{constructor(a){super(a),this.importAll=()=>{this.importNext(0)},this.importNext=n=>{const{dashboards:r}=this.state;return this.import(r[n],!0).then(()=>n+1<r.length?new Promise(l=>{setTimeout(()=>{this.importNext(n+1).then(()=>{l()})},500)}):Promise.resolve())},this.import=(n,r)=>{const{plugin:l,datasource:c}=this.props,u={pluginId:l.id,path:n.path,overwrite:r,inputs:[]};return c&&u.inputs.push({name:"*",type:"datasource",pluginId:c.meta.id,value:c.name}),(0,H.i)().post("/api/dashboards/import",u).then(m=>{M.h$.emit(Z.SI.alertSuccess,["Dashboard Imported",n.title]),(0,G.extend)(n,m),this.setState({dashboards:[...this.state.dashboards]})})},this.remove=n=>{(0,H.i)().delete("/api/dashboards/uid/"+n.uid).then(()=>{n.imported=!1,this.setState({dashboards:[...this.state.dashboards]})})},this.state={loading:!0,dashboards:[]}}async componentDidMount(){const a=this.props.plugin.id;(0,H.i)().get(`/api/plugins/${a}/dashboards`).then(n=>{this.setState({dashboards:n,loading:!1})})}render(){const{loading:a,dashboards:n}=this.state;return a?t.createElement("div",null,"loading..."):!n||!n.length?t.createElement("div",null,"No dashboards are included with this plugin"):t.createElement("div",{className:"gf-form-group"},t.createElement(ue.Z,{dashboards:n,onImport:this.import,onRemove:this.remove}))}}var ge=s(55925),fe=s(45383),he=s(62108),pe=s(66970),Ee=s(73153),ve=s(63064);function ye({plugin:e}){const a=(0,E.wW)(be),n=(0,t.useMemo)(()=>({query:"*",panel_type:e.id,kind:["panel"]}),[e]),r=(0,f.Z)(()=>(0,ve.getGrafanaSearcher)().search(n),[n]),l=r.value;return l?.totalRows?t.createElement("div",{className:a.wrap},t.createElement("div",{className:a.info},e.name," is used ",t.createElement("b",null,l.totalRows)," times."),t.createElement(ge.Z,null,({width:c,height:u})=>t.createElement(Ee.Q,{response:l,width:c,height:u,clearSelection:()=>{},keyboardEvents:(0,fe.of)(),onTagSelected:()=>{}}))):r.loading?t.createElement(he.$,null):b.config.featureToggles.panelTitleSearch?t.createElement(pe.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(P.b,{title:"Missing feature toggle: panelTitleSearch"},"Plugin usage requires the new search index to find usage across dashboards")}const be=e=>({wrap:(0,i.css)`
      width: 100%;
      height: 100%;
    `,info:(0,i.css)`
      padding-bottom: 30px;
    `});function Pe({plugin:e,queryParams:a,pageId:n}){const r=(0,E.wW)(De),{value:l}=B(e);if(n===o.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(n===o.tu.VERSIONS)return t.createElement("div",{className:r.container},t.createElement(J,{versions:e.details?.versions,installedVersion:e.installedVersion}));if(n===o.tu.CONFIG&&l?.angularConfigCtrl)return t.createElement("div",{className:r.container},t.createElement(de,{app:l}));if(l?.configPages){for(const c of l.configPages)if(n===c.id)return t.createElement("div",{className:r.container},t.createElement(w.b,{meta:l.meta},t.createElement(c.body,{plugin:l,query:a})))}return n===o.tu.USAGE&&l?t.createElement("div",{className:r.container},t.createElement(ye,{plugin:l?.meta})):n===o.tu.DASHBOARDS&&l?t.createElement("div",{className:r.container},t.createElement(me,{plugin:l?.meta})):t.createElement("div",{className:r.container},t.createElement("p",null,"Page not found."))}const De=e=>({container:(0,i.css)``,readme:(0,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 g=s(9232),X=s(74639);function Se({className:e,plugin:a}){return a.isDisabled?t.createElement(P.b,{severity:"error",title:"Plugin disabled",className:e,"aria-label":X.wl.pages.PluginPage.disabledInfo},xe(a.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 xe(e){switch(e){case g.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 g.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 g.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 Ne({className:e,plugin:a}){const n=a.signature===g.Xy.valid,r=a.signature===g.Xy.internal,l=a.isDisabled&&Ie(a.error);return n||r||l?null:t.createElement(P.b,{severity:"warning",title:"Invalid plugin signature","aria-label":X.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 Ie(e){switch(e){case g.w2.invalidSignature:case g.w2.missingSignature:case g.w2.modifiedSignature:return!0;default:return!1}}var k=s(309);const Ce=(e,a)=>{const{loading:n,error:r,value:l}=B(e),{pathname:c}=(0,p.TH)(),u=Ae(e,l),m=!!e?.isPublished,v=a||u,T=(0,t.useMemo)(()=>{const R=e&&M.Vt.hasAccessInMetadata(d.AccessControlAction.PluginsWrite,e,(0,k.RN)()),x=[];if(m&&x.push({text:o.xc.VERSIONS,id:o.tu.VERSIONS,icon:"history",url:`${c}?page=${o.tu.VERSIONS}`,active:o.tu.VERSIONS===v}),!l||(b.config.featureToggles.panelTitleSearch&&l.meta.type===g.zV.panel&&x.push({text:o.xc.USAGE,icon:"list-ul",id:o.tu.USAGE,url:`${c}?page=${o.tu.USAGE}`,active:o.tu.USAGE===v}),!R))return x;if(l.meta.type===g.zV.app){if(l.angularConfigCtrl&&x.push({text:"Config",icon:"cog",id:o.tu.CONFIG,url:`${c}?page=${o.tu.CONFIG}`,active:o.tu.CONFIG===v}),l.configPages)for(const I of l.configPages)x.push({text:I.title,icon:I.icon,id:I.id,url:`${c}?page=${I.id}`,active:I.id===v});l.meta.includes?.find(I=>I.type===g.$_.dashboard)&&x.push({text:"Dashboards",icon:"apps",id:o.tu.DASHBOARDS,url:`${c}?page=${o.tu.DASHBOARDS}`,active:o.tu.DASHBOARDS===v})}return x},[e,l,c,m,v]),z={text:e?.name??"",img:e?.info.logos.small,children:[{text:o.xc.OVERVIEW,icon:"file-alt",id:o.tu.OVERVIEW,url:`${c}?page=${o.tu.OVERVIEW}`,active:o.tu.OVERVIEW===v},...T]};return{error:r,loading:n,navModel:z,activePageId:v}};function Ae(e,a){return!e||!a||!M.Vt.hasAccessInMetadata(d.AccessControlAction.PluginsWrite,e,(0,k.RN)())||a.meta.type!==g.zV.app?o.tu.OVERVIEW:a.angularConfigCtrl?o.tu.CONFIG:a.configPages?.length?a.configPages[0].id:o.tu.OVERVIEW}var $=s(73453),Te=s(68723);function Ue({plugin:e}){const{value:a}=B(e);if(!a||!M.Vt.hasAccessInMetadata(d.AccessControlAction.PluginsWrite,e,(0,k.RN)()))return null;const{enabled:n,jsonData:r}=a?.meta,l=()=>Y(e.id,{enabled:!0,pinned:!0,jsonData:r}),c=()=>{Y(e.id,{enabled:!1,pinned:!1,jsonData:r})};return t.createElement(t.Fragment,null,!n&&t.createElement(D.zx,{variant:"primary",onClick:l},"Enable"),n&&t.createElement(D.zx,{variant:"destructive",onClick:c},"Disable"))}const Y=async(e,a)=>{try{await(0,Te.P6)(e,a),window.location.reload()}catch(n){console.error("Error while updating the plugin",n)}};var q=s(9906);function Le({plugin:e}){const a=(0,d.useDispatch)(),n=(0,q.d7)(),r=(0,t.useCallback)(()=>{const l={name:e.name,id:e.id};a((0,q.J_)(l,n.Edit))},[a,e,n]);return(0,k.Gg)()?t.createElement(D.zx,{variant:"primary",onClick:r},"Add new data source"):null}function $e({plugin:e}){if(!e.isInstalled||e.isDisabled)return null;switch(e.type){case g.zV.datasource:return t.createElement(Le,{plugin:e});case g.zV.app:return t.createElement(Ue,{plugin:e});default:return null}}var Re=s(80978),S=s(64248);const Ve=({plugin:e,pluginStatus:a,latestCompatibleVersion:n})=>{const r=(0,E.wW)(We),l=b.config.pluginAdminExternalManageEnabled,c=M.Vt.hasAccess(d.AccessControlAction.PluginsInstall,(0,k.bO)()),u=(0,S.y9)(),m=!!n;return e.type===g.zV.renderer?t.createElement("div",{className:r.message},"Renderer plugins cannot be managed by the Plugin Catalog."):e.type===g.zV.secretsmanager?t.createElement("div",{className:r.message},"Secrets manager plugins cannot be managed by the Plugin Catalog."):e.isEnterprise&&!(0,Re.v)("enterprise.plugins")?t.createElement(h.Lh,{height:"auto",align:"center"},t.createElement("span",{className:r.message},"No valid Grafana Enterprise license detected."),t.createElement(D.Qj,{href:`${(0,N.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."):!c&&!l?t.createElement("div",{className:r.message},we(a)):e.isPublished?m?u?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($.J,{name:"exclamation-triangle"}),"\xA0This plugin doesn't support your version of Grafana."):t.createElement("div",{className:r.message},t.createElement($.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.")},We=e=>({message:(0,i.css)`
      color: ${e.colors.text.secondary};
    `});function we(e){switch(e){case o.vF.INSTALL:case o.vF.REINSTALL:return"You do not have permission to install this plugin.";case o.vF.UNINSTALL:return"You do not have permission to uninstall this plugin.";case o.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=s(26129),Be=s(3613),Q=s(5933),Me=s(89033),ke=s(78467),_=s(86312);const ze=e=>{(0,_.ff)("grafana_plugin_install_clicked",e)},Fe=e=>{(0,_.ff)("grafana_plugin_uninstall_clicked",e)};function Ge({plugin:e,pluginStatus:a,latestCompatibleVersion:n,setNeedReload:r}){const l=(0,d.useDispatch)(),[c]=(0,Me.K)(),u=(0,p.TH)(),{isInstalling:m,error:v}=(0,S.IS)(),{isUninstalling:T,error:z}=(0,S.wq)(),R=(0,S.x3)(),x=(0,S.S1)(),I=(0,S.kH)(),[V,ne]=(0,t.useState)(!1),ct=()=>ne(!0),se=()=>ne(!1),re=T?"Uninstalling":"Uninstall",le={plugin_id:e.id,plugin_type:e.type,path:u.pathname};(0,t.useEffect)(()=>()=>{I()},[]);const dt=async()=>{ze(le);const j=await R(e.id,n?.version);!v&&!("error"in j)&&(Q.Z.emit(Z.SI.alertSuccess,[`Installed ${e.name}`]),e.type==="app"&&r?.(!0))},ie=async()=>{if(se(),Fe(le),await x(e.id),!z){const j=c.page;j!==o.tu.OVERVIEW&&j!==o.tu.VERSIONS&&Oe.E1.replace(`${u.pathname}?page=${o.tu.OVERVIEW}`),Q.Z.emit(Z.SI.alertSuccess,[`Uninstalled ${e.name}`]),e.type==="app"&&(l((0,ke.Lk)({pluginID:e.id})),r?.(!1))}},ut=async()=>{await R(e.id,n?.version,!0),v||Q.Z.emit(Z.SI.alertSuccess,[`Updated ${e.name}`])};if(a===o.vF.UNINSTALL)return t.createElement(t.Fragment,null,t.createElement(Be.s,{isOpen:V,title:`Uninstall ${e.name}`,body:"Are you sure you want to uninstall this plugin?",confirmText:"Confirm",icon:"exclamation-triangle",onConfirm:ie,onDismiss:se}),t.createElement(h.Lh,{align:"flex-start",width:"auto",height:"auto"},t.createElement(D.zx,{variant:"destructive",disabled:T,onClick:ct},re)));if(a===o.vF.UPDATE)return t.createElement(h.Lh,{align:"flex-start",width:"auto",height:"auto"},t.createElement(D.zx,{disabled:m,onClick:ut},m?"Updating":"Update"),t.createElement(D.zx,{variant:"destructive",disabled:T,onClick:ie},re));const mt=m||v||!b.config.angularSupportEnabled&&e.angularDetected;return t.createElement(D.zx,{disabled:mt,onClick:dt},m?"Installing":"Install")}function He({pluginId:e,pluginStatus:a,angularDetected:n}){const r=`${(0,N.Uj)(e)}/?tab=installation`;return a===o.vF.UPDATE?t.createElement(h.Lh,{height:"auto"},t.createElement(D.Qj,{href:r,target:"_blank",rel:"noopener noreferrer"},"Update via grafana.com"),t.createElement(D.Qj,{variant:"destructive",href:r,target:"_blank",rel:"noopener noreferrer"},"Uninstall via grafana.com")):a===o.vF.UNINSTALL?t.createElement(D.Qj,{variant:"destructive",href:r,target:"_blank",rel:"noopener noreferrer"},"Uninstall via grafana.com"):t.createElement(D.Qj,{disabled:!b.config.angularSupportEnabled&&n,href:r,target:"_blank",rel:"noopener noreferrer"},"Install via grafana.com")}const Ze=({plugin:e})=>{const a=(0,E.wW)(je),n=(0,S.y9)(),r=(0,N.RU)(e?.details?.versions),[l,c]=(0,t.useState)(!1);if(!e)return null;const u=(0,N.HT)(e,n,r),m=b.config.pluginAdminExternalManageEnabled,v=e.isInstalled?e.hasUpdate?o.vF.UPDATE:o.vF.UNINSTALL:o.vF.INSTALL,T=e.isCore||e.isDisabled||!(0,N.fG)()||u;return t.createElement(h.wc,null,t.createElement(h.Lh,null,!T&&t.createElement(t.Fragment,null,m?t.createElement(He,{pluginId:e.id,pluginStatus:v,angularDetected:e.angularDetected}):t.createElement(Ge,{plugin:e,latestCompatibleVersion:r,pluginStatus:v,setNeedReload:c})),t.createElement($e,{plugin:e})),l&&t.createElement(h.Lh,null,t.createElement($.J,{name:"exclamation-triangle"}),t.createElement("span",{className:a.message},"Refresh the page to see the changes")))},je=e=>({message:(0,i.css)`
      color: ${e.colors.text.secondary};
    `}),Je=({plugin:e})=>{const a=(0,S.y9)(),n=(0,E.wW)(Ke),{error:r}=(0,S.IS)();if(!e)return null;const l=(0,N.RU)(e.details?.versions),c=e.isInstalled?e.hasUpdate?o.vF.UPDATE:o.vF.UNINSTALL:o.vF.INSTALL;return t.createElement("div",{className:n.subtitle},r&&t.createElement(P.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((u,m)=>t.createElement(t.Fragment,{key:m},m>0&&" | ",t.createElement("a",{href:u.url,className:"external-link"},u.name)))),(0,N.HT)(e,a,l)&&t.createElement(Ve,{plugin:e,pluginStatus:c,latestCompatibleVersion:l}))},Ke=e=>({subtitle:(0,i.css)`
      display: flex;
      flex-direction: column;
      gap: ${e.spacing(1)};
    `});var Qe=s(76901),Xe=s(23852);function Ye({plugin:e,latestCompatibleVersion:a,className:n}){const r=(0,E.wW)(qe),l=e.details?.pluginDependencies,c=e.isInstalled?e.details?.grafanaDependency:a?.grafanaDependency||e.details?.grafanaDependency;return!c&&(!l||!l.length)?null:t.createElement(Xe.K,{gap:1},!!c&&t.createElement("div",{className:r.depBadge},t.createElement($.J,{name:"grafana",className:r.icon}),"Grafana ",c),l&&l.length>0&&t.createElement("div",null,l.map(m=>t.createElement("span",{className:r.depBadge,key:m.name},t.createElement($.J,{name:o.Co[m.type],className:r.icon}),m.name," ",m.version))))}const qe=e=>({dependencyTitle:(0,i.css)`
      margin-right: ${e.spacing(.5)};

      &::after {
        content: '';
        padding: 0;
      }
    `,depBadge:(0,i.css)({display:"flex",alignItems:"flex-start"}),icon:(0,i.css)`
      color: ${e.colors.text.secondary};
      margin-right: ${e.spacing(.5)};
    `});var _e=s(97918),et=s(25357);const ee={[g._Z.grafana]:"grafana",[g._Z.commercial]:"shield",[g._Z.community]:"shield",DEFAULT:"shield-exclamation"};function tt({signatureType:e,signatureOrg:a=""}){const n=(0,E.wW)(ae);if(!e&&!a)return null;const r=e===g._Z.grafana?"Grafana Labs":(0,G.capitalize)(e),l=ee[e||""]||ee.DEFAULT;return t.createElement(t.Fragment,null,t.createElement(te,null,t.createElement("div",{className:n.detailsWrapper},t.createElement("strong",{className:n.strong},"Level:\xA0"),t.createElement($.J,{size:"xs",name:l}),"\xA0",r)),t.createElement(te,null,t.createElement("strong",{className:n.strong},"Signed by:")," ",a))}const te=({children:e})=>{const a=(0,E.wW)(ae);return t.createElement(et.C,{color:"green",className:a.badge,text:e})},ae=e=>({badge:(0,i.css)`
    background-color: ${e.colors.background.canvas};
    border-color: ${e.colors.border.strong};
    color: ${e.colors.text.secondary};
    white-space: nowrap;
  `,detailsWrapper:(0,i.css)`
    align-items: center;
    display: flex;
  `,strong:(0,i.css)`
    color: ${e.colors.text.primary};
  `,icon:(0,i.css)`
    margin-right: ${e.spacing(.5)};
  `});function at({plugin:e}){const a=(0,E.wW)(nt),n=e.signature===g.Xy.valid;return t.createElement("div",{className:a.container},t.createElement("a",{href:"https://grafana.com/docs/grafana/latest/plugins/plugin-signatures/",target:"_blank",rel:"noreferrer",className:a.link},t.createElement(_e.o,{status:e.signature})),n&&t.createElement(tt,{signatureType:e.signatureType,signatureOrg:e.signatureOrg}))}const nt=e=>({container:(0,i.css)`
      display: flex;
      flex-wrap: wrap;
      gap: ${e.spacing(.5)};
    `,link:(0,i.css)`
      display: inline-flex;
      align-items: center;
    `}),st=e=>{const a=[];if(!e)return a;const n=(0,N.RU)(e.details?.versions),r=e.installedVersion||n?.version;r&&a.push({label:"Version",value:r}),e.orgName&&a.push({label:"From",value:e.orgName}),(!e.signatureType||e.signatureType===g._Z.community||e.signatureType===g._Z.commercial)&&e.downloads>0&&a.push({label:"Downloads",value:new Intl.NumberFormat().format(e.downloads)});const c=e.details?.pluginDependencies;return!(e.isInstalled?e.details?.grafanaDependency:n?.grafanaDependency||e.details?.grafanaDependency)&&(!c||!c.length)||a.push({label:"Dependencies",value:t.createElement(Ye,{plugin:e,latestCompatibleVersion:n})}),e.isDisabled&&a.push({label:"Status",value:t.createElement(Qe.SX,{error:e.error})}),a.push({label:"Signature",value:t.createElement(at,{plugin:e})}),a},gt=e=>({subtitle:css`
      display: flex;
      flex-direction: column;
      gap: ${e.spacing(1)};
    `}),rt=e=>{const a=st(e);return{actions:t.createElement(Ze,{plugin:e}),info:a,subtitle:t.createElement(Je,{plugin:e})}};function lt({pluginId:e,navId:a="plugins",notFoundComponent:n=t.createElement(ot,null),notFoundNavModel:r={text:"Unknown plugin",subTitle:"The requested ID does not belong to any plugin",active:!0}}){const l=(0,p.TH)(),c=new URLSearchParams(l.search),u=(0,S.bJ)(e),{navModel:m,activePageId:v}=Ce(u,c.get("page")),{actions:T,info:z,subtitle:R}=rt(u),{isLoading:x}=(0,S.ZV)(),{isLoading:I}=(0,S.bt)(),V=(0,E.wW)(it);return x||I?t.createElement(y.T,{navId:a,pageNav:{text:"",active:!0}},t.createElement(W.a,null)):u?t.createElement(y.T,{navId:a,pageNav:m,actions:T,subTitle:R,info:z},t.createElement(y.T.Contents,null,t.createElement(A.I,{className:V.tabContent},u.angularDetected&&t.createElement(U.Y,{className:V.alert,angularSupportEnabled:b.config?.angularSupportEnabled,pluginId:u.id,pluginType:u.type,showPluginDetailsLink:!1}),t.createElement(Ne,{plugin:u,className:V.alert}),t.createElement(Se,{plugin:u,className:V.alert}),t.createElement(Pe,{queryParams:Object.fromEntries(c),plugin:u,pageId:v})))):t.createElement(y.T,{navId:a,pageNav:r},n)}const it=e=>({alert:(0,i.css)`
      margin-bottom: ${e.spacing(2)};
    `,subtitle:(0,i.css)`
      display: flex;
      flex-direction: column;
      gap: ${e.spacing(1)};
    `,tabContent:(0,i.css)`
      overflow: auto;
      height: 100%;
    `});function ot(){return t.createElement(h.Ar,{justify:"center",align:"center"},t.createElement(P.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"),"."))}},64626:(F,C,s)=>{s.d(C,{Y:()=>A});var i=s(27702),t=s(9232),p=s(86312),b=s(63439);function E(P,h){let y;switch(P){case t.zV.app:y="app plugin";break;case t.zV.panel:y="panel plugin";break;case t.zV.datasource:y="data source plugin";break;default:y="plugin"}let d=`This ${y} uses a deprecated, legacy platform based on AngularJS and `;return h===void 0?d+" may be incompatible depending on your Grafana configuration.":h?d+" will stop working in future releases of Grafana.":d+" is incompatible with your current Grafana configuration."}function A(P){const{className:h,angularSupportEnabled:y,pluginId:d,pluginType:U,showPluginDetailsLink:W}=P,[w,O]=(0,i.useState)(!1);return w?null:i.createElement(b.b,{severity:"warning",title:"Angular plugin",className:h,onRemove:()=>O(!0)},i.createElement("p",null,E(U,y)),i.createElement("div",{className:"markdown-html"},i.createElement("ul",null,i.createElement("li",null,i.createElement("a",{href:"https://grafana.com/docs/grafana/latest/developers/angular_deprecation/",className:"external-link",target:"_blank",rel:"noreferrer",onClick:()=>{(0,p.ff)("angular_deprecation_docs_clicked",{pluginId:d})}},"Read our deprecation notice and migration advice.")),W&&d?i.createElement("li",null,i.createElement("a",{href:`plugins/${encodeURIComponent(d)}`,className:"external-link",target:"_blank",rel:"noreferrer"},"View plugin details")):null)))}}}]);

//# sourceMappingURL=7795.27fe6b93cfe1f5db87b2.js.map