"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[9939],{57906:(B,E,e)=>{e.r(E),e.d(E,{default:()=>A});var t=e(68404),h=e(36635),r=e(38849),d=e(35645),l=e(31403),_=e(67487),f=e(8180),i=e(79396),o=e(77582),p=e(81168),c=e(77878);const n=t.createElement("span",null,"Support bundles allow you to easily collect and share Grafana logs, configuration, and data with the Grafana Labs team."),a=t.createElement(l.Qj,{icon:"plus",href:"support-bundles/create",variant:"primary"},"New support bundle"),m=u=>({supportBundles:u.supportBundles.supportBundles,isLoading:u.supportBundles.isLoading}),O={loadBundles:c.Ch,removeBundle:c.od,checkBundles:c.ob},A=(0,h.connect)(m,O)(({supportBundles:u,isLoading:M,loadBundles:P,removeBundle:v,checkBundles:g})=>{const C=u.some(s=>s.state==="pending");(0,t.useEffect)(()=>{P()},[P]),(0,t.useEffect)(()=>{C&&g()});const D=o.Vt.hasAccess(p.AccessControlAction.ActionSupportBundlesCreate,o.Vt.isGrafanaAdmin),T=o.Vt.hasAccess(p.AccessControlAction.ActionSupportBundlesDelete,o.Vt.isGrafanaAdmin),y=d.v.featureToggles.topnav&&D?a:void 0;return t.createElement(i.T,{navId:"support-bundles",subTitle:n,actions:y},t.createElement(i.T.Contents,{isLoading:M},!d.v.featureToggles.topnav&&D&&a,t.createElement("table",{className:"filter-table form-inline"},t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",null,"Created on"),t.createElement("th",null,"Requested by"),t.createElement("th",null,"Expires"),t.createElement("th",{style:{width:"32px"}}),t.createElement("th",{style:{width:"1%"}}),t.createElement("th",{style:{width:"1%"}}))),t.createElement("tbody",null,u?.map(s=>t.createElement("tr",{key:s.uid},t.createElement("th",null,(0,r.dq)(s.createdAt*1e3)),t.createElement("th",null,s.creator),t.createElement("th",null,(0,r.dq)(s.expiresAt*1e3)),t.createElement("th",null,s.state==="pending"&&t.createElement(_.$,null)),t.createElement("th",null,t.createElement(l.Qj,{fill:"outline",disabled:s.state!=="complete",target:"_self",href:`/api/support-bundles/${s.uid}`},"Download")),t.createElement("th",null,T&&t.createElement(f.h,{onClick:()=>v(s.uid),name:"trash-alt",variant:"destructive"}))))))))})},77878:(B,E,e)=>{e.d(E,{Ch:()=>_,Jp:()=>c,ob:()=>i,od:()=>o,vc:()=>p});var t=e(82897),h=e.n(t),r=e(54899),d=e(37932),l=e(62295);function _(n=!1){return async a=>{try{n||a((0,l.Ii)());const m=await(0,r.i)().get("/api/support-bundles");a((0,l.rW)(m))}finally{a((0,l.ki)())}}}const f=(0,t.throttle)(async n=>{const a=await(0,r.i)().get("/api/support-bundles");n((0,l.rW)(a))},1e3);function i(){return async n=>{n(f)}}function o(n){return async a=>{await(0,r.i)().delete(`/api/support-bundles/${n}`),a(_(!0))}}function p(){return async n=>{try{n((0,l.ik)());const a=await(0,r.i)().get("/api/support-bundles/collectors");n((0,l.cD)(a))}catch{n((0,l.rI)("Error loading support bundles data collectors"))}finally{n((0,l.UW)())}}}function c(n){return async a=>{try{await(0,r.i)().post("/api/support-bundles",n),d.E1.push("/support-bundles")}catch{a((0,l.fT)("Error creating support bundle"))}}}}}]);

//# sourceMappingURL=SupportBundles.7fdbc0821ace690e3a9e.js.map