Skip to content

Commit

Permalink
chore: add web and common ui
Browse files Browse the repository at this point in the history
  • Loading branch information
luohf-infinilabs committed Dec 2, 2024
1 parent 8be27cd commit ec253f9
Show file tree
Hide file tree
Showing 408 changed files with 5,670 additions and 118 deletions.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a bug report to help fix a problem with the INFINI Console
---

### Description

A description of what the bug is.

### Steps to reproduce

1. Start INFINI Console
2. Second step
3. Third step

### Expected behavior

A description of what you expected to happen.

### Actual behavior

A description of what happens instead.

### Environment

- Build: [e.g. console 0.8.1 959 2023-02-26 01:19:34 a6b44b6 - type "-v" in the Command Palette]
- Operating system and version: [e.g. macOS 10.14, Windows 10, Ubuntu 18.04]
- [Linux] Desktop Environment and/or Window Manager: [e.g. Gnome, LXDE, i3]
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement_or_feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Enhancement or feature request
about: Suggest an enhancement or feature for INFINI Console
---

### Problem description

A description of a problem, workflow or integration that your suggestion would solve.
If the problem is OS-specific, include that information here.

### Preferred solution

A description of what changes should be made to INFINI Console to solve the problem.

### Alternatives

A description of any alternative solutions or enhancements considered.

### Additional Information (optional)

If applicable, add screenshots to help demonstrate the problem or proposed solution.
Code examples or related links are useful, too.
104 changes: 104 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Build and Deploy Docs

on:
push:
branches:
- main
- 'v*'
tags:
- 'v*'

