"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[9939],{99222:(B,u,e)=>{e.r(u),e.d(u,{default:()=>D});var t=e(39953),P=e(89772),r=e(48069),E=e(4919),l=e(28409),d=e(68497),i=e(13253),p=e(21308),_=e(57721),o=e(4267);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(E.Qj,{icon:"plus",href:"support-bundles/create",variant:"primary"},"New support bundle"),a=c=>({supportBundles:c.supportBundles.supportBundles,isLoading:c.supportBundles.isLoading}),m={loadBundles:o.Ch,removeBundle:o.od,checkBundles:o.ob},D=(0,P.connect)(a,m)(({supportBundles:c,isLoading:O,loadBundles:f,removeBundle:M,checkBundles:A})=>{const C=c.some(s=>s.state==="pending");(0,t.useEffect)(()=>{f()},[f]),(0,t.useEffect)(()=>{C&&A()});const v=p.Vt.hasPermission(_.AccessControlAction.ActionSupportBundlesCreate),T=p.Vt.hasPermission(_.AccessControlAction.ActionSupportBundlesDelete),g=v?n:void 0;return t.createElement(i.T,{navId:"support-bundles",subTitle:h,actions:g},t.createElement(i.T.Contents,{isLoading:O},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,c?.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(E.Qj,{fill:"outline",disabled:s.state!=="complete",target:"_self",href:`/api/support-bundles/${s.uid}`},"Download")),t.createElement("th",null,T&&t.createElement(d.h,{onClick:()=>M(s.uid),name:"trash-alt",variant:"destructive",tooltip:"Remove bundle"}))))))))})},4267:(B,u,e)=>{e.d(u,{Ch:()=>d,Jp:()=>h,ob:()=>p,od:()=>_,vc:()=>o});var t=e(86832),P=e.n(t),r=e(4148),E=e(13601),l=e(92258);function d(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 i=(0,t.throttle)(async n=>{const a=await(0,r.i)().get("/api/support-bundles");n((0,l.rW)(a))},1e3);function p(){return async n=>{n(i)}}function _(n){return async a=>{await(0,r.i)().delete(`/api/support-bundles/${n}`),a(d(!0))}}function o(){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),E.E1.push("/support-bundles")}catch{a((0,l.fT)("Error creating support bundle"))}}}}}]);

//# sourceMappingURL=SupportBundles.a0c170e3f15f704d8fba.js.map