diff --git a/services/frontend/src/components/Modal/network/CreateNetworkModal.tsx b/services/frontend/src/components/Modal/network/CreateNetworkModal.tsx index 586b3ca..c7aa3a6 100644 --- a/services/frontend/src/components/Modal/network/CreateNetworkModal.tsx +++ b/services/frontend/src/components/Modal/network/CreateNetworkModal.tsx @@ -72,7 +72,7 @@ const CreateNetworkModal: FunctionComponent = ( diff --git a/services/frontend/src/components/Modal/network/EditNetworkModal.tsx b/services/frontend/src/components/Modal/network/EditNetworkModal.tsx index 734dc07..ba391ec 100644 --- a/services/frontend/src/components/Modal/network/EditNetworkModal.tsx +++ b/services/frontend/src/components/Modal/network/EditNetworkModal.tsx @@ -63,7 +63,7 @@ const EditNetworkModal = (props: IEditNetworkModalProps) => { -
+
{openTab === "General" && } {openTab === "IPAM" && } {openTab === "Labels" && } diff --git a/services/frontend/src/components/Modal/network/EmptyNetworks.tsx b/services/frontend/src/components/Modal/network/EmptyNetworks.tsx index 2cfa597..62535c4 100644 --- a/services/frontend/src/components/Modal/network/EmptyNetworks.tsx +++ b/services/frontend/src/components/Modal/network/EmptyNetworks.tsx @@ -1,5 +1,6 @@ -import { Button, styled } from "@mui/joy"; import { FunctionComponent, ReactElement } from "react"; +import { Button, styled } from "@mui/joy"; +import { PlusIcon } from "@heroicons/react/outline"; const Root = styled("div")` display: flex; @@ -10,13 +11,15 @@ const Root = styled("div")` text-align: center; `; -const Image = styled("img")` - width: 300px; - height: auto; +const AddButton = styled(Button)` + margin-top: ${({ theme }) => theme.spacing(1)}; `; -const CreateNew = styled(Button)` +const Description = styled("p")` margin-top: ${({ theme }) => theme.spacing(1)}; + text-align: center; + color: #7a7a7a; + font-size: 14px; `; export interface IEmptyNetworksProps { @@ -29,13 +32,12 @@ const EmptyNetworks: FunctionComponent = ( const { onCreate } = props; return ( - -

- We tried our best, but could not find any networks. -

- - Create new network - + No top level networks. + + + + New network +
); }; diff --git a/services/frontend/src/components/Modal/network/IPam.tsx b/services/frontend/src/components/Modal/network/IPam.tsx index b28f2dc..8016137 100644 --- a/services/frontend/src/components/Modal/network/IPam.tsx +++ b/services/frontend/src/components/Modal/network/IPam.tsx @@ -24,19 +24,21 @@ const Configuration = styled("div")` display: flex; flex-direction: column; row-gap: ${({ theme }) => theme.spacing(1)}; - padding-left: ${({ theme }) => theme.spacing(4)}; + border-left: 4px solid #e0e8ff; + padding-left: 10px; `; const ConfigurationTop = styled("div")` display: flex; flex-direction: row; + @media (max-width: 640px) { + flex-direction: column; + } column-gap: ${({ theme }) => theme.spacing(1)}; `; const ConfigurationBorder = styled("div")` - border-bottom: dotted 1px black; height: 1px; - width: 40px; margin: 8px 0px 0px 0px; `; @@ -120,11 +122,7 @@ const IPam = () => { renderField={( element: ReactElement, field: IFieldType - ): ReactElement => ( - - {element} - - )} + ): ReactElement => {element}} renderRemove={(element: ReactElement): ReactElement => ( {element} )} diff --git a/services/frontend/src/components/Modal/network/Labels.tsx b/services/frontend/src/components/Modal/network/Labels.tsx index 55479ed..c0ef211 100644 --- a/services/frontend/src/components/Modal/network/Labels.tsx +++ b/services/frontend/src/components/Modal/network/Labels.tsx @@ -14,7 +14,7 @@ const Labels: FunctionComponent = (): ReactElement => { [ { diff --git a/services/frontend/src/components/Modal/network/NetworkList.tsx b/services/frontend/src/components/Modal/network/NetworkList.tsx index 7c56ff9..6000c0f 100644 --- a/services/frontend/src/components/Modal/network/NetworkList.tsx +++ b/services/frontend/src/components/Modal/network/NetworkList.tsx @@ -1,7 +1,8 @@ -import { MinusSmIcon, PlusSmIcon } from "@heroicons/react/outline"; +import { MinusSmIcon, PlusIcon } from "@heroicons/react/outline"; import { Button, styled } from "@mui/joy"; import IconButton from "@mui/joy/IconButton"; import { FunctionComponent, ReactElement } from "react"; +import { truncateStr } from "../../../utils"; export interface INetworkListProps { networks: Record; @@ -21,7 +22,6 @@ const Root = styled("div")` flex-direction: column; justify-content: space-between; border-right: solid #eaeaea 1px; - margin: ${({ theme }) => theme.spacing(1, 2, 1, 0)}; `; const Top = styled("div")` @@ -39,7 +39,7 @@ const ListItem = styled("div")` justify-content: space-between; align-items: center; column-gap: ${({ theme }) => theme.spacing(2)}; - padding: ${({ theme }) => theme.spacing(1, 2)}; + padding: ${({ theme }) => theme.spacing(1, 1, 1, 2)}; cursor: pointer; background-color: ${({ selected }) => selected && "#f5f5f5"}; @@ -77,7 +77,7 @@ const NetworkList: FunctionComponent = ( selected={networkUuid === selectedUuid} > - {networks[networkUuid].canvasConfig.node_name} + {truncateStr(networks[networkUuid].canvasConfig.node_name, 10)} = ( diff --git a/services/frontend/src/components/Modal/service/Environment.tsx b/services/frontend/src/components/Modal/service/Environment.tsx index d8714e0..3a19f2f 100644 --- a/services/frontend/src/components/Modal/service/Environment.tsx +++ b/services/frontend/src/components/Modal/service/Environment.tsx @@ -18,12 +18,11 @@ const Records = styled("div")` `; const AddButton = styled(Button)` - width: 140px; - margin-top: ${({ theme }) => theme.spacing(2)}; + margin-top: ${({ theme }) => theme.spacing(1)}; `; const Description = styled("p")` - margin-top: ${({ theme }) => theme.spacing(2)}; + margin-top: ${({ theme }) => theme.spacing(1)}; text-align: center; color: #7a7a7a; font-size: 14px; @@ -85,11 +84,7 @@ const Environment = () => { )} {emptyEnvironmentVariables && ( - - This service does not have any environment variables. -
- Click "+ New variable" to add a new environment variable. -
+ No environment variables. )} theme.spacing(2)}; + margin-top: ${({ theme }) => theme.spacing(1)}; `; const Description = styled("p")` - margin-top: ${({ theme }) => theme.spacing(2)}; + margin-top: ${({ theme }) => theme.spacing(1)}; text-align: center; color: #7a7a7a; font-size: 14px; @@ -133,13 +131,7 @@ const General = () => { ))}
)} - {emptyPorts && ( - - This service does not have any ports. -
- Click "+ New port" to add a new port. -
- )} + {emptyPorts && No service ports.} diff --git a/services/frontend/src/components/Modal/service/Labels.tsx b/services/frontend/src/components/Modal/service/Labels.tsx index c768880..afe693e 100644 --- a/services/frontend/src/components/Modal/service/Labels.tsx +++ b/services/frontend/src/components/Modal/service/Labels.tsx @@ -18,12 +18,11 @@ const Records = styled("div")` `; const AddButton = styled(Button)` - width: 140px; - margin-top: ${({ theme }) => theme.spacing(2)}; + margin-top: ${({ theme }) => theme.spacing(1)}; `; const Description = styled("p")` - margin-top: ${({ theme }) => theme.spacing(2)}; + margin-top: ${({ theme }) => theme.spacing(1)}; text-align: center; color: #7a7a7a; font-size: 14px; @@ -79,13 +78,7 @@ const Labels = () => { ))} )} - {emptyLabels && ( - - This service does not have any labels. -
- Click "+ New label" to add a new label. -
- )} + {emptyLabels && No labels.} diff --git a/services/frontend/src/components/Modal/service/Volumes.tsx b/services/frontend/src/components/Modal/service/Volumes.tsx index 16abafe..232508f 100644 --- a/services/frontend/src/components/Modal/service/Volumes.tsx +++ b/services/frontend/src/components/Modal/service/Volumes.tsx @@ -18,12 +18,11 @@ const Records = styled("div")` `; const AddButton = styled(Button)` - width: 140px; - margin-top: ${({ theme }) => theme.spacing(2)}; + margin-top: ${({ theme }) => theme.spacing(1)}; `; const Description = styled("p")` - margin-top: ${({ theme }) => theme.spacing(2)}; + margin-top: ${({ theme }) => theme.spacing(1)}; text-align: center; color: #7a7a7a; font-size: 14px; @@ -84,13 +83,7 @@ const Volumes = () => { ))} )} - {emptyVolumes && ( - - This service does not have any volumes. -
- Click "+ New volume" to add a new volume. -
- )} + {emptyVolumes && No volumes.} diff --git a/services/frontend/src/components/Modal/volume/Labels.tsx b/services/frontend/src/components/Modal/volume/Labels.tsx index a581862..afe693e 100644 --- a/services/frontend/src/components/Modal/volume/Labels.tsx +++ b/services/frontend/src/components/Modal/volume/Labels.tsx @@ -18,12 +18,11 @@ const Records = styled("div")` `; const AddButton = styled(Button)` - width: 140px; - margin-top: ${({ theme }) => theme.spacing(2)}; + margin-top: ${({ theme }) => theme.spacing(1)}; `; const Description = styled("p")` - margin-top: ${({ theme }) => theme.spacing(2)}; + margin-top: ${({ theme }) => theme.spacing(1)}; text-align: center; color: #7a7a7a; font-size: 14px; @@ -79,13 +78,7 @@ const Labels = () => { ))} )} - {emptyLabels && ( - - This volume does not have any labels. -
- Click "+ New label" to add a new label. -
- )} + {emptyLabels && No labels.} diff --git a/services/frontend/src/components/Record.tsx b/services/frontend/src/components/Record.tsx index 058ef80..bc4648e 100644 --- a/services/frontend/src/components/Record.tsx +++ b/services/frontend/src/components/Record.tsx @@ -46,6 +46,10 @@ const Root = styled("div")` @media (max-width: 768px) { column-gap: ${({ theme }) => theme.spacing(1)}; } + + @media (max-width: 640px) { + flex-direction: column; + } `; const RemoveButton = styled(IconButton)``; diff --git a/services/frontend/src/components/Records.tsx b/services/frontend/src/components/Records.tsx index 1f7b6e7..8b39568 100644 --- a/services/frontend/src/components/Records.tsx +++ b/services/frontend/src/components/Records.tsx @@ -25,9 +25,9 @@ const Group = styled("div")` `; const GroupTitle = styled("h5")` - font-size: 0.75rem; + font-size: 0.85rem; color: #374151; - font-weight: 500; + font-weight: 700; width: 100%; text-align: left; `; @@ -43,12 +43,11 @@ const RecordList = styled("div")` `; const AddButton = styled(Button)` - min-width: 140px; - margin-top: ${({ theme }) => theme.spacing(2)}; + margin-top: ${({ theme }) => theme.spacing(1)}; `; const Description = styled("p")` - margin-top: ${({ theme }) => theme.spacing(2)}; + margin-top: ${({ theme }) => theme.spacing(1)}; text-align: center; color: #7a7a7a; font-size: 14px; @@ -109,13 +108,7 @@ const Records: FunctionComponent = ( ))} )} - {empty && ( - - This {modal} does not have any {referred}. -
- Click "+ New {referred}" to add a new {referred}. -
- )} + {empty && No {referred}s.} diff --git a/services/frontend/src/index.css b/services/frontend/src/index.css index 77ce728..4e298a9 100644 --- a/services/frontend/src/index.css +++ b/services/frontend/src/index.css @@ -114,7 +114,7 @@ path, @apply inline-flex items-center px-2.5 py-1.5 border border-transparent text-xs font-medium rounded text-indigo-700 bg-indigo-100 hover:bg-indigo-200 focus:outline-none focus:ring-1 focus:ring-offset-1 focus:ring-indigo-500; } .lbl-util { - @apply block text-xs font-medium text-gray-700 mb-1 + @apply block text-xs font-bold text-gray-700 mb-1 } .btn-util-red { @apply inline-flex items-center px-2.5 py-1.5 border border-transparent text-xs font-medium rounded text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-1 focus:ring-offset-1 focus:ring-red-500;