jobs:
build-deploy-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout Product Repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set Variables Based on Ref
id: vars
run: |
CURRENT_REF=${GITHUB_REF##*/}
if [[ "${GITHUB_REF_TYPE}" == "branch" ]]; then
if [[ "$CURRENT_REF" == "main" ]]; then
echo "VERSION=main" >> $GITHUB_ENV
echo "BRANCH=main" >> $GITHUB_ENV
else
echo "VERSION=$CURRENT_REF" >> $GITHUB_ENV
echo "BRANCH=$CURRENT_REF" >> $GITHUB_ENV
fi
elif [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
echo "VERSION=$CURRENT_REF" >> $GITHUB_ENV
echo "BRANCH=main" >> $GITHUB_ENV # Set BRANCH to 'main' for tags
fi
# Gather branches and tags, sort, remove duplicates
VERSIONS=$(git for-each-ref refs/remotes/origin refs/tags --format="%(refname:short)" | \
grep -E "^v[0-9.]+$" | sort -Vr | uniq | tr '\n' ',' | sed 's/,$//')
echo "VERSIONS=main,$VERSIONS" >> $GITHUB_ENV
- name: Install Hugo
run: |
wget https://github.com/gohugoio/hugo/releases/download/v0.79.1/hugo_extended_0.79.1_Linux-64bit.tar.gz
tar -xzvf hugo_extended_0.79.1_Linux-64bit.tar.gz
sudo mv hugo /usr/local/bin/
- name: Checkout Docs Repo
uses: actions/checkout@v2
with:
repository: infinilabs/docs
path: docs-output
token: ${{ secrets.DOCS_DEPLOYMENT_TOKEN }}

- name: Build Documentation
run: |
(cd docs && OUTPUT=$(pwd)/../docs-output make docs-build docs-place-redirect)
- name: Commit and Push Changes to Docs Repo
working-directory: docs-output
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
if [[ -n $(git status --porcelain) ]]; then
git add .
git commit -m "Rebuild docs for version $VERSION"
git push origin main
else
echo "No changes to commit."
fi
- name: Rebuild Docs for Latest Version (main), if not already on main
run: |
# Only rebuild the main branch docs if the current ref is not "main"
if [[ "$CURRENT_REF" != "main" ]]; then
echo "Switching to main branch and rebuilding docs for 'latest'"
# Checkout the main branch of the product repo to rebuild docs for "latest"
git checkout main
# Ensure the latest changes are pulled
git pull origin main
# Build Docs for Main Branch (latest)
(cd docs && OUTPUT=$(pwd)/../docs-output VERSION="main" BRANCH="main" make docs-build docs-place-redirect)
# Commit and Push Latest Docs to Main
cd docs-output
git config user.name "GitHub Actions"
git config user.email "[email protected]"
if [[ -n $(git status --porcelain) ]]; then
git add .
git commit -m "Rebuild docs for main branch with latest version"
git push origin main
else
echo "No changes to commit for main."
fi
else
echo "Current ref is 'main', skipping rebuild for 'latest'."
fi
working-directory: ./ # Working in the product repo
83 changes: 31 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,48 @@
IK Analysis for Elasticsearch and OpenSearch
INFINI Console
==================================

![](./assets/banner.png)
![](./docs/static/img/banner.png)

INFINI Console is Multi-cluster, corss-version unified Elasticsearch/OpenSearch/Easysearch governance platform.
**INFINI Console** is a very lightweight multi-cluster, cross-version unified Elasticsearch governance platform. Through the centralized management of Elasticsearch, you can quickly and conveniently manage multiple sets of Elasticsearch clusters within the enterprise.

## Backend Development Guide
## Architecture

```sh
make build
cd bin
./console
```
![](./docs/static/img/architecture.png)

Setup wizard please vistor https://docs.infinilabs.com/console/main/docs/reference/setup/
## Features

## Frontend Development Guide
> INFINI Console is powerful, lightweight, and very easy to use.
The frontend is developed using React and outputs pure static resources into the `.public` directory. These resources can be deployed independently without relying on a Node environment.
- Support multi-cluster management, you can manage any number of clusters at the same time in one platform;
- Multi-version Elasticsearch support, support 1.x, 2.x, 5.x, 6.x, 7.x, 8.x;
- Supports grouping and managing cluster metadata information on a project-by-project basis, support custom tags;
- Support dynamic clusters registration, and the target cluster can be accessed and managed on the fly;
- Supports viewing the historical version of cluster metadata, and can view the changes and audits of cluster metadata.
- Developer tools support multiple workspaces to switch quickly, support smart suggestion, frequent used commands support to save and load;
- Supports unified multi-cluster level index and API interface granularity permission control;
- Supports a unified alerting engine across clusters and flexibly configure alarm rules based on thresholds;
- Support unified monitoring of any version, including cluster, node, index and other very detailed dimensions of the metrics viewing and analysis;
- Support common management operations of indices, support quick viewing and browsing of indices, and support updates and deletes of documents in the index;
- Support the creation of indexed data views, you can modify the display format of fields, and support the quick viewing of time series index data;
- Support for cross-platform deployment environments, support for MacOS (Intel and M1), Windows (32-bit and 64-bit), Linux (32-bit and 64-bit);
- Support x86, arm5, arm6, arm7, mips, mipsle, mips64 and other CPU architectures:
- Support for Docker containers and K8s cloud-native environments;
- Support for the management of INFINI gateways;

### Local Development Environment Setup
INFINI Console is written in Golang, the installation package is very small, only about 11MB, there is no external environment dependency, deployment and installation are very simple, just need to download the binary executable file of the corresponding platform, start the application and then you are good to go.

Ensure you have Node.js (version 16.17 ) installed:
To learn more about Console, please visit: https://docs.infinilabs.com/console/

```sh
node -v
npm -v
```

you can install cnpm for a faster and more reliable package management experience. Use the following command to install it:

```sh
# clone console-ui
git clone https://github.com/infinilabs/console-ui.git
# clone common-ui
cd src
git clone https://github.com/infinilabs/common-ui.git common
# install [email protected]
npm install -g [email protected] --registry=https://registry.npm.taobao.org
```
### Download Project Dependencies
## Community

```sh
# install dependencies
cnpm install
```
Fell free to join the Discord server to discuss anything around this project:

### Start Development Mode
[https://discord.gg/4tKTMkkvVX](https://discord.gg/4tKTMkkvVX)

```sh
cnpm run dev
```

### Compile Static Resources

```sh
cnpm run build
```

Running this command will generate the final HTML, CSS, and JS files in the `.public` directory. These are browser-ready files that can be deployed to your desired server.

### Useful Links for Frontend Development

- Current UI components used: https://3x.ant.design/components/button/
- ProComponents: https://procomponents.ant.design/
- Chart components: https://charts.ant.design/guide
- Ant Design Pro Preview: https://preview.pro.ant.design
## License

INFINI Gateway is a truly open-source project, licensed under the [GNU Affero General Public License v3.0](https://opensource.org/licenses/AGPL-3.0).
We also offer a commercially supported, enterprise-ready version of the software.
For more details, please refer to our [license information](./LICENSE).
5 changes: 5 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/public/
.idea/
docs/config.bak
docs/resources/_gen
themes/
Empty file added docs/.hugo_build.lock
Empty file.
50 changes: 50 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
SHELL=/bin/bash

# Basic info
PRODUCT?= $(shell basename "$(shell cd .. && pwd)")
BRANCH?= main
VERSION?= $(shell [[ "$(BRANCH)" == "main" ]] && echo "main" || echo "$(BRANCH)")
CURRENT_VERSION?= $(VERSION)
VERSIONS?= "main"
OUTPUT?= "/tmp/docs"
THEME_FOLDER?= "themes/book"
THEME_REPO?= "https://github.com/infinilabs/docs-theme.git"
THEME_BRANCH?= "main"

.PHONY: docs-build

default: docs-build

docs-init:
@if [ ! -d $(THEME_FOLDER) ]; then echo "theme does not exist";(git clone -b $(THEME_BRANCH) $(THEME_REPO) $(THEME_FOLDER) ) fi

docs-env:
@echo "Debugging Variables:"
@echo "PRODUCT: $(PRODUCT)"
@echo "BRANCH: $(BRANCH)"
@echo "VERSION: $(VERSION)"
@echo "CURRENT_VERSION: $(CURRENT_VERSION)"
@echo "VERSIONS: $(VERSIONS)"
@echo "OUTPUT: $(OUTPUT)"

docs-config: docs-init
cp config.yaml config.bak
# Detect OS and apply the appropriate sed command
@if [ "$$(uname)" = "Darwin" ]; then \
echo "Running on macOS"; \
sed -i '' "s/BRANCH/$(VERSION)/g" config.yaml; \
else \
echo "Running on Linux"; \
sed -i 's/BRANCH/$(VERSION)/g' config.yaml; \
fi

docs-build: docs-config
hugo --minify --theme book --destination="$(OUTPUT)/$(PRODUCT)/$(VERSION)" \
--baseURL="/$(PRODUCT)/$(VERSION)"
@$(MAKE) docs-restore-generated-file

docs-place-redirect:
echo "<!DOCTYPE html> <html> <head> <meta http-equiv=refresh content=0;url=main /> </head> <body> <p><a href=main />REDIRECT TO THE LATEST_VERSION</a>.</p> </body> </html>" > $(OUTPUT)/$(PRODUCT)/index.html

docs-restore-generated-file:
mv config.bak config.yaml
6 changes: 6 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# INFINI Documentation

## Hugo v0.79.x extended version
- https://github.com/gohugoio/hugo/releases/download/v0.79.1/hugo_extended_0.79.1_Linux-64bit.tar.gz
- https://github.com/gohugoio/hugo/releases/download/v0.79.1/hugo_extended_0.79.1_Windows-64bit.zip
- https://github.com/gohugoio/hugo/releases/download/v0.79.1/hugo_extended_0.79.1_macOS-64bit.tar.gz
Loading

0 comments on commit ec253f9

Please sign in to comment.