diff --git a/.asf.yaml b/.asf.yaml
deleted file mode 100644
index ec35b205..00000000
--- a/.asf.yaml
+++ /dev/null
@@ -1,47 +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.
-#
-
-github:
- description: EventMesh dashboard
- features:
- # Enable issue management
- issues: true
- # Enable wiki
- wiki: true
- homepage: https://eventmesh.apache.org/
- labels:
- - pubsub
- enabled_merge_buttons:
- squash: true
- merge: true
- rebase: false
- protected_branches:
- main:
- required_status_checks:
- strict: true
- required_pull_request_reviews:
- dismiss_stale_reviews: true
- required_approving_review_count: 1
-notifications:
- commits: commits@eventmesh.apache.org
- # Send all issue emails (new, closed, comments) to issues@
- issues: issues@eventmesh.apache.org
- # Send new/closed PR notifications to dev@
- pullrequests_status: dev@eventmesh.apache.org
- # Send individual PR comments/reviews to issues@
- pullrequests_comment: issues@eventmesh.apache.org
- jira_options: link label worklog
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..b27bb300
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+*.sh text eol=lf
+gradlew text eol=lf
+*.{cmd,[cC][mM][dD]} text eol=crlf
+*.{bat,[bB][aA][tT]} text eol=crlf
\ No newline at end of file
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index be2c833e..e8c512e9 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -16,11 +16,11 @@
# specific language governing permissions and limitations
# under the License.
#
-name: Build
+name: Docker
on:
push:
- branches:
- - main
+ tags:
+ - 'v*'
jobs:
docker:
@@ -31,12 +31,20 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
+ username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
+ - name: Docker meta
+ id: meta
+ uses: docker/metadata-action@v4
+ with:
+ images: |
+ apache/eventmesh-dashboard
+
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
- tags: apache/eventmesh-dashboard:latest
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
file: docker/Dockerfile
context: .
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..dba06dcd
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,55 @@
+#
+# 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.
+#
+
+name: "Continuous Integration"
+
+on:
+ push:
+ branches: [ '*' ]
+ pull_request:
+ branches: [ '*' ]
+
+jobs:
+ build:
+ name: Build
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest ]
+ java: [ 8 ]
+ language: ['java']
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ - name: Setup Gradle
+ uses: gradle/gradle-build-action@v2
+
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v3
+ with:
+ distribution: 'corretto'
+ java-version: ${{ matrix.java }}
+
+ - name: Build
+ run: ./gradlew clean build bootJar --parallel --daemon
+ env:
+ GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
diff --git a/.gitignore b/.gitignore
index b1f31d2b..1098c796 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,50 +1,74 @@
-.settings/
-.project
+.gradle
+build/
+!gradle/wrapper/gradle-wrapper.jar
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### STS ###
+.apt_generated
.classpath
-.target
-./**/.settings/
-./**/.project
./**/.classpath
-./**/target/
-
-
-#gitignore文件的内容
.factorypath
-.DS_Store
.project
-*.prefs
-.classpath
-.setting/h
-.settings/
-.idea/
+./**/.project
+.settings
+./**/.settings/
+.springBeans
+.sts4-cache
+bin/
+!**/src/main/**/bin/
+!**/src/test/**/bin/
+
+### IntelliJ IDEA ###
+.idea
+*.iws
*.iml
*.ipr
-*.iws
-logs/
+out/
+!**/src/main/**/out/
+!**/src/test/**/out/
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
-#忽略eclipse相关
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
org.eclipse.core.resources.prefs
org.eclipse.jdt.core.prefs
org.eclipse.m2e.core.prefs
org.eclipse.wst.common.component
org.eclipse.wst.common.project.facet.core.xml
+*.prefs
-#忽略java相关的文件
+### Java ###
*.class
*.trc
-# Mobile Tools for Java (J2ME)
-.mtj.tmp/
-# Package Files #
+### Package Files ###
*.jar
*.war
*.ear
-# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
-hs_err_pid*
-
-#忽略maven相关的文件
+### Maven ###
+.target
target/
+./**/target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
@@ -54,69 +78,8 @@ dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
-# Built application files
-*.apk
-*.ap_
-
-
-#忽略andriod相关的文件
-# Files for the Dalvik VM
-*.dex
-# Generated files
-bin/
-gen/
-# Gradle files
-.gradle/
-build/
-*/build/
-
-# Local configuration file (sdk path, etc)
-local.properties
-
-# Proguard folder generated by Eclipse
-proguard/
-# Log Files
+### Log Files ###
*.log
-# Android Studio Navigation editor temp files
-.navigation/
-# Android Studio captures folder
-captures/
-
-target/
-!.mvn/wrapper/maven-wrapper.jar
-!**/src/main/**/target/
-!**/src/test/**/target/
-
-### IntelliJ IDEA ###
-.idea/modules.xml
-.idea/jarRepositories.xml
-.idea/compiler.xml
-.idea/libraries/
-*.iws
-*.iml
-*.ipr
-
-### Eclipse ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-build/
-!**/src/main/**/build/
-!**/src/test/**/build/
-
-### VS Code ###
-.vscode/
-
-### Mac OS ###
-.DS_Store
\ No newline at end of file
+logs/
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..261eeb9e
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 00000000..910ee067
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,5 @@
+Apache EventMesh
+Copyright 2021-2024 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/README.md b/README.md
index 1d3574c3..5c7eac23 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,45 @@
-
+# EventMesh Dashboard
## 介绍
-
## 业务架构
-
## 技术架构
-
### 模块依赖图
### 模块介绍
-1. eventmesh-dashboard-console 业务模块的代码
+1. eventmesh-dashboard-console 业务模块的代码,调用service接口
2. eventmesh-dashboard-observe 监控模块的代码
-3. eventmesh-dashboard-core 对eventmesh以及相关组件的代码
-4. eventmesh-dashboard-service 公用接口
+3. eventmesh-dashboard-core 对eventmesh以及相关组件的代码,提供service实现
+4. eventmesh-dashboard-service 公用API接口,对core的抽象
5. eventmesh-dashboard-common 公共模块的代码
6. eventmesh-dashboard-view 前端代码
-
### eventmesh-dashboard-core 介绍
+
+## Build
+
+### Build on source code
+
+```
+cd eventmesh-dashboard
+./gradlew clean bootJar
+```
+
+```
+java -jar build/libs/eventmesh-dashboard-0.0.1-SNAPSHOT.jar
+```
+
+### Build and Run with Docker
+
+```
+cd eventmesh-dashboard
+./gradlew clean bootJar
+docker build -t yourname/eventmesh-dashboard -f docker/Dockerfile .
+```
+
+```
+docker run -d --name eventmesh-dashboard -p 8080:8080 yourname/eventmesh-dashboard
+```
\ No newline at end of file
diff --git a/docker/Dockerfile b/docker/Dockerfile
new file mode 100644
index 00000000..326c8b19
--- /dev/null
+++ b/docker/Dockerfile
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+FROM openjdk:8-jdk
+VOLUME /tmp
+COPY build/libs/eventmesh-dashboard-*.jar eventmesh-dashboard.jar
+ENV JAVA_OPTS=""
+ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar /eventmesh-dashboard.jar"]
diff --git a/eventmesh-dashboard-core/pom.xml b/eventmesh-dashboard-core/pom.xml
index 7192775b..1f23357b 100644
--- a/eventmesh-dashboard-core/pom.xml
+++ b/eventmesh-dashboard-core/pom.xml
@@ -1,4 +1,25 @@
+
+
@@ -8,14 +29,150 @@
eventmesh-dashboard0.0.1
-
org.apache.eventmesh.dashboard.coreeventmesh-dashboard-core
-
+ 0.0.1-SNAPSHOT
+ eventmesh-dashboard-core
- 17
- 17
+ 1.8UTF-8
+ UTF-8
+ 2.7.6
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ runtime
+ true
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+ true
+
+
+ org.projectlombok
+ lombok
+ true
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+ org.apache.commons
+ commons-lang3
+ 3.13.0
+
+
+ com.alibaba.fastjson2
+ fastjson2
+ 2.0.40
+
+
+
+
+ org.springdoc
+ springdoc-openapi-ui
+ 1.7.0
+
+
+ org.springdoc
+ springdoc-openapi-javadoc
+ 1.7.0
+
+
+
+
+ org.mockito
+ mockito-core
+ 5.5.0
+ test
+
+
+
+
+ com.alibaba.nacos
+ nacos-client
+ 2.2.4
+
+
+
+
+ org.apache.rocketmq
+ rocketmq-client
+ 4.9.7
+
+
+
+
+ com.alibaba
+ druid-spring-boot-starter
+ 1.2.21
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.5.5
+
+
+ com.mysql
+ mysql-connector-j
+ runtime
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-dependencies
+ ${spring-boot.version}
+ pom
+ import
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
+
+
+ 1.8
+ UTF-8
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ ${spring-boot.version}
+
+ org.apache.eventmesh.dashboard.core.EventMeshDashboardApplication
+ true
+
+
+
+ repackage
+
+ repackage
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplication.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplication.java
new file mode 100644
index 00000000..7caeddb7
--- /dev/null
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplication.java
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+package org.apache.eventmesh.dashboard.core;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.servlet.ServletComponentScan;
+
+@ServletComponentScan // Druid Monitor
+@SpringBootApplication
+public class EventMeshDashboardApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(EventMeshDashboardApplication.class, args);
+ }
+
+}
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/AdminProperties.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/AdminProperties.java
new file mode 100644
index 00000000..efcb74cf
--- /dev/null
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/AdminProperties.java
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+
+package org.apache.eventmesh.dashboard.config;
+
+import org.apache.eventmesh.dashboard.constant.ConfigConst;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import lombok.Data;
+
+@Data
+@Component
+@ConfigurationProperties(prefix = ConfigConst.ADMIN_PROPS_PREFIX)
+public class AdminProperties {
+
+ private MetaProperties meta = new MetaProperties();
+ private StoreProperties store = new StoreProperties();
+
+ @Data
+ public static class MetaProperties {
+
+ private String type = ConfigConst.META_TYPE_NACOS;
+ private NacosProperties nacos = new NacosProperties();
+ private EtcdProperties etcd = new EtcdProperties();
+ private int timeoutMs = 5000;
+
+ @Data
+ public static class NacosProperties {
+ private String addr = "127.0.0.1:8848";
+ private String namespace = "";
+ private boolean authEnabled = false;
+ private String protocol = "http";
+ private String username;
+ private String password;
+ private String accessKey;
+ private String secretKey;
+ }
+
+ @Data
+ public static class EtcdProperties {
+ private String addr;
+ }
+ }
+
+ @Data
+ public static class StoreProperties {
+
+ private String type = ConfigConst.STORE_TYPE_ROCKETMQ; // TODO should be standalone
+ private RocketMQProperties rocketmq = new RocketMQProperties();
+ private KafkaProperties kafka = new KafkaProperties();
+
+ @Data
+ public static class RocketMQProperties {
+ private String namesrvAddr;
+ private String clusterName = "";
+ private String accessKey = "";
+ private String secretKey = "";
+ }
+
+ @Data
+ public static class KafkaProperties {
+ private String namesrvAddr;
+ private int partitions = 1;
+ private int replicationFactors = 1;
+ }
+ }
+}
\ No newline at end of file
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/BeanTypeConfig.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/BeanTypeConfig.java
new file mode 100644
index 00000000..3a169f7c
--- /dev/null
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/BeanTypeConfig.java
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+
+package org.apache.eventmesh.dashboard.config;
+
+import org.apache.eventmesh.dashboard.constant.ConfigConst;
+import org.apache.eventmesh.dashboard.service.ConnectionService;
+import org.apache.eventmesh.dashboard.service.SubscriptionService;
+import org.apache.eventmesh.dashboard.service.TopicService;
+import org.apache.eventmesh.dashboard.service.meta.EtcdConnectionService;
+import org.apache.eventmesh.dashboard.service.meta.EtcdSubscriptionService;
+import org.apache.eventmesh.dashboard.service.meta.NacosConnectionService;
+import org.apache.eventmesh.dashboard.service.meta.NacosSubscriptionService;
+import org.apache.eventmesh.dashboard.service.store.RocketmqTopicService;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Use different registry SDK depending on the configured meta type;
+ * Use different storage SDK depending on the configured storage type.
+ */
+@Configuration
+public class BeanTypeConfig {
+
+ private final AdminProperties adminProperties;
+
+ public BeanTypeConfig(AdminProperties adminProperties) {
+ this.adminProperties = adminProperties;
+ }
+
+ @Bean
+ public ConnectionService connectionService() {
+ switch (adminProperties.getMeta().getType()) {
+ case ConfigConst.META_TYPE_NACOS:
+ return new NacosConnectionService(adminProperties);
+ case ConfigConst.META_TYPE_ETCD:
+ return new EtcdConnectionService();
+ default:
+ throw new IllegalArgumentException("Unsupported EventMesh Meta type: " + adminProperties.getMeta().getType());
+ }
+ }
+
+ @Bean
+ public SubscriptionService subscriptionService() {
+ switch (adminProperties.getMeta().getType()) {
+ case ConfigConst.META_TYPE_NACOS:
+ return new NacosSubscriptionService(adminProperties);
+ case ConfigConst.META_TYPE_ETCD:
+ return new EtcdSubscriptionService();
+ default:
+ throw new IllegalArgumentException("Unsupported EventMesh Meta type: " + adminProperties.getMeta().getType());
+ }
+ }
+
+ @Bean
+ public TopicService topicService() {
+ switch (adminProperties.getStore().getType()) {
+ case ConfigConst.STORE_TYPE_STANDALONE:
+ return null; // TODO StandaloneTopicService
+ case ConfigConst.STORE_TYPE_ROCKETMQ:
+ return new RocketmqTopicService(adminProperties);
+ case ConfigConst.STORE_TYPE_KAFKA:
+ return null; // TODO KafkaTopicService
+ default:
+ throw new IllegalArgumentException("Unsupported EventMesh Store type: " + adminProperties.getStore().getType());
+ }
+ }
+}
\ No newline at end of file
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/constant/ConfigConst.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/constant/ConfigConst.java
new file mode 100644
index 00000000..4932adfd
--- /dev/null
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/constant/ConfigConst.java
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+package org.apache.eventmesh.dashboard.constant;
+
+public class ConfigConst {
+
+ // yml config
+ public static final String ADMIN_PROPS_PREFIX = "eventmesh";
+ public static final String META_TYPE_NACOS = "nacos";
+ public static final String META_TYPE_ETCD = "etcd";
+ public static final String STORE_TYPE_STANDALONE = "standalone";
+ public static final String STORE_TYPE_ROCKETMQ = "rocketmq";
+ public static final String STORE_TYPE_KAFKA = "kafka";
+
+ // Open-API
+ public static final String HTTP_PREFIX = "http://";
+ public static final String HTTPS_PREFIX = "https://";
+
+ // common
+ /**
+ * colon with space
+ */
+ public static final String COLON = ": ";
+
+}
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/constant/NacosConst.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/constant/NacosConst.java
new file mode 100644
index 00000000..d0b027e8
--- /dev/null
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/constant/NacosConst.java
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+package org.apache.eventmesh.dashboard.constant;
+
+public class NacosConst {
+
+ public static final String LOGIN_API = "/nacos/v1/auth/login";
+
+ public static final String LOGIN_REQ_USERNAME = "username";
+ public static final String LOGIN_REQ_PASSWORD = "password";
+
+ public static final String LOGIN_RESP_TOKEN = "accessToken";
+
+ public static final String CONFIGS_API = "/nacos/v1/cs/configs";
+
+ public static final String CONFIGS_REQ_PAGE = "pageNo";
+ public static final String CONFIGS_REQ_PAGE_SIZE = "pageSize";
+ public static final String CONFIGS_REQ_DATAID = "dataId";
+ public static final String CONFIGS_REQ_GROUP = "group";
+ public static final String CONFIGS_REQ_SEARCH = "search";
+ public static final String CONFIGS_REQ_TOKEN = "accessToken";
+
+ public static final String CONFIGS_RESP_CONTENT_LIST = "pageItems"; // json page data list field
+ public static final String CONFIGS_RESP_CONTENT = "content"; // json page data field
+ public static final String CONFIGS_RESP_PAGES = "pagesAvailable"; // json total pages field
+ public static final String CONFIGS_RESP_DATAID = "dataId";
+ public static final String CONFIGS_RESP_GROUP = "group";
+}
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/ConnectionController.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/ConnectionController.java
new file mode 100644
index 00000000..b723e66b
--- /dev/null
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/ConnectionController.java
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+package org.apache.eventmesh.dashboard.controller;
+
+import org.apache.eventmesh.dashboard.service.ConnectionService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@RestController
+public class ConnectionController {
+
+ @Autowired
+ ConnectionService connectionService;
+
+ /**
+ * Query Connection List
+ *
+ * The subscription information of SourceConnector and SinkConnector reported by EventMesh Runtime to the meta,
+ * containing the configuration of each connection.
+ *
+ * @param page the page number
+ * @param size the page size
+ * @return A paged list of connection configuration and total number of pages
+ */
+ @GetMapping("/connection")
+ public String listConnections(@RequestParam("page") Integer page, @RequestParam("size") String size) {
+ return null;
+ }
+
+}
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/MetricsController.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/MetricsController.java
new file mode 100644
index 00000000..dfe3a463
--- /dev/null
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/MetricsController.java
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+package org.apache.eventmesh.dashboard.controller;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.alibaba.druid.stat.DruidStatManagerFacade;
+
+@RestController
+public class MetricsController {
+ @GetMapping("/druid/stat")
+ public Object druidStat() {
+ return DruidStatManagerFacade.getInstance().getDataSourceStatDataList();
+ }
+}
\ No newline at end of file
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/SubscriptionController.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/SubscriptionController.java
new file mode 100644
index 00000000..0ae0091b
--- /dev/null
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/SubscriptionController.java
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+
+package org.apache.eventmesh.dashboard.controller;
+
+import org.apache.eventmesh.dashboard.dto.Result;
+import org.apache.eventmesh.dashboard.model.SubscriptionInfo;
+import org.apache.eventmesh.dashboard.service.SubscriptionService;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/api/v1")
+public class SubscriptionController {
+
+ @Autowired
+ SubscriptionService subscriptionService;
+
+ // the subscription dataId naming pattern of EventMesh clients: ip-protocol
+ private static final String CLIENT_DATA_ID_PATTERN = "*.*.*.*-*";
+
+ /**
+ * Retrieve the config content of a specified config.
+ *
+ * @param dataId nacos config data id (Exact Matching)
+ * @param group config group (Exact Matching)
+ * @return config content
+ */
+ @GetMapping("/subscription")
+ public Result retrieveSubscription(@RequestParam("dataId") String dataId, @RequestParam("group") String group) {
+ return Result.success(subscriptionService.retrieveConfig(dataId, group));
+ }
+
+ /**
+ * Retrieve a list of configs.
+ *
+ * @param page page number
+ * @param size page size
+ * @param dataId nacos config data id (Fuzzy Matching)
+ * @param group config group (Fuzzy Matching)
+ * @return config properties and base64 encoded config content
+ */
+ @GetMapping("/subscriptions")
+ public Result> listSubscriptions(
+ @RequestParam(name = "page", defaultValue = "1") Integer page,
+ @RequestParam(name = "size", defaultValue = "10") Integer size,
+ @RequestParam(name = "dataId", defaultValue = CLIENT_DATA_ID_PATTERN) String dataId,
+ @RequestParam(name = "group", defaultValue = "") String group) {
+ return Result.success(subscriptionService.retrieveConfigs(page, size, dataId, group));
+ }
+
+}
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/TopicController.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/TopicController.java
new file mode 100644
index 00000000..09d848c2
--- /dev/null
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/TopicController.java
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+package org.apache.eventmesh.dashboard.controller;
+
+import org.apache.eventmesh.dashboard.dto.CreateTopicRequest;
+import org.apache.eventmesh.dashboard.dto.DeleteTopicRequest;
+import org.apache.eventmesh.dashboard.dto.Result;
+import org.apache.eventmesh.dashboard.model.TopicProperties;
+import org.apache.eventmesh.dashboard.service.TopicService;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/topic")
+public class TopicController {
+
+ @Autowired
+ TopicService topicService;
+
+ /**
+ * TODO Is OPTIONS method and @CrossOrigin necessary?
+ */
+ @CrossOrigin
+ @RequestMapping(method = RequestMethod.OPTIONS)
+ public ResponseEntity