"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[123],{23987(f,d,t){t.r(d),t.d(d,{default:()=>M});var n=t(74848),E=t(96540),a=t(71468),u=t(87550),e=t(52358),c=t(31944),P=t(33100),x=t(91660),i=t(45270),p=t(5246),_=t(68459),s=t(48148),r=t(68720);const h=(0,n.jsx)(i.z9,{icon:"plus",href:"support-bundles/create",variant:"primary",children:(0,n.jsx)(e.x6,{i18nKey:"support-bundles.new-bundle-button.new-support-bundle",children:"New support bundle"})}),B=l=>({supportBundles:l.supportBundles.supportBundles,isLoading:l.supportBundles.isLoading}),O={loadBundles:r.WJ,removeBundle:r.Hb,checkBundles:r.ac},M=(0,a.connect)(B,O)(({supportBundles:l,isLoading:j,loadBundles:D,removeBundle:v,checkBundles:g})=>{const y=l.some(o=>o.state==="pending");(0,E.useEffect)(()=>{D()},[D]),(0,E.useEffect)(()=>{y&&g()});const A=_.TP.hasPermission(s.w.ActionSupportBundlesCreate),m=_.TP.hasPermission(s.w.ActionSupportBundlesDelete),C=A?h:void 0,K=(0,n.jsx)("span",{children:(0,n.jsx)(e.x6,{i18nKey:"support-bundles.support-bundles-unconnected.sub-title",children:"Support bundles allow you to easily collect and share Grafana logs, configuration, and data with the Grafana Labs team."})});return(0,n.jsx)(p.Y,{navId:"support-bundles",subTitle:K,actions:C,children:(0,n.jsxs)(p.Y.Contents,{isLoading:j,children:[(0,n.jsx)(P.F,{title:(0,e.t)("support-bundles.support-bundles-unconnected.deprecation-warning-title","Deprecated feature"),severity:"warning",children:(0,n.jsx)(e.x6,{i18nKey:"support-bundles.support-bundles-unconnected.deprecation-warning-message",children:"Support bundles are deprecated and will be removed soon. For troubleshooting, collect the relevant server logs, configuration, and diagnostic details manually, then attach them to your Grafana Support ticket."})}),(0,n.jsxs)("table",{className:"filter-table form-inline",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:(0,n.jsx)(e.x6,{i18nKey:"support-bundles.support-bundles-unconnected.created-on",children:"Created on"})}),(0,n.jsx)("th",{children:(0,n.jsx)(e.x6,{i18nKey:"support-bundles.support-bundles-unconnected.requested-by",children:"Requested by"})}),(0,n.jsx)("th",{children:(0,n.jsx)(e.x6,{i18nKey:"support-bundles.support-bundles-unconnected.expires",children:"Expires"})}),(0,n.jsx)("th",{style:{width:"32px"}}),(0,n.jsx)("th",{style:{width:"1%"}}),(0,n.jsx)("th",{style:{width:"1%"}})]})}),(0,n.jsx)("tbody",{children:l?.map(o=>(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:(0,u.LE)(o.createdAt*1e3)}),(0,n.jsx)("th",{children:o.creator}),(0,n.jsx)("th",{children:(0,u.LE)(o.expiresAt*1e3)}),(0,n.jsx)("th",{children:o.state==="pending"&&(0,n.jsx)(x.y,{})}),(0,n.jsx)("th",{children:(0,n.jsx)(i.z9,{fill:"outline",disabled:o.state!=="complete",target:"_self",href:`/api/support-bundles/${o.uid}`,children:(0,n.jsx)(e.x6,{i18nKey:"support-bundles.support-bundles-unconnected.download",children:"Download"})})}),(0,n.jsx)("th",{children:m&&(0,n.jsx)(c.K,{onClick:()=>v(o.uid),name:"trash-alt",variant:"destructive",tooltip:(0,e.t)("support-bundles.support-bundles-unconnected.tooltip-remove-bundle","Remove bundle")})})]},o.uid))})]})]})})})},68720(f,d,t){t.d(d,{Hb:()=>i,OS:()=>p,WJ:()=>c,ac:()=>x,iO:()=>_});var n=t(2543),E=t.n(n),a=t(29318),u=t(98391),e=t(69726);function c(s=!1){return async r=>{try{s||r((0,e.sF)());const h=await(0,a.AI)().get("/api/support-bundles");r((0,e.sJ)(h))}finally{r((0,e.kH)())}}}const P=(0,n.throttle)(async s=>{const r=await(0,a.AI)().get("/api/support-bundles");s((0,e.sJ)(r))},1e3);function x(){return async s=>{s(P)}}function i(s){return async r=>{await(0,a.AI)().delete(`/api/support-bundles/${s}`),r(c(!0))}}function p(){return async s=>{try{s((0,e.Y1)());const r=await(0,a.AI)().get("/api/support-bundles/collectors");s((0,e.j7)(r))}catch{s((0,e.pB)("Error loading support bundles data collectors"))}finally{s((0,e.s7)())}}}function _(s){return async r=>{try{await(0,a.AI)().post("/api/support-bundles",s),u.Ny.push("/support-bundles")}catch{r((0,e.NV)("Error creating support bundle"))}}}}}]);

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