D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
usr
/
share
/
grafana
/
public
/
build
/
Filename :
PluginListPage.a7fa824e3f1d793a96e5.js
back
Copy
"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[94],{76901:(w,B,a)=>{a.d(B,{Nq:()=>g,SX:()=>x,IF:()=>A,oZ:()=>P,xh:()=>b});var n=a(27702),t=a(9232),u=a(25357);function x({error:l}){const p=f(l);return n.createElement(u.C,{icon:"exclamation-triangle",text:"Disabled",color:"red",tooltip:p})}function f(l){switch(l){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${l?`: ${l}`:""}`}}var c=a(66310),h=a(42844);const y=l=>(0,h.css)` background: ${l.colors.background.primary}; border-color: ${l.colors.border.strong}; color: ${l.colors.text.secondary}; `;function P(){const l=(0,c.wW)(y);return n.createElement(u.C,{text:"Installed",color:"orange",className:l})}var N=a(80978),S=a(64022),T=a(97918),D=a(66670);function A({plugin:l}){const p=(0,c.wW)(y),L=z=>{z.preventDefault(),window.open(`https://grafana.com/grafana/plugins/${l.id}?utm_source=grafana_catalog_learn_more`,"_blank","noopener,noreferrer")};return(0,N.v)("enterprise.plugins")?n.createElement(u.C,{text:"Enterprise",color:"blue"}):n.createElement(S.Lh,null,n.createElement(T.o,{status:l.signature}),n.createElement(u.C,{icon:"lock","aria-label":"lock icon",text:"Enterprise",color:"blue",className:p}),n.createElement(D.zx,{size:"sm",fill:"text",icon:"external-link-alt",onClick:L},"Learn more"))}function b({plugin:l}){const p=(0,c.wW)(I);return n.createElement("p",{className:p.hasUpdate},"Update available!")}const I=l=>({hasUpdate:(0,h.css)` color: ${l.colors.text.secondary}; font-size: ${l.typography.bodySmall.fontSize}; margin-bottom: 0; `});function g(){return n.createElement(u.C,{icon:"exclamation-triangle",text:"Angular",color:"orange",tooltip:"This plugin uses deprecated functionality, support for which is being removed."})}},48179:(w,B,a)=>{a.r(B),a.d(B,{default:()=>te});var n=a(42844),t=a(27702),u=a(7662),x=a(26129),f=a(66310),c=a(22209),h=a(28580),y=a(40705),P=a(80011),N=a(52419),S=a(44644),T=a(86809),D=a(90131),A=a(18771),b=a(58083),I=a(34667),g=a(95948),l=a(73453),p=a(9232),L=a(64022),z=a(97918),m=a(76901);function M({plugin:e}){const r=e.hasUpdate&&!e.isCore&&e.type!==p.zV.renderer;return e.isEnterprise?t.createElement(L.Lh,{height:"auto",wrap:!0},t.createElement(m.IF,{plugin:e}),e.isDisabled&&t.createElement(m.SX,{error:e.error}),r&&t.createElement(m.xh,{plugin:e}),e.angularDetected&&t.createElement(m.Nq,null)):t.createElement(L.Lh,{height:"auto",wrap:!0},t.createElement(z.o,{status:e.signature}),e.isDisabled&&t.createElement(m.SX,{error:e.error}),e.isInstalled&&t.createElement(m.oZ,null),r&&t.createElement(m.xh,{plugin:e}),e.angularDetected&&t.createElement(m.Nq,null))}function X({alt:e,className:r,src:o,height:s}){return t.createElement("img",{src:o,className:r,alt:e,loading:"lazy",height:s})}const G="48px";function j({plugin:e,pathName:r,displayMode:o=g.lL.Grid}){const s=(0,f.wW)(V),i=o===g.lL.List;return t.createElement("a",{href:`${r}/${e.id}`,className:(0,n.cx)(s.container,{[s.list]:i})},t.createElement(X,{src:e.info.logos.small,className:s.pluginLogo,height:G,alt:""}),t.createElement("h2",{className:(0,n.cx)(s.name,"plugin-name")},e.name),t.createElement("div",{className:(0,n.cx)(s.content,"plugin-content")},t.createElement("p",null,"By ",e.orgName),t.createElement(M,{plugin:e})),t.createElement("div",{className:s.pluginType},e.type&&t.createElement(l.J,{name:g.Co[e.type],title:`${e.type} plugin`})))}const V=e=>({container:(0,n.css)` display: grid; grid-template-columns: ${G} 1fr ${e.spacing(3)}; grid-template-rows: auto; gap: ${e.spacing(2)}; grid-auto-flow: row; background: ${e.colors.background.secondary}; border-radius: ${e.shape.borderRadius()}; padding: ${e.spacing(3)}; transition: ${e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short})}; &:hover { background: ${e.colors.emphasize(e.colors.background.secondary,.03)}; } `,list:(0,n.css)` row-gap: 0px; > img { align-self: start; } > .plugin-content { min-height: 0px; grid-area: 2 / 2 / 4 / 3; > p { margin: ${e.spacing(0,0,.5,0)}; } } > .plugin-name { align-self: center; grid-area: 1 / 2 / 2 / 3; } `,pluginType:(0,n.css)` grid-area: 1 / 3 / 2 / 4; color: ${e.colors.text.secondary}; `,pluginLogo:(0,n.css)` grid-area: 1 / 1 / 3 / 2; max-width: 100%; align-self: center; object-fit: contain; `,content:(0,n.css)` grid-area: 3 / 1 / 4 / 3; color: ${e.colors.text.secondary}; `,name:(0,n.css)` grid-area: 1 / 2 / 3 / 3; align-self: center; font-size: ${e.typography.h4.fontSize}; color: ${e.colors.text.primary}; margin: 0; `}),J=({plugins:e,displayMode:r})=>{const o=r===g.lL.List,s=(0,f.wW)(K),{pathname:i}=(0,u.TH)(),F=I.config.appSubUrl+(i.endsWith("/")?i.slice(0,-1):i);return t.createElement("div",{className:(0,n.cx)(s.container,{[s.list]:o}),"data-testid":"plugin-list"},e.map(v=>t.createElement(j,{key:v.id,plugin:v,pathName:F,displayMode:r})))},K=e=>({container:(0,n.css)` display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: ${e.spacing(3)}; `,list:(0,n.css)` grid-template-columns: 1fr; `});var Q=a(29956),Y=a(33716);const k=(e,r=0,o=[])=>{const s=(0,t.useRef)(!0),i=[...o,s];return(0,Q.Z)(()=>{if(s.current){s.current=!1;return}return e()},r,i)},q=({value:e,onSearch:r})=>{const[o,s]=(0,t.useState)(e);return k(()=>r(o??""),500,[o]),t.createElement(Y.H,{value:o,onKeyDown:i=>{(i.key==="Enter"||i.keyCode===13)&&r(i.currentTarget.value)},placeholder:"Search Grafana plugins",onChange:i=>{s(i)},width:46})};var _=a(67972);const ee=()=>({push:({query:e})=>{x.E1.partial(e)}});var W=a(64248);function te({route:e}){const r=(0,u.TH)(),o=(0,x.Ox)(r.search),s=(0,A.useSelector)(d=>(0,T.ht)(d.navIndex,"plugins")),{displayMode:i,setDisplayMode:F}=(0,W.iY)(),v=(0,f.wW)(ae),C=ee(),ne=(0,W.y9)(),U=o.q||"",E=o.filterBy||"installed",$=o.filterByType||"all",Z=o.sortBy||_.Nh.nameAsc,{isLoading:le,error:H,plugins:se}=(0,W.Pj)({keyword:U,type:$!=="all"?$:void 0,isInstalled:E==="installed"?!0:void 0,isCore:E==="installed"?void 0:!1},Z),R=[{value:"all",label:"All"},{value:"installed",label:"Installed"}],re=d=>{C.push({query:{sortBy:d.value}})},O=d=>{C.push({query:{filterBy:d}})},oe=d=>{C.push({query:{filterByType:d.value}})},ie=d=>{C.push({query:{filterBy:E,filterByType:$,q:d}})};if(H)return console.error(H.message),null;const ce=t.createElement("div",null,"Extend the Grafana experience with panel plugins and apps. To find more data sources go to"," ",t.createElement("a",{className:"external-link",href:`${D.Z.AddNewConnection}?cat=data-source`},"Connections"),".");return t.createElement(S.T,{navModel:s,subTitle:ce},t.createElement(S.T.Contents,null,t.createElement(b.L,{wrap:!0},t.createElement(c.g,{label:"Search"},t.createElement(q,{value:U,onSearch:ie})),t.createElement(b.L,{wrap:!0,className:v.actionBar},t.createElement(c.g,{label:"Type"},t.createElement(h.Ph,{"aria-label":"Plugin type filter",value:$,onChange:oe,width:18,options:[{value:"all",label:"All"},{value:"datasource",label:"Data sources"},{value:"panel",label:"Panels"},{value:"app",label:"Applications"}]})),ne?t.createElement(c.g,{label:"State"},t.createElement(y.S,{value:E,onChange:O,options:R})):t.createElement(P.u,{content:"This filter has been disabled because the Grafana server cannot access grafana.com",placement:"top"},t.createElement("div",null,t.createElement(c.g,{label:"State"},t.createElement(y.S,{disabled:!0,value:E,onChange:O,options:R})))),t.createElement(c.g,{label:"Sort"},t.createElement(h.Ph,{"aria-label":"Sort Plugins List",width:24,value:Z,onChange:re,options:[{value:"nameAsc",label:"By name (A-Z)"},{value:"nameDesc",label:"By name (Z-A)"},{value:"updated",label:"By updated date"},{value:"published",label:"By published date"},{value:"downloads",label:"By downloads"}]})),t.createElement(c.g,{label:"View"},t.createElement(y.S,{className:v.displayAs,value:i,onChange:F,options:[{value:g.lL.Grid,icon:"table",description:"Display plugins in a grid layout"},{value:g.lL.List,icon:"list-ul",description:"Display plugins in list"}]})))),t.createElement("div",{className:v.listWrap},le?t.createElement(N.u,{className:(0,n.css)` margin-bottom: 0; `,text:"Loading results"}):t.createElement(J,{plugins:se,displayMode:i}))))}const ae=e=>({actionBar:(0,n.css)` ${e.breakpoints.up("xl")} { margin-left: auto; } `,listWrap:(0,n.css)` margin-top: ${e.spacing(2)}; `,displayAs:(0,n.css)` svg { margin-right: 0; } `})}}]); //# sourceMappingURL=PluginListPage.a7fa824e3f1d793a96e5.js.map