Skip to content

Commit 18a3f42

Browse files
authored
Merge pull request #4972 from jumpserver/dev
v4.9.0
2 parents 68030d9 + 42e9fac commit 18a3f42

File tree

88 files changed

+1266
-686
lines changed

Some content is hidden

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

88 files changed

+1266
-686
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:20240723_084702 AS stage-build
1+
FROM jumpserver/lina-base:20250408_074136 AS stage-build
22

33
ARG VERSION
44
ENV VERSION=$VERSION

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "lina",
33
"version": "v4.0.0",
44
"description": "JumpServer Web UI",
5-
"author": "JumpServer Team <support@fit2cloud.com>",
5+
"author": "JumpServer Team <support@lxware.hk>",
66
"license": "GPL-3.0-or-later",
77
"scripts": {
88
"dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
@@ -81,6 +81,7 @@
8181
"vue-select": "^3.9.5",
8282
"vuejs-logger": "^1.5.4",
8383
"vuex": "3.1.0",
84+
"watermark-js-plus": "^1.5.8",
8485
"xss": "^1.0.14",
8586
"xterm": "^4.5.0",
8687
"xterm-addon-fit": "^0.3.0",
@@ -94,7 +95,6 @@
9495
"@vue/cli-plugin-unit-jest": "3.6.3",
9596
"@vue/cli-service": "3.6.0",
9697
"@vue/test-utils": "1.0.0-beta.29",
97-
"@vue/runtime-dom": "3.5.13",
9898
"autoprefixer": "^9.5.1",
9999
"babel-core": "7.0.0-bridge.0",
100100
"babel-eslint": "10.0.1",
@@ -121,7 +121,7 @@
121121
"serve-static": "^1.16.0",
122122
"strip-ansi": "^7.1.0",
123123
"svg-sprite-loader": "4.1.3",
124-
"svgo": "1.2.4",
124+
"svgo": "1.2.2",
125125
"vue-i18n-extract": "^1.1.1",
126126
"vue-template-compiler": "2.6.10"
127127
},
@@ -143,5 +143,6 @@
143143
"src/**/*.{js,vue}": [
144144
"eslint --fix"
145145
]
146-
}
146+
},
147+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
147148
}

src/App.vue

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,59 @@
55
</template>
66

77
<script>
8-
import { mapState } from 'vuex'
8+
import { mapState, mapGetters } from 'vuex'
9+
import { Watermark } from 'watermark-js-plus'
910
1011
export default {
1112
name: 'App',
13+
data() {
14+
return {
15+
watermark: null
16+
}
17+
},
1218
computed: {
1319
...mapState({
1420
isRouterAlive: state => state.common.isRouterAlive
21+
}),
22+
...mapGetters({
23+
currentUser: 'currentUser',
24+
publicSettings: 'publicSettings'
1525
})
26+
},
27+
watch: {
28+
currentUser: {
29+
handler(newVal) {
30+
this.createWatermark()
31+
}
32+
},
33+
'publicSettings.SECURITY_WATERMARK_ENABLED': {
34+
handler(newVal) {
35+
if (!newVal) {
36+
return setTimeout(() => {
37+
this.watermark?.destroy()
38+
this.watermark = null
39+
})
40+
}
41+
42+
this.createWatermark()
43+
}
44+
}
45+
},
46+
methods: {
47+
createWatermark() {
48+
if (this.currentUser?.username && this.publicSettings?.SECURITY_WATERMARK_ENABLED) {
49+
this.watermark = new Watermark({
50+
content: `${this.currentUser.username}(${this.currentUser.name})`,
51+
width: 200,
52+
height: 200,
53+
rotate: 45,
54+
fontWeight: 'normal',
55+
fontColor: 'rgba(128, 128, 128, 0.2)'
56+
})
57+
58+
this.watermark.create()
59+
}
60+
}
1661
}
1762
}
1863
</script>

src/assets/img/icons/general.png

385 Bytes
Loading

src/assets/img/icons/other.png

677 Bytes
Loading

src/assets/img/icons/windows_ad.png

2.32 KB
Loading

