3 files changed
+21
-11
No files matched your search
@@ -5,6 +5,7 @@ interface AddServerModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
name: string;
|
||||
id: string;
|
||||
onSaveServer: (name: string, isDefault: boolean) => Promise<void>;
|
||||
type: "add" | "edit";
|
||||
isDefault: boolean;
|
||||
@@ -13,6 +14,7 @@ export const AddServerModal: React.FC<AddServerModalProps> = ({
|
||||
isOpen,
|
||||
onClose,
|
||||
name,
|
||||
id,
|
||||
onSaveServer,
|
||||
type,
|
||||
isDefault,
|
||||
@@ -49,12 +51,17 @@ export const AddServerModal: React.FC<AddServerModalProps> = ({
|
||||
{type === "add" ? t("Create New Resource Group") : t("Edit Resource Group")}
|
||||
</ModalHeader>
|
||||
<ModalBody>
|
||||
<Input
|
||||
label={t("Resource Group Name")}
|
||||
value={serverName}
|
||||
placeholder={t("Edit Resource Group Name")}
|
||||
onChange={(e) => setServerName(e.target.value)}
|
||||
/>
|
||||
{
|
||||
!['allow-all', 'deny-all'].includes(id) && <>
|
||||
<Input
|
||||
label={t("Resource Group Name")}
|
||||
value={serverName}
|
||||
placeholder={t("Edit Resource Group Name")}
|
||||
onChange={(e) => setServerName(e.target.value)}
|
||||
maxLength={255}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-lg">
|
||||
<div className="flex flex-col gap-1">
|
||||
<span className="text-sm font-medium">
|
||||
@@ -73,9 +80,9 @@ export const AddServerModal: React.FC<AddServerModalProps> = ({
|
||||
</div>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button
|
||||
color="danger"
|
||||
variant="light"
|
||||
<Button
|
||||
color="danger"
|
||||
variant="light"
|
||||
onPress={onClose}
|
||||
isDisabled={isLoading}
|
||||
>
|
||||
|
||||
@@ -106,7 +106,7 @@ const GroupServiceTable: React.FC<GroupServiceTableProps> = ({
|
||||
{resourceGroupDetail?.name}
|
||||
</h2>
|
||||
<div className="flex gap-2 h-[32px]">
|
||||
{showOptions && currentGroupId && <>
|
||||
{currentGroupId && <>
|
||||
<Button
|
||||
isIconOnly
|
||||
size="sm"
|
||||
@@ -114,7 +114,9 @@ const GroupServiceTable: React.FC<GroupServiceTableProps> = ({
|
||||
onPress={() => onEditGroup(currentGroupId)}
|
||||
>
|
||||
<Edit2 size={18} />
|
||||
</Button>
|
||||
</Button></>
|
||||
}
|
||||
{showOptions && currentGroupId && <>
|
||||
<Button
|
||||
isIconOnly
|
||||
size="sm"
|
||||
|
||||
@@ -330,6 +330,7 @@ const ResourceGroupManagement: React.FC = () => {
|
||||
setEditingGroup(null);
|
||||
}}
|
||||
name={editingGroup?.name || ""}
|
||||
id={editingGroup?.id || ""}
|
||||
isDefault={editingGroup?.isDefault || false}
|
||||
onSaveServer={handleSaveGroup}
|
||||
type={editingGroup ? "edit" : "add"}
|
||||
|
||||
Reference in new issue
Block a user