Merge branch 'DEVELOPMENT' of https://gitea.internship.project-moonshot.com/Laux/Frontend-Internal-Developer-Platform into DEVELOPMENT
This commit is contained in:
@@ -112,30 +112,32 @@ const AgentsPage = () => {
|
|||||||
topbarTitle="Agents"
|
topbarTitle="Agents"
|
||||||
requiredButtons={["title", "add", "search"]}
|
requiredButtons={["title", "add", "search"]}
|
||||||
/>
|
/>
|
||||||
{isMobile ? (
|
|
||||||
<div className={styles.cardContainer}>
|
<div className={styles.cardContainer}>
|
||||||
<MobileSearchBar />
|
<MobileSearchBar />
|
||||||
{sampleData.map((data, key) => {
|
{isMobile &&
|
||||||
|
sampleData.map((data, key) => {
|
||||||
return <Card data={data} key={key} />;
|
return <Card data={data} key={key} />;
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
|
||||||
<div className={styles.tableContainer}>
|
|
||||||
<table className={styles.table}>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th width="25%">Name</th>
|
|
||||||
<th>Endpoint</th>
|
|
||||||
<th>Type</th>
|
|
||||||
<th>Proxy Name</th>
|
|
||||||
<th>Date Created</th>
|
|
||||||
|
|
||||||
<th width="10%"></th>
|
<div className={styles.tableContainer}>
|
||||||
</tr>
|
<table className={styles.table}>
|
||||||
</thead>
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th width="25%">Name</th>
|
||||||
|
<th>Endpoint</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Proxy Name</th>
|
||||||
|
<th>Date Created</th>
|
||||||
|
|
||||||
<tbody>
|
<th width="10%"></th>
|
||||||
{sampleData.map((org, index) => {
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{!isMobile &&
|
||||||
|
sampleData.map((org, index) => {
|
||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
key={index}
|
key={index}
|
||||||
@@ -161,10 +163,9 @@ const AgentsPage = () => {
|
|||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -86,7 +86,15 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
overflow: auto;
|
display: none;
|
||||||
|
}
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.cardContainer {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.tableContainer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.searchBarContainer {
|
.searchBarContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -103,7 +111,6 @@
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
background-color: transparent;
|
|
||||||
color: white;
|
color: white;
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const hamburger = () => {
|
const hamburger = (props) => {
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
@@ -8,10 +8,11 @@ const hamburger = () => {
|
|||||||
height={24}
|
height={24}
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
fill="none"
|
fill="none"
|
||||||
|
{...props}
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
d="M3 4H21V6H3V4ZM3 11H15V13H3V11ZM3 18H21V20H3V18Z"
|
d="M3 4H21V6H3V4ZM3 11H15V13H3V11ZM3 18H21V20H3V18Z"
|
||||||
fill="white"
|
fill="currentColor"
|
||||||
style={{ fillOpacity: 1 }}
|
style={{ fillOpacity: 1 }}
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
@@ -1,19 +1,99 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
import styles from "./styles.module.css";
|
import styles from "./styles.module.css";
|
||||||
import NavLeft from "./navleft/Header";
|
import NavLeft from "./navleft/Header";
|
||||||
import NavRight from "./navright/Profile";
|
import NavRight from "./navright/Profile";
|
||||||
import HamburgerIcon from "../../components/icons/hamburger";
|
import HamburgerIcon from "../../components/icons/hamburger";
|
||||||
import useIsMobile from "@/app/hooks/useIsMobile";
|
import useIsMobile from "@/app/hooks/useIsMobile";
|
||||||
|
import LogoIcon from "../icons/logo";
|
||||||
|
import HomeIcon from "../icons/home";
|
||||||
|
import OrganizationIcon from "../icons/organization";
|
||||||
|
import ProjectIcon from "../icons/project";
|
||||||
|
import UserIcon from "../icons/user";
|
||||||
|
import RolesIcon from "../icons/roles";
|
||||||
|
import CredentialsIcon from "../icons/credentials";
|
||||||
|
import AgentIcon from "../icons/agent";
|
||||||
|
import DownloadIcon from "../icons/download";
|
||||||
|
import useNavigations from "@/app/hooks/useNagivation";
|
||||||
|
|
||||||
const Navbar = () => {
|
const Navbar = () => {
|
||||||
|
const [triggerDropDown, setTriggerDropDown] = useState(false);
|
||||||
|
const {
|
||||||
|
navToAgents,
|
||||||
|
navToCredentials,
|
||||||
|
navToProject,
|
||||||
|
navToRoles,
|
||||||
|
navToHome,
|
||||||
|
navToOrganization,
|
||||||
|
navToUsers,
|
||||||
|
} = useNavigations();
|
||||||
|
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
return (
|
return (
|
||||||
<div className={styles.mainContainer}>
|
<div className={styles.mainContainer}>
|
||||||
{/* Mobile Hamburger Button */}
|
{/* Mobile Hamburger Button */}
|
||||||
<div className={styles.mobileHamburger}>
|
<div className={styles.mobileHamburger}>
|
||||||
{isMobile && <HamburgerIcon />}
|
<div className={styles.hamburgerMenu}>
|
||||||
|
<HamburgerIcon
|
||||||
|
onClick={() => setTriggerDropDown(!triggerDropDown)}
|
||||||
|
className={triggerDropDown ? styles.active : ""}
|
||||||
|
/>
|
||||||
|
{triggerDropDown && (
|
||||||
|
<div className={styles.dropDownMenu}>
|
||||||
|
<div className={styles.headings}>
|
||||||
|
<div>
|
||||||
|
<div className={styles.logoContainer}>
|
||||||
|
<LogoIcon />
|
||||||
|
</div>
|
||||||
|
<div className={styles.info}>
|
||||||
|
<p>Internal Developer Platform</p>
|
||||||
|
<p>By Project Moonshot Inc.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={styles.navs}>
|
||||||
|
<div className={styles.nav} onClick={navToHome}>
|
||||||
|
<HomeIcon />
|
||||||
|
<p>Home</p>
|
||||||
|
</div>
|
||||||
|
<div className={styles.nav} onClick={navToOrganization}>
|
||||||
|
<OrganizationIcon />
|
||||||
|
<p>Organization</p>
|
||||||
|
</div>
|
||||||
|
<div className={styles.nav} onClick={navToProject}>
|
||||||
|
<ProjectIcon />
|
||||||
|
<p>Project</p>
|
||||||
|
</div>
|
||||||
|
<div className={styles.nav} onClick={navToUsers}>
|
||||||
|
<UserIcon />
|
||||||
|
<p>Users</p>
|
||||||
|
</div>
|
||||||
|
<div className={styles.nav} onClick={navToRoles}>
|
||||||
|
<RolesIcon />
|
||||||
|
<p>Roles</p>
|
||||||
|
</div>
|
||||||
|
<div className={styles.nav} onClick={navToCredentials}>
|
||||||
|
<CredentialsIcon />
|
||||||
|
<p>Credentials</p>
|
||||||
|
</div>
|
||||||
|
<div className={styles.nav} onClick={navToAgents}>
|
||||||
|
<AgentIcon />
|
||||||
|
<p>Agents</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={styles.footer}>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<p>Download ICTL v3</p>
|
||||||
|
<DownloadIcon />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
<NavLeft />
|
<NavLeft />
|
||||||
</div>
|
</div>
|
||||||
{/* Mobile Menu Button */}
|
{/* Mobile Menu Button */}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
background: #2d3143;
|
background: #2d3143;
|
||||||
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.25);
|
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.25);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 4;
|
||||||
top: 100%;
|
top: 100%;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|||||||
@@ -18,35 +18,36 @@ const Profile = () => {
|
|||||||
{/* Profile Section */}
|
{/* Profile Section */}
|
||||||
<div className={styles.profileContainer}>
|
<div className={styles.profileContainer}>
|
||||||
{/* Profile */}
|
{/* Profile */}
|
||||||
{!isMobile && (
|
|
||||||
<div className={styles.profileBadge} onClick={() => setOpen(!open)}>
|
|
||||||
{/* Username and Role*/}
|
|
||||||
{sampleData.map((data, index) => {
|
|
||||||
return (
|
|
||||||
<div className={styles.nameRole} key={index}>
|
|
||||||
<p className={styles.userName}>{data.name}</p>
|
|
||||||
<p className={styles.userRole}>{data.role}</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
|
|
||||||
{/* User profile*/}
|
<div
|
||||||
<div className={styles.userImgContainer}>
|
className={styles.profileBadgeButton}
|
||||||
<div className={styles.userPic}></div>
|
onClick={() => setOpen(!open)}
|
||||||
<EllipsisIcon />
|
>
|
||||||
</div>
|
{/* Username and Role*/}
|
||||||
|
{sampleData.map((data, index) => {
|
||||||
|
return (
|
||||||
|
<div className={styles.nameRole} key={index}>
|
||||||
|
<p className={styles.userName}>{data.name}</p>
|
||||||
|
<p className={styles.userRole}>{data.role}</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
|
||||||
|
{/* User profile*/}
|
||||||
|
<div className={styles.userImgContainer}>
|
||||||
|
<div className={styles.userPic}></div>
|
||||||
|
<EllipsisIcon />
|
||||||
</div>
|
</div>
|
||||||
)}
|
</div>
|
||||||
|
|
||||||
{/* Mobile Ellipsis */}
|
{/* Mobile Ellipsis */}
|
||||||
{isMobile && (
|
|
||||||
<div
|
<div
|
||||||
className={`${styles.mobileEllipsis} ${open ? styles.active : ""}`}
|
className={`${styles.mobileEllipsis} ${open ? styles.active : ""}`}
|
||||||
onClick={() => setOpen(!open)}
|
onClick={() => setOpen(!open)}
|
||||||
>
|
>
|
||||||
<EllipsisIcon style={isMobile ? styles.rotated : ""} />
|
<EllipsisIcon style={isMobile ? styles.rotated : ""} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Dropdown */}
|
{/* Dropdown */}
|
||||||
{open && <ProfileDropdown isMobile={isMobile} user={sampleData[0]} />}
|
{open && <ProfileDropdown isMobile={isMobile} user={sampleData[0]} />}
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.profileBadge {
|
.profileBadge,
|
||||||
|
.profileBadgeButton {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 6px 0 6px 8px;
|
padding: 6px 0 6px 8px;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
@@ -153,6 +154,9 @@
|
|||||||
.rotated {
|
.rotated {
|
||||||
transform: rotate(90deg);
|
transform: rotate(90deg);
|
||||||
}
|
}
|
||||||
|
.mobileEllipsis {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
.mobileEllipsis.active {
|
.mobileEllipsis.active {
|
||||||
color: #959aff;
|
color: #959aff;
|
||||||
}
|
}
|
||||||
@@ -183,7 +187,9 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #85869b;
|
color: #85869b;
|
||||||
}
|
}
|
||||||
|
.profileBadgeButton {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
.profileBadge {
|
.profileBadge {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 12px 16px;
|
padding: 12px 16px;
|
||||||
|
|||||||
@@ -9,14 +9,154 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Mobile */
|
/* Mobile */
|
||||||
|
|
||||||
|
.hamburgerMenu {
|
||||||
|
display: none;
|
||||||
|
height: 61px;
|
||||||
|
padding-left: 16px;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.active path {
|
||||||
|
color: #8187ff;
|
||||||
|
}
|
||||||
|
.dropDownMenu {
|
||||||
|
display: flex;
|
||||||
|
width: 100vw;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
background: linear-gradient(0deg, #2d3143 0%, #191a24 100%);
|
||||||
|
left: 0;
|
||||||
|
z-index: 2;
|
||||||
|
top: 60px;
|
||||||
|
animation-name: dropDownAnimation;
|
||||||
|
animation-duration: 200ms;
|
||||||
|
}
|
||||||
|
.headings {
|
||||||
|
display: flex;
|
||||||
|
padding: 32px 16px 16px 16px;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 24px;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
.headings > div {
|
||||||
|
display: flex;
|
||||||
|
padding-right: 6px;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
.logoContainer {
|
||||||
|
display: flex;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 9px;
|
||||||
|
aspect-ratio: 1/1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 4px;
|
||||||
|
flex: 1 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info p {
|
||||||
|
color: #85869b;
|
||||||
|
font-size: 14px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: normal;
|
||||||
|
letter-spacing: 0.07px;
|
||||||
|
}
|
||||||
|
.info > p:nth-child(1) {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 18px; /* 100% */
|
||||||
|
}
|
||||||
|
.navs {
|
||||||
|
display: flex;
|
||||||
|
padding: 16px 0;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
.nav {
|
||||||
|
display: flex;
|
||||||
|
padding: 8px 16px;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16px;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
.nav:hover {
|
||||||
|
background: rgba(149, 154, 255, 0.05);
|
||||||
|
}
|
||||||
|
.nav path {
|
||||||
|
stroke: #858699;
|
||||||
|
}
|
||||||
|
.nav:hover path {
|
||||||
|
stroke: #d2d3e0;
|
||||||
|
}
|
||||||
|
.nav p {
|
||||||
|
color: #d2d3e1;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: normal;
|
||||||
|
}
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
padding: 16px;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 10px;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
.footer > div {
|
||||||
|
display: flex;
|
||||||
|
padding: 12px 16px;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 24px;
|
||||||
|
align-self: stretch;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #1d1e2c;
|
||||||
|
}
|
||||||
|
.footer > div > div {
|
||||||
|
display: flex;
|
||||||
|
height: 24px;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes dropDownAnimation {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-5%);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.mobileHamburger {
|
.mobileHamburger {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 61px;
|
height: 61px;
|
||||||
padding-left: 16px;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mainContainer {
|
.mainContainer {
|
||||||
@@ -25,4 +165,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
.hamburgerMenu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,31 +13,19 @@ import AgentIcon from "../icons/agent";
|
|||||||
import DownloadIcon from "../icons/download";
|
import DownloadIcon from "../icons/download";
|
||||||
import LogoIcon from "../icons/logo";
|
import LogoIcon from "../icons/logo";
|
||||||
import ArrowDownIcon from "../icons/arrowDown";
|
import ArrowDownIcon from "../icons/arrowDown";
|
||||||
|
import useNavigations from "@/app/hooks/useNagivation";
|
||||||
|
|
||||||
const Sidebar = () => {
|
const Sidebar = () => {
|
||||||
const router = useRouter();
|
|
||||||
const [isCollapsed, setIsCollapsed] = useState(false);
|
const [isCollapsed, setIsCollapsed] = useState(false);
|
||||||
const navToHome = () => {
|
const {
|
||||||
router.push("/home");
|
navToAgents,
|
||||||
};
|
navToCredentials,
|
||||||
const navToOrganization = () => {
|
navToProject,
|
||||||
router.push("/organization");
|
navToRoles,
|
||||||
};
|
navToHome,
|
||||||
const navToProject = () => {
|
navToOrganization,
|
||||||
router.push("/projects");
|
navToUsers,
|
||||||
};
|
} = useNavigations();
|
||||||
const navToUsers = () => {
|
|
||||||
router.push("/users");
|
|
||||||
};
|
|
||||||
const navToRoles = () => {
|
|
||||||
router.push("/roles");
|
|
||||||
};
|
|
||||||
const navToCredentials = () => {
|
|
||||||
router.push("/credentials");
|
|
||||||
};
|
|
||||||
const navToAgents = () => {
|
|
||||||
router.push("/agents");
|
|
||||||
};
|
|
||||||
|
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ const TopHeader = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
{triggerDropDownMenu && (
|
{triggerDropDownMenu && (
|
||||||
<div className={styles.dropDown}>
|
<div className={styles.dropDown}>
|
||||||
<div>
|
<div onClick={() => props?.setTriggerLogsModal?.(true)}>
|
||||||
<div>
|
<div>
|
||||||
<ViewLogsIcon />
|
<ViewLogsIcon />
|
||||||
<p>View Logs</p>
|
<p>View Logs</p>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ html,
|
|||||||
body {
|
body {
|
||||||
max-width: 100vw;
|
max-width: 100vw;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@@ -55,7 +56,7 @@ a {
|
|||||||
}
|
}
|
||||||
@media (max-width: 900px) {
|
@media (max-width: 900px) {
|
||||||
:root {
|
:root {
|
||||||
--table-font-size: 9px;
|
--table-font-size: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media (max-width: 500px) {
|
@media (max-width: 500px) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
|
|
||||||
export default function useIsMobile(breakpoint = 768) {
|
export default function useIsMobile(breakpoint = 768) {
|
||||||
const [isMobile, setIsMobile] = useState(false);
|
const [isMobile, setIsMobile] = useState(true);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const checkScreen = () => {
|
const checkScreen = () => {
|
||||||
|
|||||||
36
frontend/src/app/hooks/useNagivation.jsx
Normal file
36
frontend/src/app/hooks/useNagivation.jsx
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
const useNavigations = () => {
|
||||||
|
const router = useRouter();
|
||||||
|
const navToHome = () => {
|
||||||
|
router.push("/home");
|
||||||
|
};
|
||||||
|
const navToOrganization = () => {
|
||||||
|
router.push("/organization");
|
||||||
|
};
|
||||||
|
const navToProject = () => {
|
||||||
|
router.push("/projects");
|
||||||
|
};
|
||||||
|
const navToUsers = () => {
|
||||||
|
router.push("/users");
|
||||||
|
};
|
||||||
|
const navToRoles = () => {
|
||||||
|
router.push("/roles");
|
||||||
|
};
|
||||||
|
const navToCredentials = () => {
|
||||||
|
router.push("/credentials");
|
||||||
|
};
|
||||||
|
const navToAgents = () => {
|
||||||
|
router.push("/agents");
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
navToHome,
|
||||||
|
navToAgents,
|
||||||
|
navToCredentials,
|
||||||
|
navToOrganization,
|
||||||
|
navToProject,
|
||||||
|
navToRoles,
|
||||||
|
navToUsers,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
export default useNavigations;
|
||||||
@@ -68,26 +68,26 @@ const OrganizationPage = () => {
|
|||||||
topbarTitle="Organization"
|
topbarTitle="Organization"
|
||||||
requiredButtons={["title", "add", "search"]}
|
requiredButtons={["title", "add", "search"]}
|
||||||
/>
|
/>
|
||||||
{isMobile ? (
|
|
||||||
<div className={styles.cardContainer}>
|
|
||||||
<MobileSearchBar />
|
|
||||||
{sampleData.map((data, key) => (
|
|
||||||
<Card data={data} key={key} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div className={styles.tableContainer}>
|
|
||||||
<table className={styles.table}>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th width="45%">Organization Name</th>
|
|
||||||
<th width="45%">Date Created</th>
|
|
||||||
<th width="10%"></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
<div className={styles.cardContainer}>
|
||||||
{sampleData.map((org, index) => {
|
<MobileSearchBar />
|
||||||
|
{isMobile &&
|
||||||
|
sampleData.map((data, key) => <Card data={data} key={key} />)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.tableContainer}>
|
||||||
|
<table className={styles.table}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th width="45%">Organization Name</th>
|
||||||
|
<th width="45%">Date Created</th>
|
||||||
|
<th width="10%"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{!isMobile &&
|
||||||
|
sampleData.map((org, index) => {
|
||||||
return (
|
return (
|
||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
<td>{org.organizationName}</td>
|
<td>{org.organizationName}</td>
|
||||||
@@ -100,10 +100,9 @@ const OrganizationPage = () => {
|
|||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -61,4 +61,13 @@
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.cardContainer {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.tableContainer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,33 +181,35 @@ const ProjectsPage = () => {
|
|||||||
topbarTitle="Project"
|
topbarTitle="Project"
|
||||||
requiredButtons={["title", "add", "search"]}
|
requiredButtons={["title", "add", "search"]}
|
||||||
/>
|
/>
|
||||||
{isMobile ? (
|
|
||||||
<div className={styles.cardContainer}>
|
<div className={styles.cardContainer}>
|
||||||
<MobileSearchBar />
|
<MobileSearchBar />
|
||||||
{sampleData.map((data, key) => (
|
{isMobile &&
|
||||||
|
sampleData.map((data, key) => (
|
||||||
<Card
|
<Card
|
||||||
data={data}
|
data={data}
|
||||||
key={key}
|
key={key}
|
||||||
onClick={() => router.push("/projects/view")}
|
onClick={() => router.push("/projects/view")}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
|
||||||
<div className={styles.tableContainer}>
|
<div className={styles.tableContainer}>
|
||||||
<table className={styles.table}>
|
<table className={styles.table}>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Version</th>
|
<th>Version</th>
|
||||||
<th>CPU Used/Limit</th>
|
<th>CPU Used/Limit</th>
|
||||||
<th>Memory Used/Limit</th>
|
<th>Memory Used/Limit</th>
|
||||||
<th>Storage Used/Limit</th>
|
<th>Storage Used/Limit</th>
|
||||||
<th>Date Created</th>
|
<th>Date Created</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{sampleData.map((project, index) => {
|
{!isMobile &&
|
||||||
|
sampleData.map((project, index) => {
|
||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
key={index}
|
key={index}
|
||||||
@@ -256,10 +258,9 @@ const ProjectsPage = () => {
|
|||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -92,4 +92,13 @@
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.cardContainer {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.tableContainer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,11 +8,13 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
padding: 5px;
|
||||||
background-color: #00000037;
|
background-color: #00000037;
|
||||||
}
|
}
|
||||||
.modal {
|
.modal {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
padding: 24px 24px 32px 24px;
|
padding: 24px 24px 32px 24px;
|
||||||
|
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 48px;
|
gap: 48px;
|
||||||
@@ -70,7 +72,7 @@
|
|||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 545px;
|
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
import CloseIcon from "@/app/components/icons/close";
|
||||||
|
import React from "react";
|
||||||
|
import styles from "./styles.module.css";
|
||||||
|
|
||||||
|
const LogsModal = (props) => {
|
||||||
|
return (
|
||||||
|
<div className={styles.modalContainer}>
|
||||||
|
<div className={styles.container}>
|
||||||
|
<div className={styles.header}>
|
||||||
|
<div className={styles.statusContainer}>
|
||||||
|
<div>
|
||||||
|
<p>Server Logs: gateway-api</p>
|
||||||
|
<div>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width={6}
|
||||||
|
height={6}
|
||||||
|
viewBox="0 0 6 6"
|
||||||
|
fill="none"
|
||||||
|
>
|
||||||
|
<circle
|
||||||
|
cx={3}
|
||||||
|
cy={3}
|
||||||
|
r={3}
|
||||||
|
fill="#98FA8D"
|
||||||
|
style={{
|
||||||
|
fill: "#98FA8D",
|
||||||
|
fillColor: "color(display-p3 0.5952 0.9819 0.5537)",
|
||||||
|
fillOpacity: 1,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<p>Connected</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<CloseIcon
|
||||||
|
className={styles.close}
|
||||||
|
onClick={() => props?.setTriggerLogsModal?.(false)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className={styles.logContentContainer}></div>
|
||||||
|
<div className={styles.footer}>
|
||||||
|
<div>
|
||||||
|
<div className={styles.autoScroll}>
|
||||||
|
<input type="checkbox" />
|
||||||
|
<p>Auto Scroll</p>
|
||||||
|
</div>
|
||||||
|
<div className={styles.linesCount}>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width={18}
|
||||||
|
height={18}
|
||||||
|
viewBox="0 0 18 18"
|
||||||
|
fill="none"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M5.25 6L2.25 9L5.25 12M12.75 6L15.75 9L12.75 12M10.5 3L7.5 15"
|
||||||
|
stroke="white"
|
||||||
|
style={{ stroke: "white", strokeOpacity: 1 }}
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<p>124 Lines</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LogsModal;
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
.modalContainer {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 50;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: #0000004d;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 1200px;
|
||||||
|
border-radius: 6px;
|
||||||
|
background: #21232f;
|
||||||
|
height: 100%;
|
||||||
|
animation-name: dropDownAnimation;
|
||||||
|
animation-duration: 200ms;
|
||||||
|
}
|
||||||
|
@keyframes dropDownAnimation {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-5%);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
padding: 12px 12px 12px 16px;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
.close {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.statusContainer {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 8px;
|
||||||
|
flex: 1 0 0;
|
||||||
|
}
|
||||||
|
.statusContainer > div {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
.statusContainer > div > p {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
color: #d2d3e1;
|
||||||
|
font-size: 16px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.statusContainer > div > div {
|
||||||
|
display: flex;
|
||||||
|
padding: 1px 6px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
border-radius: 100px;
|
||||||
|
background: rgba(66, 180, 78, 0.1);
|
||||||
|
}
|
||||||
|
.statusContainer > div > div > p {
|
||||||
|
color: #72fd7f;
|
||||||
|
text-align: center;
|
||||||
|
font-feature-settings:
|
||||||
|
"liga" off,
|
||||||
|
"clig" off;
|
||||||
|
font-family: Inter;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 22px; /* 183.333% */
|
||||||
|
}
|
||||||
|
.logContentContainer {
|
||||||
|
width: 100%;
|
||||||
|
background-color: rebeccapurple;
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
padding: 12px 16px;
|
||||||
|
align-items: center;
|
||||||
|
gap: 48px;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
.footer > div {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 24px;
|
||||||
|
flex: 1 0 0;
|
||||||
|
}
|
||||||
|
.autoScroll {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
.autoScroll input[type="checkbox"] {
|
||||||
|
accent-color: #5980f1;
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.autoScroll p {
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
/* Base/Medium */
|
||||||
|
font-family: Inter;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 24px; /* 150% */
|
||||||
|
letter-spacing: 0.08px;
|
||||||
|
}
|
||||||
|
.linesCount {
|
||||||
|
display: flex;
|
||||||
|
padding: 4px 8px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
border-radius: 6px;
|
||||||
|
background: rgba(0, 101, 244, 0.1);
|
||||||
|
}
|
||||||
|
.linesCount p {
|
||||||
|
color: #fff;
|
||||||
|
font-family: Inter;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 24px;
|
||||||
|
letter-spacing: 0.07px;
|
||||||
|
}
|
||||||
@@ -12,11 +12,13 @@ import CustomCheckbox from "@/app/components/checkbox/CheckBox";
|
|||||||
import DeleteIcon from "@/app/components/icons/delete";
|
import DeleteIcon from "@/app/components/icons/delete";
|
||||||
import SelectField from "@/app/components/select/SelectField";
|
import SelectField from "@/app/components/select/SelectField";
|
||||||
import ActionButton from "@/app/components/actionButton/ActionButton";
|
import ActionButton from "@/app/components/actionButton/ActionButton";
|
||||||
|
import LogsModal from "./LogsModal/logsModas";
|
||||||
const AddServices = () => {
|
const AddServices = () => {
|
||||||
const [triggerVariableDropDown, setTriggerVariableDropDown] = useState(false);
|
const [triggerVariableDropDown, setTriggerVariableDropDown] = useState(false);
|
||||||
const [triggerAddVariable, setTriggerAddVariable] = useState(false);
|
const [triggerAddVariable, setTriggerAddVariable] = useState(false);
|
||||||
const [triggerAddVolume, setTriggerAddVolume] = useState(false);
|
const [triggerAddVolume, setTriggerAddVolume] = useState(false);
|
||||||
const [triggeAddConfigMap, setTriggerAddConfigMap] = useState(false);
|
const [triggeAddConfigMap, setTriggerAddConfigMap] = useState(false);
|
||||||
|
const [triggerLogsModal, setTriggerLogsModal] = useState(false);
|
||||||
const sampleData = [
|
const sampleData = [
|
||||||
{ id: 1, key: "REQUEST_SERVICE_GRPC", value: "request-service:50053" },
|
{ id: 1, key: "REQUEST_SERVICE_GRPC", value: "request-service:50053" },
|
||||||
{ id: 1, key: "REQUEST_SERVICE_GRPC", value: "request-service:50053" },
|
{ id: 1, key: "REQUEST_SERVICE_GRPC", value: "request-service:50053" },
|
||||||
@@ -27,6 +29,9 @@ const AddServices = () => {
|
|||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<div className={globalStyle.section}>
|
<div className={globalStyle.section}>
|
||||||
|
{triggerLogsModal && (
|
||||||
|
<LogsModal setTriggerLogsModal={setTriggerLogsModal} />
|
||||||
|
)}
|
||||||
{triggerAddVariable && (
|
{triggerAddVariable && (
|
||||||
<AddVariableModal setTriggerAddVariable={setTriggerAddVariable} />
|
<AddVariableModal setTriggerAddVariable={setTriggerAddVariable} />
|
||||||
)}
|
)}
|
||||||
@@ -44,6 +49,7 @@ const AddServices = () => {
|
|||||||
state="view"
|
state="view"
|
||||||
topbarTitle="View Services"
|
topbarTitle="View Services"
|
||||||
requiredButtons={["back", "title", "edit", "download"]}
|
requiredButtons={["back", "title", "edit", "download"]}
|
||||||
|
setTriggerLogsModal={setTriggerLogsModal}
|
||||||
/>
|
/>
|
||||||
<div className={styles.contentContainer}>
|
<div className={styles.contentContainer}>
|
||||||
<div className={styles.fieldsContainerCreateNew}>
|
<div className={styles.fieldsContainerCreateNew}>
|
||||||
|
|||||||
@@ -3,18 +3,14 @@ import React, { useState } from "react";
|
|||||||
import globalStyle from "@/app/globalStyle.module.css";
|
import globalStyle from "@/app/globalStyle.module.css";
|
||||||
import TopHeader from "@/app/components/topHeader/TopHeader";
|
import TopHeader from "@/app/components/topHeader/TopHeader";
|
||||||
import styles from "./styles.module.css";
|
import styles from "./styles.module.css";
|
||||||
import variableStyles from "./variableStyles.module.css";
|
|
||||||
import TextField from "@/app/components/fields/textfield";
|
|
||||||
import AddVariableModal from "../variableModals/AddVariableModal/AddVariableModal";
|
import AddVariableModal from "../variableModals/AddVariableModal/AddVariableModal";
|
||||||
import AddVolumeModal from "../variableModals/AddVolumes/AddVolumeModal";
|
import AddVolumeModal from "../variableModals/AddVolumes/AddVolumeModal";
|
||||||
import AddConfigMapModal from "../variableModals/AddConfigMap/AddConfigMapModal";
|
import AddConfigMapModal from "../variableModals/AddConfigMap/AddConfigMapModal";
|
||||||
import DeleteIcon from "@/app/components/icons/delete";
|
|
||||||
import CustomCheckbox from "@/app/components/checkbox/CheckBox";
|
|
||||||
import SelectField from "@/app/components/select/SelectField";
|
|
||||||
import useServicesForm from "@/app/hooks/useServicesForm";
|
import useServicesForm from "@/app/hooks/useServicesForm";
|
||||||
import Alert from "@/app/components/alerts/Alert";
|
import Alert from "@/app/components/alerts/Alert";
|
||||||
|
import ProjectDetails from "./projectDetails";
|
||||||
|
import Settings from "./settings";
|
||||||
const AddServices = () => {
|
const AddServices = () => {
|
||||||
const [triggerVariableDropDown, setTriggerVariableDropDown] = useState(false);
|
|
||||||
const [triggerAddVariable, setTriggerAddVariable] = useState(false);
|
const [triggerAddVariable, setTriggerAddVariable] = useState(false);
|
||||||
const [triggerAddVolume, setTriggerAddVolume] = useState(false);
|
const [triggerAddVolume, setTriggerAddVolume] = useState(false);
|
||||||
const [triggerAddConfigMap, setTriggerAddConfigMap] = useState(false);
|
const [triggerAddConfigMap, setTriggerAddConfigMap] = useState(false);
|
||||||
@@ -67,456 +63,40 @@ const AddServices = () => {
|
|||||||
topbarTitle="Create New Services"
|
topbarTitle="Create New Services"
|
||||||
requiredButtons={["title", "save"]}
|
requiredButtons={["title", "save"]}
|
||||||
/>
|
/>
|
||||||
<div className={styles.contentContainer}>
|
<div className={styles.content}>
|
||||||
<form
|
<div className={styles.heading}>
|
||||||
className={styles.fieldsContainerCreateNew}
|
<div>
|
||||||
id="form"
|
<p>Project Details</p>
|
||||||
onSubmit={handleSubmit(onSubmit)}
|
<p>Settings</p>
|
||||||
>
|
|
||||||
<div className={styles.projectDetails}>
|
|
||||||
<div className={styles.projectDetailsHeader}>
|
|
||||||
<p>Project Details</p>
|
|
||||||
</div>
|
|
||||||
<div className={styles.fieldsCreateNew}>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<p>
|
|
||||||
Repository <span>(Optional)</span>
|
|
||||||
</p>
|
|
||||||
<label className={styles.repositoryForm} htmlFor="#repo">
|
|
||||||
+ Link Repository
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<p>Name</p>
|
|
||||||
<TextField
|
|
||||||
placeHolder="Enter service name"
|
|
||||||
{...register("serviceName", { required: true })}
|
|
||||||
hasError={!!errors.serviceName}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>Version</p>
|
|
||||||
<TextField
|
|
||||||
placeHolder="Service version"
|
|
||||||
{...register("serviceVersion", { required: true })}
|
|
||||||
hasError={!!errors.serviceVersion}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<p>
|
|
||||||
Image <span>(Optional)</span>
|
|
||||||
</p>
|
|
||||||
<TextField
|
|
||||||
placeHolder="Enter image name"
|
|
||||||
{...register("imageName", { required: false })}
|
|
||||||
hasError={!!errors.imageName}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<p>Port</p>
|
|
||||||
<TextField
|
|
||||||
placeHolder="Enter port"
|
|
||||||
{...register("port", { required: true })}
|
|
||||||
hasError={!!errors.port}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<p>Ingress</p>
|
|
||||||
<SelectField
|
|
||||||
label="Select"
|
|
||||||
options={[
|
|
||||||
{ label: "Option", value: "option" },
|
|
||||||
{ label: "Option 1", value: "option 1" },
|
|
||||||
{ label: "Option 2", value: "option 2" },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>Ingress</p>
|
|
||||||
<SelectField
|
|
||||||
label="Select"
|
|
||||||
options={[
|
|
||||||
{ label: "Option", value: "option" },
|
|
||||||
{ label: "Option 1", value: "option 1" },
|
|
||||||
{ label: "Option 2", value: "option 2" },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={styles.resource}>
|
|
||||||
<div className={styles.projectDetailsHeader}>
|
|
||||||
<p>Resource</p>
|
|
||||||
</div>
|
|
||||||
<div className={styles.resourceFields}>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<p>CPU Request (MB)</p>
|
|
||||||
<TextField
|
|
||||||
placeHolder="250"
|
|
||||||
{...register("cpuRequest", { required: true })}
|
|
||||||
hasError={!!errors.cpuRequest}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>CPU Limit (MB)</p>
|
|
||||||
<TextField
|
|
||||||
placeHolder="250"
|
|
||||||
{...register("cpuLimit", { required: true })}
|
|
||||||
hasError={!!errors.cpuLimit}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<p>Memory Request (MB)</p>
|
|
||||||
<TextField
|
|
||||||
placeHolder="250"
|
|
||||||
{...register("memoryRequest", { required: true })}
|
|
||||||
hasError={!!errors.memoryRequest}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>Memory Limit (MB)</p>
|
|
||||||
<TextField
|
|
||||||
placeHolder="500"
|
|
||||||
{...register("memoryLimit", { required: true })}
|
|
||||||
hasError={!!errors.memoryLimit}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={styles.additionalDetails}>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<div className={styles.additionalDetailsHeader}>
|
|
||||||
<div>
|
|
||||||
<p>Auto Scaling</p>
|
|
||||||
<CustomCheckbox
|
|
||||||
id="scalingCheckBox"
|
|
||||||
setChecked={() => setDisableScaling(!disableScaling)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={styles.additionalDetailsFields}>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<p>Minimum pods</p>
|
|
||||||
|
|
||||||
<TextField
|
|
||||||
placeHolder="1"
|
|
||||||
disabled={disableScaling}
|
|
||||||
{...register("minPods", {
|
|
||||||
required:
|
|
||||||
maxPods.trim() !== "" && !disableScaling,
|
|
||||||
})}
|
|
||||||
hasError={!!errors.minPods}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>Maximum pods</p>
|
|
||||||
<TextField
|
|
||||||
placeHolder="1"
|
|
||||||
disabled={disableScaling}
|
|
||||||
{...register("maxPods", {
|
|
||||||
required:
|
|
||||||
minPods.trim() !== "" && !disableScaling,
|
|
||||||
})}
|
|
||||||
hasError={!!errors.maxPods}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<div className={styles.additionalDetailsHeader}>
|
|
||||||
<div>
|
|
||||||
<p>Readiness</p>
|
|
||||||
<CustomCheckbox
|
|
||||||
id="readiNessCheckBox"
|
|
||||||
setChecked={() =>
|
|
||||||
setDisableReadiness(!disableReadiness)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={styles.additionalDetailsFields}>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<p>Readiness Path</p>
|
|
||||||
|
|
||||||
<TextField
|
|
||||||
placeHolder="Enter Readiness path"
|
|
||||||
disabled={disableReadiness}
|
|
||||||
{...register("readinessPath", {
|
|
||||||
required:
|
|
||||||
readinessPort.trim() !== "" &&
|
|
||||||
!disableReadiness,
|
|
||||||
})}
|
|
||||||
hasError={!!errors.readinessPath}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>Readiness Port</p>
|
|
||||||
<TextField
|
|
||||||
placeHolder="Enter Readiness port"
|
|
||||||
disabled={disableReadiness}
|
|
||||||
{...register("readinessPort", {
|
|
||||||
required:
|
|
||||||
readinessPath.trim() !== "" &&
|
|
||||||
!disableReadiness,
|
|
||||||
})}
|
|
||||||
hasError={!!errors.readinessPort}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<div className={styles.additionalDetailsHeader}>
|
|
||||||
<div>
|
|
||||||
<p>Liveness</p>
|
|
||||||
<CustomCheckbox
|
|
||||||
id="liveNessCheckBox"
|
|
||||||
setChecked={() =>
|
|
||||||
setDisableLiveness(!disableLiveness)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={styles.additionalDetailsFields}>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<p>Liveness Path</p>
|
|
||||||
<TextField
|
|
||||||
placeHolder="Enter liveness path"
|
|
||||||
disabled={disableLiveness}
|
|
||||||
{...register("livenessPath", {
|
|
||||||
required:
|
|
||||||
livenessPort.trim() !== "" &&
|
|
||||||
!disableLiveness,
|
|
||||||
})}
|
|
||||||
hasError={!!errors.livenessPath}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>Liveness Port</p>
|
|
||||||
<TextField
|
|
||||||
placeHolder="Enter liveness port"
|
|
||||||
disabled={disableLiveness}
|
|
||||||
{...register("livenessPort", {
|
|
||||||
required:
|
|
||||||
livenessPath.trim() !== "" &&
|
|
||||||
!disableLiveness,
|
|
||||||
})}
|
|
||||||
hasError={!!errors.livenessPort}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<div className={variableStyles.variables}>
|
|
||||||
<div className={variableStyles.variablesHeader}>
|
|
||||||
<div>
|
|
||||||
<div className={variableStyles.searchContainer}>
|
|
||||||
<div className={variableStyles.searchInputGroup}>
|
|
||||||
<svg
|
|
||||||
width="20"
|
|
||||||
height="20"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
fill="none"
|
|
||||||
>
|
|
||||||
<g clipPath="url(#clip0)">
|
|
||||||
<path
|
|
||||||
d="M8.66099 16.0271C12.7292 16.0271 16.0271 12.7292 16.0271 8.66099C16.0271 4.59282 12.7292 1.29492 8.66099 1.29492C4.59282 1.29492 1.29492 4.59282 1.29492 8.66099C1.29492 12.7292 4.59282 16.0271 8.66099 16.0271Z"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="2"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M18.7051 18.7061L14.0176 14.0186"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="2"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
<input type="text" placeholder="Search" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={variableStyles.variablesHeaderDropDown}>
|
|
||||||
<div
|
|
||||||
className={variableStyles.variableHeaderDropdownButton}
|
|
||||||
onClick={() =>
|
|
||||||
setTriggerVariableDropDown(!triggerVariableDropDown)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="24"
|
|
||||||
height="24"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M12 5.29199V18.7087"
|
|
||||||
stroke="white"
|
|
||||||
strokeWidth="2"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M5.29102 12H18.7077"
|
|
||||||
stroke="white"
|
|
||||||
strokeWidth="2"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
{triggerVariableDropDown && (
|
|
||||||
<div className={variableStyles.dropDownContainer}>
|
|
||||||
<div
|
|
||||||
onClick={() => {
|
|
||||||
setTriggerAddVariable(true);
|
|
||||||
setTriggerVariableDropDown(
|
|
||||||
!triggerVariableDropDown,
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<p>Environment Variables</p>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
onClick={() => {
|
|
||||||
setTriggerAddVolume(true);
|
|
||||||
setTriggerVariableDropDown(
|
|
||||||
!triggerVariableDropDown,
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<p>Volumes</p>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
onClick={() => {
|
|
||||||
setTriggerAddConfigMap(true);
|
|
||||||
setTriggerVariableDropDown(
|
|
||||||
!triggerVariableDropDown,
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<p>Config Maps</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={variableStyles.variablesContentContainer}>
|
|
||||||
<div>
|
|
||||||
<div className={variableStyles.variablesContent}>
|
|
||||||
<div
|
|
||||||
className={variableStyles.environmentVariablesContainer}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className={variableStyles.environmentVariablesHeader}
|
|
||||||
>
|
|
||||||
<p>Environment Variables</p>
|
|
||||||
</div>
|
|
||||||
<div className={variableStyles.envVariablesHeader}>
|
|
||||||
<div>
|
|
||||||
<p>Key</p>
|
|
||||||
<p>Value</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={variableStyles.variableList}>
|
|
||||||
<div className={variableStyles.emptyVariableList}>
|
|
||||||
<div>
|
|
||||||
<p>No Environment Variables added</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/* <div className={variableStyles.variable}>
|
|
||||||
<p>REQUEST_SERVICE_GRPC</p>
|
|
||||||
<p>request-service:50053</p>
|
|
||||||
<DeleteIcon />
|
|
||||||
</div> */}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={variableStyles.variablesContent}>
|
|
||||||
<div
|
|
||||||
className={variableStyles.environmentVariablesContainer}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className={variableStyles.environmentVariablesHeader}
|
|
||||||
>
|
|
||||||
<p>Volumes</p>
|
|
||||||
</div>
|
|
||||||
<div className={variableStyles.envVariablesHeader}>
|
|
||||||
<div>
|
|
||||||
<p>Name</p>
|
|
||||||
<p>Path</p>
|
|
||||||
<p>Size/Type</p>
|
|
||||||
<p>Access Mode</p>
|
|
||||||
<p>Storage Class</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={variableStyles.variableList}>
|
|
||||||
<div className={variableStyles.emptyVariableList}>
|
|
||||||
<div>
|
|
||||||
<p>No volume added</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={variableStyles.variablesContent}>
|
|
||||||
<div
|
|
||||||
className={variableStyles.environmentVariablesContainer}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className={variableStyles.environmentVariablesHeader}
|
|
||||||
>
|
|
||||||
<p>Config maps</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={variableStyles.variableList}>
|
|
||||||
<div className={variableStyles.emptyVariableList}>
|
|
||||||
<div>
|
|
||||||
<p>No config map added</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className={styles.contentContainer}>
|
||||||
|
<ProjectDetails
|
||||||
|
register={register}
|
||||||
|
handleSubmit={handleSubmit}
|
||||||
|
errors={errors}
|
||||||
|
onSubmit={onSubmit}
|
||||||
|
triggerAlert={triggerAlert}
|
||||||
|
disableScaling={disableScaling}
|
||||||
|
disableReadiness={disableReadiness}
|
||||||
|
disableLiveness={disableLiveness}
|
||||||
|
setDisableScaling={setDisableScaling}
|
||||||
|
setDisableReadiness={setDisableReadiness}
|
||||||
|
setDisableLiveness={setDisableLiveness}
|
||||||
|
setTriggerAlert={setTriggerAlert}
|
||||||
|
minPods={minPods}
|
||||||
|
maxPods={maxPods}
|
||||||
|
readinessPath={readinessPath}
|
||||||
|
readinessPort={readinessPort}
|
||||||
|
livenessPort={livenessPort}
|
||||||
|
livenessPath={livenessPath}
|
||||||
|
/>
|
||||||
|
<Settings
|
||||||
|
setTriggerAddConfigMap={setTriggerAddConfigMap}
|
||||||
|
setTriggerAddVariable={setTriggerAddVariable}
|
||||||
|
setTriggerAddVolume={setTriggerAddVolume}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,295 @@
|
|||||||
|
"use client";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import styles from "./styles.module.css";
|
||||||
|
import TextField from "@/app/components/fields/textfield";
|
||||||
|
import CustomCheckbox from "@/app/components/checkbox/CheckBox";
|
||||||
|
import SelectField from "@/app/components/select/SelectField";
|
||||||
|
|
||||||
|
const ProjectDetails = ({
|
||||||
|
register,
|
||||||
|
handleSubmit,
|
||||||
|
errors,
|
||||||
|
onSubmit,
|
||||||
|
triggerAlert,
|
||||||
|
disableScaling,
|
||||||
|
disableReadiness,
|
||||||
|
disableLiveness,
|
||||||
|
setDisableScaling,
|
||||||
|
setDisableReadiness,
|
||||||
|
setDisableLiveness,
|
||||||
|
setTriggerAlert,
|
||||||
|
minPods,
|
||||||
|
maxPods,
|
||||||
|
readinessPath,
|
||||||
|
readinessPort,
|
||||||
|
livenessPort,
|
||||||
|
livenessPath,
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<form
|
||||||
|
className={styles.fieldsContainerCreateNew}
|
||||||
|
id="form"
|
||||||
|
onSubmit={handleSubmit(onSubmit)}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<div className={styles.projectDetails}>
|
||||||
|
<div className={styles.projectDetailsHeader}>
|
||||||
|
<p>Project Details</p>
|
||||||
|
</div>
|
||||||
|
<div className={styles.fieldsCreateNew}>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
Repository <span>(Optional)</span>
|
||||||
|
</p>
|
||||||
|
<label className={styles.repositoryForm} htmlFor="#repo">
|
||||||
|
+ Link Repository
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<p>Name</p>
|
||||||
|
<TextField
|
||||||
|
placeHolder="Enter service name"
|
||||||
|
{...register("serviceName", { required: true })}
|
||||||
|
hasError={!!errors.serviceName}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>Version</p>
|
||||||
|
<TextField
|
||||||
|
placeHolder="Service version"
|
||||||
|
{...register("serviceVersion", { required: true })}
|
||||||
|
hasError={!!errors.serviceVersion}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
Image <span>(Optional)</span>
|
||||||
|
</p>
|
||||||
|
<TextField
|
||||||
|
placeHolder="Enter image name"
|
||||||
|
{...register("imageName", { required: false })}
|
||||||
|
hasError={!!errors.imageName}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<p>Port</p>
|
||||||
|
<TextField
|
||||||
|
placeHolder="Enter port"
|
||||||
|
{...register("port", { required: true })}
|
||||||
|
hasError={!!errors.port}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<p>Ingress</p>
|
||||||
|
<SelectField
|
||||||
|
label="Select"
|
||||||
|
options={[
|
||||||
|
{ label: "Option", value: "option" },
|
||||||
|
{ label: "Option 1", value: "option 1" },
|
||||||
|
{ label: "Option 2", value: "option 2" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>Ingress</p>
|
||||||
|
<SelectField
|
||||||
|
label="Select"
|
||||||
|
options={[
|
||||||
|
{ label: "Option", value: "option" },
|
||||||
|
{ label: "Option 1", value: "option 1" },
|
||||||
|
{ label: "Option 2", value: "option 2" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={styles.resource}>
|
||||||
|
<div className={styles.projectDetailsHeader}>
|
||||||
|
<p>Resource</p>
|
||||||
|
</div>
|
||||||
|
<div className={styles.resourceFields}>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<p>CPU Request (MB)</p>
|
||||||
|
<TextField
|
||||||
|
placeHolder="250"
|
||||||
|
{...register("cpuRequest", { required: true })}
|
||||||
|
hasError={!!errors.cpuRequest}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>CPU Limit (MB)</p>
|
||||||
|
<TextField
|
||||||
|
placeHolder="250"
|
||||||
|
{...register("cpuLimit", { required: true })}
|
||||||
|
hasError={!!errors.cpuLimit}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<p>Memory Request (MB)</p>
|
||||||
|
<TextField
|
||||||
|
placeHolder="250"
|
||||||
|
{...register("memoryRequest", { required: true })}
|
||||||
|
hasError={!!errors.memoryRequest}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>Memory Limit (MB)</p>
|
||||||
|
<TextField
|
||||||
|
placeHolder="500"
|
||||||
|
{...register("memoryLimit", { required: true })}
|
||||||
|
hasError={!!errors.memoryLimit}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={styles.additionalDetails}>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<div className={styles.additionalDetailsHeader}>
|
||||||
|
<div>
|
||||||
|
<p>Auto Scaling</p>
|
||||||
|
<CustomCheckbox
|
||||||
|
id="scalingCheckBox"
|
||||||
|
setChecked={() => setDisableScaling(!disableScaling)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={styles.additionalDetailsFields}>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<p>Minimum pods</p>
|
||||||
|
|
||||||
|
<TextField
|
||||||
|
placeHolder="1"
|
||||||
|
disabled={disableScaling}
|
||||||
|
{...register("minPods", {
|
||||||
|
required: maxPods.trim() !== "" && !disableScaling,
|
||||||
|
})}
|
||||||
|
hasError={!!errors.minPods}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>Maximum pods</p>
|
||||||
|
<TextField
|
||||||
|
placeHolder="1"
|
||||||
|
disabled={disableScaling}
|
||||||
|
{...register("maxPods", {
|
||||||
|
required: minPods.trim() !== "" && !disableScaling,
|
||||||
|
})}
|
||||||
|
hasError={!!errors.maxPods}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<div className={styles.additionalDetailsHeader}>
|
||||||
|
<div>
|
||||||
|
<p>Readiness</p>
|
||||||
|
<CustomCheckbox
|
||||||
|
id="readiNessCheckBox"
|
||||||
|
setChecked={() => setDisableReadiness(!disableReadiness)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={styles.additionalDetailsFields}>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<p>Readiness Path</p>
|
||||||
|
|
||||||
|
<TextField
|
||||||
|
placeHolder="Enter Readiness path"
|
||||||
|
disabled={disableReadiness}
|
||||||
|
{...register("readinessPath", {
|
||||||
|
required:
|
||||||
|
readinessPort.trim() !== "" && !disableReadiness,
|
||||||
|
})}
|
||||||
|
hasError={!!errors.readinessPath}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>Readiness Port</p>
|
||||||
|
<TextField
|
||||||
|
placeHolder="Enter Readiness port"
|
||||||
|
disabled={disableReadiness}
|
||||||
|
{...register("readinessPort", {
|
||||||
|
required:
|
||||||
|
readinessPath.trim() !== "" && !disableReadiness,
|
||||||
|
})}
|
||||||
|
hasError={!!errors.readinessPort}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<div className={styles.additionalDetailsHeader}>
|
||||||
|
<div>
|
||||||
|
<p>Liveness</p>
|
||||||
|
<CustomCheckbox
|
||||||
|
id="liveNessCheckBox"
|
||||||
|
setChecked={() => setDisableLiveness(!disableLiveness)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={styles.additionalDetailsFields}>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<p>Liveness Path</p>
|
||||||
|
<TextField
|
||||||
|
placeHolder="Enter liveness path"
|
||||||
|
disabled={disableLiveness}
|
||||||
|
{...register("livenessPath", {
|
||||||
|
required:
|
||||||
|
livenessPort.trim() !== "" && !disableLiveness,
|
||||||
|
})}
|
||||||
|
hasError={!!errors.livenessPath}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>Liveness Port</p>
|
||||||
|
<TextField
|
||||||
|
placeHolder="Enter liveness port"
|
||||||
|
disabled={disableLiveness}
|
||||||
|
{...register("livenessPort", {
|
||||||
|
required:
|
||||||
|
livenessPath.trim() !== "" && !disableLiveness,
|
||||||
|
})}
|
||||||
|
hasError={!!errors.livenessPort}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ProjectDetails;
|
||||||
170
frontend/src/app/projects/view/add-from-scratch/settings.jsx
Normal file
170
frontend/src/app/projects/view/add-from-scratch/settings.jsx
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
"use client";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import variableStyles from "./variableStyles.module.css";
|
||||||
|
const Settings = ({
|
||||||
|
setTriggerAddVariable,
|
||||||
|
setTriggerAddVolume,
|
||||||
|
setTriggerAddConfigMap,
|
||||||
|
}) => {
|
||||||
|
const [triggerVariableDropDown, setTriggerVariableDropDown] = useState(false);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={variableStyles.variables}>
|
||||||
|
<div className={variableStyles.variablesHeader}>
|
||||||
|
<div>
|
||||||
|
<div className={variableStyles.searchContainer}>
|
||||||
|
<div className={variableStyles.searchInputGroup}>
|
||||||
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
|
||||||
|
<g clipPath="url(#clip0)">
|
||||||
|
<path
|
||||||
|
d="M8.66099 16.0271C12.7292 16.0271 16.0271 12.7292 16.0271 8.66099C16.0271 4.59282 12.7292 1.29492 8.66099 1.29492C4.59282 1.29492 1.29492 4.59282 1.29492 8.66099C1.29492 12.7292 4.59282 16.0271 8.66099 16.0271Z"
|
||||||
|
stroke="currentColor"
|
||||||
|
strokeWidth="2"
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M18.7051 18.7061L14.0176 14.0186"
|
||||||
|
stroke="currentColor"
|
||||||
|
strokeWidth="2"
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
<input type="text" placeholder="Search" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={variableStyles.variablesHeaderDropDown}>
|
||||||
|
<div
|
||||||
|
className={variableStyles.variableHeaderDropdownButton}
|
||||||
|
onClick={() =>
|
||||||
|
setTriggerVariableDropDown(!triggerVariableDropDown)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M12 5.29199V18.7087"
|
||||||
|
stroke="white"
|
||||||
|
strokeWidth="2"
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M5.29102 12H18.7077"
|
||||||
|
stroke="white"
|
||||||
|
strokeWidth="2"
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
{triggerVariableDropDown && (
|
||||||
|
<div className={variableStyles.dropDownContainer}>
|
||||||
|
<div
|
||||||
|
onClick={() => {
|
||||||
|
setTriggerAddVariable(true);
|
||||||
|
setTriggerVariableDropDown(!triggerVariableDropDown);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<p>Environment Variables</p>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
onClick={() => {
|
||||||
|
setTriggerAddVolume(true);
|
||||||
|
setTriggerVariableDropDown(!triggerVariableDropDown);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<p>Volumes</p>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
onClick={() => {
|
||||||
|
setTriggerAddConfigMap(true);
|
||||||
|
setTriggerVariableDropDown(!triggerVariableDropDown);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<p>Config Maps</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={variableStyles.variablesContentContainer}>
|
||||||
|
<div>
|
||||||
|
<div className={variableStyles.variablesContent}>
|
||||||
|
<div className={variableStyles.environmentVariablesContainer}>
|
||||||
|
<div className={variableStyles.environmentVariablesHeader}>
|
||||||
|
<p>Environment Variables</p>
|
||||||
|
</div>
|
||||||
|
<div className={variableStyles.envVariablesHeader}>
|
||||||
|
<div>
|
||||||
|
<p>Key</p>
|
||||||
|
<p>Value</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={variableStyles.variableList}>
|
||||||
|
<div className={variableStyles.emptyVariableList}>
|
||||||
|
<div>
|
||||||
|
<p>No Environment Variables added</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* <div className={variableStyles.variable}>
|
||||||
|
<p>REQUEST_SERVICE_GRPC</p>
|
||||||
|
<p>request-service:50053</p>
|
||||||
|
<DeleteIcon />
|
||||||
|
</div> */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={variableStyles.variablesContent}>
|
||||||
|
<div className={variableStyles.environmentVariablesContainer}>
|
||||||
|
<div className={variableStyles.environmentVariablesHeader}>
|
||||||
|
<p>Volumes</p>
|
||||||
|
</div>
|
||||||
|
<div className={variableStyles.envVariablesHeader}>
|
||||||
|
<div>
|
||||||
|
<p>Name</p>
|
||||||
|
<p>Path</p>
|
||||||
|
<p>Size/Type</p>
|
||||||
|
<p>Access Mode</p>
|
||||||
|
<p>Storage Class</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={variableStyles.variableList}>
|
||||||
|
<div className={variableStyles.emptyVariableList}>
|
||||||
|
<div>
|
||||||
|
<p>No volume added</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={variableStyles.variablesContent}>
|
||||||
|
<div className={variableStyles.environmentVariablesContainer}>
|
||||||
|
<div className={variableStyles.environmentVariablesHeader}>
|
||||||
|
<p>Config maps</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={variableStyles.variableList}>
|
||||||
|
<div className={variableStyles.emptyVariableList}>
|
||||||
|
<div>
|
||||||
|
<p>No config map added</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Settings;
|
||||||
@@ -1,24 +1,68 @@
|
|||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 16px;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
height: calc(100vh - 170px);
|
||||||
|
/* ✅ fills remaining space */
|
||||||
|
min-height: 0;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
.contentContainer {
|
.contentContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
flex: 1 0 0;
|
flex: 1;
|
||||||
|
background-color: red;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.heading {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 16px;
|
||||||
|
padding: 0 16px;
|
||||||
|
align-self: stretch;
|
||||||
|
background: #191a24;
|
||||||
|
}
|
||||||
|
.heading > div {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 16px;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
.heading p {
|
||||||
|
display: flex;
|
||||||
|
padding: 24px 4px 16px 4px;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 5px;
|
||||||
|
color: #85869b;
|
||||||
|
font-family: Inter;
|
||||||
|
font-size: 18px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: normal;
|
||||||
|
letter-spacing: 0.18px;
|
||||||
|
}
|
||||||
.fieldsContainerCreateNew {
|
.fieldsContainerCreateNew {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding-top: 36px;
|
padding-top: 36px;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 550px;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 36px;
|
gap: 36px;
|
||||||
background: #191a24;
|
background: #191a24;
|
||||||
height: calc(100vh - 175px);
|
height: 100%;
|
||||||
|
min-height: 0;
|
||||||
|
background-color: red;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.projectDetails {
|
.projectDetails {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 36px;
|
padding: 0 20px;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
}
|
}
|
||||||
.searchContainer > div {
|
.searchContainer > div {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 310px;
|
width: 100%;
|
||||||
padding: 8px 12px;
|
padding: 8px 12px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 9px;
|
gap: 9px;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
text-wrap: nowrap;
|
text-wrap: nowrap;
|
||||||
color: #85869b;
|
color: #85869b;
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
z-index: 5;
|
z-index: 3;
|
||||||
font-size: var(--table-font-size);
|
font-size: var(--table-font-size);
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|||||||
Reference in New Issue
Block a user