"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[123],{236(D,u,t){t.r(u),t.d(u,{default:()=>f});var n=t(74848),P=t(96540),a=t(71468),d=t(80011),e=t(92745),c=t(76319),x=t(68079),i=t(45861),p=t(13791),_=t(15130),h=t(11257),s=t(65075);const r=(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"})}),E=l=>({supportBundles:l.supportBundles.supportBundles,isLoading:l.supportBundles.isLoading}),O={loadBundles:s.WJ,removeBundle:s.Hb,checkBundles:s.ac},f=(0,a.connect)(E,O)(({supportBundles:l,isLoading:M,loadBundles:B,removeBundle:j,checkBundles:A})=>{const v=l.some(o=>o.state==="pending");(0,P.useEffect)(()=>{B()},[B]),(0,P.useEffect)(()=>{v&&A()});const y=_.TP.hasPermission(h.w.ActionSupportBundlesCreate),C=_.TP.hasPermission(h.w.ActionSupportBundlesDelete),K=y?r:void 0,T=(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:T,actions:K,children:(0,n.jsx)(p.Y.Contents,{isLoading:M,children:(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,d.LE)(o.createdAt*1e3)}),(0,n.jsx)("th",{children:o.creator}),(0,n.jsx)("th",{children:(0,d.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:C&&(0,n.jsx)(c.K,{onClick:()=>j(o.uid),name:"trash-alt",variant:"destructive",tooltip:(0,e.t)("support-bundles.support-bundles-unconnected.tooltip-remove-bundle","Remove bundle")})})]},o.uid))})]})})})})},65075(D,u,t){t.d(u,{Hb:()=>p,OS:()=>_,WJ:()=>c,ac:()=>i,iO:()=>h});var n=t(2543),P=t.n(n),a=t(68143),d=t(36490),e=t(69807);function c(s=!1){return async r=>{try{s||r((0,e.sF)());const E=await(0,a.AI)().get("/api/support-bundles");r((0,e.sJ)(E))}finally{r((0,e.kH)())}}}const x=(0,n.throttle)(async s=>{const r=await(0,a.AI)().get("/api/support-bundles");s((0,e.sJ)(r))},1e3);function i(){return async s=>{s(x)}}function p(s){return async r=>{await(0,a.AI)().delete(`/api/support-bundles/${s}`),r(c(!0))}}function _(){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 h(s){return async r=>{try{await(0,a.AI)().post("/api/support-bundles",s),d.Ny.push("/support-bundles")}catch{r((0,e.NV)("Error creating support bundle"))}}}}}]);

//# sourceMappingURL=SupportBundles.7324220c97b1c003e5eb.js.map