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
8 changes: 6 additions & 2 deletions src/components/Apps/ManyJsonTabs/AssetJsonTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<script>
import { DrawerListTable as ListTable } from '@/components'
import { toM2MJsonParams } from '@/utils/jms/index'
import { toM2MInstanceJsonParams } from '@/utils/jms/index'
import { DetailFormatter } from '@/components/Table/TableFormatters'
import TwoCol from '@/layout/components/Page/TwoColPage.vue'

Expand All @@ -21,10 +21,14 @@ export default {
type: Object,
default: () => {
}
},
objectAppModel: {
type: String,
default: ''
}
},
data() {
const [key, value] = toM2MJsonParams(this.object.assets)
const [key, value] = toM2MInstanceJsonParams(this.objectAppModel, this.object.id)
const org_id = this.object.org_id || this.$store.getters.currentOrg.id
return {
config: {
Expand Down
8 changes: 6 additions & 2 deletions src/components/Apps/ManyJsonTabs/UserJsonTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<script>
import { DrawerListTable as ListTable } from '@/components'
import { toM2MJsonParams } from '@/utils/jms/index'
import { toM2MInstanceJsonParams } from '@/utils/jms/index'
import TwoCol from '@/layout/components/Page/TwoColPage.vue'
import { DetailFormatter } from '@/components/Table/TableFormatters'

Expand All @@ -21,10 +21,14 @@ export default {
type: Object,
default: () => {
}
},
objectAppModel: {
type: String,
default: ''
}
},
data() {
const [key, value] = toM2MJsonParams(this.object.users)
const [key, value] = toM2MInstanceJsonParams(this.objectAppModel, this.object.id)
const org_id = this.object.org_id || this.$store.getters.currentOrg.id
return {
config: {
Expand Down
11 changes: 11 additions & 0 deletions src/utils/jms/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,17 @@
return ['attr_rules', encodeURIComponent(btoa(String.fromCharCode(...data)))]
}

export function toM2MInstanceJsonParams(instanceAppModel, instanceId) {
const encoder = new TextEncoder()
const [instanceApp, instanceModel] = instanceAppModel.split('.')
const data = encoder.encode(JSON.stringify({
'app': instanceApp,
'model': instanceModel,
'id': instanceId
}))
return ['attr_rules_instance', encodeURIComponent(btoa(String.fromCharCode(...data)))]

Check warning on line 189 in src/utils/jms/index.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `String.fromCodePoint()` over `String.fromCharCode()`.

See more on https://sonarcloud.io/project/issues?id=jumpserver_lina&issues=AZ13QvXuO6YgXYsHdyqC&open=AZ13QvXuO6YgXYsHdyqC&pullRequest=5359
}

export function IsSupportPauseSessionType(terminalType) {
const supportedType = ['koko', 'lion', 'chen', 'kael']
return supportedType.includes(terminalType)
Expand Down
2 changes: 1 addition & 1 deletion src/views/acls/AssetLoginACL/AssetLoginAclDetail/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<GenericDetailPage :active-menu.sync="config.activeMenu" :object.sync="instance" v-bind="config" v-on="$listeners">
<keep-alive>
<component :is="config.activeMenu" :object="instance" />
<component :is="config.activeMenu" :object="instance" object-app-model="acls.LoginAssetACL" />
</keep-alive>
</GenericDetailPage>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
v-on="$listeners"
>
<keep-alive>
<component :is="config.activeMenu" :object="CommandFilterACL" />
<component :is="config.activeMenu" :object="CommandFilterACL" object-app-model="acls.CommandFilterACL" />
</keep-alive>
</GenericDetailPage>
</template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<GenericDetailPage :active-menu.sync="config.activeMenu" :object.sync="TaskDetail" v-bind="config" v-on="$listeners">
<keep-alive>
<component :is="config.activeMenu" :object="TaskDetail" />
<component :is="config.activeMenu" :object="TaskDetail" object-app-model="acls.ConnectMethodACL" />
</keep-alive>
</GenericDetailPage>
</template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<GenericDetailPage :active-menu.sync="config.activeMenu" :object.sync="instance" v-bind="config" v-on="$listeners">
<keep-alive>
<component :is="config.activeMenu" :object="instance" />
<component :is="config.activeMenu" :object="instance" object-app-model="acls.DataMaskingRule" />
</keep-alive>
</GenericDetailPage>
</template>
Expand Down
Loading