* 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:
fit2bot
2022-03-02 20:49:23 +08:00
committed by GitHub
parent 10655a3ff4
commit c0448afda4
11 changed files with 41 additions and 24 deletions

View File

@@ -3,7 +3,8 @@
width="50" width="50"
:title="this.$t('assets.UpdateAssetUserToken')" :title="this.$t('assets.UpdateAssetUserToken')"
:destroy-on-close="true" :destroy-on-close="true"
v-bind="$attrs" :visible.sync="isVisible"
@update:visible="(event) => $emit('update:visible', event)"
@confirm="handleConfirm()" @confirm="handleConfirm()"
@cancel="handleCancel()" @cancel="handleCancel()"
v-on="$listeners" v-on="$listeners"
@@ -42,6 +43,10 @@ export default {
account: { account: {
type: Object, type: Object,
default: () => ({}) default: () => ({})
},
visible: {
type: Boolean,
default: false
} }
}, },
data() { data() {
@@ -53,6 +58,11 @@ export default {
} }
} }
}, },
computed: {
isVisible() {
return this.visible
}
},
methods: { methods: {
handleConfirm() { handleConfirm() {
const data = {} const data = {}

View File

@@ -2,7 +2,7 @@
<div> <div>
<ListTable ref="ListTable" :table-config="tableConfig" :header-actions="headerActions" /> <ListTable ref="ListTable" :table-config="tableConfig" :header-actions="headerActions" />
<ShowSecretInfo v-if="showViewSecretDialog" :visible.sync="showViewSecretDialog" :account="account" /> <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> </div>
</template> </template>
@@ -46,6 +46,7 @@ export default {
} }
}, },
data() { data() {
const vm = this
return { return {
showViewSecretDialog: false, showViewSecretDialog: false,
showUpdateSecretDialog: false, showUpdateSecretDialog: false,
@@ -100,10 +101,10 @@ export default {
name: 'View', name: 'View',
title: this.$t('common.View'), title: this.$t('common.View'),
type: 'primary', type: 'primary',
callback: function({ row }) { callback: ({ row }) => {
this.account = row vm.account = row
this.showViewSecretDialog = true vm.showViewSecretDialog = true
}.bind(this) }
}, },
{ {
name: 'Delete', name: 'Delete',
@@ -132,10 +133,15 @@ export default {
name: 'Update', name: 'Update',
title: this.$t('common.Update'), title: this.$t('common.Update'),
can: !this.$store.getters.currentOrgIsRoot, can: !this.$store.getters.currentOrgIsRoot,
callback: function({ row }) { callback: ({ row }) => {
this.account = row vm.account = row
this.showUpdateSecretDialog = true vm.showUpdateSecretDialog = false
}.bind(this) setTimeout(() => {
vm.showUpdateSecretDialog = true
console.log('Show update1: ', vm.showUpdateSecretDialog)
})
console.log('Show update2: ', vm.showUpdateSecretDialog)
}
} }
] ]
} }

View File

@@ -4,10 +4,11 @@ import locale from 'element-ui/lib/locale'
import VueI18n from 'vue-i18n' import VueI18n from 'vue-i18n'
import messages from './langs' import messages from './langs'
import date from './date' import date from './date'
import VueCookie from 'vue-cookie'
Vue.use(VueI18n) Vue.use(VueI18n)
const i18n = new VueI18n({ const i18n = new VueI18n({
locale: localStorage.lang || 'cn', locale: (VueCookie.get('django_language') || 'zh-hans') === 'zh-hans' ? 'cn' : 'en',
fallbackLocale: 'en', fallbackLocale: 'en',
silentFallbackWarn: true, silentFallbackWarn: true,
silentTranslationWarn: true, silentTranslationWarn: true,

View File

@@ -25,7 +25,9 @@ export default {
meta: { meta: {
icon: 'dashboard', icon: 'dashboard',
title: i18n.t('route.Overview'), title: i18n.t('route.Overview'),
permissions: [] permissions: ['common.view_resourcestatistics'],
resource: 'common',
app: 'common'
} }
}, },
{ {

View File

@@ -161,7 +161,7 @@ export default [
path: '', path: '',
name: 'CommandFilterList', name: 'CommandFilterList',
component: () => import('@/views/assets/CommandFilter/CommandFilterList.vue'), component: () => import('@/views/assets/CommandFilter/CommandFilterList.vue'),
meta: { title: i18n.t('route.CommandFilterList'), activeMenu: 'CommandFilterList' } meta: { title: i18n.t('route.CommandFilterList') }
}, },
{ {
path: ':id/update', path: ':id/update',
@@ -191,7 +191,7 @@ export default [
component: empty, component: empty,
hidden: true, hidden: true,
meta: { meta: {
permissions: ['assets.view_commandfilterrule'] resource: 'commandfilterrule'
}, },
children: [ children: [
{ {
@@ -217,7 +217,9 @@ export default [
{ {
path: 'platforms', path: 'platforms',
component: empty, component: empty,
meta: { permissions: ['assets.view_platform'] }, meta: {
resource: 'platform'
},
redirect: '', redirect: '',
children: [ children: [
{ {
@@ -254,7 +256,7 @@ export default [
component: empty, component: empty,
redirect: '', redirect: '',
meta: { meta: {
permissions: ['assets.view_label'] resource: 'label'
}, },
children: [ children: [
{ {

View File

@@ -31,7 +31,7 @@ export default {
meta: { meta: {
icon: 'dashboard', icon: 'dashboard',
title: i18n.t('route.Overview'), title: i18n.t('route.Overview'),
permissions: [] permissions: ['common.view_resourcestatistics']
} }
}, },
{ {

View File

@@ -26,7 +26,7 @@ export default {
meta: { meta: {
icon: 'dashboard', icon: 'dashboard',
title: i18n.t('route.Overview'), title: i18n.t('route.Overview'),
permissions: [] permissions: ['common.view_resourcestatistics']
} }
}, },
{ {

View File

@@ -46,7 +46,7 @@ export default {
} }
], ],
select2Option: { select2Option: {
url: '/api/v1/users/users/?all=true' url: '/api/v1/users/users/?oid=root'
}, },
fields: [ fields: [
] ]

View File

@@ -33,7 +33,7 @@ export default {
icon: 'fa-user', icon: 'fa-user',
title: this.$t('common.Members'), title: this.$t('common.Members'),
objectsAjax: { 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) => { transformOption: (item) => {
return { label: item.name + '(' + item.username + ')', value: item.id } return { label: item.name + '(' + item.username + ')', value: item.id }
} }

View File

@@ -34,14 +34,11 @@ export default {
UserLoginACLList UserLoginACLList
}, },
data() { data() {
const vm = this
return { return {
user: { name: '', username: '', email: '', comment: '' }, user: { name: '', username: '', email: '', comment: '' },
config: { config: {
activeMenu: 'UserInfo', activeMenu: 'UserInfo',
actions: { actions: {
canUpdate: () => vm.user.can_update,
canDelete: () => vm.user.can_delete
}, },
submenu: [ submenu: [
{ {

1
utils/build.sh Normal file → Executable file
View File

@@ -28,7 +28,6 @@ function build() {
if [[ -n ${VERSION-''} ]]; then if [[ -n ${VERSION-''} ]]; then
change_version || exit 2 change_version || exit 2
fi fi
rm -rf lina dist
yarn build:prod || exit 5 yarn build:prod || exit 5
# 打包 # 打包
rm -rf "${release_dir:?}"/* rm -rf "${release_dir:?}"/*