From 42c65c3efc60c278bb968ec07892d9974fe8ddcf Mon Sep 17 00:00:00 2001 From: David Edler Date: Fri, 1 Dec 2023 08:34:50 +0100 Subject: [PATCH] fix(forms) Simplify formik prop propagation Update src/pages/settings/Settings.tsx Co-authored-by: Michele Lo Russo Signed-off-by: David Edler --- src/components/forms/CloudInitForm.tsx | 6 +++--- src/components/forms/ResourceLimitsForm.tsx | 10 +++++----- src/components/forms/SecurityPoliciesForm.tsx | 18 ++++++++--------- src/components/forms/SnapshotsForm.tsx | 8 ++++---- .../networks/forms/NetworkFormBridge.tsx | 6 +++--- src/pages/networks/forms/NetworkFormDns.tsx | 6 +++--- src/pages/networks/forms/NetworkFormIpv4.tsx | 10 +++++----- src/pages/networks/forms/NetworkFormIpv6.tsx | 12 +++++------ src/pages/networks/forms/NetworkFormMain.tsx | 8 ++++---- .../projects/forms/ClusterRestrictionForm.tsx | 4 ++-- .../forms/DeviceUsageRestrictionForm.tsx | 20 +++++++++---------- .../forms/InstanceRestrictionForm.tsx | 16 +++++++-------- .../projects/forms/NetworkRestrictionForm.tsx | 8 ++++---- .../forms/ProjectResourceLimitsForm.tsx | 16 +++++++-------- src/pages/settings/Settings.tsx | 4 ++-- .../storage/forms/StorageVolumeFormBlock.tsx | 4 ++-- .../storage/forms/StorageVolumeFormMain.tsx | 4 ++-- .../forms/StorageVolumeFormSnapshots.tsx | 6 +++--- .../storage/forms/StorageVolumeFormZFS.tsx | 12 +++++------ src/util/config.tsx | 3 ++- 20 files changed, 91 insertions(+), 90 deletions(-) diff --git a/src/components/forms/CloudInitForm.tsx b/src/components/forms/CloudInitForm.tsx index 738d59eb39..c94341a1bc 100644 --- a/src/components/forms/CloudInitForm.tsx +++ b/src/components/forms/CloudInitForm.tsx @@ -46,7 +46,7 @@ const CloudInitForm: FC = ({ formik }) => { } rows={[ getInstanceConfigurationRow({ - formik: formik, + formik, label: "Network config", name: "cloud_init_network_config", defaultValue: "\n\n", @@ -62,7 +62,7 @@ const CloudInitForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "User data", name: "cloud_init_user_data", defaultValue: "\n\n", @@ -78,7 +78,7 @@ const CloudInitForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "Vendor data", name: "cloud_init_vendor_data", defaultValue: "\n\n", diff --git a/src/components/forms/ResourceLimitsForm.tsx b/src/components/forms/ResourceLimitsForm.tsx index 1c8b4ae9df..5f30116d01 100644 --- a/src/components/forms/ResourceLimitsForm.tsx +++ b/src/components/forms/ResourceLimitsForm.tsx @@ -48,7 +48,7 @@ const ResourceLimitsForm: FC = ({ formik }) => { = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "limits_memory", label: "Memory limit", defaultValue: DEFAULT_MEM_LIMIT, @@ -82,7 +82,7 @@ const ResourceLimitsForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "limits_memory_swap", label: "Memory swap (Containers only)", defaultValue: "", @@ -97,7 +97,7 @@ const ResourceLimitsForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "limits_disk_priority", label: "Disk priority", defaultValue: "", @@ -105,7 +105,7 @@ const ResourceLimitsForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "limits_processes", label: "Max number of processes (Containers only)", defaultValue: "", diff --git a/src/components/forms/SecurityPoliciesForm.tsx b/src/components/forms/SecurityPoliciesForm.tsx index 52d01922fc..5fe52ab360 100644 --- a/src/components/forms/SecurityPoliciesForm.tsx +++ b/src/components/forms/SecurityPoliciesForm.tsx @@ -60,7 +60,7 @@ const SecurityPoliciesForm: FC = ({ formik }) => { = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "Privileged (Containers only)", name: "security_privileged", defaultValue: "", @@ -84,7 +84,7 @@ const SecurityPoliciesForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "Protect UID/GID shift (Containers only)", name: "security_protection_shift", defaultValue: "", @@ -96,7 +96,7 @@ const SecurityPoliciesForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "Base host id (Containers only)", name: "security_idmap_base", defaultValue: "", @@ -114,7 +114,7 @@ const SecurityPoliciesForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "Idmap size (Containers only)", name: "security_idmap_size", defaultValue: "", @@ -133,7 +133,7 @@ const SecurityPoliciesForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "Unique idmap (Containers only)", name: "security_idmap_isolated", defaultValue: "", @@ -145,7 +145,7 @@ const SecurityPoliciesForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "Allow /dev/lxd in the instance (Containers only)", name: "security_devlxd", defaultValue: "", @@ -157,7 +157,7 @@ const SecurityPoliciesForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "Make /1.0/images API available over /dev/lxd (Containers only)", name: "security_devlxd_images", @@ -170,7 +170,7 @@ const SecurityPoliciesForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "Enable secureboot (VMs only)", name: "security_secureboot", defaultValue: "", diff --git a/src/components/forms/SnapshotsForm.tsx b/src/components/forms/SnapshotsForm.tsx index f2f9428fd4..f1982a0046 100644 --- a/src/components/forms/SnapshotsForm.tsx +++ b/src/components/forms/SnapshotsForm.tsx @@ -35,7 +35,7 @@ const SnapshotsForm: FC = ({ formik }) => { = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "Expire after", name: "snapshots_expiry", defaultValue: "", @@ -51,7 +51,7 @@ const SnapshotsForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "Snapshot stopped instances", name: "snapshots_schedule_stopped", defaultValue: "", @@ -60,7 +60,7 @@ const SnapshotsForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, label: "Schedule", name: "snapshots_schedule", defaultValue: "", diff --git a/src/pages/networks/forms/NetworkFormBridge.tsx b/src/pages/networks/forms/NetworkFormBridge.tsx index 3d37a9d5c0..7fa5e325ab 100644 --- a/src/pages/networks/forms/NetworkFormBridge.tsx +++ b/src/pages/networks/forms/NetworkFormBridge.tsx @@ -14,7 +14,7 @@ const NetworkFormBridge: FC = ({ formik }) => { = ({ formik }) => { }), getNetworkConfigurationRow({ - formik: formik, + formik, name: "bridge_hwaddr", label: "Hardware address", help: "MAC address for the bridge", @@ -34,7 +34,7 @@ const NetworkFormBridge: FC = ({ formik }) => { ...(formik.values.type === "bridge" ? [ getNetworkConfigurationRow({ - formik: formik, + formik, name: "bridge_driver", label: "Bridge driver", help: "Native or openvswitch", diff --git a/src/pages/networks/forms/NetworkFormDns.tsx b/src/pages/networks/forms/NetworkFormDns.tsx index 6e34f93095..8a23315bec 100644 --- a/src/pages/networks/forms/NetworkFormDns.tsx +++ b/src/pages/networks/forms/NetworkFormDns.tsx @@ -14,7 +14,7 @@ const NetworkFormDns: FC = ({ formik }) => { = ({ formik }) => { ...(formik.values.type === "bridge" ? [ getNetworkConfigurationRow({ - formik: formik, + formik, name: "dns_mode", label: "DNS mode", defaultValue: "", @@ -57,7 +57,7 @@ const NetworkFormDns: FC = ({ formik }) => { : []), getNetworkConfigurationRow({ - formik: formik, + formik, name: "dns_search", label: "DNS search", help: "Full comma-separated domain search list, defaulting to DNS domain value", diff --git a/src/pages/networks/forms/NetworkFormIpv4.tsx b/src/pages/networks/forms/NetworkFormIpv4.tsx index 59e1ac8a7c..c2b8771636 100644 --- a/src/pages/networks/forms/NetworkFormIpv4.tsx +++ b/src/pages/networks/forms/NetworkFormIpv4.tsx @@ -17,7 +17,7 @@ const NetworkFormIpv4: FC = ({ formik }) => { = ({ formik }) => { ...(formik.values.type !== "ovn" && hasDhcp ? [ getNetworkConfigurationRow({ - formik: formik, + formik, name: "ipv4_dhcp_expiry", label: "IPv4 DHCP expiry", help: "When to expire DHCP leases", @@ -36,7 +36,7 @@ const NetworkFormIpv4: FC = ({ formik }) => { }), getNetworkConfigurationRow({ - formik: formik, + formik, name: "ipv4_dhcp_ranges", label: "IPv4 DHCP ranges", help: "Comma-separated list of IP ranges to use for DHCP (FIRST-LAST format)", @@ -49,7 +49,7 @@ const NetworkFormIpv4: FC = ({ formik }) => { ...(formik.values.type === "ovn" ? [ getNetworkConfigurationRow({ - formik: formik, + formik, name: "ipv4_l3only", label: "IPv4 L3 only", defaultValue: "", @@ -61,7 +61,7 @@ const NetworkFormIpv4: FC = ({ formik }) => { ...(formik.values.type !== "ovn" ? [ getNetworkConfigurationRow({ - formik: formik, + formik, name: "ipv4_ovn_ranges", label: "IPv4 OVN ranges", help: "Comma-separated list of IPv4 ranges to use for child OVN network routers (FIRST-LAST format)", diff --git a/src/pages/networks/forms/NetworkFormIpv6.tsx b/src/pages/networks/forms/NetworkFormIpv6.tsx index 2e4dbce580..3707ef797e 100644 --- a/src/pages/networks/forms/NetworkFormIpv6.tsx +++ b/src/pages/networks/forms/NetworkFormIpv6.tsx @@ -17,7 +17,7 @@ const NetworkFormIpv6: FC = ({ formik }) => { = ({ formik }) => { ...(hasDhcp && formik.values.type !== "ovn" ? [ getNetworkConfigurationRow({ - formik: formik, + formik, name: "ipv6_dhcp_expiry", label: "IPv6 DHCP expiry", help: "When to expire DHCP leases", @@ -36,7 +36,7 @@ const NetworkFormIpv6: FC = ({ formik }) => { }), getNetworkConfigurationRow({ - formik: formik, + formik, name: "ipv6_dhcp_ranges", label: "IPv6 DHCP ranges", help: "Comma-separated list of IPv6 ranges to use for DHCP (FIRST-LAST format)", @@ -49,7 +49,7 @@ const NetworkFormIpv6: FC = ({ formik }) => { ...(hasDhcp ? [ getNetworkConfigurationRow({ - formik: formik, + formik, name: "ipv6_dhcp_stateful", label: "IPv6 DHCP stateful", defaultValue: "", @@ -61,7 +61,7 @@ const NetworkFormIpv6: FC = ({ formik }) => { ...(formik.values.type === "ovn" ? [ getNetworkConfigurationRow({ - formik: formik, + formik, name: "ipv6_l3only", label: "IPv6 L3 only", defaultValue: "", @@ -73,7 +73,7 @@ const NetworkFormIpv6: FC = ({ formik }) => { ...(formik.values.type !== "ovn" ? [ getNetworkConfigurationRow({ - formik: formik, + formik, name: "ipv6_ovn_ranges", label: "IPv6 OVN ranges", help: "Comma-separated list of IPv6 ranges to use for child OVN network routers (FIRST-LAST format)", diff --git a/src/pages/networks/forms/NetworkFormMain.tsx b/src/pages/networks/forms/NetworkFormMain.tsx index b7d3bf2c2f..c2cb9d63fb 100644 --- a/src/pages/networks/forms/NetworkFormMain.tsx +++ b/src/pages/networks/forms/NetworkFormMain.tsx @@ -63,7 +63,7 @@ const NetworkFormMain: FC = ({ formik, project }) => { = ({ formik, project }) => { ...(formik.values.ipv4_address !== "none" ? [ getNetworkConfigurationRow({ - formik: formik, + formik, name: "ipv4_nat", label: "IPv4 NAT", defaultValue: "", @@ -103,7 +103,7 @@ const NetworkFormMain: FC = ({ formik, project }) => { : []), getNetworkConfigurationRow({ - formik: formik, + formik, name: "ipv6_address", label: "IPv6 address", defaultValue: "auto", @@ -135,7 +135,7 @@ const NetworkFormMain: FC = ({ formik, project }) => { ...(formik.values.ipv6_address !== "none" ? [ getNetworkConfigurationRow({ - formik: formik, + formik, name: "ipv6_nat", label: "IPv6 NAT", defaultValue: "", diff --git a/src/pages/projects/forms/ClusterRestrictionForm.tsx b/src/pages/projects/forms/ClusterRestrictionForm.tsx index eb81cb3e87..a0b1282b67 100644 --- a/src/pages/projects/forms/ClusterRestrictionForm.tsx +++ b/src/pages/projects/forms/ClusterRestrictionForm.tsx @@ -31,7 +31,7 @@ const ClusterRestrictionForm: FC = ({ formik }) => { = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_cluster_target", label: "Direct cluster targeting", defaultValue: "", diff --git a/src/pages/projects/forms/DeviceUsageRestrictionForm.tsx b/src/pages/projects/forms/DeviceUsageRestrictionForm.tsx index 6ee56f947f..ad3b205070 100644 --- a/src/pages/projects/forms/DeviceUsageRestrictionForm.tsx +++ b/src/pages/projects/forms/DeviceUsageRestrictionForm.tsx @@ -52,7 +52,7 @@ const DeviceUsageRestrictionForm: FC = ({ formik }) => { @@ -68,7 +68,7 @@ const DeviceUsageRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_devices_disk_paths", label: "Disk devices path", defaultValue: "", @@ -76,7 +76,7 @@ const DeviceUsageRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_devices_gpu", label: "GPU devices", defaultValue: "", @@ -85,7 +85,7 @@ const DeviceUsageRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_devices_infiniband", label: "Infiniband devices", defaultValue: "", @@ -94,7 +94,7 @@ const DeviceUsageRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_devices_nic", label: "Network devices", defaultValue: "", @@ -104,7 +104,7 @@ const DeviceUsageRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_devices_pci", label: "PCI devices", defaultValue: "", @@ -113,7 +113,7 @@ const DeviceUsageRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_devices_unix_block", label: "Unix-block devices", defaultValue: "", @@ -122,7 +122,7 @@ const DeviceUsageRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_devices_unix_char", label: "Unix-char devices", defaultValue: "", @@ -131,7 +131,7 @@ const DeviceUsageRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_devices_unix_hotplug", label: "Unix-hotplug devices", defaultValue: "", @@ -140,7 +140,7 @@ const DeviceUsageRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_devices_usb", label: "USB devices", defaultValue: "", diff --git a/src/pages/projects/forms/InstanceRestrictionForm.tsx b/src/pages/projects/forms/InstanceRestrictionForm.tsx index c37113a913..4a0e8df1f2 100644 --- a/src/pages/projects/forms/InstanceRestrictionForm.tsx +++ b/src/pages/projects/forms/InstanceRestrictionForm.tsx @@ -49,7 +49,7 @@ const InstanceRestrictionForm: FC = ({ formik }) => { = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_containers_low_level", label: "Low level container operations", defaultValue: "", @@ -67,7 +67,7 @@ const InstanceRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_containers_nesting", label: "Container nesting", defaultValue: "", @@ -76,7 +76,7 @@ const InstanceRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_containers_privilege", label: "Container privilege", defaultValue: "", @@ -86,7 +86,7 @@ const InstanceRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_container_interception", label: "Container interception", defaultValue: "", @@ -95,7 +95,7 @@ const InstanceRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restrict_snapshots", label: "Snapshot creation", defaultValue: "", @@ -104,7 +104,7 @@ const InstanceRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_idmap_uid", label: "Idmap UID", defaultValue: "", @@ -112,7 +112,7 @@ const InstanceRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_idmap_gid", label: "Idmap GID", defaultValue: "", diff --git a/src/pages/projects/forms/NetworkRestrictionForm.tsx b/src/pages/projects/forms/NetworkRestrictionForm.tsx index e7b52cf3f2..033909d21a 100644 --- a/src/pages/projects/forms/NetworkRestrictionForm.tsx +++ b/src/pages/projects/forms/NetworkRestrictionForm.tsx @@ -37,7 +37,7 @@ const NetworkRestrictionForm: FC = ({ formik }) => { = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_network_subnets", label: "Network subnets", defaultValue: "", @@ -53,7 +53,7 @@ const NetworkRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_network_uplinks", label: "Network uplinks", defaultValue: "", @@ -61,7 +61,7 @@ const NetworkRestrictionForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "restricted_network_zones", label: "Network zones", defaultValue: "", diff --git a/src/pages/projects/forms/ProjectResourceLimitsForm.tsx b/src/pages/projects/forms/ProjectResourceLimitsForm.tsx index d82c452ff3..ea4b6edd0e 100644 --- a/src/pages/projects/forms/ProjectResourceLimitsForm.tsx +++ b/src/pages/projects/forms/ProjectResourceLimitsForm.tsx @@ -41,7 +41,7 @@ const ProjectResourceLimitsForm: FC = ({ formik }) => { = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "limits_containers", label: "Max number of containers", defaultValue: "", @@ -57,7 +57,7 @@ const ProjectResourceLimitsForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "limits_virtual_machines", label: "Max number of VMs", defaultValue: "", @@ -65,7 +65,7 @@ const ProjectResourceLimitsForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "limits_disk", label: "Max disk space (used by all instances)", defaultValue: "", @@ -79,7 +79,7 @@ const ProjectResourceLimitsForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "limits_networks", label: "Max number of networks", defaultValue: "", @@ -87,7 +87,7 @@ const ProjectResourceLimitsForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "limits_cpu", label: "Max sum of CPU", defaultValue: "", @@ -95,7 +95,7 @@ const ProjectResourceLimitsForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "limits_memory", label: "Max sum of memory limits", defaultValue: "", @@ -103,7 +103,7 @@ const ProjectResourceLimitsForm: FC = ({ formik }) => { }), getInstanceConfigurationRow({ - formik: formik, + formik, name: "limits_processes", label: "Max sum of processes", defaultValue: "-", diff --git a/src/pages/settings/Settings.tsx b/src/pages/settings/Settings.tsx index 5bd61ea032..148b29e4c8 100644 --- a/src/pages/settings/Settings.tsx +++ b/src/pages/settings/Settings.tsx @@ -68,7 +68,7 @@ const Settings: FC = () => { key: "user.ui_title", category: "user", default: "", - shortdesc: "Title for LXD-UI in the browser. Shows hostname when unset.", + shortdesc: "Title for the LXD-UI web page. Shows the hostname when unset.", type: "string", }); @@ -141,7 +141,7 @@ const Settings: FC = () => { href={`${docBaseLink}/server/`} title="Learn more about server configuration" > - Server settings + Settings } contentClassName="settings" diff --git a/src/pages/storage/forms/StorageVolumeFormBlock.tsx b/src/pages/storage/forms/StorageVolumeFormBlock.tsx index 460902674a..9c7ea091a1 100644 --- a/src/pages/storage/forms/StorageVolumeFormBlock.tsx +++ b/src/pages/storage/forms/StorageVolumeFormBlock.tsx @@ -14,7 +14,7 @@ const StorageVolumeFormBlock: FC = ({ formik }) => { = ({ formik }) => { }), getStorageConfigurationRow({ - formik: formik, + formik, label: "Block mount options", name: "block_mount_options", defaultValue: "", diff --git a/src/pages/storage/forms/StorageVolumeFormMain.tsx b/src/pages/storage/forms/StorageVolumeFormMain.tsx index 175a31fa33..762c88b147 100644 --- a/src/pages/storage/forms/StorageVolumeFormMain.tsx +++ b/src/pages/storage/forms/StorageVolumeFormMain.tsx @@ -95,7 +95,7 @@ const StorageVolumeFormMain: FC = ({ formik, project }) => { = ({ formik, project }) => { }), getStorageConfigurationRow({ - formik: formik, + formik, label: "Security unmapped", name: "security_unmapped", defaultValue: "", diff --git a/src/pages/storage/forms/StorageVolumeFormSnapshots.tsx b/src/pages/storage/forms/StorageVolumeFormSnapshots.tsx index b6a759ac2c..b5c4068f21 100644 --- a/src/pages/storage/forms/StorageVolumeFormSnapshots.tsx +++ b/src/pages/storage/forms/StorageVolumeFormSnapshots.tsx @@ -18,7 +18,7 @@ const StorageVolumeFormSnapshots: FC = ({ formik }) => { = ({ formik }) => { }), getStorageConfigurationRow({ - formik: formik, + formik, label: "Expire after", name: "snapshots_expiry", help: "Controls when snapshots are to be deleted", @@ -59,7 +59,7 @@ const StorageVolumeFormSnapshots: FC = ({ formik }) => { }), getStorageConfigurationRow({ - formik: formik, + formik, label: "Schedule", name: "snapshots_schedule", defaultValue: "", diff --git a/src/pages/storage/forms/StorageVolumeFormZFS.tsx b/src/pages/storage/forms/StorageVolumeFormZFS.tsx index 14b97c637c..03fe5fc02d 100644 --- a/src/pages/storage/forms/StorageVolumeFormZFS.tsx +++ b/src/pages/storage/forms/StorageVolumeFormZFS.tsx @@ -15,7 +15,7 @@ const StorageVolumeFormZFS: FC = ({ formik }) => { = ({ formik }) => { }), getStorageConfigurationRow({ - formik: formik, + formik, label: "ZFS block mode", name: "zfs_block_mode", defaultValue: "", @@ -66,7 +66,7 @@ const StorageVolumeFormZFS: FC = ({ formik }) => { }), getStorageConfigurationRow({ - formik: formik, + formik, label: "ZFS delegate", name: "zfs_delegate", defaultValue: "", @@ -75,7 +75,7 @@ const StorageVolumeFormZFS: FC = ({ formik }) => { }), getStorageConfigurationRow({ - formik: formik, + formik, label: "ZFS remove snapshots", name: "zfs_remove_snapshots", defaultValue: "", @@ -84,7 +84,7 @@ const StorageVolumeFormZFS: FC = ({ formik }) => { }), getStorageConfigurationRow({ - formik: formik, + formik, label: "ZFS use refquota", name: "zfs_use_refquota", defaultValue: "", @@ -93,7 +93,7 @@ const StorageVolumeFormZFS: FC = ({ formik }) => { }), getStorageConfigurationRow({ - formik: formik, + formik, label: "ZFS reserve space", name: "zfs_reserve_space", defaultValue: "", diff --git a/src/util/config.tsx b/src/util/config.tsx index d072e9373d..3921b35863 100644 --- a/src/util/config.tsx +++ b/src/util/config.tsx @@ -100,7 +100,8 @@ export const configDescriptionToHtml = (input: string, docBaseLink: string) => { // code blocks let count = 0; - while (result.includes("`") && count++ < 100) { + const maxCodeblockReplacementCount = 100; // avoid infinite loop + while (result.includes("`") && count++ < maxCodeblockReplacementCount) { result = result.replace("`", "").replace("`", ""); }