From fbeb3a509afb9362bd8557c027184e7d4d2c09be Mon Sep 17 00:00:00 2001 From: Laux Dev <2201104208@student.buksu.edu.ph> Date: Mon, 16 Mar 2026 14:42:04 +0800 Subject: [PATCH] progress --- .../buttons/primarybutton/styles.module.css | 2 +- .../mobileSearchBar/styles.module.css | 5 +- .../app/components/topHeader/TopHeader.jsx | 2 +- frontend/src/app/globals.css | 2 +- frontend/src/app/projects/page.jsx | 6 +- .../src/app/projects/project-card/Card.jsx | 2 +- .../projects/project-card/styles.module.css | 1 + frontend/src/app/projects/view/page.jsx | 492 +++++++++--------- .../app/projects/view/service-card/Card.jsx | 170 ++++++ .../view/service-card/styles.module.css | 116 +++++ .../src/app/projects/view/styles.module.css | 13 + 11 files changed, 572 insertions(+), 239 deletions(-) create mode 100644 frontend/src/app/projects/view/service-card/Card.jsx create mode 100644 frontend/src/app/projects/view/service-card/styles.module.css diff --git a/frontend/src/app/components/buttons/primarybutton/styles.module.css b/frontend/src/app/components/buttons/primarybutton/styles.module.css index 223f4c6..5765302 100644 --- a/frontend/src/app/components/buttons/primarybutton/styles.module.css +++ b/frontend/src/app/components/buttons/primarybutton/styles.module.css @@ -1,6 +1,6 @@ .button { display: flex; - padding: 8px 12px; + padding: 8px 10px; justify-content: center; align-items: center; gap: 10px; diff --git a/frontend/src/app/components/mobileSearchBar/styles.module.css b/frontend/src/app/components/mobileSearchBar/styles.module.css index f9d97eb..760e6ad 100644 --- a/frontend/src/app/components/mobileSearchBar/styles.module.css +++ b/frontend/src/app/components/mobileSearchBar/styles.module.css @@ -9,14 +9,14 @@ .searchBarContainer > input { width: 100%; padding: 11px 12px; - padding-left: 30px; + padding-left: 40px; background-color: transparent; border: none; outline: none; background-color: transparent; color: white; font-family: Inter; - font-size: 16px; + font-size: 18px; outline: none; font-style: normal; font-weight: 400; @@ -25,4 +25,5 @@ } .searchIcon { position: absolute; + left: 10; } diff --git a/frontend/src/app/components/topHeader/TopHeader.jsx b/frontend/src/app/components/topHeader/TopHeader.jsx index 55cb402..3f83cac 100644 --- a/frontend/src/app/components/topHeader/TopHeader.jsx +++ b/frontend/src/app/components/topHeader/TopHeader.jsx @@ -71,7 +71,7 @@ const TopHeader = (props) => { {props?.requiredButtons.includes("add-services") && ( } - text={props.buttonText} + text={isMobile ? "" : props.buttonText} onClick={() => props?.trigger(!props?.triggerState)} /> )} diff --git a/frontend/src/app/globals.css b/frontend/src/app/globals.css index 2f708a5..3bf291a 100644 --- a/frontend/src/app/globals.css +++ b/frontend/src/app/globals.css @@ -55,7 +55,7 @@ a { } @media (max-width: 900px) { :root { - --table-font-size: 12px; + --table-font-size: 9px; } } @media (max-width: 500px) { diff --git a/frontend/src/app/projects/page.jsx b/frontend/src/app/projects/page.jsx index d4227ad..02e20d9 100644 --- a/frontend/src/app/projects/page.jsx +++ b/frontend/src/app/projects/page.jsx @@ -185,7 +185,11 @@ const ProjectsPage = () => {
{sampleData.map((data, key) => ( - + router.push("/projects/view")} + /> ))}
) : ( diff --git a/frontend/src/app/projects/project-card/Card.jsx b/frontend/src/app/projects/project-card/Card.jsx index 8f32326..9af1f52 100644 --- a/frontend/src/app/projects/project-card/Card.jsx +++ b/frontend/src/app/projects/project-card/Card.jsx @@ -4,7 +4,7 @@ import styles from "./styles.module.css"; const Card = (props) => { return ( -
+

Name

diff --git a/frontend/src/app/projects/project-card/styles.module.css b/frontend/src/app/projects/project-card/styles.module.css index 86042c7..978f817 100644 --- a/frontend/src/app/projects/project-card/styles.module.css +++ b/frontend/src/app/projects/project-card/styles.module.css @@ -5,6 +5,7 @@ gap: 16px; align-self: stretch; border-bottom: 1px solid #2c2d3d; + cursor: pointer; } .cardDetails { display: flex; diff --git a/frontend/src/app/projects/view/page.jsx b/frontend/src/app/projects/view/page.jsx index 5405c0c..c1ed4de 100644 --- a/frontend/src/app/projects/view/page.jsx +++ b/frontend/src/app/projects/view/page.jsx @@ -6,10 +6,13 @@ import styles from "./styles.module.css"; import AddServicesModal from "./AddServicesModal/AddServicesModal"; import { useRouter, usePathname } from "next/navigation"; import CopyIcon from "@/app/components/icons/copy"; +import useIsMobile from "@/app/hooks/useIsMobile"; +import Card from "./service-card/Card"; +import MobileSearchBar from "@/app/components/mobileSearchBar/MobileSearchBar"; const AddProject = () => { const [triggerAddServicesModal, setTriggerAddServicesModal] = useState(false); const router = useRouter(); - + const isMobile = useIsMobile(); const pathName = usePathname(); const sampleData = [ { @@ -108,254 +111,279 @@ const AddProject = () => { "services-drop-down", ]} /> -
- - - - - - - - - - - - - - - {sampleData.map((services, index) => { - return ( - - router.push(`${pathName}/${services.id}`) - } - > - - - + + ); + })} + +
NameVersionHealthStatusImageIngressPortActions
{services.name} - {services.version} - -
-
+ {isMobile ? ( +
+ + {sampleData.map((data, key) => ( + router.push(`${pathName}/${data.id}`)} + /> + ))} +
+ ) : ( +
+ + + + + + + + + + + + + + + {sampleData.map((services, index) => { + return ( + + router.push(`${pathName}/${services.id}`) + } + > + + + - + - - - - + + + + - - ); - })} - -
NameVersionHealthStatusImageIngressPortActions
{services.name} + {services.version} + +
- - - -

Overall

+
+ + + +

Overall

+
+

{services.health.overall}

-

{services.health.overall}

-
-
- - - -

Liveness

+
+ + + +

Liveness

+
+

{services.health.liveness}

-

{services.health.liveness}

-
-
- - - -

Readiness

+
+ + + +

Readiness

+
+

{services.health.readiness}

-

{services.health.readiness}

- -
-
-
+
+
- - - -

Deployment

+
+ + + +

Deployment

+
+

{services.status.deployment}

-

{services.status.deployment}

-
-
- - - - - - - - -

Replicas

+
+ + + + + + + + +

Replicas

+
+

{services.status.replicas}

-

{services.status.replicas}

- -
-
- -

Copy

-
-

{services.image}

-
{services.ingress}{services.ports} -
+
- + +

Copy

-
- +

{services.image}

+
{services.ingress}{services.ports} +
+
+ +
+
+ +
- -
-
+
+
+ )}
diff --git a/frontend/src/app/projects/view/service-card/Card.jsx b/frontend/src/app/projects/view/service-card/Card.jsx new file mode 100644 index 0000000..50a2c72 --- /dev/null +++ b/frontend/src/app/projects/view/service-card/Card.jsx @@ -0,0 +1,170 @@ +import DeleteIcon from "@/app/components/icons/delete"; +import React from "react"; +import styles from "./styles.module.css"; + +const Card = (props) => { + return ( +
+
+
+

Name

+

{props?.data?.name}

+
+
+

Version

+

{props?.data?.version}

+
+
+

Health

+
+
+
+ + + +

Overall

+
+

{props?.data?.health?.overall}

+
+
+
+ + + +

Liveness

+
+

{props?.data?.health?.liveness}

+
+ +
+
+ + + +

Readiness

+
+

{props?.data?.health?.readiness}

+
+
+
+
+

Status

+
+
+
+ + + +

Deployment

+
+

{props?.data?.status?.deployment}

+
+ +
+
+ + + + + + + + +

Replicas

+
+

{props?.data?.status?.replicas}

+
+
+
+
+

Image

+

{props?.data?.image}

+
+
+
+ +
+
+ ); +}; + +export default Card; diff --git a/frontend/src/app/projects/view/service-card/styles.module.css b/frontend/src/app/projects/view/service-card/styles.module.css new file mode 100644 index 0000000..976c19c --- /dev/null +++ b/frontend/src/app/projects/view/service-card/styles.module.css @@ -0,0 +1,116 @@ +.cardContainer { + display: flex; + padding: 16px 0; + align-items: flex-start; + gap: 16px; + align-self: stretch; + border-bottom: 1px solid #2c2d3d; + cursor: pointer; +} +.cardDetails { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 8px; + flex: 1 0 0; +} +.list { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 5px; + align-self: stretch; +} +.list > p { + color: #85869b; + font-family: Inter; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: normal; + overflow-wrap: anywhere; +} + +.list > p:nth-child(2) { + color: #eeeffd; + font-family: Inter; + font-size: 16px; + font-weight: 500; +} +.cardAction { + display: flex; + align-items: center; + gap: 17px; +} +.servicesHealth, +.servicesStatus { + display: flex; + align-items: start; + gap: 4px; + width: 100%; + align-self: stretch; +} +.servicesHealth > div, +.servicesStatus > div { + display: flex; + padding: 4px 6px; + flex-direction: column; + justify-content: center; + align-items: flex-start; + gap: 5px; + border-radius: 6px; + border: 1px solid rgba(22, 159, 49, 0.25); + background: rgba(22, 159, 49, 0.05); + color: #179f31; + font-family: Inter; + font-size: 12px; + font-style: normal; + font-weight: 500; + line-height: normal; +} +.servicesHealth > div:nth-child(2) { + border: 1px solid rgba(207, 176, 0, 0.25); + background: rgba(207, 176, 0, 0.05); + color: #cfb000; +} +.servicesHealth > div:nth-child(2) > div { + color: #cfb000; +} +.servicesHealth > div:nth-child(3) { + border: 1px solid rgba(117, 118, 153, 0.25); + background: rgba(117, 118, 153, 0.05); + color: #757696; +} +.servicesHealth > div:nth-child(3) > div { + color: #757696; +} +.servicesHealth > div > div, +.servicesStatus > div > div { + display: flex; + align-items: center; + gap: 4px; + color: #179f31; + font-family: Inter; + font-size: 10px; + font-style: normal; + font-weight: 400; + line-height: normal; +} +.servicesStatus > div:nth-child(1) { + border-radius: 6px; + border: 1px solid rgba(80, 241, 255, 0.25); + background: rgba(80, 241, 255, 0.05); + color: #82eeff; +} +.servicesStatus > div:nth-child(1) > div { + color: #82eeff; +} +.servicesStatus > div:nth-child(2) { + border-radius: 6px; + border: 1px solid rgba(89, 127, 241, 0.25); + background: rgba(89, 127, 241, 0.05); + color: #617ee9; +} +.servicesStatus > div:nth-child(2) > div { + color: #617ee9; +} diff --git a/frontend/src/app/projects/view/styles.module.css b/frontend/src/app/projects/view/styles.module.css index 97d0388..db6bc8c 100644 --- a/frontend/src/app/projects/view/styles.module.css +++ b/frontend/src/app/projects/view/styles.module.css @@ -59,8 +59,10 @@ .servicesStatus { display: flex; align-items: start; + text-wrap: nowrap; gap: 4px; width: 100%; + flex-wrap: wrap; align-self: stretch; } .servicesHealth > div, @@ -185,3 +187,14 @@ .imageText:hover > div { opacity: 1; } +.cardContainer { + display: flex; + padding: 0 16px; + padding-bottom: 50px; + height: calc(100vh - 170px); + flex-direction: column; + align-items: flex-start; + gap: 12px; + align-self: stretch; + overflow: auto; +}