"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[9939],{57906:(B,E,e)=>{e.r(E),e.d(E,{default:()=>D});var t=e(66111),f=e(67948),r=e(77258),d=e(31403),l=e(67487),i=e(8180),_=e(8412),o=e(77582),p=e(27876),c=e(77878);const h=t.createElement("span",null,"Support bundles allow you to easily collect and share Grafana logs, configuration, and data with the Grafana Labs team."),n=t.createElement(d.Qj,{icon:"plus",href:"support-bundles/create",variant:"primary"},"New support bundle"),a=u=>({supportBundles:u.supportBundles.supportBundles,isLoading:u.supportBundles.isLoading}),m={loadBundles:c.Ch,removeBundle:c.od,checkBundles:c.ob},D=(0,f.connect)(a,m)(({supportBundles:u,isLoading:A,loadBundles:P,removeBundle:O,checkBundles:M})=>{const C=u.some(s=>s.state==="pending");(0,t.useEffect)(()=>{P()},[P]),(0,t.useEffect)(()=>{C&&M()});const v=o.Vt.hasAccess(p.AccessControlAction.ActionSupportBundlesCreate,o.Vt.isGrafanaAdmin),T=o.Vt.hasAccess(p.AccessControlAction.ActionSupportBundlesDelete,o.Vt.isGrafanaAdmin),g=v?n:void 0;return t.createElement(_.T,{navId:"support-bundles",subTitle:h,actions:g},t.createElement(_.T.Contents,{isLoading: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(l.$,null)),t.createElement("th",null,t.createElement(d.Qj,{fill:"outline",disabled:s.state!=="complete",target:"_self",href:`/api/support-bundles/${s.uid}`},"Download")),t.createElement("th",null,T&&t.createElement(i.h,{onClick:()=>O(s.uid),name:"trash-alt",variant:"destructive"}))))))))})},77878:(B,E,e)=>{e.d(E,{Ch:()=>i,Jp:()=>h,ob:()=>o,od:()=>p,vc:()=>c});var t=e(82897),f=e.n(t),r=e(54899),d=e(37932),l=e(62295);function i(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 _=(0,t.throttle)(async n=>{const a=await(0,r.i)().get("/api/support-bundles");n((0,l.rW)(a))},1e3);function o(){return async n=>{n(_)}}function p(n){return async a=>{await(0,r.i)().delete(`/api/support-bundles/${n}`),a(i(!0))}}function c(){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 h(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.bf7c93c84295cd9cdaa4.js.map