Compare commits

...

17 Commits

Author SHA1 Message Date
“huailei000”
8697ea629d fix: 修复概览页路由跳转权限判断问题 2022-04-11 15:22:15 +08:00
feng626
cd520c7b95 fix: 修复消息订阅无法更新bug 2022-04-08 16:07:02 +08:00
“huailei000”
3ac7c04ff0 fix: 修复终端管理-批量更新弹窗不显示label问题 2022-04-08 15:22:22 +08:00
feng626
521e33adff fix: 修改系统用户类型 2022-04-06 14:24:50 +08:00
ibuler
9926065ab0 perf: 优化 data action 高度 2022-04-02 15:55:20 +08:00
“huailei000”
68fb4b4e99 fix:修复资产列表-从节点移除 权限位不准确问题 2022-03-25 14:43:09 +08:00
feng626
43badfa0b3 fix: user org perm 2022-03-22 16:58:34 +08:00
“huailei000”
d3cfcbf71f fix: 修复系统用户-资产列表按钮权限不准确问题 2022-03-21 19:24:19 +08:00
feng626
89141636a2 Merge pull request #1600 from jumpserver/pr@v2.20@asset_user_perm
fix: 修复资产详情中授权用户可查看用户权限
2022-03-21 11:16:26 +08:00
feng626
085789f6c5 fix: 修复资产详情中授权用户可查看用户权限 2022-03-21 10:58:42 +08:00
Jiangjie.Bai
0f47f99786 fix: 从节点移除资产权限位修改 2022-03-18 17:11:20 +08:00
Jiangjie.Bai
a549f3f81f fix: 修复资产详情系统用户页面权限控制 2022-03-18 16:54:08 +08:00
Jiangjie.Bai
3b54ad8b00 fix: 修复工单中会话卡片按钮的权限控制 2022-03-18 16:40:51 +08:00
Jiangjie.Bai
e5e976e007 fix: 修复角色更新、删除权限控制 2022-03-18 14:52:53 +08:00
ibuler
ad4ddcd1c0 perf: 优化 form label 位置 2022-03-17 20:31:26 +08:00
ibuler
944aba8b26 perf: 优化详情中btn 2022-03-17 19:52:41 +08:00
ibuler
36d8e8cca6 perf: 优化移动端显示 2022-03-17 19:46:58 +08:00
19 changed files with 75 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div :class="grouped ? 'el-button-group' : 'el-button-ungroup'">
<div :class="grouped ? 'el-button-group' : 'el-button-ungroup'" style="display: flex">
<template v-for="action in iActions">
<el-dropdown
v-if="action.dropdown"
@@ -13,7 +13,7 @@
<el-button :size="size" v-bind="cleanButtonAction(action)">
{{ action.title }}<i class="el-icon-arrow-down el-icon--right" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-menu slot="dropdown" style="overflow: auto;max-height: 60vh">
<template v-for="option in action.dropdown">
<div v-if="option.group" :key="'group:'+option.name" class="dropdown-menu-title" style="width:130px">
{{ option.group }}

View File

