Compare commits

..

2 Commits

9 changed files with 102 additions and 184 deletions

View File

@@ -1,4 +1,4 @@
FROM jumpserver/lina-base:20251201_095403 AS stage-build FROM jumpserver/lina-base:20251105_092554 AS stage-build
ARG VERSION ARG VERSION
ENV VERSION=$VERSION ENV VERSION=$VERSION

View File

@@ -140,6 +140,5 @@
"src/**/*.{js,vue}": [ "src/**/*.{js,vue}": [
"eslint --fix" "eslint --fix"
] ]
}, }
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
} }

View File

@@ -62,6 +62,7 @@ import Dialog from '@/components/Dialog/index.vue'
import PasswordHistoryDialog from './PasswordHistoryDialog.vue' import PasswordHistoryDialog from './PasswordHistoryDialog.vue'
import { SecretViewerFormatter } from '@/components/Table/TableFormatters' import { SecretViewerFormatter } from '@/components/Table/TableFormatters'
import { encryptPassword } from '@/utils/secure' import { encryptPassword } from '@/utils/secure'
import { mapGetters } from 'vuex'
export default { export default {
name: 'ShowSecretInfo', name: 'ShowSecretInfo',
@@ -111,6 +112,9 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters({
publicSettings: 'publicSettings'
}),
secretTypeLabel() { secretTypeLabel() {
return this.account['secret_type'].label || 'Password' return this.account['secret_type'].label || 'Password'
}, },
@@ -146,7 +150,11 @@ export default {
}) })
}, },
showSecretDialog() { showSecretDialog() {
return this.$axios.get(this.url, { disableFlashErrorMsg: true }).then((res) => { if (!this.publicSettings.SECURITY_ACCOUNT_SECRET_READ) {
this.$message.warning(this.$tc('AccountSecretReadDisabled'))
return
}
return this.$axios.get(this.url).then((res) => {
this.secretInfo = res this.secretInfo = res
this.sshKeyFingerprint = res?.spec_info?.ssh_key_fingerprint || '-' this.sshKeyFingerprint = res?.spec_info?.ssh_key_fingerprint || '-'
this.showSecret = true this.showSecret = true

View File

@@ -38,6 +38,7 @@
<script> <script>
import { copy, downloadText } from '@/utils/common/index' import { copy, downloadText } from '@/utils/common/index'
import BaseFormatter from '@/components/Table/TableFormatters/base.vue' import BaseFormatter from '@/components/Table/TableFormatters/base.vue'
import { mapGetters } from 'vuex'
export default { export default {
name: 'SecretViewerFormatter', name: 'SecretViewerFormatter',
@@ -69,6 +70,9 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters({
publicSettings: 'publicSettings'
}),
hasShow: function() { hasShow: function() {
return this.formatterArgs.hasShow return this.formatterArgs.hasShow
}, },
@@ -140,6 +144,10 @@ export default {
}, },
methods: { methods: {
async getAccountSecret() { async getAccountSecret() {
if (!this.publicSettings.SECURITY_ACCOUNT_SECRET_READ) {
this.$message.warning(this.$tc('AccountSecretReadDisabled'))
return
}
if (this.formatterArgs.secretFrom === 'cellValue' || this.getIt) { if (this.formatterArgs.secretFrom === 'cellValue' || this.getIt) {
return return
} }

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free v5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z"/></svg>

Before

Width:  |  Height:  |  Size: 691 B

View File

@@ -123,16 +123,6 @@ export default {
permissions: ['authentication.view_connectiontoken'] permissions: ['authentication.view_connectiontoken']
} }
}, },
{
path: '/profile/access-token',
component: () => import('@/views/profile/AccessToken'),
name: 'AccessToken',
meta: {
title: i18n.t('AccessToken'),
icon: 'access-token',
permissions: ['oauth2_provider.view_accesstoken']
}
},
{ {
path: '/profile/preferences', path: '/profile/preferences',
name: 'Preferences', name: 'Preferences',

View File

@@ -77,7 +77,7 @@ export default {
[this.$tc('Platform'), 'platform'], [this.$tc('Platform'), 'platform'],
[this.$tc('Node'), 'node'], [this.$tc('Node'), 'node'],
[this.$tc('Protocol'), 'protocols'], [this.$tc('Protocol'), 'protocols'],
[this.$tc('Region'), 'region_name'] [this.$tc('Region'), 'region_id']
], ],
data: [] data: []
}, },
@@ -124,7 +124,7 @@ export default {
this.ws.onmessage = e => { this.ws.onmessage = e => {
const data = JSON.parse(e.data) const data = JSON.parse(e.data)
if (data.action === 'sync_region') { if (data.action === 'sync_region') {
this.addRegion(data.id, data.name) this.addRegion(data.region_id)
} else if (data.action === 'import') { } else if (data.action === 'import') {
data['@status'] = 'pending' data['@status'] = 'pending'
this.$refs.importTable.addTableItem(data) this.$refs.importTable.addTableItem(data)
@@ -140,10 +140,10 @@ export default {
} }
} }
}, },
addRegion(regionId, regionName) { addRegion(region) {
if (!this.alreadySync.includes(regionId)) { if (!this.alreadySync.includes(region)) {
this.alreadySync.push(regionId) this.alreadySync.push(region)
this.tip = `${this.$t('SyncRegion')}: ${regionName}` this.tip = `${this.$t('SyncRegion')}: ${this.alreadySync.at(-1)}`
} }
}, },
showResult() { showResult() {

View File

@@ -17,8 +17,6 @@ export const ucloud = 'ucloud'
export const volcengine = 'volcengine' export const volcengine = 'volcengine'
export const ctyun = 'ctyun'
export const qingcloud_private = 'qingcloud_private' export const qingcloud_private = 'qingcloud_private'
export const huaweicloud_private = 'huaweicloud_private' export const huaweicloud_private = 'huaweicloud_private'
export const ctyun_private = 'ctyun_private' export const ctyun_private = 'ctyun_private'
@@ -48,8 +46,7 @@ export const publicHostProviders = [
gcp, gcp,
ucloud, ucloud,
volcengine, volcengine,
smartx, smartx
ctyun
] ]
export const publicDBProviders = [aliyun] export const publicDBProviders = [aliyun]
@@ -144,12 +141,6 @@ export const ACCOUNT_PROVIDER_ATTRS_MAP = {
attrs: ['access_key_id', 'access_key_secret'], attrs: ['access_key_id', 'access_key_secret'],
image: require('@/assets/img/cloud/volcengine.svg') image: require('@/assets/img/cloud/volcengine.svg')
}, },
[ctyun]: {
name: ctyun,
title: i18n.t('CTYun'),
attrs: ['access_key_id', 'access_key_secret', 'project_id'],
image: require('@/assets/img/cloud/state.svg')
},
[vmware]: { [vmware]: {
name: vmware, name: vmware,
title: 'VMware', title: 'VMware',

View File

@@ -1,77 +0,0 @@
<template>
<GenericListPage
ref="GenericListTable"
:header-actions="headerActions"
:help-tip="helpMessage"
:table-config="tableConfig"
/>
</template>
<script>
import { GenericListPage } from '@/layout/components'
export default {
components: {
GenericListPage
},
data() {
const ajaxUrl = '/api/v1/authentication/access-tokens/'
return {
helpMessage: this.$t('AccessTokenTip'),
tableConfig: {
hasSelection: false,
url: ajaxUrl,
columns: [
'token_preview', 'scope', 'is_valid', 'expires', 'updated', 'created', 'actions'
],
columnsMeta: {
actions: {
prop: '',
formatterArgs: {
hasUpdate: false,
hasClone: false,
hasDelete: false,
extraActions: [
{
name: 'Revoke',
title: this.$t('Revoke'),
can: ({ row }) => this.$hasPerm('oauth2_provider.delete_accesstoken'),
type: 'info',
callback: function({ row }) {
this.$axios.delete(`${ajaxUrl}${row.id}/revoke/`,
).then(res => {
this.reloadTable()
this.$message.success(this.$tc('UpdateSuccessMsg'))
}).catch(error => {
this.$message.error(this.$tc('UpdateErrorMsg' + ' ' + error))
})
}.bind(this)
}
]
}
}
}
},
headerActions: {
hasLeftActions: false,
hasSearch: false,
hasRightActions: true,
hasRefresh: true,
hasExport: false,
hasImport: false,
hasBulkDelete: false,
hasCreate: false,
extraActions: []
}
}
},
methods: {
reloadTable() {
this.$refs.GenericListTable.reloadTable()
}
}
}
</script>
<style scoped>
</style>