Submit
Path:
~
/
/
snap
/
lxd
/
current
/
share
/
lxd-ui
/
assets
/
File Content:
ProjectConfiguration-e5324f11.js
import{b3 as S,al as C,d as c,i as y,r as h,e as b,bi as R,j as t,aa as L,I as D,bj as E,q as k,l as I,x as j,z as F,bk as N,H as q,u as V,A as H,bl as B,C as z,m as K,ae as T,L as O}from"./index-13b2882d.js";import{P as Q,p as $,b as A,r as M,c as U,i as J,d as W,n as G,a as X}from"./ProjectForm-55619b78.js";import{S as Y,u as Z}from"./updateMaxHeight-325b3cd4.js";import{c as x,a as P,u as w}from"./index.esm-82c30f37.js";import{e as ee,a as p}from"./formFields-fc140429.js";import{R as te}from"./RenameHeader-c74d9adb.js";import"./FormMenuItem-c8a1a121.js";import"./AutoExpandingTextArea-3a779a81.js";import"./DiskSizeSelector-dd5e138a.js";import"./instanceConfigInheritance-fbf987f8.js";import"./ConfigurationTable-1a9d4d6f.js";import"./ConfigFieldDescription-00c1a193.js";const ie=e=>({name:e.name,readOnly:!0,description:e.description,restricted:e.config.restricted==="true",features_images:e.config["features.images"]==="true",features_profiles:S(e),features_networks:e.config["features.networks"]==="true",features_networks_zones:e.config["features.networks.zones"]==="true",features_storage_buckets:e.config["features.storage.buckets"]==="true",features_storage_volumes:e.config["features.storage.volumes"]==="true",type:"project",limits_instances:e.config["limits.instances"]?parseInt(e.config["limits.instances"]):void 0,limits_containers:e.config["limits.containers"]?parseInt(e.config["limits.containers"]):void 0,limits_virtual_machines:e.config["limits.virtual-machines"]?parseInt(e.config["limits.virtual-machines"]):void 0,limits_disk:e.config["limits.disk"],limits_networks:e.config["limits.networks"]?parseInt(e.config["limits.networks"]):void 0,limits_cpu:e.config["limits.cpu"]?parseInt(e.config["limits.cpu"]):void 0,limits_memory:e.config["limits.memory"]?parseInt(e.config["limits.memory"]):void 0,limits_processes:e.config["limits.processes"]?parseInt(e.config["limits.processes"]):void 0,restricted_cluster_groups:e.config["restricted.cluster.groups"],restricted_cluster_target:e.config["restricted.cluster.target"],restricted_virtual_machines_low_level:e.config["restricted.virtual-machines.lowlevel"],restricted_containers_low_level:e.config["restricted.containers.lowlevel"],restricted_containers_nesting:e.config["restricted.containers.nesting"],restricted_containers_privilege:e.config["restricted.containers.privilege"],restricted_container_interception:e.config["restricted.containers.interception"],restrict_snapshots:e.config["restricted.snapshots"],restricted_idmap_uid:e.config["restricted.idmap.uid"],restricted_idmap_gid:e.config["restricted.idmap.gid"],restricted_devices_disk:e.config["restricted.devices.disk"],restricted_devices_disk_paths:e.config["restricted.devices.disk.paths"],restricted_devices_gpu:e.config["restricted.devices.gpu"],restricted_devices_infiniband:e.config["restricted.devices.infiniband"],restricted_devices_nic:e.config["restricted.devices.nic"],restricted_devices_pci:e.config["restricted.devices.pci"],restricted_devices_unix_block:e.config["restricted.devices.unix-block"],restricted_devices_unix_char:e.config["restricted.devices.unix-char"],restricted_devices_unix_hotplug:e.config["restricted.devices.unix-hotplug"],restricted_devices_usb:e.config["restricted.devices.usb"],restricted_network_access:e.config["restricted.networks.access"],restricted_network_subnets:e.config["restricted.networks.subnets"],restricted_network_uplinks:e.config["restricted.networks.uplinks"],restricted_network_zones:e.config["restricted.networks.zones"]}),se=({project:e})=>{const s=C(),r=c.useNotify(),m=y(),[d,l]=h.useState(!1),u=b(),a=e.name==="default",n=R(e),i=()=>a?"The default project cannot be deleted":n?"Delete project":"Non-empty projects cannot be deleted",f=()=>{l(!0),E(e).then(()=>{u("/ui/project/default/instances",r.queue(r.success(`Project ${e.name} deleted.`)))}).catch(g=>{l(!1),r.failure("Project deletion failed",g)}).finally(()=>{m.invalidateQueries({queryKey:[k.projects]})})};return t.jsxs(c.ConfirmationButton,{onHoverText:i(),appearance:s?"base":"default",className:L("u-no-margin--bottom",{"has-icon":s}),loading:d,disabled:a||!n,confirmationModalProps:{title:"Confirm delete",confirmButtonLabel:"Delete",onConfirm:f,children:t.jsxs("p",{children:["This will permanently delete project"," ",t.jsx(D,{item:e,bold:!0}),".",t.jsx("br",{}),"This action cannot be undone, and can result in data loss."]})},shiftClickEnabled:!0,showShiftClickHint:!0,children:[s&&t.jsx(c.Icon,{name:"delete"}),!s&&t.jsx("span",{children:"Delete project"})]})},ne=({project:e})=>{const s=I(),r=j(),m=b(),d=c.useNotify(),l=h.useState(null),u=x().shape({name:P().test("deduplicate","A project with this name already exists",n=>e.name===n||F(n,"",l,"projects")).required("Project name is required")}),a=w({initialValues:{name:e.name,isRenaming:!1},validationSchema:u,onSubmit:n=>{if(e.name===n.name){a.setFieldValue("isRenaming",!1),a.setSubmitting(!1);return}N(e.name,n.name).then(i=>r.set(i.metadata.id,()=>{m(`/ui/project/${n.name}/configuration`,d.queue(d.success("Project renamed."))),a.setFieldValue("isRenaming",!1)},f=>d.failure("Renaming failed",new Error(f)),()=>a.setSubmitting(!1)))}});return t.jsx(te,{name:e.name,parentItems:[t.jsx(q,{href:`${s}/reference/projects/`,title:"Learn more about project configuration",children:"Project configuration"},"project-configuration")],renameDisabledReason:e.name==="default"?"Cannot rename the default project":void 0,controls:t.jsx(se,{project:e}),isLoaded:!!e,formik:a})},re=({project:e})=>{var g;const{isRestricted:s}=V(),r=c.useNotify(),m=y(),[d,l]=h.useState(Q),u=()=>{Z("form-contents","p-bottom-controls")};h.useEffect(u,[(g=r.notification)==null?void 0:g.message,d]),H("resize",u);const a=x().shape({name:P().required()}),n=ie(e),i=w({initialValues:n,validationSchema:a,onSubmit:o=>{const _=f(o);_.etag=e.etag,B(_).then(()=>{r.success("Project updated."),i.setFieldValue("readOnly",!0)}).catch(v=>{r.failure("Project update failed",v)}).finally(()=>{i.setSubmitting(!1),m.invalidateQueries({queryKey:[k.projects]})})}}),f=o=>{const _=ee(),v=new Set(["name","description","config"]);return{...$(o),config:{...A(o),...M(o),...o.restricted?{...U(o),...J(o),...W(o),...G(o)}:{},...p(e.config,_)},...p(e,v)}};return t.jsxs(z,{header:t.jsx(ne,{project:e}),contentClassName:"edit-project",children:[t.jsx(X,{formik:i,project:e,section:d,updateSection:l,isEdit:!0}),!s&&t.jsxs("div",{className:"p-bottom-controls",id:"form-footer",children:[t.jsx("hr",{}),t.jsx(c.Row,{children:t.jsx(c.Col,{size:12,className:"u-align--right",children:i.values.readOnly?t.jsx(t.Fragment,{children:t.jsx(c.Button,{appearance:"positive",onClick:()=>void i.setFieldValue("readOnly",!1),children:"Edit configuration"})}):t.jsxs(t.Fragment,{children:[t.jsx(c.Button,{appearance:"base",onClick:()=>i.setValues(n),children:"Cancel"}),t.jsx(Y,{isSubmitting:i.isSubmitting,isDisabled:!i.isValid||!i.values.name,buttonLabel:"Save changes",onClick:()=>void i.submitForm()})]})})})]})]})},pe=()=>{const{project:e}=K();if(!e)return t.jsx(t.Fragment,{children:"Missing project"});const{project:s,isLoading:r}=T();return r?t.jsx(O,{}):s?t.jsx(re,{project:s},s.name):t.jsx(t.Fragment,{children:"Loading project failed"})};export{pe as default};
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
data
---
0755
img
---
0755
AutoExpandingTextArea-3a779a81.js
352 bytes
0644
CancelOperationBtn-5e4a9f41.js
1454 bytes
0644
CertificateAdd-5762bbdd.js
2423 bytes
0644
CertificateGenerate-67a1d99d.js
9813 bytes
0644
ClusterGroupForm-f258bb5e.js
3146 bytes
0644
ClusterList-13b65a6c.js
4834 bytes
0644
ConfigFieldDescription-00c1a193.js
3588 bytes
0644
ConfigurationTable-1a9d4d6f.js
2213 bytes
0644
CreateClusterGroup-3b03283b.js
329 bytes
0644
CreateInstance-2dc2e316.js
15924 bytes
0644
CreateNetwork-9059effd.js
2293 bytes
0644
CreateProfile-fa64def5.js
3354 bytes
0644
CreateProject-3768bb7f.js
1942 bytes
0644
CreateStoragePool-e2d089cb.js
1809 bytes
0644
DiskSizeSelector-dd5e138a.js
1843 bytes
0644
EditClusterGroup-08d77b61.js
622 bytes
0644
FormMenuItem-c8a1a121.js
504 bytes
0644
Images-40cc8e59.js
4475 bytes
0644
InstanceDetail-ee6a9c3e.js
497285 bytes
0644
InstanceFormMenu-dff7cf6c.js
1710 bytes
0644
InstanceList-23508fa8.js
15982 bytes
0644
Login-a15594e3.js
1504 bytes
0644
NetworkDetail-c85f81d1.js
10357 bytes
0644
NetworkDevicesForm-bcf4be77.js
28882 bytes
0644
NetworkForm-ffe61c80.js
11091 bytes
0644
NetworkList-45862bf6.js
2938 bytes
0644
NetworkMap-30a0e19e.js
393598 bytes
0644
OperationList-b576a26c.js
3103 bytes
0644
ProfileDetail-1a7135fe.js
9972 bytes
0644
ProfileDetailsForm-809e7c02.js
856 bytes
0644
ProfileFormMenu-3458e77a.js
1542 bytes
0644
ProfileList-3777bd96.js
3396 bytes
0644
ProfileSelector-b579b8c7.js
1770 bytes
0644
ProjectConfiguration-e5324f11.js
7224 bytes
0644
ProjectForm-55619b78.js
14396 bytes
0644
ProtectedRoute-49eddddb.js
209 bytes
0644
RenameHeader-c74d9adb.js
1641 bytes
0644
SelectableMainTable-5a3f3fef.js
1514 bytes
0644
Settings-2fc8ab81.js
6119 bytes
0644
StoragePoolDetail-5cad7e82.js
5661 bytes
0644
StorageUsedBy-2e98cb1b.js
2208 bytes
0644
StorageVolumeCreate-76138e07.js
1794 bytes
0644
StorageVolumeDetail-513f1051.js
6918 bytes
0644
StorageVolumeForm-228515f8.js
9860 bytes
0644
StorageVolumeFormMenu-e90b9f5c.js
1378 bytes
0644
WarningList-74e9b259.js
1899 bytes
0644
certificate-3aff5cf1.js
283833 bytes
0644
clusterGroups-3fc1789d.js
3402 bytes
0644
formFields-fc140429.js
4724 bytes
0644
images-2ea813f2.js
702 bytes
0644
index-13b2882d.js
600882 bytes
0644
index-205b9caf.css
493180 bytes
0644
index.esm-82c30f37.js
70743 bytes
0644
instanceConfigInheritance-fbf987f8.js
1414 bytes
0644
instanceDelete-e714bd59.js
1559 bytes
0644
instanceEdit-cf20bafe.js
5416 bytes
0644
instanceValidation-26160179.css
52045 bytes
0644
instanceValidation-45cfba9a.js
2195634 bytes
0644
networks-5caac489.js
1747 bytes
0644
operations-beb03b33.js
433 bytes
0644
settings-c23f9009.js
183 bytes
0644
updateMaxHeight-325b3cd4.js
861 bytes
0644
useClusterMembers-dbf45674.js
3396 bytes
0644
N4ST4R_ID | Naxtarrr