Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: Optimized style #4486

Open
wants to merge 1 commit into
base: pam
Choose a base branch
from
Open
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
style: Optimized style
  • Loading branch information
ZhaoJiSen committed Dec 5, 2024
commit e44b60a92152c317d86c7e95781f9b05d6043f69
82 changes: 56 additions & 26 deletions src/views/accounts/Account/AccountDetail/Detail.vue
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
<template>
<el-row :gutter="20">
<el-col :md="15" :sm="24" class="auto-detail-card">
<AutoDetailCard :object="object" v-bind="detail" />
</el-col>
<el-col :md="9" :sm="24" class="quick-actions">
<QuickActions :actions="quickActions" type="primary" />
<ViewSecret
v-if="showViewSecretDialog"
:account="object"
:url="secretUrl"
:visible.sync="showViewSecretDialog"
/>
<AutomationParamsForm
:has-button="false"
:method="pushAccountMethod"
:visible.sync="autoPushVisible"
@canSetting="onCanSetting"
@submit="onSubmit"
/>
</el-col>
</el-row>
<div>
<el-row :gutter="20">
<el-col :md="15" :sm="24" class="auto-detail-card">
<AutoDetailCard :object="object" v-bind="detail" />
</el-col>
<el-col :md="9" :sm="24" class="quick-actions">
<QuickActions :actions="quickActions" type="primary" />
<ViewSecret
v-if="showViewSecretDialog"
:account="object"
:url="secretUrl"
:visible.sync="showViewSecretDialog"
/>
<AutomationParamsForm
:has-button="false"
:method="pushAccountMethod"
:visible.sync="autoPushVisible"
@canSetting="onCanSetting"
@submit="onSubmit"
/>
</el-col>
</el-row>

<el-drawer
size="50%"
:with-header="false"
:append-to-body="true"
:visible.sync="pamDrawerShow"
>
<component :is="drawerRefName" />
</el-drawer>
</div>
</template>

<script>
import AutoDetailCard from '@/components/Cards/DetailCard/auto.vue'
import { openTaskPage } from '@/utils/jms'
import QuickActions from '@/components/QuickActions/index.vue'
import AutoDetailCard from '@/components/Cards/DetailCard/auto.vue'
import AssetDetail from '@/views/assets/Asset/AssetDetail/index.vue'
import ViewSecret from '@/components/Apps/AccountListTable/ViewSecret.vue'
import { openTaskPage } from '@/utils/jms'
import AutomationParamsForm from '@/views/assets/Platform/AutomationParamsSetting.vue'

export default {
name: 'Detail',
components: {
AutoDetailCard,
ViewSecret,
AssetDetail,
QuickActions,
AutomationParamsForm,
ViewSecret
AutoDetailCard,
AutomationParamsForm
},
props: {
object: {
Expand All @@ -47,6 +60,8 @@ export default {
data() {
const vm = this
return {
pamDrawerShow: false,
drawerRefName: null,
needSetAutoPushParams: false,
autoPushVisible: false,
secretUrl: `/api/v1/accounts/account-secrets/${this.object.id}/`,
Expand Down Expand Up @@ -213,6 +228,21 @@ export default {
name: 'AssetDetail',
params: { id: this.object.asset.id }
}

if (this.$route.query.type === 'pam') {
this.drawerRefName = 'AssetDetail'

this.$route.params.id = this.object.asset.id

return (
<span style={{ color: '#1c84c6', cursor: 'pointer' }} onClick={() => {
this.pamDrawerShow = true
}}>
{value?.name}
</span>
)
}

return <router-link to={route}>{value?.name}</router-link>
},
su_from: (item, value) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
</div>

<el-drawer
direction="btt"
size="50%"
:with-header="false"
:append-to-body="true"
Expand Down
3 changes: 2 additions & 1 deletion src/views/pam/Account/AccountList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default {
return (
<span style={{ color: '#1c84c6', cursor: 'pointer' }} onClick={() => {
this.$route.params.id = row.id
this.$route.query.type = 'pam'

this.currentTemplate = 'AssetAccountDetail'
this.showTableDetailDrawer = true
Expand All @@ -60,7 +61,7 @@ export default {
this.drawerTitle = this.$t('AssetDetail')
}}
>
{row.name}
{row.asset.name}
</span>
) : (
<span>{row.asset ? row.asset.name : ''}</span>
Expand Down
Loading