perf: add pam panel

This commit is contained in:
ibuler
2024-09-12 18:56:34 +08:00
parent 833e44024f
commit 77a0100add
8 changed files with 714 additions and 0 deletions

8
src/icons/svg/pam.svg Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="40px" height="48px" viewBox="0 0 40 48" version="1.1" xmlns="http://www.w3.org/2000/svg"
>
<path d="M36.0001406,20.0002344 L36.0001406,16.000375 C36.0001406,7.17752804 28.8226126,0 20.0002344,0 C11.1778562,0 4.00032813,7.17752804 4.00032813,15.9999062 L4.00032813,19.9997656 L0,19.9997656 L0,48.0001875 L40,48.0001875 L40,20.0002344 L36.0001406,20.0002344 Z M8.0001875,15.9999062 C8.0001875,9.3830054 13.3833335,3.99985937 20.0002344,3.99985937 C26.6171352,3.99985937 32.0002813,9.3830054 32.0002813,15.9999062 L32.0002813,19.9997656 L8.0001875,19.9997656 L8.0001875,15.9999062 Z M36.0006094,44.0003281 L4.00032813,44.0003281 L4.00032813,24.0000938 L36.0006094,24.0000938 L36.0006094,44.0003281 Z"
id="形状"></path>
<path d="M20.0002344,40 C22.2094618,40 24.0000938,38.2088993 24.0000938,36.0001406 C24.0000938,34.5231036 23.1905593,33.2476299 21.9999297,32.5548147 L21.9999297,27.9999531 L18.0000703,27.9999531 L18.0000703,32.5548147 C16.8094407,33.2476299 15.9999062,34.5231036 15.9999062,36.0001406 C16.000375,38.209368 17.791007,40 20.0002344,40 L20.0002344,40 Z"
id="路径"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -115,6 +115,7 @@ export default {
this.tipHasRead = '1'
this.iShowTip = false
}
console.log('Route to: ', routeName)
this.$router.push(routeName)
this.$emit('view-change', routeName)
}

View File