src/components/Apps/AccountCreateUpdateForm/const.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ import AutomationParamsForm from '@/views/assets/Platform/AutomationParamsSettin
66
export const accountFieldsMeta = (vm) => {
77
const defaultPrivilegedAccounts = ['root', 'administrator']
88

9+
function onPrivilegedUser(value, updateForm) {
10+
const maybePrivileged = defaultPrivilegedAccounts.includes(value)
11+
if (maybePrivileged) {
12+
updateForm({ privileged: true, secret_reset: false, push_now: false })
13+
}
14+
}
15+
916
return {
1017
assets: {
1118
component: Select2,
@@ -70,11 +77,8 @@ export const accountFieldsMeta = (vm) => {
7077
if (!vm.account?.name) {
7178
updateForm({ username: value })
7279
}
73-
const maybePrivileged = defaultPrivilegedAccounts.includes(value)
74-
if (maybePrivileged) {
75-
updateForm({ privileged: true })
76-
}
7780
}
81+
onPrivilegedUser(value, updateForm)
7882
}
7983
},
8084
hidden: () => {
@@ -92,10 +96,7 @@ export const accountFieldsMeta = (vm) => {
9296
vm.usernameChanged = true
9397
},
9498
change: ([value], updateForm) => {
95-
const maybePrivileged = defaultPrivilegedAccounts.includes(value)
96-
if (maybePrivileged) {
97-
updateForm({ privileged: true })
98-
}
99+
onPrivilegedUser(value, updateForm)
99100
}
100101
},
101102
hidden: () => {

src/components/Apps/AccountListTable/AccountList.vue

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
<script>
5353
import { mapGetters } from 'vuex'
54-
import { accountOtherActions, accountQuickFilters, connectivityMeta } from './const'
54+
import { accountOtherActions, accountQuickFilters, connectivityMeta, isDirectoryServiceAccount } from './const'
5555
import { openTaskPage } from '@/utils/jms'
5656
import {
5757
AccountConnectFormatter,
@@ -182,13 +182,21 @@ export default {
182182
},
183183
columnsMeta: {
184184
name: {
185-
width: '120px',
185+
minWidth: '60px',
186186
formatterArgs: {
187187
can: () => vm.$hasPerm('accounts.view_account'),
188188
getRoute: ({ row }) => ({
189189
name: 'AccountDetail',
190190
params: { id: row.id }
191191
}),
192+
getTitle: ({ row }) => {
193+
let title = row.name
194+
if (row.ds && this.asset && this.asset.id !== row.asset.id) {
195+
const dsID = row.ds.id.split('-')[0]
196+
title = `${row.name}@${dsID}`
197+
}
198+
return title
199+
},
192200
getDrawerTitle({ row }) {
193201
return `${row.username}@${row.asset.name}`
194202
}
@@ -208,15 +216,19 @@ export default {
208216
width: '80px',
209217
formatter: AccountConnectFormatter,
210218
formatterArgs: {
211-
buttonIcon: 'fa fa-desktop',
212-
url: '/api/v1/assets/assets/{id}',
213-
can: () => this.currentUserIsSuperAdmin,
214-
connectUrlTemplate: (row) => `/luna/pam_connect/${row.id}/${row.username}/${row.asset.id}/${row.asset.name}/`,
215-
setMapItem: (id, protocol) => {
216-
this.$store.commit('table/SET_PROTOCOL_MAP_ITEM', {
217-
key: id,
218-
value: protocol
219-
})
219+
asset: this.asset,
220+
can: ({ row }) => {
221+
return this.currentUserIsSuperAdmin
222+
}
223+
}
224+
},
225+
ds: {
226+
width: '100px',
227+
formatter: (row) => {
228+
if (row.ds && row.ds['domain_name']) {
229+
return row.ds['domain_name']
230+
} else {
231+
return ''
220232
}
221233
}
222234
},
@@ -229,12 +241,20 @@ export default {
229241
}
230242
},
231243
asset: {
244+
minWidth: '100px',
232245
formatter: function(row) {
233246
return row.asset.name
234247
}
235248
},
236249
username: {
237-
width: '120px'
250+
minWidth: '60px',
251+
formatter: function(row) {
252+
if (row.ds && row.ds['domain_name']) {
253+
return `${row.username}@${row.ds['domain_name']}`
254+
} else {
255+
return row.username
256+
}
257+
}
238258
},
239259
secret_type: {
240260
formatter: function(row) {
@@ -264,10 +284,15 @@ export default {
264284
formatter: ActionsFormatter,
265285
has: this.showActions,
266286
formatterArgs: {
287+
performDelete: ({ row }) => {
288+
const id = row.id
289+
const url = `/api/v1/accounts/accounts/${id}/`
290+
return this.$axios.delete(url)
291+
},
267292
hasUpdate: false, // can set function(row, value)
268293
hasDelete: true, // can set function(row, value)
269294
hasClone: false,
270-
canDelete: () => vm.$hasPerm('accounts.delete_account'),
295+
canDelete: ({ row }) => vm.$hasPerm('accounts.delete_account') && !isDirectoryServiceAccount(row, this),
271296
moreActionsTitle: this.$t('More'),
272297
extraActions: accountOtherActions(this)
273298
}

0 commit comments

Comments
 (0)