%PDF- %PDF-
Direktori : /proc/self/root/snap/lxd/29351/share/lxd-ui/assets/ |
Current File : //proc/self/root/snap/lxd/29351/share/lxd-ui/assets/StorageUsedBy-2e98cb1b.js |
import{f as i,q as x,bB as u,j as e,aE as a,aF as r,aA as $,c as d}from"./index-13b2882d.js";const m=({id:c,project:t})=>{const{data:n}=i({queryKey:[x.images,c],queryFn:()=>u(c,t)}),s=n!=null&&n.properties.description?n.properties.description:c;return e.jsx("div",{className:"u-truncate",title:s,children:s})},j="Instances",o="Profiles",l="Images",p="Snapshots",h="Custom",g=({storage:c,project:t})=>{const n={[j]:a("instances",c.used_by),[o]:a("profiles",c.used_by),[l]:a("images",c.used_by),[p]:a("snapshots",c.used_by),[h]:a("volumes",c.used_by)};return e.jsx("table",{children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsxs("th",{className:"p-muted-heading",children:["Instances (",n[j].length,")"]}),e.jsx("td",{children:e.jsx(r,{items:n[j].map(s=>e.jsxs("div",{children:[e.jsx($,{instance:s}),s.project!==t&&` (project ${s.project})`]},`${s.name}-${s.project}`))})})]}),e.jsxs("tr",{children:[e.jsxs("th",{className:"p-muted-heading",children:["Profiles (",n[o].length,")"]}),e.jsx("td",{children:e.jsx(r,{items:n[o].map(s=>e.jsxs("div",{children:[e.jsx(d,{to:`/ui/project/${s.project}/profiles/detail/${s.name}`,children:s.name}),s.project!==t&&` (project ${s.project})`]},`${s.name}-${s.project}`))})})]}),e.jsxs("tr",{children:[e.jsxs("th",{className:"p-muted-heading",children:["Images (",n[l].length,")"]}),e.jsx("td",{children:e.jsx(r,{items:n[l].map(s=>e.jsx(m,{id:s.name,project:s.project},`${s.name}-${s.project}`))})})]}),e.jsxs("tr",{children:[e.jsxs("th",{className:"p-muted-heading",children:["Snapshots (",n[p].length,")"]}),e.jsx("td",{children:e.jsx(r,{items:n[p].map(s=>e.jsxs("div",{children:[e.jsx(d,{to:`/ui/project/${s.project}/instances/detail/${s.instance}/snapshots`,children:`${s.instance} ${s.name}`}),s.project!==t&&` (project ${s.project})`]},`${s.instance}-${s.name}-${s.project}`))})})]}),e.jsxs("tr",{children:[e.jsxs("th",{className:"p-muted-heading",children:["Custom (",n[h].length,")"]}),e.jsx("td",{children:e.jsx(r,{items:n[h].map(s=>e.jsx("div",{children:e.jsxs(d,{to:`/ui/project/${s.project}/storage/detail/${c.name}/custom/${s.name}`,children:[s.name,s.project!==t&&` (project ${s.project})`]})},`${s.name}-${s.project}`))})})]})]})})};export{g as S};