/
snap
/
lxd
/
current
/
share
/
lxd-ui
/
assets
/
File Upload :
llllll
Current File: //snap/lxd/current/share/lxd-ui/assets/StoragePools-DCiuUrin.js
import{c as x,y as b,m as N,j as e,d as t,p as S,E as y,aG as f,v as u,L as v,aJ as C,e as P}from"./index-B3cgCbnJ.js";import{D as L}from"./DeleteStoragePoolBtn-DgrSzU4b.js";import{S as I}from"./StoragePoolSize-34u3KM6q.js";import{H as w}from"./HelpLink-D9xEWgz5.js";import{P as l}from"./PageHeader-CCfZuT9z.js";import{S as B}from"./StoragePoolClusterMember-C_lGzG9t.js";import"./Meter-v0AAwaqr.js";const d=({project:i,className:a})=>{const o=x(),r=b(),{canCreateStoragePools:n}=N();return e.jsxs(t.Button,{appearance:"positive",className:a,hasIcon:!r,title:n()?"":"You do not have permission to create storage pools",onClick:async()=>o(`/ui/project/${encodeURIComponent(i)}/storage/pools/create`),disabled:!n(),children:[!r&&e.jsx(t.Icon,{name:"plus",light:!0}),e.jsx("span",{children:"Create pool"})]})},U=()=>{const i=t.useNotify(),{project:a}=S(),o=y();if(!a)return e.jsx(e.Fragment,{children:"Missing project"});const{data:r=[],error:n,isLoading:g}=f();n&&i.failure("Loading storage pools failed",n);const p=[{content:"Name",sortKey:"name"},{content:"Driver",sortKey:"driver",className:"driver"},...o?[{content:"Cluster member",className:"cluster-member"}]:[],{content:"Size",className:u("size",{clustered:o})},{content:e.jsx(e.Fragment,{children:"Used by"}),sortKey:"usedBy",className:"u-align--right volumes-total"},{content:"Status",sortKey:"status",className:"status"},{"aria-label":"Actions",className:"u-align--right actions"}],h=r.map(s=>{var c,m;return{key:s.name,columns:[{content:e.jsx(v,{to:`/ui/project/${encodeURIComponent(a)}/storage/pool/${encodeURIComponent(s.name)}`,children:s.name}),role:"rowheader","aria-label":"Name"},{content:s.driver,role:"cell","aria-label":"Driver",className:"driver"},...o?[{content:e.jsx(B,{pool:s}),role:"cell","aria-label":"Cluster member",className:"cluster-member"}]:[],{content:e.jsx(I,{pool:s,hasMeterBar:!0}),role:"cell","aria-label":"Size",className:u("size",{clustered:o})},{content:((c=s.used_by)==null?void 0:c.length)??0,role:"cell",className:"u-align--right volumes-total","aria-label":"Volumes in all projects"},{content:s.status,role:"cell","aria-label":"Status",className:"status"},{content:e.jsx(L,{pool:s,project:a},s.name),role:"cell",className:"u-align--right actions","aria-label":"Actions"}],sortData:{name:s.name.toLowerCase(),driver:s.driver,status:s.status,usedBy:((m=s.used_by)==null?void 0:m.length)??0}}});if(g)return e.jsx(t.Spinner,{className:"u-loader",text:"Loading...",isMainComponent:!0});const j=r.length>0?e.jsx(t.Row,{children:e.jsx(t.ScrollableTable,{dependencies:[r],tableId:"storage-pool-table",belowIds:["status-bar"],children:e.jsx(t.MainTable,{id:"storage-pool-table",headers:p,rows:h,sortable:!0,className:"storage-pool-table"})})}):e.jsxs(t.EmptyState,{className:"empty-state",image:e.jsx(t.Icon,{name:"switcher-dashboard",className:"empty-state-icon"}),title:"No pools found in this project",children:[e.jsx("p",{children:"Storage pools will appear here."}),e.jsx("p",{children:e.jsx(C,{docPath:"/explanation/storage/",hasExternalIcon:!0,children:"Learn more about storage pools, volumes and buckets"})}),e.jsx(d,{project:a,className:"empty-state-button"})]});return e.jsxs(t.CustomLayout,{contentClassName:"detail-page",header:e.jsxs(l,{children:[e.jsx(l.Left,{children:e.jsx(l.Title,{children:e.jsx(w,{docPath:"/explanation/storage/",title:"Learn more about storage pools, volumes and buckets",children:"Pools"})})}),e.jsx(l.BaseActions,{children:e.jsx(d,{project:a,className:"u-float-right u-no-margin--bottom"})})]}),children:[e.jsx(P,{}),e.jsx(t.Row,{children:j})]})};export{U as default};
Copyright ©2k19 -
Hexid
|
Tex7ure