Skip to content

Commit

Permalink
ref: change folder web app
Browse files Browse the repository at this point in the history
  • Loading branch information
kenriortega committed Nov 6, 2021
1 parent 030e3ce commit 81a4b21
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 32 deletions.
3 changes: 2 additions & 1 deletion web/ngonx-app/.gitignore → web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
.DS_Store
dist
dist-ssr
*.local
*.local
pkg
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import React, { Fragment, useEffect, useReducer, useState } from 'react'
import EndpointCard from './EndpointCard'
import { Box, Container, Flex, Heading, Text } from "@chakra-ui/react"
import { Box, Container, Flex, Heading, Text, Center } from "@chakra-ui/react"
import { getAllEndpoints, GetEndpointsReducer, initialStateGetAllEndpoints } from '../lib/getEndpointsReducer'
import { FaIdCard, FaTable } from 'react-icons/fa'
import EndpointTable from './EndpointTable'
import NoDataImage from './NoData'
const Endpoints = () => {
// const [{ endpoints, loading, errorMessage }, dispatch] =
// useReducer(GetEndpointsReducer, initialStateGetAllEndpoints)
const [{ endpoints, loading, errorMessage }, dispatch] =
useReducer(GetEndpointsReducer, initialStateGetAllEndpoints)

// useEffect(() => {
// async function fetchEndpoints() {
// try {
// let response = await getAllEndpoints(dispatch)
// if (!response) return;
// } catch (error) {
// console.log(error);
// }
// }
useEffect(() => {
async function fetchEndpoints() {
try {
let response = await getAllEndpoints(dispatch)
if (!response) return;
} catch (error) {
console.log(error);
}
}

// fetchEndpoints()
// }, [])
fetchEndpoints()
}, [])

const endpoints = [
{
id: "6c4fa765-f6bf-4f00-950f-3315f504cc50",
path_url: "http://localhost:3000/api/v1/health/",
status: "down"
},
{
id: "4abbf98f-8a8c-46ca-a2c5-ae8eaefbef60",
path_url: "http://localhost:3000/api/v1/version/",
status: "down"
}
]
// const endpoints = [
// {
// id: "6c4fa765-f6bf-4f00-950f-3315f504cc50",
// path_url: "http://localhost:3000/api/v1/health/",
// status: "down"
// },
// {
// id: "4abbf98f-8a8c-46ca-a2c5-ae8eaefbef60",
// path_url: "http://localhost:3000/api/v1/version/",
// status: "down"
// }
// ]

const loading = false
// const loading = false
const [viewElement, setViewElement] = useState(false)

const handleViewElement = () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ const MenuLinks = ({ isOpen, colorMode, toggleColorMode }) => {
direction={["column", "row", "row", "row"]}
pt={[4, 4, 0, 0]}
>
<MenuItem to="/"
{/* <MenuItem to="/"
className="link-name"
textStyle="linkName"
> ⚙️ Home
</MenuItem>
</MenuItem> */}
<IconButton
aria-label=""
mr="4"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const GetEndpointsReducer = (initialState, action) => {
}
};

const ROOT_URL = 'http://localhost:10001';
// const ROOT_URL = 'http://localhost:10001';

export async function getAllEndpoints(dispatch) {
const requestOptions = {
Expand All @@ -40,7 +40,7 @@ export async function getAllEndpoints(dispatch) {

try {
dispatch({ type: 'ENDPOINTS_REQUEST' });
let response = await fetch(`${ROOT_URL}/api/v1/mngt`, requestOptions);
let response = await fetch(`/api/v1/mngt/`, requestOptions);
let data = await response.json();
if (data.length >= 0) {

Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 81a4b21

Please sign in to comment.