Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ yurt-dashboard is the web console for OpenYurt Novice Trial Platform.

## Documentation

- [x] [OpenYurt Experience Center overall introduction](https://openyurt.io/docs/next/installation/openyurt-experience-center/overview)
- [x] [OpenYurt overall introduction](https://openyurt.io/docs/next/installation/openyurt-experience-center/overview)
- [x] [How to create an account in the experience center and get an out-of-box OpenYurt cluster](https://openyurt.io/docs/next/installation/openyurt-experience-center/user)
- [x] [How to join an user's node to the cluster and quickly deploy an app with one click](https://openyurt.io/docs/next/installation/openyurt-experience-center/web_console)
- [x] [How to use `kubeconfig` to experience OpenYurt capabilities](https://openyurt.io/docs/next/installation/openyurt-experience-center/kubeconfig)
Expand Down
2 changes: 1 addition & 1 deletion backend/proxy_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func main() {
setAPIGroup(router)

// Start and run the server
if err := router.Run(":80"); err != nil {
if err := router.Run(":4000"); err != nil {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the exposed port has been changed. The declaration in yaml should also be changed

logger.Error("server", "start", "Failed to start server: "+err.Error())
panic("gin server fail to start")
}
Expand Down
2 changes: 1 addition & 1 deletion charts/yurt-dashboard/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
imagePullPolicy: {{ .Values.dashboard.image.pullPolicy }}
ports:
- name: http
containerPort: 80
containerPort: 4000
protocol: TCP
env:
- name: SHOW_GUIDE_PAGE
Expand Down
85 changes: 85 additions & 0 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
jest: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
'plugin:import/recommended',
'prettier',
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react', 'react-hooks', 'jsx-a11y', 'import'],
settings: {
react: {
version: '17.0.2', // Specify your React version here
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx'],
},
},
},
rules: {
'no-console': 'warn',
'no-unused-vars': 'warn',
'no-undef': 'error',
'no-var': 'error',
'prefer-const': 'error',

'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
'react/jsx-key': 'error',
'react/jsx-no-target-blank': 'error',
'react/no-deprecated': 'error',

'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',

'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['hrefLeft', 'hrefRight'],
aspects: ['invalidHref', 'preferButton'],
},
],

'import/no-unresolved': 'error',
'import/named': 'error',
'import/namespace': 'error',
'import/default': 'error',
'import/export': 'error',
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
overrides: [
{
files: ['**/*.test.js', '**/*.test.jsx'],
env: {
jest: true,
},
},
],
};
90 changes: 0 additions & 90 deletions frontend/.eslintrc.js

This file was deleted.

30 changes: 30 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Environment variables
.env.local
.env.development.local
.env.test.local
.env.production.local
88 changes: 65 additions & 23 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,82 @@
# Getting Started
# OpenYurt

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This is the frontend application for the OpenYurt, built with Vite + React.

## Available Scripts
## Features

In the project directory, you can run:
- Modern development environment with Vite
- React 18 with hooks
- Ant Design for UI components
- React Router v6 for routing
- Lingui for internationalization
- TypeScript support

### `npm start`
## Getting Started

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
### Prerequisites

The page will reload if you make edits.\
You will also see any lint errors in the console.
- Node.js 16.x or later
- npm 7.x or later

### `npm test`
### Installation

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
1. Clone the repository
2. Install dependencies:
```bash
npm install
```

### `npm run build`
### Development

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
To start the development server:

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
```bash
npm run dev
```

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
The application will be available at http://localhost:3000.

### `npm run eject`
### Building for Production

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
To build the application for production:

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
```bash
npm run build
```

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
The built files will be in the `dist` directory.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
### Linting and Formatting

To check for linting errors:

```bash
npm run lint
```

To format the code:

```bash
npm run format
```

## Project Structure

```
src/
├── assets/ # Static assets
├── components/ # React components
├── constants/ # Constants and configuration
├── utils/ # Utility functions
├── locales/ # Internationalization files
├── App.jsx # Main application component
└── main.jsx # Application entry point
```

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
16 changes: 16 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/OpenYurt.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OpenYurt</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>

</html>
12 changes: 12 additions & 0 deletions frontend/lingui.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

export default {
locales: ['en', 'zh'],
sourceLocale: 'en',
catalogs: [
{
path: '<rootDir>/src/locales/{locale}/messages',
include: ['src'],
},
],
compileNamespace: 'es'
};
Loading
Loading