mirror of
https://github.com/jumpserver/lina.git
synced 2025-10-21 15:39:36 +00:00
Fix rbac (#1361)
* perf: debug account * Debug: 添加 debug * debug: 添加线上debug * debug: remove vue config * chore: diglog 添加vif * debug: authbook * chore: debug account * fix: 修改资产账号更新弹窗组件传参方式 * perf: 修改 authbook * fix: 修复资产账号的更新组件不生效问题 * perf: change build scropt * feat: 配置概况页的路由权限 * fix: 修复工单流自定义用户获取全局用户bug * fix: 修复系统角色绑定用户为全局用户 * fix: 修改i18n cn.json=>zh-hans.json 文件名 * fix: 修改i18n cn.json 文件名 Co-authored-by: ibuler <ibuler@qq.com> Co-authored-by: “怀磊” <2280131253@qq.com> Co-authored-by: feng626 <1304903146@qq.com> Co-authored-by: Jiangjie.Bai <bugatti_it@163.com>
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
width="50"
|
||||
:title="this.$t('assets.UpdateAssetUserToken')"
|
||||
:destroy-on-close="true"
|
||||
v-bind="$attrs"
|
||||
:visible.sync="isVisible"
|
||||
@update:visible="(event) => $emit('update:visible', event)"
|
||||
@confirm="handleConfirm()"
|
||||
@cancel="handleCancel()"
|
||||
v-on="$listeners"
|
||||
@@ -42,6 +43,10 @@ export default {
|
||||
account: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -53,6 +58,11 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isVisible() {
|
||||
return this.visible
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleConfirm() {
|
||||
const data = {}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<ListTable ref="ListTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||
<ShowSecretInfo v-if="showViewSecretDialog" :visible.sync="showViewSecretDialog" :account="account" />
|
||||
<UpdateSecretInfo :visible.sync="showUpdateSecretDialog" :account="account" @updateAuthDone="onUpdateAuthDone" />
|
||||
<UpdateSecretInfo v-if="showUpdateSecretDialog" :visible.sync="showUpdateSecretDialog" :account="account" @updateAuthDone="onUpdateAuthDone" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -46,6 +46,7 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
showViewSecretDialog: false,
|
||||
showUpdateSecretDialog: false,
|
||||
@@ -100,10 +101,10 @@ export default {
|
||||
name: 'View',
|
||||
title: this.$t('common.View'),
|
||||
type: 'primary',
|
||||
callback: function({ row }) {
|
||||
this.account = row
|
||||
this.showViewSecretDialog = true
|
||||
}.bind(this)
|
||||
callback: ({ row }) => {
|
||||
vm.account = row
|
||||
vm.showViewSecretDialog = true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
@@ -132,10 +133,15 @@ export default {
|
||||
name: 'Update',
|
||||
title: this.$t('common.Update'),
|
||||
can: !this.$store.getters.currentOrgIsRoot,
|
||||
callback: function({ row }) {
|
||||
this.account = row
|
||||
this.showUpdateSecretDialog = true
|
||||
}.bind(this)
|
||||
callback: ({ row }) => {
|
||||
vm.account = row
|
||||
vm.showUpdateSecretDialog = false
|
||||
setTimeout(() => {
|
||||
vm.showUpdateSecretDialog = true
|
||||
console.log('Show update1: ', vm.showUpdateSecretDialog)
|
||||
})
|
||||
console.log('Show update2: ', vm.showUpdateSecretDialog)
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -4,10 +4,11 @@ import locale from 'element-ui/lib/locale'
|
||||
import VueI18n from 'vue-i18n'
|
||||
import messages from './langs'
|
||||
import date from './date'
|
||||
import VueCookie from 'vue-cookie'
|
||||
|
||||
Vue.use(VueI18n)
|
||||
const i18n = new VueI18n({
|
||||
locale: localStorage.lang || 'cn',
|
||||
locale: (VueCookie.get('django_language') || 'zh-hans') === 'zh-hans' ? 'cn' : 'en',
|
||||
fallbackLocale: 'en',
|
||||
silentFallbackWarn: true,
|
||||
silentTranslationWarn: true,
|
||||
|
@@ -25,7 +25,9 @@ export default {
|
||||
meta: {
|
||||
icon: 'dashboard',
|
||||
title: i18n.t('route.Overview'),
|
||||
permissions: []
|
||||
permissions: ['common.view_resourcestatistics'],
|
||||
resource: 'common',
|
||||
app: 'common'
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@@ -161,7 +161,7 @@ export default [
|
||||
path: '',
|
||||
name: 'CommandFilterList',
|
||||
component: () => import('@/views/assets/CommandFilter/CommandFilterList.vue'),
|
||||
meta: { title: i18n.t('route.CommandFilterList'), activeMenu: 'CommandFilterList' }
|
||||
meta: { title: i18n.t('route.CommandFilterList') }
|
||||
},
|
||||
{
|
||||
path: ':id/update',
|
||||
@@ -191,7 +191,7 @@ export default [
|
||||
component: empty,
|
||||
hidden: true,
|
||||
meta: {
|
||||
permissions: ['assets.view_commandfilterrule']
|
||||
resource: 'commandfilterrule'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@@ -217,7 +217,9 @@ export default [
|
||||
{
|
||||
path: 'platforms',
|
||||
component: empty,
|
||||
meta: { permissions: ['assets.view_platform'] },
|
||||
meta: {
|
||||
resource: 'platform'
|
||||
},
|
||||
redirect: '',
|
||||
children: [
|
||||
{
|
||||
@@ -254,7 +256,7 @@ export default [
|
||||
component: empty,
|
||||
redirect: '',
|
||||
meta: {
|
||||
permissions: ['assets.view_label']
|
||||
resource: 'label'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
@@ -31,7 +31,7 @@ export default {
|
||||
meta: {
|
||||
icon: 'dashboard',
|
||||
title: i18n.t('route.Overview'),
|
||||
permissions: []
|
||||
permissions: ['common.view_resourcestatistics']
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@@ -26,7 +26,7 @@ export default {
|
||||
meta: {
|
||||
icon: 'dashboard',
|
||||
title: i18n.t('route.Overview'),
|
||||
permissions: []
|
||||
permissions: ['common.view_resourcestatistics']
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@@ -46,7 +46,7 @@ export default {
|
||||
}
|
||||
],
|
||||
select2Option: {
|
||||
url: '/api/v1/users/users/?all=true'
|
||||
url: '/api/v1/users/users/?oid=root'
|
||||
},
|
||||
fields: [
|
||||
]
|
||||
|
@@ -33,7 +33,7 @@ export default {
|
||||
icon: 'fa-user',
|
||||
title: this.$t('common.Members'),
|
||||
objectsAjax: {
|
||||
url: '/api/v1/users/users/?fields_size=mini&order=name',
|
||||
url: `/api/v1/users/users/?fields_size=mini&order=name${this.object.scope === 'system' ? '&oid=root' : ''}`,
|
||||
transformOption: (item) => {
|
||||
return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||
}
|
||||
|
@@ -34,14 +34,11 @@ export default {
|
||||
UserLoginACLList
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
user: { name: '', username: '', email: '', comment: '' },
|
||||
config: {
|
||||
activeMenu: 'UserInfo',
|
||||
actions: {
|
||||
canUpdate: () => vm.user.can_update,
|
||||
canDelete: () => vm.user.can_delete
|
||||
},
|
||||
submenu: [
|
||||
{
|
||||
|
1
utils/build.sh
Normal file → Executable file
1
utils/build.sh
Normal file → Executable file
@@ -28,7 +28,6 @@ function build() {
|
||||
if [[ -n ${VERSION-''} ]]; then
|
||||
change_version || exit 2
|
||||
fi
|
||||
rm -rf lina dist
|
||||
yarn build:prod || exit 5
|
||||
# 打包
|
||||
rm -rf "${release_dir:?}"/*
|
||||
|
Reference in New Issue
Block a user