"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["components/pages/DomainsResourceUsagePage"],{1439:(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]}`}},2971:(e,a,s)=>{s.r(a),s.d(a,{default:()=>t.default});var t=s(2972)},2972:(e,a,s)=>{s.r(a),s.d(a,{default:()=>p});var t=s(296),r=s(90),n=s(295),o=s(1169),i=s(1439),l=s(1290),c=s.n(l);s(2973);const d=r.Locale.getTranslate("admin.components.lists.resourceusage"),p=()=>{const{listProps:e,listInput:a,queryResult:{data:s}}=(0,o.useGraphQlList)({key:"ResourceUsagePage",query:c(),extractList:e=>e.viewer.client.resourceUsage}),r=s?.os?.isUnix??!1,l=(0,n.useMemo)(()=>[{key:"domainName",render:({domainName:e})=>(0,n.jsx)("span",{className:"domain-resource-usage-page-nowrap",children:e})},{key:"clientName",render:({clientName:e})=>(0,n.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,n.jsx)(t.ListActions,{children:(0,n.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,n.jsx)(d,{content:"webStatistics"})})})}].filter(Boolean).map(({key:e,width:a,title:s,render:t})=>({key:e,width:a,title:s??(0,n.jsx)(d,{content:e}),sortable:!0,render:t})),[r]),p=(0,n.jsxs)(t.Toolbar,{children:[(0,n.jsx)(t.ToolbarExpander,{}),(0,n.jsx)(t.ToolbarGroup,{title:"",children:(0,n.jsx)(t.ToolbarGroup,{groupable:!1,title:"",children:(0,n.jsx)(o.GraphQlList.SearchBar,{name:"search"})})})]});return(0,n.jsx)(o.GraphQlList,{rowKey:"id",filtered:!!a.searchFilters?.search,columns:l,toolbar:p,emptyView:(0,n.jsx)(t.ListEmptyView,{title:(0,n.jsx)(d,{content:"noResults"})}),...e})}},2973:(e,a,s)=>{s.r(a)}}]);
//# sourceMappingURL=DomainsResourceUsagePage.js.map?ded9dd028503895ade67