@@ -1,9 +1,10 @@
<template>
<ElFormRender
ref="form"
:class="mobile? 'mobile' : 'desktop'"
:content="fields"
:form="basicForm"
label-position="right"
:label-position="labelPosition"
label-width="20%"
v-bind="$attrs"
v-on="$listeners"
@@ -68,6 +69,14 @@ export default {
basicForm: this.form
}
},
computed: {
mobile() {
return this.$store.state.app.device === 'mobile'
},
labelPosition() {
return this.mobile ? 'top' : 'right'
}
},
methods: {
// 获取表单数据
submitForm(formName, addContinue) {
@@ -99,27 +108,35 @@ export default {
</script>
<style lang="less" scoped>
.el-form ::v-deep .el-form-item {
.el-form ::v-deep .el-form-item {
margin-bottom: 12px;
}
.el-form ::v-deep .el-form-item__content {
.el-form ::v-deep .el-form-item__content {
width: 75%;
}
.el-form ::v-deep .el-form-item__label {
.mobile.el-form ::v-deep .el-form-item__content {
width: 100%;
}
.el-form ::v-deep .el-form-item__label {
padding: 0 30px 0 0;
}
.el-form ::v-deep .el-form-item__error {
.el-form ::v-deep .el-form-item__error {
position: inherit;
}
.el-form ::v-deep .form-group-header {
.el-form ::v-deep .form-group-header {
margin-left: 50px;
}
.el-form ::v-deep .help-block {
.el-form.mobile ::v-deep .form-group-header {
margin-left: 0;
}
.el-form ::v-deep .help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
@@ -127,7 +144,7 @@ export default {
font-size: 12px;
line-height: 18px;
}
.el-form ::v-deep .help-block a {
.el-form ::v-deep .help-block a {
color: #1c84c6;
}
.form-buttons {

View File

@@ -65,4 +65,7 @@ export default {
margin-right: 5px;
vertical-align: middle;
}
.mobile .header-avatar {
display: none;
}
</style>

View File

@@ -4,13 +4,13 @@
<div class="nav-logo">
<Logo v-if="showLogo" :collapse="isCollapse" />
</div>
<div class="nav-title" :class="{'collapsed': isCollapse}">
{{ isTitle }}
</div>
<div class="active-mobile">
<ViewSwitcher />
<Organization class="organization" />
</div>
<div class="nav-title" :class="{'collapsed': isCollapse}">
{{ isTitle }}
</div>
</div>
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-menu

View File

@@ -157,5 +157,9 @@ export const CLOUD = [
]
export const ApplicationTypes = [
...REMOTE_APP, ...DATABASE, ...CLOUD
...DATABASE, ...REMOTE_APP, ...CLOUD
]
export const ApplicationSystemUserTypes = [
...DATABASE, ...CLOUD
]

View File

@@ -54,6 +54,7 @@ export default {
},
columnsMeta: {
name: {
formatter: vm.$hasPerm('users.view_user') ? DetailFormatter : '',
formatterArgs: {
route: 'UserDetail'
},

View File

@@ -36,7 +36,7 @@ export default {
{
title: this.$t('assets.SystemUser'),
name: 'SystemUserList',
hidden: () => !this.$hasPerm('assets.view_systemuser')
hidden: () => !this.$hasPerm('assets.view_authbook')
},
{
title: this.$t('assets.AccountList'),

View File

@@ -237,12 +237,12 @@ export default {
name: 'RemoveFromCurrentNode',
title: this.$t('assets.RemoveFromCurrentNode'),
can: ({ selectedRows }) => {
if (!this.$route.query.node) {
if (!vm.$route.query.node) {
return false
}
return selectedRows.length > 0 &&
!vm.currentOrgIsRoot &&
vm.$hasPerm('assets.change_asset')
vm.$hasPerm('assets.change_node')
},
callback: function({ selectedRows, reloadTable }) {
const assetsId = []

View File

@@ -68,7 +68,7 @@ export default {
name: 'Push',
title: this.$t('common.Push'),
type: 'primary',
can: this.object.auto_push,
can: this.object.auto_push && vm.$hasPerm('assets.push_assetsystemuser'),
callback: ({ row }) => {
const theUrl = `/api/v1/assets/system-users/${vm.object.id}/tasks/`
const data = { action: 'push', assets: [row.asset] }
@@ -81,7 +81,7 @@ export default {
name: 'Delete',
title: this.$t('common.Delete'),
type: 'danger',
can: !this.$store.getters.currentOrgIsRoot,
can: !this.$store.getters.currentOrgIsRoot && vm.$hasPerm('assets.delete_authbook'),
callback: (val) => {
this.$axios.delete(`/api/v1/assets/system-users-assets-relations/${val.row.id}/`).then(() => {
this.$message.success(this.$t('common.deleteSuccessMsg'))
@@ -103,7 +103,7 @@ export default {
title: this.$t('common.PushSelected'),
name: 'PushSelected',
can({ selectedRows }) {
return selectedRows.length > 0 && vm.object.auto_push
return selectedRows.length > 0 && vm.object.auto_push && vm.$hasPerm('assets.push_assetsystemuser')
},
callback: this.bulkPushCallback.bind(this)
},
@@ -111,7 +111,7 @@ export default {
title: this.$t('assets.TestAssetsConnective'),
name: 'TestSelected',
can({ selectedRows }) {
return selectedRows.length > 0
return selectedRows.length > 0 && vm.$hasPerm('assets.test_assetconnectivity')
},
callback: this.bulkTestCallback.bind(this)
}
@@ -122,7 +122,8 @@ export default {
title: this.$t('assets.TestAssetsConnective'),
attrs: {
type: 'primary',
label: this.$t('common.Test')
label: this.$t('common.Test'),
disabled: !vm.$hasPerm('assets.test_assetconnectivity')
},
callbacks: {
click: function() {

View File

@@ -9,7 +9,7 @@
<script>
import { GenericListTable } from '@/layout/components'
import { ApplicationTypes } from '@/views/applications/const'
import { ApplicationSystemUserTypes } from '@/views/applications/const'
import { AssetProtocols } from '@/views/assets/const'
export default {
@@ -78,7 +78,7 @@ export default {
},
dropdown: [
...AssetProtocols,
...ApplicationTypes
...ApplicationSystemUserTypes
]
}
},

View File

@@ -11,6 +11,7 @@ export default {
HomeCard
},
data() {
const vm = this
return {
cardConfig: {
title: this.$t('route.SessionOffline')
@@ -29,7 +30,11 @@ export default {
formatter: function(row, column, cellValue, index) {
const label = index + 1
const route = { to: { name: 'SessionDetail', params: { id: row.id }}}
return <router-link {...{ attrs: route }}>{ label }</router-link>
if (vm.$hasPerm('terminal.view_session')) {
return <router-link {...{ attrs: route }} >{ label }</router-link>
} else {
return label
}
}
},
user: {

View File

@@ -39,8 +39,8 @@ export default {
return 'AssetsTicketDetail'
} else if (row.type === 'apply_application') {
return 'AppsTicketDetail'
} else if (row.type === 'login_asset_confirm') {
return 'loginAssetTicketDetail'
} else if (row.type === 'login_asset_confirm' || row.type === 'login_confirm') {
return 'LoginAssetTicketDetail'
} else if (row.type === 'command_confirm') {
return 'CommandConfirmDetail'
} else {

View File

@@ -86,7 +86,7 @@ export default {
this.$axios.patch(
`/api/v1/notifications/system-msg-subscription/${sub.id}/`,
{ receiveBackends: backends }
{ receive_backends: backends }
).catch(err => {
this.$log.error(err)
})

View File

@@ -40,11 +40,13 @@ export default {
visible: false,
iFormSetting: {
url: '/api/v1/terminal/terminals/',
getUrl: () => '/api/v1/terminal/terminals/',
fields: [
['', ['command_storage', 'replay_storage']]
],
fieldsMeta: {
command_storage: {
label: this.$t('sessions.commandStorage'),
component: Select2,
el: {
ajax: {
@@ -54,6 +56,7 @@ export default {
}
},
replay_storage: {
label: this.$t('sessions.replayStorage'),
component: Select2,
el: {
ajax: {

View File

@@ -37,7 +37,7 @@
<el-button
type="danger"
size="small"
:disabled="asDisabled(!session.can_terminate || !$hasPerm('terminal.terminate_session'))"
:disabled="!session.can_terminate"
@click="onConnect"
>
{{ $t('sessions.terminate') }}
@@ -45,7 +45,7 @@
<el-button
type="primary"
size="small"
:disabled="asDisabled(!session.can_join || !$hasPerm('terminal.monitor_session'))"
:disabled="!session.can_join"
@click="onMonitor"
>
{{ $t('sessions.Monitor') }}
@@ -117,9 +117,6 @@ export default {
onMonitor() {
const joinUrl = `/luna/monitor/${this.session.id}`
window.open(joinUrl, 'height=600, width=800, top=400, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no')
},
asDisabled(type) {
return (type || true) || !this.$hasPerm('tickets.view_ticket')
}
}

View File

@@ -31,6 +31,7 @@ export default {
return {
loading: true,
relationConfig: {
disabled: !this.$hasPerm('rbac.add_systemrolebinding'),
icon: 'fa-user',
title: this.$t('common.Members'),
objectsAjax: {

View File

@@ -36,10 +36,10 @@ export default {
activeMenu: 'RoleInfo',
actions: {
canDelete: () => {
return vm.hasPermNotBuiltinNotRootOrg(this.role, `rbac.delete_${scopeRole}`)
return vm.hasPermNotBuiltin(this.role, `rbac.delete_${scopeRole}`)
},
canUpdate: () => {
return vm.hasPermNotBuiltinNotRootOrg(this.role, `rbac.change_${scopeRole}`)
return vm.hasPermNotBuiltin(this.role, `rbac.change_${scopeRole}`)
},
updateRoute: {
name: this.$route.name.replace('Detail', 'Update'),
@@ -62,10 +62,8 @@ export default {
}
},
methods: {
hasPermNotBuiltinNotRootOrg(row, perm) {
return !row['builtin'] &&
this.$hasPerm(perm) &&
!this.$isRootOrg()
hasPermNotBuiltin(row, perm) {
return !row['builtin'] && this.$hasPerm(perm)
}
}
}

View File

@@ -60,10 +60,10 @@ export default {
actions: {
formatterArgs: {
canUpdate: ({ row }) => {
return this.hasPermNotBuiltinNotRootOrg(row, `rbac.change_${row.scope}role`)
return this.hasPermNotBuiltin(row, `rbac.change_${row.scope}role`)
},
canDelete: ({ row }) => {
return this.hasPermNotBuiltinNotRootOrg(row, `rbac.delete_${row.scope}role`)
return this.hasPermNotBuiltin(row, `rbac.delete_${row.scope}role`)
},
updateRoute: {
name: 'RoleUpdate',
@@ -108,8 +108,8 @@ export default {
}
},
methods: {
hasPermNotBuiltinNotRootOrg(row, perm) {
return !row['builtin'] && this.$hasPerm(perm) && !this.$isRootOrg()
hasPermNotBuiltin(row, perm) {
return !row['builtin'] && this.$hasPerm(perm)
}
}
}

View File

@@ -116,7 +116,7 @@ export default {
}
},
hidden: () => {
return !this.$hasPerm('rbac.change_systemrolebinding')
return !this.$hasPerm('rbac.add_systemrolebinding')
},
value: []
},
@@ -135,7 +135,7 @@ export default {
},
hidden: () => {
return !this.$store.getters.hasValidLicense ||
!this.$hasPerm('rbac.change_orgrolebinding') ||
!this.$hasPerm('rbac.add_orgrolebinding') ||
this.$store.getters.currentOrgIsRoot
},
helpText: this.$t('users.HelpText.OrgRoleHelpText')