Skip to content

Commit 0c5e84d

Browse files
authored
Merge pull request #5010 from jumpserver/dev
v4.10.0
2 parents 18a3f42 + 6063434 commit 0c5e84d

File tree

99 files changed

+2001
-963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2001
-963
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM jumpserver/lina-base:20250408_074136 AS stage-build
1+
FROM jumpserver/lina-base:20250508_085854 AS stage-build
22

33
ARG VERSION
44
ENV VERSION=$VERSION

package.json

Lines changed: 147 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -1,148 +1,149 @@
11
{
2-
"name": "lina",
3-
"version": "v4.0.0",
4-
"description": "JumpServer Web UI",
5-
"author": "JumpServer Team <support@lxware.hk>",
6-
"license": "GPL-3.0-or-later",
7-
"scripts": {
8-
"dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
9-
"serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
10-
"build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build",
11-
"build:prod": "vue-cli-service build",
12-
"build:stage": "vue-cli-service build --mode staging",
13-
"preview": "node build/index.js --preview",
14-
"lint": "eslint --ext .js,.vue src",
15-
"fix": "eslint --ext .js,.vue --fix src",
16-
"test:unit": "jest --clearCache && vue-cli-service test:unit",
17-
"test:ci": "npm run lint && npm run test:unit",
18-
"svgo": "svgo -f src/icons/svg --config=src/icas/svgo.yml",
19-
"vue-i18n-extract": "vue-i18n-extract",
20-
"vue-i18n-report": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json'",
21-
"vue-i18n-report-json": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json' -o /tmp/abc.json",
22-
"vue-i18n-report-add-miss": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json' -a",
23-
"diff-i18n": "python ./src/i18n/langs/i18n-util.py diff en ja zh_Hant",
24-
"apply-i18n": "python ./src/i18n/langs/i18n-util.py apply en ja zh_Hant"
25-
},
26-
"dependencies": {
27-
"@babel/plugin-proposal-optional-chaining": "^7.13.12",
28-
"@fontsource/open-sans": "^5.0.24",
29-
"@traptitech/markdown-it-katex": "^3.6.0",
30-
"@ztree/ztree_v3": "3.5.44",
31-
"axios": "0.28.0",
32-
"axios-retry": "^3.1.9",
33-
"caniuse-lite": "^1.0.30001642",
34-
"cron-parser": "^4.0.0",
35-
"crypto-js": "^4.1.1",
36-
"css-color-function": "^1.3.3",
37-
"decimal.js": "^10.4.3",
38-
"deepmerge": "^4.2.2",
39-
"dompurify": "^3.1.6",
40-
"echarts": "4.7.0",
41-
"element-ui": "2.15.14",
42-
"eslint-plugin-html": "^6.0.0",
43-
"highlight.js": "^11.9.0",
44-
"install": "^0.13.0",
45-
"jquery": "^3.6.1",
46-
"js-cookie": "2.2.0",
47-
"jsencrypt": "^3.2.1",
48-
"less": "^3.10.3",
49-
"less-loader": "^5.0.0",
50-
"lodash": "^4.17.21",
51-
"lodash.clonedeep": "^4.5.0",
52-
"lodash.frompairs": "^4.0.1",
53-
"lodash.get": "^4.4.2",
54-
"lodash.has": "^4.5.2",
55-
"lodash.includes": "^4.3.0",
56-
"lodash.isempty": "^4.4.0",
57-
"lodash.isequal": "^4.5.0",
58-
"lodash.isplainobject": "^4.0.6",
59-
"lodash.set": "^4.3.2",
60-
"lodash.topairs": "^4.3.0",
61-
"lodash.values": "^4.3.0",
62-
"markdown-it": "^13.0.2",
63-
"markdown-it-link-attributes": "^4.0.1",
64-
"moment": "^2.29.4",
65-
"moment-parseformat": "^4.0.0",
66-
"normalize.css": "7.0.0",
67-
"npm": "^7.8.0",
68-
"nprogress": "0.2.0",
69-
"path-to-regexp": "3.3.0",
70-
"v-sanitize": "^0.0.13",
71-
"vue": "2.6.10",
72-
"vue-codemirror": "4.0.6",
73-
"vue-cookie": "^1.1.4",
74-
"vue-echarts": "^5.0.0-beta.0",
75-
"vue-i18n": "^8.15.5",
76-
"vue-json-editor": "^1.4.3",
77-
"vue-markdown": "^2.2.4",
78-
"vue-moment": "^4.1.0",
79-
"vue-password-strength-meter": "^1.7.2",
80-
"vue-router": "3.0.6",
81-
"vue-select": "^3.9.5",
82-
"vuejs-logger": "^1.5.4",
83-
"vuex": "3.1.0",
84-
"watermark-js-plus": "^1.5.8",
85-
"xss": "^1.0.14",
86-
"xterm": "^4.5.0",
87-
"xterm-addon-fit": "^0.3.0",
88-
"zxcvbn": "^4.4.2"
89-
},
90-
"devDependencies": {
91-
"@babel/core": "7.18.6",
92-
"@babel/register": "7.0.0",
93-
"@vue/cli-plugin-babel": "3.6.0",
94-
"@vue/cli-plugin-eslint": "^3.9.1",
95-
"@vue/cli-plugin-unit-jest": "3.6.3",
96-
"@vue/cli-service": "3.6.0",
97-
"@vue/test-utils": "1.0.0-beta.29",
98-
"autoprefixer": "^9.5.1",
99-
"babel-core": "7.0.0-bridge.0",
100-
"babel-eslint": "10.0.1",
101-
"babel-jest": "23.6.0",
102-
"chalk": "2.4.2",
103-
"compression-webpack-plugin": "^6.1.1",
104-
"connect": "3.6.6",
105-
"deasync": "^0.1.29",
106-
"element-theme-chalk": "^2.13.1",
107-
"eslint": "^5.15.3",
108-
"eslint-plugin-vue": "5.2.2",
109-
"eslint-plugin-vue-i18n": "^0.3.0",
110-
"github-markdown-css": "^5.1.0",
111-
"html-webpack-plugin": "3.2.0",
112-
"husky": "^4.2.3",
113-
"less-loader": "^5.0.0",
114-
"lint-staged": "^10.1.2",
115-
"mockjs": "1.0.1-beta3",
116-
"runjs": "^4.3.2",
117-
"sass": "~1.32.6",
118-
"sass-loader": "^7.1.0",
119-
"script-ext-html-webpack-plugin": "2.1.3",
120-
"script-loader": "0.7.2",
121-
"serve-static": "^1.16.0",
122-
"strip-ansi": "^7.1.0",
123-
"svg-sprite-loader": "4.1.3",
124-
"svgo": "1.2.2",
125-
"vue-i18n-extract": "^1.1.1",
126-
"vue-template-compiler": "2.6.10"
127-
},
128-
"engines": {
129-
"node": ">=8.9",
130-
"npm": ">= 3.0.0"
131-
},
132-
"browserslist": [
133-
"> 1%",
134-
"last 4 versions",
135-
"ie 11"
136-
],
137-
"husky": {
138-
"hooks": {
139-
"pre-commit": "lint-staged"
140-
}
141-
},
142-
"lint-staged": {
143-
"src/**/*.{js,vue}": [
144-
"eslint --fix"
145-
]
146-
},
147-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
2+
"name": "lina",
3+
"version": "v4.0.0",
4+
"description": "JumpServer Web UI",
5+
"author": "JumpServer Team <support@lxware.hk>",
6+
"license": "GPL-3.0-or-later",
7+
"scripts": {
8+
"dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
9+
"serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
10+
"build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build",
11+
"build:prod": "vue-cli-service build",
12+
"build:stage": "vue-cli-service build --mode staging",
13+
"preview": "node build/index.js --preview",
14+
"lint": "eslint --ext .js,.vue src",
15+
"fix": "eslint --ext .js,.vue --fix src",
16+
"test:unit": "jest --clearCache && vue-cli-service test:unit",
17+
"test:ci": "npm run lint && npm run test:unit",
18+
"svgo": "svgo -f src/icons/svg --config=src/icas/svgo.yml",
19+
"vue-i18n-extract": "vue-i18n-extract",
20+
"vue-i18n-report": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json'",
21+
"vue-i18n-report-json": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json' -o /tmp/abc.json",
22+
"vue-i18n-report-add-miss": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json' -a",
23+
"diff-i18n": "python ./src/i18n/langs/i18n-util.py diff en ja zh_Hant",
24+
"apply-i18n": "python ./src/i18n/langs/i18n-util.py apply en ja zh_Hant"
25+
},
26+
"dependencies": {
27+
"@babel/plugin-proposal-optional-chaining": "^7.13.12",
28+
"@fontsource/open-sans": "^5.0.24",
29+
"@traptitech/markdown-it-katex": "^3.6.0",
30+
"@ztree/ztree_v3": "3.5.44",
31+
"axios": "0.28.0",
32+
"axios-retry": "^3.1.9",
33+
"caniuse-lite": "^1.0.30001642",
34+
"cron-parser": "^4.0.0",
35+
"crypto-js": "^4.1.1",
36+
"css-color-function": "^1.3.3",
37+
"decimal.js": "^10.4.3",
38+
"deepmerge": "^4.2.2",
39+
"dompurify": "^3.1.6",
40+
"echarts": "4.7.0",
41+
"element-ui": "2.15.14",
42+
"eslint-plugin-html": "^6.0.0",
43+
"highlight.js": "^11.9.0",
44+
"install": "^0.13.0",
45+
"jquery": "^3.6.1",
46+
"js-cookie": "2.2.0",
47+
"jsencrypt": "^3.2.1",
48+
"less": "^3.10.3",
49+
"less-loader": "^5.0.0",
50+
"lodash": "^4.17.21",
51+
"lodash.clonedeep": "^4.5.0",
52+
"lodash.frompairs": "^4.0.1",
53+
"lodash.get": "^4.4.2",
54+
"lodash.has": "^4.5.2",
55+
"lodash.includes": "^4.3.0",
56+
"lodash.isempty": "^4.4.0",
57+
"lodash.isequal": "^4.5.0",
58+
"lodash.isplainobject": "^4.0.6",
59+
"lodash.set": "^4.3.2",
60+
"lodash.topairs": "^4.3.0",
61+
"lodash.values": "^4.3.0",
62+
"markdown-it": "^13.0.2",
63+
"markdown-it-link-attributes": "^4.0.1",
64+
"moment": "^2.29.4",
65+
"moment-parseformat": "^4.0.0",
66+
"normalize.css": "7.0.0",
67+
"npm": "^7.8.0",
68+
"nprogress": "0.2.0",
69+
"path-to-regexp": "3.3.0",
70+
"sortablejs": "^1.15.6",
71+
"v-sanitize": "^0.0.13",
72+
"vue": "2.6.10",
73+
"vue-codemirror": "4.0.6",
74+
"vue-cookie": "^1.1.4",
75+
"vue-echarts": "^5.0.0-beta.0",
76+
"vue-i18n": "^8.15.5",
77+
"vue-json-editor": "^1.4.3",
78+
"vue-markdown": "^2.2.4",
79+
"vue-moment": "^4.1.0",
80+
"vue-password-strength-meter": "^1.7.2",
81+
"vue-router": "3.0.6",
82+
"vue-select": "^3.9.5",
83+
"vuejs-logger": "^1.5.4",
84+
"vuex": "3.1.0",
85+
"watermark-js-plus": "^1.5.8",
86+
"xss": "^1.0.14",
87+
"xterm": "^4.5.0",
88+
"xterm-addon-fit": "^0.3.0",
89+
"zxcvbn": "^4.4.2"
90+
},
91+
"devDependencies": {
92+
"@babel/core": "7.18.6",
93+
"@babel/register": "7.0.0",
94+
"@vue/cli-plugin-babel": "3.6.0",
95+
"@vue/cli-plugin-eslint": "^3.9.1",
96+
"@vue/cli-plugin-unit-jest": "3.6.3",
97+
"@vue/cli-service": "3.6.0",
98+
"@vue/test-utils": "1.0.0-beta.29",
99+
"autoprefixer": "^9.5.1",
100+
"babel-core": "7.0.0-bridge.0",
101+
"babel-eslint": "10.0.1",
102+
"babel-jest": "23.6.0",
103+
"chalk": "2.4.2",
104+
"compression-webpack-plugin": "^6.1.1",
105+
"connect": "3.6.6",
106+
"deasync": "^0.1.29",
107+
"element-theme-chalk": "^2.13.1",
108+
"eslint": "^5.15.3",
109+
"eslint-plugin-vue": "5.2.2",
110+
"eslint-plugin-vue-i18n": "^0.3.0",
111+
"github-markdown-css": "^5.1.0",
112+
"html-webpack-plugin": "3.2.0",
113+
"husky": "^4.2.3",
114+
"less-loader": "^5.0.0",
115+
"lint-staged": "^10.1.2",
116+
"mockjs": "1.0.1-beta3",
117+
"runjs": "^4.3.2",
118+
"sass": "~1.32.6",
119+
"sass-loader": "^7.1.0",
120+
"script-ext-html-webpack-plugin": "2.1.3",
121+
"script-loader": "0.7.2",
122+
"serve-static": "^1.16.0",
123+
"strip-ansi": "^7.1.0",
124+
"svg-sprite-loader": "4.1.3",
125+
"svgo": "1.2.2",
126+
"vue-i18n-extract": "^1.1.1",
127+
"vue-template-compiler": "2.6.10"
128+
},
129+
"engines": {
130+
"node": ">=8.9",
131+
"npm": ">= 3.0.0"
132+
},
133+
"browserslist": [
134+
"> 1%",
135+
"last 4 versions",
136+
"ie 11"
137+
],
138+
"husky": {
139+
"hooks": {
140+
"pre-commit": "lint-staged"
141+
}
142+
},
143+
"lint-staged": {
144+
"src/**/*.{js,vue}": [
145+
"eslint --fix"
146+
]
147+
},
148+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
148149
}

