Your IP : 216.73.216.189


Current Path : /proc/thread-self/root/snap/lxd/current/share/lxd-ui/assets/
Upload File :
Current File : //proc/thread-self/root/snap/lxd/current/share/lxd-ui/assets/ProfileDetailsForm-DfcZ9aQr.js

import{d as i,r as v,K as _,j as e,aZ as b,ba as j,bQ as E,bR as g,bS as S,a2 as I,S as C}from"./index-BFGypnt-.js";import{F as n,e as x}from"./FormMenuItem-fhYfVpHc.js";import{h as D,a as B,P as N,S as P}from"./NetworkDevicePanel-DHptDuuK.js";import{h as l}from"./FormFooterLayout-CMGxv4XX.js";import{A as O}from"./AutoExpandingTextArea-WEdimI5c.js";import{S as R}from"./ScrollableForm-D-7nf2YI.js";const M="Main configuration",T="Disk",F="Network",y="GPU",A="Proxy",G="Other",U="Resource limits",V="Security policies",L="Snapshots",f="Migration",w="Boot",Y="Cloud init",X="YAML configuration",Z=({active:s,setActive:d,isDisabled:o,formik:a})=>{const u=i.useNotify(),[r,c]=v.useState(!0),{hasMetadataConfiguration:m}=_(),p=o?"Please enter a name before adding custom configuration":void 0,t={active:s,setActive:d,disableReason:p},h=()=>{I("form-navigation","p-bottom-controls")};return v.useEffect(h,[u.notification?.message]),i.useListener(window,h,"resize",!0),e.jsx("div",{className:"p-side-navigation--accordion form-navigation",children:e.jsx("nav",{"aria-label":"Profile form navigation",children:e.jsxs("ul",{className:"p-side-navigation__list",children:[e.jsx(n,{label:M,...t,isBold:!0}),e.jsxs("li",{className:"p-side-navigation__item",children:[e.jsx(i.Button,{type:"button",className:"p-side-navigation__accordion-button","aria-expanded":r?"true":"false",onClick:()=>{o||c(!r)},disabled:o,title:p,children:a.values.devices.length>0?e.jsx("strong",{children:"Devices"}):"Devices"}),e.jsxs("ul",{className:"p-side-navigation__list","aria-expanded":r?"true":"false",children:[e.jsx(n,{label:T,hasError:D(a),...t,isBold:a.values.devices.some(b)}),e.jsx(n,{label:F,hasError:B(a),...t,isBold:a.values.devices.some(j)}),e.jsx(n,{label:y,...t,isBold:a.values.devices.some(E)}),e.jsx(n,{label:A,...t,isBold:a.values.devices.some(g)}),m&&e.jsx(n,{label:G,...t,isBold:a.values.devices.some(S)})]})]}),e.jsx(n,{label:U,...t,isBold:l(a,"limits_")}),e.jsx(n,{label:V,...t,isBold:l(a,"security_")}),e.jsx(n,{label:L,...t,isBold:l(a,"snapshots_")}),e.jsx(n,{label:f,...t,isBold:l(a,"migration_")||l(a,"cluster_")}),e.jsx(n,{label:w,...t,isBold:l(a,"boot_")}),e.jsx(n,{label:Y,...t,isBold:l(a,"cloud_init_","cloud_init_ssh_keys")})]})})})},J=({formik:s,isEdit:d,project:o})=>{const a=s.values.name==="default",u=C(),r=a?"Default profile cannot be renamed.":"Click the name in the header to rename the profile.";return e.jsx(R,{children:e.jsx(i.Row,{children:e.jsxs(i.Col,{size:12,children:[d?e.jsx(i.OutputField,{id:"name",label:"Profile name",value:s.values.name,help:r}):e.jsx(i.Input,{id:"name",name:"name",type:"text",label:"Profile name",placeholder:"Enter name",onBlur:s.handleBlur,onChange:s.handleChange,value:s.values.name,error:s.touched.name?s.errors.name:null,required:!0}),e.jsx(O,{id:"description",name:"description",label:"Description",placeholder:"Enter description",onBlur:s.handleBlur,onChange:c=>{d&&x(s),s.handleChange(c)},value:s.values.description,disabled:!!s.values.editRestriction,title:s.values.editRestriction}),u&&e.jsx(N,{value:s.values.placement_group,setValue:c=>{x(s),s.setFieldValue("placement_group",c||void 0)},project:o,hasNoneOption:!0}),e.jsx(P,{formik:s})]})})})};export{w as B,Y as C,T as D,y as G,M,F as N,G as O,Z as P,U as R,V as S,X as Y,J as a,A as b,L as c,f as d};