"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["components/pages/DomainsResourceUsagePage"],{3133(e,a,s){s.r(a),s.d(a,{default:()=>g});var t=s(373),r=s(90),o=s(372),n=s(1272),i=s(1539),l=s(1393),c=s.n(l);s(3134);const d=r.Locale.getTranslate("admin.components.lists.resourceusage"),g=()=>{const{listProps:e,listInput:a,queryResult:{data:s}}=(0,n.useGraphQlList)({key:"ResourceUsagePage",query:c(),extractList:e=>e.viewer.client.resourceUsage}),r=s?.os?.isUnix??!1,l=(0,o.useMemo)(()=>[{key:"domainName",render:({domainName:e})=>(0,o.jsx)("span",{className:"domain-resource-usage-page-nowrap",children:e})},{key:"clientName",render:({clientName:e})=>(0,o.jsx)("span",{"data-testid":"client-name",className:"domain-resource-usage-page-nowrap",children:e})},{key:"webUsage",render:({webUsage:e})=>(0,i.formatByteSize)(e)},{key:"mailUsage",render:({mailUsage:e})=>(0,i.formatByteSize)(e)},{key:"databaseUsage",render:({databaseUsage:e})=>(0,i.formatByteSize)(e)},{key:"backupsUsage",render:({backupsUsage:e})=>(0,i.formatByteSize)(e)},r&&{key:"configsUsage",render:({configsUsage:e})=>(0,i.formatByteSize)(e)},{key:"logsUsage",render:({logsUsage:e})=>(0,i.formatByteSize)(e)},{key:"anonFtpUsage",render:({anonFtpUsage:e})=>(0,i.formatByteSize)(e)},{key:"actions",title:"",render:({domainName:e})=>(0,o.jsx)(t.ListActions,{children:(0,o.jsx)(t.ListAction,{onClick:()=>{window.open(`https://${e}/plesk-stat/webstat-ssl/`,"_blank","popup,width=700,height=500")},icon:"bar-chart-vertical-lock",primary:!0,children:(0,o.jsx)(d,{content:"webStatistics"})})})}].filter(Boolean).map(({key:e,width:a,title:s,render:t})=>({key:e,width:a,title:s??(0,o.jsx)(d,{content:e}),sortable:!0,render:t})),[r]),g=(0,o.jsxs)(t.Toolbar,{children:[(0,o.jsx)(t.ToolbarExpander,{}),(0,o.jsx)(t.ToolbarGroup,{title:"",children:(0,o.jsx)(t.ToolbarGroup,{groupable:!1,title:"",children:(0,o.jsx)(n.GraphQlList.SearchBar,{name:"search"})})})]});return(0,o.jsx)(n.GraphQlList,{rowKey:"id",filtered:!!a.searchFilters?.search,columns:l,toolbar:g,emptyView:(0,o.jsx)(t.ListEmptyView,{title:(0,o.jsx)(d,{content:"noResults"})}),vertical:850,...e})}},3132(e,a,s){s.r(a),s.d(a,{default:()=>t.default});var t=s(3133)},1539(e,a,s){s.r(a),s.d(a,{formatByteSize:()=>r});const t=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=e=>{if(!e)return"0 B";const a=Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**a).toFixed(2)} ${t[a]}`}},3134(e,a,s){s.r(a)}}]);
//# sourceMappingURL=DomainsResourceUsagePage.js.map?0b5c17cf0721c271b365