src/App.vue

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,48 @@ export default {
4444
}
4545
},
4646
methods: {
47+
getWaterMarkFields() {
48+
const user = this.currentUser
49+
const userId = user?.id || ''
50+
const name = user?.name || ''
51+
const userName = user?.username || ''
52+
const currentTime = this.$moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
53+
return { userId, name, userName, currentTime }
54+
},
55+
getWaterMarkContent() {
56+
const fields = this.getWaterMarkFields()
57+
const template = this.publicSettings.SECURITY_WATERMARK_CONSOLE_CONTENT || ''
58+
59+
// 找出模板中所有的变量占位符 ${xxx}
60+
const placeholders = template.match(/\${([^}]+)}/g) || []
61+
const allVariables = {}
62+
63+
// 为模板中的每个变量准备值
64+
placeholders.forEach(placeholder => {
65+
const varName = placeholder.slice(2, -1) // 提取变量名,去掉 ${ 和 }
66+
allVariables[varName] = fields[varName] !== undefined ? fields[varName] : 'N/A'
67+
})
68+
69+
// 合并用户现有的字段和模板中可能缺失的字段
70+
const safeFields = { ...fields, ...allVariables }
71+
72+
// 安全解析模板
73+
return new Function(...Object.keys(safeFields), `return \`${template}\`;`)(...Object.values(safeFields))
74+
},
75+
4776
createWatermark() {
48-
if (this.currentUser?.username && this.publicSettings?.SECURITY_WATERMARK_ENABLED) {
77+
if (this.currentUser?.username && this.publicSettings?.SECURITY_WATERMARK_ENABLED && this.$store.getters.hasValidLicense) {
4978
this.watermark = new Watermark({
50-
content: `${this.currentUser.username}(${this.currentUser.name})`,
51-
width: 200,
52-
height: 200,
53-
rotate: 45,
79+
content: this.getWaterMarkContent(),
80+
width: this.publicSettings?.SECURITY_WATERMARK_WIDTH,
81+
height: this.publicSettings?.SECURITY_WATERMARK_HEIGHT,
82+
rotate: this.publicSettings?.SECURITY_WATERMARK_ROTATE,
5483
fontWeight: 'normal',
55-
fontColor: 'rgba(128, 128, 128, 0.2)'
84+
fontSize: this.publicSettings?.SECURITY_WATERMARK_FONT_SIZE + 'px',
85+
fontColor: this.publicSettings?.SECURITY_WATERMARK_COLOR,
86+
contentType: 'multi-line-text',
87+
lineHeight: this.publicSettings?.SECURITY_WATERMARK_FONT_SIZE
5688
})
57-
5889
this.watermark.create()
5990
}
6091
}

src/api/asset.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export function getSystemUserList(data) {
1616
})
1717
}
1818

19-
export function getDomainList(data) {
19+
export function getZoneList(data) {
2020
return request({
21-
url: '/api/v1/assets/domains/',
21+
url: '/api/v1/assets/zones/',
2222
method: 'get',
2323
params: data
2424
})

0 commit comments

Comments
 (0)