"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[9939],{75080:(B,E,e)=>{e.r(E),e.d(E,{default:()=>A});var t=e(65237),h=e(37149),r=e(25641),d=e(49784),l=e(48389),_=e(44380),f=e(67262),i=e(38992),o=e(63969),p=e(3315),c=e(66621);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"}))))))))})},66621:(B,E,e)=>{e.d(E,{Ch:()=>_,Jp:()=>c,ob:()=>i,od:()=>o,vc:()=>p});var t=e(89949),h=e.n(t),r=e(55041),d=e(38002),l=e(61210);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.29ded9b8bf3b0ebe6140.js.map