import{w as S,o as A,O as m,L as n,J as t,G as a,P as q,N as i,F as f,R as C,S as x,b as E,T as F,I as o,U as w,a0 as T,K as u,V as Q,W as V,Q as c,M as p}from"./index-iCRehgtD.js";import{Q as h,a as b,b as g}from"./QList-rYekqV6v.js";import{Q as d,f as M,a as R,b as W,r as j}from"./tapeLibraries-CZZodTLz.js";import{u as z,Q as G}from"./useSetupWs-P74ozpSr.js";import{u as J}from"./setup-B2WhYkmc.js";const K={class:"row items-center no-wrap q-col-gutter-sm"},O={class:"q-ml-lg q-mt-sm"},H={key:0,class:"text-caption q-mt-sm"},X={class:"row justify-between"},se={__name:"ComponentsPage",setup(Y){const k=F(),s=J(),{send:D,messages:B}=z(),v=E(()=>s.storageTargets.disk||s.storageTargets.tape);S(()=>[s.storageTargets.disk,s.storageTargets.tape],()=>{s.resetStorageConfigured()}),S(B,r=>{const e=r[r.length-1];!e||e.type!=="storage_inventory"||(s.diskInventory=e.disks??[],s.tapeChangers=e.tape_changers??[],s.tapeDrives=e.tape_drives??[],s.tapeChangers.length>0&&!s.storageTargets.tape&&!s.tapeTargetAutoSelected&&(s.storageTargets.tape=!0,s.tapeTargetAutoSelected=!0))},{deep:!0}),A(()=>{D({action:"scan_storage"})});function I(r){return M(r)}function L(r){return R(r)}function N(r){return W(r)}function _(r){return j(r,s.tapeDrives)}function P(){s.prevStep(),k.push("/install")}function U(){s.nextStep(),k.push("/disk")}return(r,e)=>(o(),m("div",null,[e[10]||(e[10]=n("div",{class:"step-header"},"Storage Targets",-1)),e[11]||(e[11]=n("p",{class:"text-body2 q-mb-md"}," Select where Bareos should store backup data. Disk and tape can be used independently, but at least one target is required. ",-1)),t(q,{flat:"",bordered:"",class:"q-mb-lg"},{default:a(()=>[t(w,null,{default:a(()=>[t(h,null,{default:a(()=>[t(b,{tag:"label"},{default:a(()=>[t(g,{avatar:""},{default:a(()=>[t(T,{modelValue:i(s).storageTargets.disk,"onUpdate:modelValue":e[0]||(e[0]=l=>i(s).storageTargets.disk=l)},null,8,["modelValue"])]),_:1}),t(g,null,{default:a(()=>[t(d,null,{default:a(()=>[...e[2]||(e[2]=[u("Store to disk",-1)])]),_:1}),t(d,{caption:""},{default:a(()=>[...e[3]||(e[3]=[u("Configure a filesystem path for disk volumes.",-1)])]),_:1})]),_:1})]),_:1}),t(b,{tag:"label"},{default:a(()=>[t(g,{avatar:""},{default:a(()=>[t(T,{modelValue:i(s).storageTargets.tape,"onUpdate:modelValue":e[1]||(e[1]=l=>i(s).storageTargets.tape=l)},null,8,["modelValue"])]),_:1}),t(g,null,{default:a(()=>[t(d,null,{default:a(()=>[...e[4]||(e[4]=[u("Store to tape changer",-1)])]),_:1}),t(d,{caption:""},{default:a(()=>[...e[5]||(e[5]=[u("Scan attached changers and assign tape drives.",-1)])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),i(s).tapeChangers.length?(o(),f(q,{key:0,flat:"",bordered:"",class:"q-mb-lg"},{default:a(()=>[t(w,null,{default:a(()=>[e[8]||(e[8]=n("div",{class:"text-subtitle2 q-mb-sm"},"Detected tape changers",-1)),t(h,{bordered:"",separator:""},{default:a(()=>[(o(!0),m(Q,null,V(i(s).tapeChangers,l=>(o(),f(b,{key:l.path,class:"q-py-md"},{default:a(()=>[t(g,null,{default:a(()=>[t(d,{class:"text-subtitle2"},{default:a(()=>[n("div",K,[t(c,{name:"precision_manufacturing",color:"primary"}),n("span",null,p(I(l)),1)])]),_:2},1024),t(d,{caption:"",class:"q-mt-xs q-ml-lg"},{default:a(()=>[u(p(L(l)),1)]),_:2},1024),t(d,{caption:"",class:"q-mt-xs q-ml-lg"},{default:a(()=>[u(p(N(l)),1)]),_:2},1024),n("div",O,[t(d,null,{default:a(()=>[e[6]||(e[6]=n("strong",null,"Path:",-1)),u(" "+p(l.path),1)]),_:2},1024),_(l).length?(o(),m("div",H,[(o(!0),m(Q,null,V(_(l),y=>(o(),m("div",{key:y.key,class:"row items-start no-wrap q-col-gutter-sm q-mt-xs"},[t(c,{name:"dns",color:"primary",size:"18px",class:"q-mt-xs"}),n("div",null,p(y.label),1)]))),128))])):(o(),f(d,{key:1,caption:"",class:"q-mt-sm"},{default:a(()=>[...e[7]||(e[7]=[u("-",-1)])]),_:1}))])]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})):C("",!0),v.value?C("",!0):(o(),f(G,{key:1,class:"bg-warning text-white q-mb-md",rounded:""},{avatar:a(()=>[t(c,{name:"warning"})]),default:a(()=>[e[9]||(e[9]=u(" Select at least one storage target. ",-1))]),_:1})),n("div",X,[t(x,{flat:"",label:"Back",icon:"arrow_back",onClick:P}),t(x,{label:"Continue",color:"primary","icon-right":"arrow_forward",disable:!v.value,onClick:U},null,8,["disable"])])]))}};export{se as default};
