diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index c0f64a83..00000000 --- a/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -dist/ -build/ diff --git a/docs/UserGuide_CN.md b/docs/UserGuide_CN.md deleted file mode 100644 index 0ffdd02f..00000000 --- a/docs/UserGuide_CN.md +++ /dev/null @@ -1 +0,0 @@ -// TODO \ No newline at end of file diff --git a/docs/UserGuide_EN.md b/docs/UserGuide_EN.md deleted file mode 100644 index 0ffdd02f..00000000 --- a/docs/UserGuide_EN.md +++ /dev/null @@ -1 +0,0 @@ -// TODO \ No newline at end of file diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/Main.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/Main.java new file mode 100644 index 00000000..e32e92ab --- /dev/null +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/Main.java @@ -0,0 +1,7 @@ +package org.apache.eventmesh.dashboard.core; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} \ No newline at end of file diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java new file mode 100644 index 00000000..0927abf9 --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java @@ -0,0 +1,7 @@ +package org.apache.eventmesh.dashboard.service; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} \ No newline at end of file diff --git a/frontend/.gitignore b/eventmesh-dashboard-view/.gitignore similarity index 100% rename from frontend/.gitignore rename to eventmesh-dashboard-view/.gitignore diff --git a/frontend/.dockerignore b/frontend/.dockerignore deleted file mode 100644 index 252089de..00000000 --- a/frontend/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -out/ \ No newline at end of file diff --git a/frontend/README.md b/frontend/README.md deleted file mode 100644 index c6d90a59..00000000 --- a/frontend/README.md +++ /dev/null @@ -1,54 +0,0 @@ -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). - -## Getting Started - -First, run the development server: - -```bash -npm run dev -# or -yarn dev -``` - -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. - -You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. - -[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. - -The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. - -## Getting Started with Docker - -Pull the image and run the container by following commands: - -``` -docker pull apache/eventmesh-dashboard:latest -``` - -``` -docker run -d --name eventmesh-dashboard -p 8080:80 -t apache/eventmesh-dashboard:latest -``` - -Open [http://localhost:8080](http://localhost:8080) in your browser to see the result. - -You can also build a mirror of your own by executing the following command in the root of your git repository: - -``` -docker build -t /eventmesh-dashboard:latest -f docker/Dockerfile . -``` - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/frontend/components/client/GrpcClientTable.tsx b/frontend/components/client/GrpcClientTable.tsx deleted file mode 100644 index 1ffdfeaa..00000000 --- a/frontend/components/client/GrpcClientTable.tsx +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { - HStack, - Select, - Input, - Table, - Thead, - Tbody, - Tr, - Th, - Td, - TableContainer, - useToast, - Box, - Button, -} from '@chakra-ui/react'; -import axios from 'axios'; -import { useContext, useEffect, useState } from 'react'; -import { AppContext } from '../../context/context'; - -interface GrpcClient { - env: string, - subsystem: string, - url: string, - pid: number, - host: string, - port: number, - version: string, - idc: string, - group: string, - purpose: string, - protocol: string, -} - -interface GrpcClientProps { - url: string, - group: string, -} - -interface RemoveGrpcClientRequest { - url: string, -} - -const GrpcClientRow = ({ - url, group, -}: GrpcClientProps) => { - const { state } = useContext(AppContext); - - const toast = useToast(); - const [loading, setLoading] = useState(false); - const onRemoveClick = async () => { - try { - setLoading(true); - await axios.delete(`${state.endpoint}/client/grpc`, { - data: { - url, - }, - }); - setLoading(false); - } catch (error) { - if (axios.isAxiosError(error)) { - toast({ - title: 'Failed to remove the gRPC Client', - description: error.message, - status: 'error', - duration: 3000, - isClosable: true, - }); - } - } - }; - - return ( - - {url} - {group} - - - - - - - ); -}; - -const GrpcClientTable = () => { - const { state } = useContext(AppContext); - - const [searchInput, setSearchInput] = useState(''); - const handleSearchInputChange = (event: React.FormEvent) => { - setSearchInput(event.currentTarget.value); - }; - - const [groupSet, setGroupSet] = useState>(new Set()); - const [groupFilter, setGroupFilter] = useState(''); - const handleGroupSelectChange = (event: React.FormEvent) => { - setGroupFilter(event.currentTarget.value); - }; - - const [GrpcClientList, setGrpcClientList] = useState([]); - const toast = useToast(); - useEffect(() => { - const fetch = async () => { - try { - const { data } = await axios.get(`${state.endpoint}/client/grpc`); - setGrpcClientList(data); - - const nextGroupSet = new Set(); - data.forEach(({ group }) => { - nextGroupSet.add(group); - }); - setGroupSet(nextGroupSet); - } catch (error) { - if (axios.isAxiosError(error)) { - toast({ - title: 'Failed to fetch the list of gRPC Clients', - description: 'Unable to connect to the EventMesh daemon', - status: 'error', - duration: 3000, - isClosable: true, - }); - setGrpcClientList([]); - } - } - }; - - fetch(); - }, []); - - return ( - - - - - - - - - - - - - - - - - {GrpcClientList && GrpcClientList.filter(({ - url, group, - }) => { - if (searchInput && !url.includes(searchInput)) { - return false; - } - if (groupFilter && groupFilter !== group) { - return false; - } - return true; - }).map(({ - url, group, - }) => ( - - ))} - -
URLGroupAction
-
-
- ); -}; - -export default GrpcClientTable; diff --git a/frontend/components/client/HTTPClientTable.tsx b/frontend/components/client/HTTPClientTable.tsx deleted file mode 100644 index 832ea91b..00000000 --- a/frontend/components/client/HTTPClientTable.tsx +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { - HStack, - Select, - Input, - Table, - Thead, - Tbody, - Tr, - Th, - Td, - TableContainer, - useToast, - Box, - Button, -} from '@chakra-ui/react'; -import axios from 'axios'; -import { useContext, useEffect, useState } from 'react'; -import { AppContext } from '../../context/context'; - -interface HTTPClient { - env: string, - subsystem: string, - url: string, - pid: number, - host: string, - port: number, - version: string, - idc: string, - group: string, - purpose: string, - protocol: string, -} - -interface HTTPClientProps { - url: string, - group: string, -} - -interface RemoveHTTPClientRequest { - url: string, -} - -const HTTPClientRow = ({ - url, group, -}: HTTPClientProps) => { - const { state } = useContext(AppContext); - - const toast = useToast(); - const [loading, setLoading] = useState(false); - const onRemoveClick = async () => { - try { - setLoading(true); - await axios.delete(`${state.endpoint}/client/http`, { - data: { - url, - }, - }); - setLoading(false); - } catch (error) { - if (axios.isAxiosError(error)) { - toast({ - title: 'Failed to remove the HTTP Client', - description: error.message, - status: 'error', - duration: 3000, - isClosable: true, - }); - } - } - }; - - return ( - - {url} - {group} - - - - - - - ); -}; - -const HTTPClientTable = () => { - const { state } = useContext(AppContext); - - const [searchInput, setSearchInput] = useState(''); - const handleSearchInputChange = (event: React.FormEvent) => { - setSearchInput(event.currentTarget.value); - }; - - const [groupSet, setGroupSet] = useState>(new Set()); - const [groupFilter, setGroupFilter] = useState(''); - const handleGroupSelectChange = (event: React.FormEvent) => { - setGroupFilter(event.currentTarget.value); - }; - - const [HTTPClientList, setHTTPClientList] = useState([]); - const toast = useToast(); - useEffect(() => { - const fetch = async () => { - try { - const { data } = await axios.get(`${state.endpoint}/client/http`); - setHTTPClientList(data); - - const nextGroupSet = new Set(); - data.forEach(({ group }) => { - nextGroupSet.add(group); - }); - setGroupSet(nextGroupSet); - } catch (error) { - if (axios.isAxiosError(error)) { - toast({ - title: 'Failed to fetch the list of HTTP Clients', - description: 'Unable to connect to the EventMesh daemon', - status: 'error', - duration: 3000, - isClosable: true, - }); - setHTTPClientList([]); - } - } - }; - - fetch(); - }, []); - - return ( - - - - - - - - - - - - - - - - - {HTTPClientList && HTTPClientList.filter(({ - url, group, - }) => { - if (searchInput && !url.includes(searchInput)) { - return false; - } - if (groupFilter && groupFilter !== group) { - return false; - } - return true; - }).map(({ - url, group, - }) => ( - - ))} - -
URLGroupAction
-
-
- ); -}; - -export default HTTPClientTable; diff --git a/frontend/components/client/TCPClientTable.tsx b/frontend/components/client/TCPClientTable.tsx deleted file mode 100644 index dc245890..00000000 --- a/frontend/components/client/TCPClientTable.tsx +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { - HStack, - Select, - Input, - Table, - Thead, - Tbody, - Tr, - Th, - Td, - TableContainer, - useToast, - Box, - Button, -} from '@chakra-ui/react'; -import axios from 'axios'; -import { useContext, useEffect, useState } from 'react'; -import { AppContext } from '../../context/context'; - -interface TCPClient { - env: string, - subsystem: string, - url: string, - pid: number, - host: string, - port: number, - version: string, - idc: string, - group: string, - purpose: string, - protocol: string, -} - -interface TCPClientProps { - host: string, - port: number, - group: string, -} - -interface RemoveTCPClientRequest { - host: string, - port: number, -} - -const TCPClientRow = ({ - host, port, group, -}: TCPClientProps) => { - const { state } = useContext(AppContext); - - const toast = useToast(); - const [loading, setLoading] = useState(false); - const onRemoveClick = async () => { - try { - setLoading(true); - await axios.delete(`${state.endpoint}/client/tcp`, { - data: { - host, - port, - }, - }); - setLoading(false); - } catch (error) { - if (axios.isAxiosError(error)) { - toast({ - title: 'Failed to remove the TCP Client', - description: error.message, - status: 'error', - duration: 3000, - isClosable: true, - }); - } - } - }; - - return ( - - {`${host}:${port}`} - {group} - - - - - - - ); -}; - -const TCPClientTable = () => { - const { state } = useContext(AppContext); - - const [searchInput, setSearchInput] = useState(''); - const handleSearchInputChange = (event: React.FormEvent) => { - setSearchInput(event.currentTarget.value); - }; - - const [groupSet, setGroupSet] = useState>(new Set()); - const [groupFilter, setGroupFilter] = useState(''); - const handleGroupSelectChange = (event: React.FormEvent) => { - setGroupFilter(event.currentTarget.value); - }; - - const [TCPClientList, setTCPClientList] = useState([]); - const toast = useToast(); - useEffect(() => { - const fetch = async () => { - try { - const { data } = await axios.get(`${state.endpoint}/client/tcp`); - setTCPClientList(data); - - const nextGroupSet = new Set(); - data.forEach(({ group }) => { - nextGroupSet.add(group); - }); - setGroupSet(nextGroupSet); - } catch (error) { - if (axios.isAxiosError(error)) { - toast({ - title: 'Failed to fetch the list of TCP Clients', - description: 'Unable to connect to the EventMesh daemon', - status: 'error', - duration: 3000, - isClosable: true, - }); - setTCPClientList([]); - } - } - }; - - fetch(); - }, []); - - return ( - - - - - - - - - - - - - - - - - - {TCPClientList && TCPClientList.filter(({ - host, port, group, - }) => { - const address = `${host}:${port}`; - if (searchInput && !address.includes(searchInput)) { - return false; - } - if (groupFilter && groupFilter !== group) { - return false; - } - return true; - }).map(({ - host, port, group, - }) => ( - - ))} - -
HostHostGroupAction
-
-
- ); -}; - -export default TCPClientTable; diff --git a/frontend/components/event/EventTable.tsx b/frontend/components/event/EventTable.tsx deleted file mode 100644 index b0d0a13d..00000000 --- a/frontend/components/event/EventTable.tsx +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { - HStack, - Input, - Table, - Thead, - Tbody, - Tr, - Th, - Td, - TableContainer, - useToast, - Box, - Button, - Modal, - ModalBody, - ModalCloseButton, - ModalContent, - ModalFooter, - ModalHeader, - ModalOverlay, - useDisclosure, - Select, - VStack, - Textarea, -} from '@chakra-ui/react'; -import axios from 'axios'; -import { useContext, useEffect, useState } from 'react'; -import { CloudEvent } from 'cloudevents'; -import { AppContext } from '../../context/context'; - -interface Topic { - name: string, - messageCount: number, -} - -interface EventProps { - event: CloudEvent, -} - -interface CreateEventRequest { - event: CloudEvent, -} - -const CreateEventModal = () => { - const { state } = useContext(AppContext); - - const { isOpen, onOpen, onClose } = useDisclosure(); - - const [id, setId] = useState(''); - const handleIdChange = (event: React.FormEvent) => { - setId(event.currentTarget.value); - }; - - const [source, setSource] = useState(''); - const handleSourceChange = (event: React.FormEvent) => { - setSource(event.currentTarget.value); - }; - - const [subject, setSubject] = useState(''); - const handleSubjectChange = (event: React.FormEvent) => { - setSubject(event.currentTarget.value); - }; - - const [type, setType] = useState(''); - const handleTypeChange = (event: React.FormEvent) => { - setType(event.currentTarget.value); - }; - - const [data, setData] = useState(''); - const handleDataChange = (event: React.FormEvent) => { - setData(event.currentTarget.value); - }; - - const toast = useToast(); - const [loading, setLoading] = useState(false); - const onCreateClick = async () => { - try { - setLoading(true); - await axios.post(`${state.endpoint}/event`, new CloudEvent({ - source, - subject, - type, - data, - specversion: '1.0', - })); - onClose(); - } catch (error) { - if (axios.isAxiosError(error)) { - toast({ - title: 'Failed to publish the event', - description: error.message, - status: 'error', - duration: 3000, - isClosable: true, - }); - } - } finally { - setLoading(false); - } - }; - - return ( - <> - - - - - Create Event - - - - - - - - - - - - - - - - - - - ); -}; - -const EventRow = ({ - event, -}: EventProps) => { - const { isOpen, onOpen, onClose } = useDisclosure(); - const eventDataBase64 = event.data_base64 || ''; - const eventData = Buffer.from(eventDataBase64, 'base64').toString('utf-8'); - - return ( - <> - - - - Event Data - - - -