"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["components/pages/DomainsResourceUsagePage"],{1448:(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]}`}},2991:(e,a,s)=>{s.r(a),s.d(a,{default:()=>t.default});var t=s(2992)},2992:(e,a,s)=>{s.r(a),s.d(a,{default:()=>g});var t=s(297),r=s(90),o=s(296),n=s(1180),i=s(1448),l=s(1301),c=s.n(l);s(2993);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"})}),...e})}},2993:(e,a,s)=>{s.r(a)}}]);
//# sourceMappingURL=DomainsResourceUsagePage.js.map?2173f2cdd2ad22f7e0d4