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
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@babel/preset-react"
],
"plugins": [
["@babel/plugin-transform-private-property-in-object", { "loose": true }],
[
"@babel/plugin-transform-runtime",
{
Expand Down Expand Up @@ -72,4 +73,4 @@
]
}
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/buid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Setup node env and build
uses: actions/setup-node@v3
with:
node-version: 16.13
node-version: 18.20
cache: 'yarn'
cache-dependency-path: yarn.lock

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup node env and build
uses: actions/setup-node@v3
with:
node-version: 16.13
node-version: 18.20
cache: 'yarn'
cache-dependency-path: yarn.lock

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup node env and build
uses: actions/setup-node@v3
with:
node-version: 16.13
node-version: 18.20
cache: 'yarn'
cache-dependency-path: yarn.lock

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# $ docker run -d --name kc-console --restart=always --net=host -v /var/log/nginx:/var/log/nginx -v your_nginx_file:/etc/nginx/nginx.conf kc-console:latest

# Setp1. Build dist
FROM --platform=${BUILDPLATFORM} node:12-alpine AS builder
FROM --platform=${BUILDPLATFORM} node:18-alpine AS builder

COPY ./ /root/kc-console/
WORKDIR /root/kc-console
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ KubeClipper console is the web for [KubeClipper](https://github.com/kubeclipper/

#### Node.js

Console is written using Javascript. If you don't have a Node.js development environment, please [set it up](https://nodejs.org/en/download/). The minimum version required is `12.18`.
Console is written using Javascript. If you don't have a Node.js development environment, please [set it up](https://nodejs.org/en/download/). The minimum version required is `18.x`.

#### Yarn

We use [Yarn](https://yarnpkg.com/) to do package management. If you don't have yarn, use the following to install:

```
npm install -g yarn@1.22.4
npm install -g yarn@1.22.22
```

The minimum version required is `1.22.4`, but you can use a newer version.
The minimum version required is `1.22.22`, but you can use a newer version.

### Install dependencies

Expand Down
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash

echo "Add WorkLoad = $1"
ADD_WORKLOAD=${1:-false}
echo "Add WorkLoad = $ADD_WORKLOAD"

# 软件版本信息
BRANCH=$(git rev-parse --abbrev-ref HEAD)
COMMIT_REF=$(git rev-parse --verify HEAD)
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown-branch")
COMMIT_REF=$(git rev-parse --verify HEAD 2>/dev/null || echo "unknown-commit")
BUILD_TIME=$(date -u '+%Y-%m-%d/%I:%M:%S')
COMMIT_TIME=$(git show --pretty=format:"%ci %cr" | HEAD -1)
ADD_WORKLOAD=$1
COMMIT_TIME=$(git log -1 --format=%ai HEAD 2>/dev/null | sed 's/ /T/g' || echo "unknown-time")

yarn run build:run -- --env.BRANCH=$BRANCH --env.COMMIT_REF=$COMMIT_REF --env.BUILD_TIME=$BUILD_TIME --env.COMMIT_TIME=$COMMIT_TIME --env.ADD_WORKLOAD=$ADD_WORKLOAD
19 changes: 4 additions & 15 deletions config/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ const root = (path) => resolve(__dirname, `../${path}`);

const util = require('./util');
const { getConfig } = util;
const { devIp } = getConfig();
const { devIp, host, port } = getConfig();

module.exports = (env = {}) => {
const devServer = {
host: 'localhost',
port: 8089,
host: host || 'localhost',
port: port || 8089,
contentBase: root('dist'),
historyApiFallback: {
disableDotRule: true,
Expand All @@ -56,21 +56,10 @@ module.exports = (env = {}) => {
};

devServer.proxy = {
'/apis/cluster': {
target: `https://${devIp}`,
secure: false,
changeOrigin: true,
pathRewrite: {
'^/apis/cluster/': '/cluster-proxy/',
},
},
'/apis': {
target: `https://${devIp}`, //9节点 172.20.151.92:8099
target: devIp || 'http://localhost:8080',
secure: false,
changeOrigin: true,
pathRewrite: {
'^/apis': '/',
},
},
};

Expand Down
2 changes: 1 addition & 1 deletion docs/1-ready-to-work.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- node 环境

- package.json 中要求:`"node": ">=12"`
- package.json 中要求:`"node": ">=18"`
- 验证 nodejs 版本

```shell
Expand Down
2 changes: 1 addition & 1 deletion docs/4-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

- node.js 环境

- 中要求:`"node.js": ">=12"`
- 中要求:`"node.js": ">=18"`
- 验证 node.js 版本

```shell
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"start-with-workload": "npm run dev -- --env.ADD_WORKLOAD=true",
"build": "bash build.sh",
"build-with-args": "npm run build --",
"build:run": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=2048 webpack --progress --config config/webpack.prod.js",
"build_win": "set NODE_OPTIONS=--max-old-space-size=2048 && webpack --progress --config config/webpack.prod.js",
"build:test": "cross-env NODE_ENV=test NODE_OPTIONS=--max-old-space-size=2048 webpack --progress --config config/webpack.e2e.js",
"build:run": "cross-env NODE_ENV=production NODE_OPTIONS=\"--max-old-space-size=2048 --openssl-legacy-provider\" webpack --progress --config config/webpack.prod.js",
"build_win": "set NODE_OPTIONS=\"--max-old-space-size=2048 --openssl-legacy-provider\" && webpack --progress --config config/webpack.prod.js",
"build:test": "cross-env NODE_ENV=test NODE_OPTIONS=\"--max-old-space-size=2048 --openssl-legacy-provider\" webpack --progress --config config/webpack.e2e.js",
"i18n": "grunt",
"lint": "eslint src --fix --quiet --ext .js,.jsx",
"report:delete-json": "rm -rf cypress/results/* || true",
Expand Down Expand Up @@ -64,7 +64,7 @@
"babel-plugin-import": "^1.8.0",
"babel-plugin-istanbul": "^6.0.0",
"clean-webpack-plugin": "^1.0.0",
"compression-webpack-plugin": "5.0.1",
"compression-webpack-plugin": "6.1.1",
"conventional-changelog-cli": "^2.1.1",
"copy-webpack-plugin": "6.2.1",
"cross-env": "^7.0.3",
Expand All @@ -85,7 +85,7 @@
"husky": "^7.0.4",
"i18next-scanner": "2.9.2",
"istanbul-lib-coverage": "^3.0.0",
"jest": "^26.6.0",
"jest": "26.6.0",
"json-loader": "^0.5.7",
"less": "^3.8.1",
"less-loader": "^4.1.0",
Expand Down Expand Up @@ -181,7 +181,10 @@
"yarn": "^1.22.17"
},
"engines": {
"node": ">=12",
"node": ">=18",
"yarn": ">=1.22.4"
},
"resolutions": {
"cheerio": "1.0.0-rc.12"
}
}
Loading
Loading