"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[123],{72055:(f,d,s)=>{s.r(d),s.d(d,{default:()=>A});var t=s(74848),P=s(96540),o=s(71468),u=s(88090),a=s(54594),i=s(20968),B=s(99764),_=s(54122),p=s(87638),E=s(61491),l=s(81628);const n=(0,t.jsx)("span",{children:"Support bundles allow you to easily collect and share Grafana logs, configuration, and data with the Grafana Labs team."}),e=(0,t.jsx)(a.z9,{icon:"plus",href:"support-bundles/create",variant:"primary",children:"New support bundle"}),h=c=>({supportBundles:c.supportBundles.supportBundles,isLoading:c.supportBundles.isLoading}),O={loadBundles:l.WJ,removeBundle:l.Hb,checkBundles:l.ac},A=(0,o.connect)(h,O)(({supportBundles:c,isLoading:M,loadBundles:D,removeBundle:x,checkBundles:j})=>{const C=c.some(r=>r.state==="pending");(0,P.useEffect)(()=>{D()},[D]),(0,P.useEffect)(()=>{C&&j()});const v=p.TP.hasPermission(E.AccessControlAction.ActionSupportBundlesCreate),T=p.TP.hasPermission(E.AccessControlAction.ActionSupportBundlesDelete),g=v?e:void 0;return(0,t.jsx)(_.Y,{navId:"support-bundles",subTitle:n,actions:g,children:(0,t.jsx)(_.Y.Contents,{isLoading:M,children:(0,t.jsxs)("table",{className:"filter-table form-inline",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"Created on"}),(0,t.jsx)("th",{children:"Requested by"}),(0,t.jsx)("th",{children:"Expires"}),(0,t.jsx)("th",{style:{width:"32px"}}),(0,t.jsx)("th",{style:{width:"1%"}}),(0,t.jsx)("th",{style:{width:"1%"}})]})}),(0,t.jsx)("tbody",{children:c?.map(r=>(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:(0,u.LE)(r.createdAt*1e3)}),(0,t.jsx)("th",{children:r.creator}),(0,t.jsx)("th",{children:(0,u.LE)(r.expiresAt*1e3)}),(0,t.jsx)("th",{children:r.state==="pending"&&(0,t.jsx)(i.y,{})}),(0,t.jsx)("th",{children:(0,t.jsx)(a.z9,{fill:"outline",disabled:r.state!=="complete",target:"_self",href:`/api/support-bundles/${r.uid}`,children:"Download"})}),(0,t.jsx)("th",{children:T&&(0,t.jsx)(B.K,{onClick:()=>x(r.uid),name:"trash-alt",variant:"destructive",tooltip:"Remove bundle"})})]},r.uid))})]})})})})},81628:(f,d,s)=>{s.d(d,{Hb:()=>p,OS:()=>E,WJ:()=>i,ac:()=>_,iO:()=>l});var t=s(2543),P=s.n(t),o=s(28082),u=s(53027),a=s(28378);function i(n=!1){return async e=>{try{n||e((0,a.sF)());const h=await(0,o.AI)().get("/api/support-bundles");e((0,a.sJ)(h))}finally{e((0,a.kH)())}}}const B=(0,t.throttle)(async n=>{const e=await(0,o.AI)().get("/api/support-bundles");n((0,a.sJ)(e))},1e3);function _(){return async n=>{n(B)}}function p(n){return async e=>{await(0,o.AI)().delete(`/api/support-bundles/${n}`),e(i(!0))}}function E(){return async n=>{try{n((0,a.Y1)());const e=await(0,o.AI)().get("/api/support-bundles/collectors");n((0,a.j7)(e))}catch{n((0,a.pB)("Error loading support bundles data collectors"))}finally{n((0,a.s7)())}}}function l(n){return async e=>{try{await(0,o.AI)().post("/api/support-bundles",n),u.Ny.push("/support-bundles")}catch{e((0,a.NV)("Error creating support bundle"))}}}}}]);

//# sourceMappingURL=SupportBundles.15f6f7c9d7e879707cc2.js.map