diff --git a/services/frontend/src/components/Modal/Network/General.tsx b/services/frontend/src/components/Modal/Network/General.tsx
new file mode 100644
index 0000000..00639c8
--- /dev/null
+++ b/services/frontend/src/components/Modal/Network/General.tsx
@@ -0,0 +1,32 @@
+const General = (props: any) => {
+ const { formik } = props;
+
+ return (
+ <>
+
+ >
+ );
+};
+export default General;
diff --git a/services/frontend/src/components/Modal/Network/IPam.tsx b/services/frontend/src/components/Modal/Network/IPam.tsx
new file mode 100644
index 0000000..05b471f
--- /dev/null
+++ b/services/frontend/src/components/Modal/Network/IPam.tsx
@@ -0,0 +1,6 @@
+const IPam = (props: any) => {
+ const { formik } = props;
+
+ return <>>;
+};
+export default IPam;
diff --git a/services/frontend/src/components/Modal/Network/Labels.tsx b/services/frontend/src/components/Modal/Network/Labels.tsx
new file mode 100644
index 0000000..9838a34
--- /dev/null
+++ b/services/frontend/src/components/Modal/Network/Labels.tsx
@@ -0,0 +1,6 @@
+const Labels = (props: any) => {
+ const { formik } = props;
+
+ return <>>;
+};
+export default Labels;
diff --git a/services/frontend/src/components/Modal/Network/index.tsx b/services/frontend/src/components/Modal/Network/index.tsx
new file mode 100644
index 0000000..c65ccf4
--- /dev/null
+++ b/services/frontend/src/components/Modal/Network/index.tsx
@@ -0,0 +1,124 @@
+import { useState } from "react";
+import { useFormik } from "formik";
+import { XIcon } from "@heroicons/react/outline";
+import General from "./General";
+import IPam from "./IPam";
+import Labels from "./Labels";
+import { topLevelNetworkConfigInitialValues } from "../../../utils";
+import { CallbackFunction } from "../../../types";
+
+interface IModalNetworkProps {
+ onHide: CallbackFunction;
+}
+
+const ModalNetwork = (props: IModalNetworkProps) => {
+ const { onHide } = props;
+ const [openTab, setOpenTab] = useState("General");
+
+ const formik = useFormik({
+ initialValues: {
+ ...topLevelNetworkConfigInitialValues()
+ },
+ onSubmit: () => undefined
+ });
+ const tabs = [
+ {
+ name: "General",
+ href: "#",
+ current: true,
+ hidden: false
+ },
+ {
+ name: "Ipam",
+ href: "#",
+ current: false,
+ hidden: false
+ },
+ {
+ name: "Labels",
+ href: "#",
+ current: false,
+ hidden: false
+ }
+ ];
+ const classNames = (...classes: string[]) => {
+ return classes.filter(Boolean).join(" ");
+ };
+
+ return (
+
+
+
+
+
+
+
Top level networks
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default ModalNetwork;
diff --git a/services/frontend/src/components/Project/index.tsx b/services/frontend/src/components/Project/index.tsx
index 095aad2..739eecd 100644
--- a/services/frontend/src/components/Project/index.tsx
+++ b/services/frontend/src/components/Project/index.tsx
@@ -33,6 +33,7 @@ import Spinner from "../global/Spinner";
import ModalConfirmDelete from "../Modal/ConfirmDelete";
import ModalServiceCreate from "../Modal/Service/Create";
import ModalServiceEdit from "../Modal/Service/Edit";
+import ModalNetwork from "../Modal/Network";
import CodeEditor from "../CodeEditor";
export default function Project() {
@@ -276,6 +277,10 @@ export default function Project() {
if (!error) {
return (
<>
+ {showNetworksModal ? (
+ setShowNetworksModal(false)} />
+ ) : null}
+
{showModalCreateService ? (
setShowModalCreateService(false)}
diff --git a/services/frontend/src/types/index.ts b/services/frontend/src/types/index.ts
index b1ed0ff..5393ba9 100644
--- a/services/frontend/src/types/index.ts
+++ b/services/frontend/src/types/index.ts
@@ -2,6 +2,8 @@ import { AnchorId } from "@jsplumb/common";
import { Dictionary } from "lodash";
import { NodeGroupType } from "./enums";
+type NetworkImapConfig = "subnet";
+
type KeyValPair = {
[x: string]: string | number;
};
@@ -95,6 +97,31 @@ export interface IVolume {
consistency: string;
}
+export interface INetworkTopLevel {
+ driver: string;
+ driver_opts: KeyValPair;
+ attachable: boolean;
+ enable_ipv6: boolean;
+ ipam: {
+ driver: string;
+ config: {
+ subnet: string;
+ ip_range: string;
+ gateway: string;
+ aux_addresses: {
+ host1: string;
+ host2: string;
+ host3: string;
+ };
+ }[];
+ options: KeyValPair;
+ };
+ internal: boolean;
+ labels: string[] | KeyValPair;
+ external: boolean;
+ name: string;
+}
+
export interface IService {
build: {
context: string;
diff --git a/services/frontend/src/utils/index.ts b/services/frontend/src/utils/index.ts
index 1d45421..40fed1b 100644
--- a/services/frontend/src/utils/index.ts
+++ b/services/frontend/src/utils/index.ts
@@ -15,7 +15,8 @@ import {
IClientNodeItem,
INodeLibraryItem,
INodeGroup,
- ICanvasConfig
+ ICanvasConfig,
+ INetworkTopLevel
} from "../types";
export function ensure(
@@ -172,6 +173,13 @@ export const getNodeKeyFromConnectionId = (uuid: string) => {
return key;
};
+export const topLevelNetworkConfigInitialValues =
+ (): Partial => {
+ return {
+ name: "unnamed"
+ };
+ };
+
export const canvasConfigInitialValues = (): ICanvasConfig => {
return {
service_name: "unnamed"