mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-14 11:55:34 +00:00
Compare commits
19 Commits
v4.10.13-l
...
pr@dev@fea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
465eb45ff9 | ||
|
|
f258b47ba6 | ||
|
|
0a8ed3c4cc | ||
|
|
1cd1437357 | ||
|
|
ef2c72b80e | ||
|
|
cf3d2fff03 | ||
|
|
3221e44e69 | ||
|
|
65706509b1 | ||
|
|
3d668502e1 | ||
|
|
56e07c8568 | ||
|
|
c2f7a9e8e2 | ||
|
|
f0949f0e54 | ||
|
|
a165e45937 | ||
|
|
6350bdb42d | ||
|
|
4ecaee36f9 | ||
|
|
43e7e5cd74 | ||
|
|
4332dbcc1c | ||
|
|
a755b2ffa0 | ||
|
|
d391592778 |
@@ -140,5 +140,6 @@
|
|||||||
"src/**/*.{js,vue}": [
|
"src/**/*.{js,vue}": [
|
||||||
"eslint --fix"
|
"eslint --fix"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -167,54 +175,54 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.item-textarea ::v-deep .el-textarea__inner {
|
.item-textarea ::v-deep .el-textarea__inner {
|
||||||
height: 110px;
|
height: 110px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item {
|
||||||
|
border-bottom: 1px solid #EBEEF5;
|
||||||
|
padding: 5px 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item {
|
::v-deep .el-form-item__label {
|
||||||
border-bottom: 1px solid #EBEEF5;
|
display: flex;
|
||||||
padding: 5px 0;
|
align-items: center;
|
||||||
margin-bottom: 0;
|
justify-content: flex-start;
|
||||||
|
padding-right: 20px;
|
||||||
&:last-child {
|
line-height: 30px;
|
||||||
border-bottom: none;
|
word-break: keep-all;
|
||||||
}
|
overflow-wrap: break-word;
|
||||||
|
white-space: normal;
|
||||||
::v-deep .el-form-item__label {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
padding-right: 20px;
|
|
||||||
line-height: 30px;
|
|
||||||
word-break: keep-all;
|
|
||||||
overflow-wrap: break-word;
|
|
||||||
white-space: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .el-form-item__content {
|
|
||||||
line-height: 30px;
|
|
||||||
|
|
||||||
pre {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
::v-deep .el-form-item__content {
|
||||||
margin: 0;
|
line-height: 30px;
|
||||||
}
|
|
||||||
|
|
||||||
li {
|
pre {
|
||||||
display: block;
|
margin: 0;
|
||||||
font-size: 13px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
color: #303133;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
display: block;
|
||||||
|
font-size: 13px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
color: #303133;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -4,15 +4,11 @@
|
|||||||
<div class="panel-title">
|
<div class="panel-title">
|
||||||
<el-avatar :src="imageUrl" shape="square" />
|
<el-avatar :src="imageUrl" shape="square" />
|
||||||
<div class="title-display">
|
<div class="title-display">
|
||||||
<span class="name">{{ object.name }}</span>
|
<p class="name" :title="object.name">{{ object.name }}</p>
|
||||||
<span class="comment">{{ object.provider.label }}</span>
|
<span class="comment">{{ object.provider.label }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="iActions.length !== 0" class="panel-actions" @click="handleClick($event)">
|
||||||
v-if="iActions.length !== 0"
|
|
||||||
class="panel-actions"
|
|
||||||
@click="handleClick($event)"
|
|
||||||
>
|
|
||||||
<el-dropdown>
|
<el-dropdown>
|
||||||
<el-button size="mini">
|
<el-button size="mini">
|
||||||
<i class="el-icon-more el-icon--right" />
|
<i class="el-icon-more el-icon--right" />
|
||||||
@@ -64,21 +60,19 @@ export default {
|
|||||||
},
|
},
|
||||||
getImage: {
|
getImage: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: (obj) => ''
|
default: obj => ''
|
||||||
},
|
},
|
||||||
getInfos: {
|
getInfos: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: (obj) => []
|
default: obj => []
|
||||||
},
|
},
|
||||||
handleUpdate: {
|
handleUpdate: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => {
|
default: () => {}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onView: {
|
onView: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => {
|
default: () => {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -152,13 +146,13 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
div.info-panel {
|
div.info-panel {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
gap: 10px;
|
gap: unset;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
height: initial !important;
|
||||||
|
|
||||||
.panel-header {
|
.panel-header {
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
@@ -175,12 +169,22 @@ div.info-panel {
|
|||||||
|
|
||||||
.title-display {
|
.title-display {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-basis: 225px;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
text-align: left;
|
justify-content: center;
|
||||||
|
align-items: start;
|
||||||
|
max-width: 225px;
|
||||||
|
min-width: 0;
|
||||||
|
overflow-x: hidden;
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
color: #555555;
|
color: #555555;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
margin: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment {
|
.comment {
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
@@ -178,48 +186,48 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.content {
|
.content {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
//white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
font-size: 13px;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
flex: 1;
|
||||||
|
display: inline;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
//white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-left: 1px;
|
||||||
|
display: inline;
|
||||||
|
|
||||||
.text {
|
&.right {
|
||||||
flex: 1;
|
float: right;
|
||||||
display: inline;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.action {
|
.fa {
|
||||||
font-size: 13px;
|
margin-right: 5px;
|
||||||
cursor: pointer;
|
|
||||||
margin-left: 1px;
|
|
||||||
display: inline;
|
|
||||||
|
|
||||||
&.right {
|
&:hover {
|
||||||
float: right;
|
color: var(--color-primary);
|
||||||
}
|
|
||||||
|
|
||||||
.fa {
|
|
||||||
margin-right: 5px;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: var(--color-primary);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.edit-input ::v-deep input {
|
.edit-input ::v-deep input {
|
||||||
border-left: none;
|
border-left: none;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
border-top: none;
|
border-top: none;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
1
src/icons/svg/access-token.svg
Normal file
1
src/icons/svg/access-token.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 691 B |
@@ -123,6 +123,16 @@ 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',
|
||||||
|
|||||||
@@ -137,8 +137,8 @@ export default {
|
|||||||
getUrlQuery: true,
|
getUrlQuery: true,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
label: this.$t('TaskID'),
|
label: this.$t('ID'),
|
||||||
value: 'automation_id'
|
value: 'id'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('DisplayName'),
|
label: this.$t('DisplayName'),
|
||||||
|
|||||||
@@ -61,8 +61,11 @@ export default {
|
|||||||
},
|
},
|
||||||
callbacks: {
|
callbacks: {
|
||||||
change: function(val) {
|
change: function(val) {
|
||||||
|
const category = this.object.category.value
|
||||||
|
const normalizedCategory =
|
||||||
|
category === 'ds' ? 'directorie' : category
|
||||||
this.$axios.patch(
|
this.$axios.patch(
|
||||||
`/api/v1/assets/assets/${this.object.id}/`,
|
`/api/v1/assets/${normalizedCategory}s/${this.object.id}/`,
|
||||||
{ is_active: val }
|
{ is_active: val }
|
||||||
).then(res => {
|
).then(res => {
|
||||||
this.$message.success(this.$tc('UpdateSuccessMsg'))
|
this.$message.success(this.$tc('UpdateSuccessMsg'))
|
||||||
|
|||||||
@@ -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_id']
|
[this.$tc('Region'), 'region_name']
|
||||||
],
|
],
|
||||||
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.region_id)
|
this.addRegion(data.id, data.name)
|
||||||
} 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(region) {
|
addRegion(regionId, regionName) {
|
||||||
if (!this.alreadySync.includes(region)) {
|
if (!this.alreadySync.includes(regionId)) {
|
||||||
this.alreadySync.push(region)
|
this.alreadySync.push(regionId)
|
||||||
this.tip = `${this.$t('SyncRegion')}: ${this.alreadySync.at(-1)}`
|
this.tip = `${this.$t('SyncRegion')}: ${regionName}`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showResult() {
|
showResult() {
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ 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'
|
||||||
@@ -46,7 +48,8 @@ export const publicHostProviders = [
|
|||||||
gcp,
|
gcp,
|
||||||
ucloud,
|
ucloud,
|
||||||
volcengine,
|
volcengine,
|
||||||
smartx
|
smartx,
|
||||||
|
ctyun
|
||||||
]
|
]
|
||||||
|
|
||||||
export const publicDBProviders = [aliyun]
|
export const publicDBProviders = [aliyun]
|
||||||
@@ -141,6 +144,12 @@ 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',
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ export const UserAssetPermissionListPageSearchConfigOptions = [
|
|||||||
{ label: i18n.t('UserGroups'), value: 'user_group' },
|
{ label: i18n.t('UserGroups'), value: 'user_group' },
|
||||||
{ label: i18n.t('AssetName'), value: 'asset_name' },
|
{ label: i18n.t('AssetName'), value: 'asset_name' },
|
||||||
{ label: i18n.t('AssetAddress'), value: 'address' },
|
{ label: i18n.t('AssetAddress'), value: 'address' },
|
||||||
{ label: i18n.t('Account'), value: 'accounts' },
|
|
||||||
{
|
{
|
||||||
label: i18n.t('Valid'),
|
label: i18n.t('Valid'),
|
||||||
value: 'is_valid',
|
value: 'is_valid',
|
||||||
|
|||||||
77
src/views/profile/AccessToken.vue
Normal file
77
src/views/profile/AccessToken.vue
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<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>
|
||||||
@@ -96,7 +96,6 @@ export default {
|
|||||||
{
|
{
|
||||||
title: this.$t('FacialFeatures'),
|
title: this.$t('FacialFeatures'),
|
||||||
has: this.$store.getters.publicSettings.FACE_RECOGNITION_ENABLED &&
|
has: this.$store.getters.publicSettings.FACE_RECOGNITION_ENABLED &&
|
||||||
this.$store.getters.publicSettings.XPACK_LICENSE_EDITION_ULTIMATE &&
|
|
||||||
!store.getters.publicSettings['PRIVACY_MODE'],
|
!store.getters.publicSettings['PRIVACY_MODE'],
|
||||||
attrs: {
|
attrs: {
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
|
|||||||
@@ -1,36 +1,41 @@
|
|||||||
<template>
|
<template>
|
||||||
<Account
|
<TwoCol>
|
||||||
:url="url"
|
<template>
|
||||||
:columns-meta="columnsMeta"
|
<Account :url="url" :columns-meta="columnsMeta" :object.sync="object" />
|
||||||
:extra-quick-actions="quickActions"
|
</template>
|
||||||
:object.sync="object"
|
<template #right>
|
||||||
/>
|
<QuickActions :actions="quickActions" type="primary" />
|
||||||
|
</template>
|
||||||
|
</TwoCol>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { QuickActions } from '@/components'
|
||||||
import Account from '@/views/assets/Asset/AssetDetail/Account'
|
import Account from '@/views/assets/Asset/AssetDetail/Account'
|
||||||
|
import TwoCol from '@/layout/components/Page/TwoColPage.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Accounts',
|
name: 'Accounts',
|
||||||
components: {
|
components: {
|
||||||
Account
|
TwoCol,
|
||||||
|
Account,
|
||||||
|
QuickActions
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
object: {
|
object: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
name: {
|
name: {
|
||||||
formatter: (row) => <span>{row.name}</span>
|
formatter: row => <span>{row.name}</span>
|
||||||
},
|
},
|
||||||
asset: {
|
asset: {
|
||||||
label: this.$t('Asset'),
|
label: this.$t('Asset'),
|
||||||
formatter: (row) => <span>{row.asset.name}</span>
|
formatter: row => <span>{row.asset.name}</span>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
quickActions: [
|
quickActions: [
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default {
|
|||||||
'CAS_RENAME_ATTRIBUTES'
|
'CAS_RENAME_ATTRIBUTES'
|
||||||
]],
|
]],
|
||||||
[this.$t('Other'), [
|
[this.$t('Other'), [
|
||||||
'CAS_ORG_IDS', 'CAS_CREATE_USER', 'CAS_LOGOUT_COMPLETELY'
|
'CAS_ORG_IDS', 'CAS_LOGOUT_COMPLETELY'
|
||||||
]]
|
]]
|
||||||
],
|
],
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ export default {
|
|||||||
'GPT_BASE_URL',
|
'GPT_BASE_URL',
|
||||||
'GPT_API_KEY',
|
'GPT_API_KEY',
|
||||||
'GPT_PROXY',
|
'GPT_PROXY',
|
||||||
'GPT_MODEL'
|
'GPT_MODEL',
|
||||||
|
'CUSTOM_GPT_MODEL',
|
||||||
|
'CUSTOM_DEEPSEEK_MODEL'
|
||||||
],
|
],
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
CHAT_AI_TYPE: {
|
CHAT_AI_TYPE: {
|
||||||
@@ -115,6 +117,16 @@ export default {
|
|||||||
},
|
},
|
||||||
CHAT_AI_EMBED_URL: {
|
CHAT_AI_EMBED_URL: {
|
||||||
hidden: (formValue) => formValue.CHAT_AI_METHOD !== 'embed'
|
hidden: (formValue) => formValue.CHAT_AI_METHOD !== 'embed'
|
||||||
|
},
|
||||||
|
CUSTOM_GPT_MODEL: {
|
||||||
|
hidden: (formValue) => {
|
||||||
|
return formValue.CHAT_AI_METHOD !== 'api' || formValue.CHAT_AI_TYPE !== 'gpt' || formValue.GPT_MODEL !== 'custom'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
CUSTOM_DEEPSEEK_MODEL: {
|
||||||
|
hidden: (formValue) => {
|
||||||
|
return formValue.CHAT_AI_METHOD !== 'api' || formValue.CHAT_AI_TYPE !== 'deep-seek' || formValue.DEEPSEEK_MODEL !== 'custom'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
submitMethod() {
|
submitMethod() {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
:create-drawer="createDrawer"
|
:create-drawer="createDrawer"
|
||||||
:detail-drawer="detailDrawer"
|
:detail-drawer="detailDrawer"
|
||||||
:header-actions="iTicketAction"
|
:header-actions="iTicketAction"
|
||||||
|
:quick-filters="quickFilters"
|
||||||
:table-config="ticketTableConfig"
|
:table-config="ticketTableConfig"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -41,6 +42,72 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
getDrawerTitle: () => ' ',
|
getDrawerTitle: () => ' ',
|
||||||
createDrawer: () => import('@/views/tickets/RequestAssetPerm/CreateUpdate'),
|
createDrawer: () => import('@/views/tickets/RequestAssetPerm/CreateUpdate'),
|
||||||
|
quickFilters: [
|
||||||
|
{
|
||||||
|
label: this.$t('Type'),
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: this.$t('ApplyAsset'),
|
||||||
|
filter: {
|
||||||
|
type: 'apply_asset'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('LoginConfirm'),
|
||||||
|
filter: {
|
||||||
|
type: 'login_confirm'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('CommandConfirm'),
|
||||||
|
filter: {
|
||||||
|
type: 'command_confirm'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('LoginAssetConfirm'),
|
||||||
|
filter: {
|
||||||
|
type: 'login_asset_confirm'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('Action'),
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: this.$t('All'),
|
||||||
|
filter: {
|
||||||
|
state: 'all'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('Open'),
|
||||||
|
filter: {
|
||||||
|
state: 'pending'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('Cancel'),
|
||||||
|
filter: {
|
||||||
|
state: 'closed'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('Approved'),
|
||||||
|
filter: {
|
||||||
|
state: 'approved'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('Rejected'),
|
||||||
|
filter: {
|
||||||
|
state: 'rejected'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
detailDrawer: null,
|
detailDrawer: null,
|
||||||
ticketTableConfig: {
|
ticketTableConfig: {
|
||||||
url: this.url,
|
url: this.url,
|
||||||
@@ -142,7 +209,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
defaultTicketActions: {
|
defaultTicketActions: {
|
||||||
hasExport: false,
|
hasImport: false,
|
||||||
hasMoreActions: false,
|
hasMoreActions: false,
|
||||||
hasLeftActions: true,
|
hasLeftActions: true,
|
||||||
canCreate: this.$hasPerm('tickets.view_ticket'),
|
canCreate: this.$hasPerm('tickets.view_ticket'),
|
||||||
@@ -189,10 +256,6 @@ export default {
|
|||||||
value: 'relevant_asset',
|
value: 'relevant_asset',
|
||||||
label: this.$t('RelevantAsset')
|
label: this.$t('RelevantAsset')
|
||||||
},
|
},
|
||||||
{
|
|
||||||
value: 'relevant_system_user',
|
|
||||||
label: this.$t('RelevantCommand')
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
value: 'relevant_command',
|
value: 'relevant_command',
|
||||||
label: this.$t('ApplyRunCommand')
|
label: this.$t('ApplyRunCommand')
|
||||||
|
|||||||
Reference in New Issue
Block a user