PageSourceSearch

https://ciptagelar.info/ui/chunk-W7AGFE7C.js

js ciptagelar.info collected 2026-10-03 18:48:05 UTC 2,473 bytes, 2 lines download raw bytes

1import{b as s,e as d,f as p}from"./chunk-56XENPRK.js";import{Ia as f,L as u,Na as y,Ri as V}from"./chunk-CPOZEFYP.js";var W=(()=>{let r=class r{constructor(e){this.api=e,this.diskResource="disk.query"}filesystemStat(e){return this.api.call("filesystem.stat",[e])}listDisks(){return this.api.call(this.diskResource,[])}getDatasetNameOptions(){return this.api.call("pool.filesystem_choices").pipe(u(e=>e.map(t=>({label:t,value:t}))))}isDatasetTopLevel(e){if(typeof e!="string")throw new Error('isDatasetTopLevel received "path" parameter that is not of type "string."');return e=e.startsWith("/")?e.substring(1):e,!e.includes("/")}getRedundancyLevel(e){switch(e.type){case s.Disk:case s.Stripe:return 0;case s.Mirror:return e.children.length-1;case s.Raidz:case s.Raidz1:return 1;case s.Raidz2:return 2;case s.Raidz3:return 3;default:return-1}}getVdevWidths(e){let t=new Set;return e==null||e.forEach(i=>{let a=0;i.type===s.Disk||i.type===s.Stripe||i.children.length===0?t.add(1):(i.children.forEach(()=>{a+=1}),t.add(a))}),t}isMixedWidth(e){return e.size>1}getVdevCapacities(e){let t=new Set;return e==null||e.forEach(i=>{t.add(i.stats.size)}),t}isMixedVdevCapacity(e){let t=Math.max(...e),i=Math.min(...e),a=t*(5/100);return i+a+1073741824*2<t}getVdevDiskCapacities(e,t){let i=[];return e==null||e.forEach(a=>{let n=new Set;a.children.length?a.children.forEach(o=>{let c=t==null?void 0:t.findIndex(l=>l.name===o.disk);c>=0&&t[c].size&&n.add(t[c].size)}):n.add(a.stats.size),i.push(n)}),i}isMixedVdevDiskCapacity(e){return e.filter(i=>i.size>1).length>0}getVdevTypes(e){let t=new Set;return e==null||e.forEach(i=>{t.add(i.type)}),t}isMixedVdevType(e){return e.size>1}validateVdevs(e,t,i){let a=[],n=!1,o=!1,c=!1,l=!1,m=this.getVdevCapacities(t);n=this.isMixedVdevCapacity(m);let x=this.getVdevDiskCapacities(t,i);o=this.isMixedVdevDiskCapacity(x);let g=this.getVdevWidths(t);c=this.isMixedWidth(g);let M=this.getVdevTypes(t);return l=this.isMixedVdevType(M),t.length&&(l&&a.push(d.MixedVdevLayout),o&&a.push(d.MixedDiskCapacity),n&&a.push(d.MixedVdevCapacity),c&&a.push(d.MixedVdevWidth),[p.Data,p.Dedup,p.Special].includes(e)&&this.hasZeroRedundancyLevelVdev(t)&&a.push(d.NoRedundancy)),a}hasZeroRedundancyLevelVdev(e){return e.filter(t=>this.getRedundancyLevel(t)===0).length>0}};r.\u0275fac=function(t){return new(t||r)(y(V))},r.\u0275prov=f({token:r,factory:r.\u0275fac,providedIn:"root"});let h=r;return h})();export{W as a};
2//# sourceMappingURL=chunk-W7AGFE7C.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.