@@ -32,6 +32,7 @@ import workbenchViewRoutes from './workbench'
import ticketsRoutes from './tickets'
import settingsRoutes from './settings'
import profileRoutes from './profile'
import pamViewRoutes from './pam'
import { getPropView } from '@/utils/jms'
import store from '@/store'
@@ -92,6 +93,7 @@ export const viewRoutes = [
consoleViewRoutes,
auditViewRoutes,
workbenchViewRoutes,
pamViewRoutes,
ticketsRoutes,
settingsRoutes,
profileRoutes

View File

@@ -0,0 +1,318 @@
import empty from '@/layout/empty.vue'
import i18n from '@/i18n/i18n'
export default [
{
path: 'account-gather',
component: empty,
redirect: {
name: 'AccountGatherList'
},
name: 'AccountGather',
meta: {
title: i18n.t('AccountGatherList'),
app: 'accounts',
icon: 'client'
// activeMenu: '/console/accounts/automations',
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountGather/index.vue'),
name: 'AccountGatherList',
meta: {
menuTitle: i18n.t('GatherAccounts'),
title: i18n.t('AccountGatherTaskList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_gatheredaccount']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountGather/TaskCreateUpdate'),
name: 'AccountGatherTaskCreate',
hidden: true,
meta: {
title: i18n.t('AccountGatherTaskCreate'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.add_gatheraccountsautomation']
}
},
{
path: ':id',
component: () => import('@/views/accounts/AccountGather/TaskDetail/index'),
name: 'AccountGatherTaskDetail',
hidden: true,
meta: {
title: i18n.t('AccountGatherTaskDetail'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_gatheraccountsautomation']
}
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountGather/TaskCreateUpdate'),
name: 'AccountGatherTaskUpdate',
hidden: true,
meta: {
title: i18n.t('AccountGatherTaskUpdate'),
action: 'update',
permissions: ['accounts.change_gatheraccountsautomation'],
activeMenu: '/accounts/account-gather'
}
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountGather/TaskDetail/TaskExecutionList.vue'),
name: 'AccountGatherTaskExecutionList',
hidden: true,
meta: {
title: i18n.t('ExecutionList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_gatheraccountsexecution']
}
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountGather/TaskDetail/AccountGatherExecutionDetail/index.vue'),
name: 'AccountGatherExecutionDetail',
hidden: true,
meta: {
title: i18n.t('ExecutionDetail'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_gatheraccountsexecution']
}
}
]
},
{
path: 'account-push',
name: 'AccountRisk',
component: empty,
redirect: {
name: 'AccountPushList'
},
meta: {
app: 'accounts',
name: 'BaseAccountPushList',
icon: 'accounts',
resource: 'pushaccountautomation'
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountPush/index.vue'),
name: 'AccountPushList',
meta: {
title: i18n.t('AccountPushList'),
menuTitle: i18n.t('AccountPushList'),
permissions: ['accounts.view_pushaccountautomation']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'),
name: 'AccountPushCreate',
hidden: true,
meta: {
title: i18n.t('AccountPushCreate'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.add_pushaccountautomation']
}
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'),
name: 'AccountPushUpdate',
hidden: true,
meta: {
title: i18n.t('AccountPushUpdate'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.change_pushaccountautomation']
}
},
{
path: ':id',
component: () => import('@/views/accounts/AccountPush/AccountPushDetail/index.vue'),
name: 'AccountPushDetail',
hidden: true,
meta: {
title: i18n.t('AccountPushList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_pushaccountautomation']
}
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue'),
name: 'AccountPushExecutionList',
hidden: true,
meta: {
title: i18n.t('ExecutionList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_pushaccountexecution']
}
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'),
name: 'AccountPushExecutionDetail',
hidden: true,
meta: {
title: i18n.t('ExecutionDetail'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_pushaccountexecution']
}
}
]
},
{
path: 'account-change-secret',
name: 'AccountChangeSecret',
component: empty,
redirect: {
name: 'AccountChangeSecretList'
},
meta: {
title: i18n.t('BaseAccountChangeSecret'),
icon: 'basic',
app: 'accounts'
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountChangeSecret/index.vue'),
name: 'AccountChangeSecretList',
meta: {
menuTitle: i18n.t('ChangeCredentials'),
title: i18n.t('AccountChangeSecret'),
permissions: ['accounts.view_changesecretautomation']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretCreateUpdate.vue'),
name: 'AccountChangeSecretCreate',
hidden: true,
meta: {
title: i18n.t('AssetChangeSecretCreate'),
permissions: ['accounts.add_changesecretautomation']
}
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretCreateUpdate.vue'),
name: 'AccountChangeSecretUpdate',
hidden: true,
meta: {
title: i18n.t('AssetChangeSecretUpdate'),
permissions: ['accounts.change_changesecretautomation']
}
},
{
path: ':id',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/index.vue'),
name: 'AccountChangeSecretDetail',
hidden: true,
meta: {
title: i18n.t('AccountChangeSecret'),
permissions: ['accounts.view_changesecretautomation']
}
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/AccountChangeSecretExecution/AccountChangeSecretExecutionList.vue'),
name: 'AccountChangeSecretExecutionList',
hidden: true,
meta: {
title: i18n.t('ExecutionList'),
permissions: ['accounts.view_changesecretexecution']
}
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/AccountChangeSecretExecution/AccountChangeSecretExecutionDetail/index.vue'),
name: 'AccountChangeSecretExecutionDetail',
hidden: true,
meta: {
title: i18n.t('ExecutionDetail'),
permissions: ['accounts.view_changesecretexecution']
}
}
]
},
{
path: 'account-backup',
component: empty,
name: 'AccountBackup',
redirect: {
name: 'AccountBackupList'
},
meta: {
title: i18n.t('AccountBackup'),
app: 'accounts',
icon: 'clean',
resource: 'accountbackupautomation'
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountBackup/index.vue'),
name: 'AccountBackupList',
meta: {
menuTitle: i18n.t('AccountBackup'),
title: i18n.t('AccountBackupList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_accountbackupautomation']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'),
name: 'AccountBackupCreate',
meta: {
title: i18n.t('AccountBackupCreate'),
// activeMenu: '/console/accounts/automations',
action: 'create'
},
hidden: true
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'),
name: 'AccountBackupUpdate',
meta: {
title: i18n.t('AccountBackupUpdate'),
// activeMenu: '/console/accounts/automations',
action: 'update'
},
hidden: true
},
{
path: ':id',
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/index.vue'),
name: 'AccountBackupDetail',
// activeMenu: '/console/accounts/automations',
meta: {
title: i18n.t('AccountBackupDetail'),
activeMenu: '/console/accounts/automations'
},
hidden: true
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionList.vue'),
name: 'AccountBackupExecutionList',
meta: { title: i18n.t('ExecutionDetail') },
hidden: true
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionDetail/index.vue'),
name: 'AccountBackupExecutionDetail',
meta: { title: i18n.t('ExecutionDetail') },
hidden: true
}
]
}
]

80
src/router/pam/index.js Normal file
View File

@@ -0,0 +1,80 @@
import Layout from '@/layout'
import i18n from '@/i18n/i18n'
import empty from '@/layout/empty'
import store from '@/store'
import automations from './automations'
import services from './service'
import security from './security'
export default {
path: '/pam/',
name: 'pam',
component: Layout,
redirect: '/pam/dashboard',
meta: {
title: i18n.t('PAM'),
icon: 'pam',
type: 'view',
showNavSwitcher: () => {
return store.getters.consoleOrgs.length > 0
},
permissions: [],
view: 'pam'
},
children: [
{
path: '/pam/dashboard',
component: () => import('@/views/dashboard/Audit/index'),
name: 'PamDashboard',
meta: {
icon: 'dashboard',
title: i18n.t('Dashboard'),
permissions: []
}
},
{
path: '/pam/accounts',
name: 'PamAccounts',
component: () => import('@/views/pam/Account/AccountList.vue'),
meta: {
title: i18n.t('Accounts'),
icon: 'accounts',
permissions: []
}
},
{
path: '/pam/automations',
name: 'AccountAutomation',
component: empty,
// redirect: '/audit/sessions/sessions',
meta: {
title: i18n.t('Automation'),
icon: 'accounts',
permissions: []
},
children: automations
},
{
path: '/pam/security',
name: 'AccountSecurity',
component: empty,
meta: {
title: i18n.t('Security'),
icon: 'accounts',
permissions: []
},
children: security
},
{
path: '/pam/services',
name: 'AccountService',
meta: {
title: i18n.t('Service'),
icon: 'accounts',
permissions: []
},
children: services
}
]
}

View File

@@ -0,0 +1,86 @@
import empty from '@/layout/empty.vue'
import i18n from '@/i18n/i18n'
export default [
{
path: 'risk',
name: 'AccountRisk',
component: empty,
redirect: {
name: 'AccountPushList'
},
meta: {
app: 'accounts',
name: 'BaseAccountRisk',
icon: 'accounts',
resource: 'pushaccountautomation'
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountPush/index.vue'),
name: 'AccountPushList',
meta: {
title: i18n.t('风险扫描'),
menuTitle: i18n.t('风险扫描'),
permissions: ['accounts.view_pushaccountautomation']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'),
name: 'AccountPushCreate',
hidden: true,
meta: {
title: i18n.t('AccountPushCreate'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.add_pushaccountautomation']
}
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'),
name: 'AccountPushUpdate',
hidden: true,
meta: {
title: i18n.t('AccountPushUpdate'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.change_pushaccountautomation']
}
},
{
path: ':id',
component: () => import('@/views/accounts/AccountPush/AccountPushDetail/index.vue'),
name: 'AccountPushDetail',
hidden: true,
meta: {
title: i18n.t('AccountPushList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_pushaccountautomation']
}
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue'),
name: 'AccountPushExecutionList',
hidden: true,
meta: {
title: i18n.t('ExecutionList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_pushaccountexecution']
}
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'),
name: 'AccountPushExecutionDetail',
hidden: true,
meta: {
title: i18n.t('ExecutionDetail'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_pushaccountexecution']
}
}
]
}
]

86
src/router/pam/service.js Normal file
View File

@@ -0,0 +1,86 @@
import empty from '@/layout/empty.vue'
import i18n from '@/i18n/i18n'
export default [
{
path: 'service',
name: 'AccountService',
component: empty,
redirect: {
name: 'AccountServiceList'
},
meta: {
app: 'accounts',
name: 'AccountService',
icon: 'accounts',
resource: 'pushaccountautomation'
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountPush/index.vue'),
name: 'AccountServiceList',
meta: {
title: i18n.t('服务对接'),
menuTitle: i18n.t('服务对接'),
permissions: ['accounts.view_pushaccountautomation']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'),
name: 'AccountPushCreate',
hidden: true,
meta: {
title: i18n.t('AccountPushCreate'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.add_pushaccountautomation']
}
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'),
name: 'AccountPushUpdate',
hidden: true,
meta: {
title: i18n.t('AccountPushUpdate'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.change_pushaccountautomation']
}
},
{
path: ':id',
component: () => import('@/views/accounts/AccountPush/AccountPushDetail/index.vue'),
name: 'AccountPushDetail',
hidden: true,
meta: {
title: i18n.t('AccountPushList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_pushaccountautomation']
}
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue'),
name: 'AccountPushExecutionList',
hidden: true,
meta: {
title: i18n.t('ExecutionList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_pushaccountexecution']
}
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'),
name: 'AccountPushExecutionDetail',
hidden: true,
meta: {
title: i18n.t('ExecutionDetail'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_pushaccountexecution']
}
}
]
}
]

View File

@@ -0,0 +1,133 @@
<template>
<TabPage
v-if="!loading"
:active-menu.sync="activeMenu"
:submenu="tab.submenu"
@tab-click="changeMoreCreates"
>
<keep-alive>
<AccountListTable ref="table" v-bind="tableConfig" />
</keep-alive>
</TabPage>
</template>
<script>
import AccountListTable from '@/components/Apps/AccountListTable/AccountList.vue'
import { TabPage } from '@/layout/components'
export default {
name: 'AssetAccountList',
components: {
TabPage,
AccountListTable
},
data() {
return {
isInit: true,
clickedRow: null,
iShowTree: true,
loading: true,
activeMenu: 'host',
tab: {
submenu: [
{
name: 'all',
title: this.$t('All'),
icon: 'fa-bars'
}
]
},
tableConfig: {
url: '/api/v1/accounts/accounts/',
hasLeftActions: true,
hasImport: true
}
}
},
watch: {
activeMenu(val) {
let url = '/api/v1/accounts/accounts/'
if (val !== 'all') {
url += '?category=' + val
}
this.tableConfig.url = url
}
},
async mounted() {
try {
await this.setCategoriesTab()
} finally {
this.loading = false
}
},
methods: {
changeMoreCreates() {
},
async setCategoriesTab() {
const categoryIcon = {
host: 'fa-inbox',
device: 'fa-microchip',
database: 'fa-database',
cloud: 'fa-cloud',
web: 'fa-globe',
gpt: 'fa-comment',
custom: 'fa-cube'
}
const state = await this.$store.dispatch('assets/getAssetCategories')
for (const item of state.assetCategories) {
this.tab.submenu.push({
name: item.value,
title: item.label,
icon: categoryIcon[item.value]
})
}
}
}
}
</script>
<style lang="scss" scoped>
.asset-table ::v-deep .row-clicked, .asset-user-table ::v-deep .row-background-color {
background-color: #f5f7fa;
}
.asset-table {
&:hover {
cursor: pointer;
}
& ::v-deep .table-content {
margin-left: 21px;
}
& ::v-deep .el-table__row {
height: 40px;
& > td {
padding: 0;
}
}
}
.noDataR {
width: 100%;
height: 40vh;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
flex-direction: column;
.hintWrap {
color: #D4D6E6;
display: flex;
align-items: flex-start;
justify-content: center;
flex-direction: column;
}
}
.asset-user-table {
padding-left: 20px;
}
</style>