perf: 修改账号相关的一些内容

This commit is contained in:
ibuler
2024-03-28 18:14:58 +08:00
parent 88d9238c17
commit 7845a1901b
10 changed files with 55 additions and 42 deletions

View File

@@ -235,16 +235,20 @@ export default {
}
},
{
name: 'ClearSecret',
title: this.$t('ClearSecret'),
can: this.$hasPerm('accounts.change_account'),
type: 'primary',
name: 'Update',
title: this.$t('Edit'),
can: this.$hasPerm('accounts.change_account') && !this.$store.getters.currentOrgIsRoot,
callback: ({ row }) => {
this.$axios.patch(
`/api/v1/accounts/accounts/clear-secret/`,
{ account_ids: [row.id] }
).then(() => {
this.$message.success(this.$tc('ClearSuccessMsg'))
const data = {
...this.asset,
...row.asset
}
vm.account = row
vm.iAsset = data
vm.showAddDialog = false
vm.accountCreateUpdateTitle = this.$t('UpdateAccount')
setTimeout(() => {
vm.showAddDialog = true
})
}
},
@@ -266,20 +270,16 @@ export default {
}
},
{
name: 'Update',
title: this.$t('Update'),
can: this.$hasPerm('accounts.change_account') && !this.$store.getters.currentOrgIsRoot,
name: 'ClearSecret',
title: this.$t('ClearSecret'),
can: this.$hasPerm('accounts.change_account'),
type: 'primary',
callback: ({ row }) => {
const data = {
...this.asset,
...row.asset
}
vm.account = row
vm.iAsset = data
vm.showAddDialog = false
vm.accountCreateUpdateTitle = this.$t('UpdateAccount')
setTimeout(() => {
vm.showAddDialog = true
this.$axios.patch(
`/api/v1/accounts/accounts/clear-secret/`,
{ account_ids: [row.id] }
).then(() => {
this.$message.success(this.$tc('ClearSuccessMsg'))
})
}
}

View File

@@ -1,6 +1,6 @@
<template>
<div :class="bolder ? 'bolder' : ''" class="input-text">
{{ value.toString() || text }}
{{ text || value.toString() }}
</div>
</template>
@@ -8,7 +8,7 @@
export default {
props: {
value: {
type: [String, Boolean],
type: [String, Boolean, Object, Array],
default: ''
},
text: {

View File

@@ -12,7 +12,6 @@
@input="treeSearchHandle"
>
<span slot="suffix">
<!-- <i class="fa fa-search" style="font-size: 14px; color: #676A6C;" /> -->
<svg-icon
:icon-class="'close'"
class="icon"
@@ -22,7 +21,7 @@
</span>
</el-input>
</div>
<ul v-show="loading" class="ztree">
<ul v-show="loading" class="zloading">
{{ this.$t('Loading') }}...
</ul>
<ul v-show="!loading" :id="iZTreeID" :key="iZTreeID" class="ztree" />
@@ -80,12 +79,29 @@ export default {
mounted() {
window.refresh = this.refresh
window.onSearch = this.onSearch
this.initTree()
this.initTree().then(() => {
setTimeout(() => this.updateTreeHeight(), 1000)
})
},
beforeDestroy() {
$.fn.zTree.destroy(this.iZTreeID)
},
methods: {
updateTreeHeight() {
const tree = document.getElementById(this.iZTreeID)
if (!tree) {
console.log('No tree found')
return
}
const dialog = document.getElementsByClassName('el-dialog__body')
if (dialog.length > 0) {
const dialogRect = dialog[0].getBoundingClientRect()
tree.style.height = `${dialogRect.height - 60}px`
return
}
const ztreeRect = tree.getBoundingClientRect()
tree.style.height = `calc(100vh - ${ztreeRect.top}px - 20px)`
},
async initTree(refresh = false) {
const vm = this
let treeUrl
@@ -428,7 +444,6 @@ div.rMenu li {
overflow: auto;
background-color: transparent;
height: 100%;
max-height: calc(100vh - 220px);
.level0 .node_name {
max-width: 120px;

View File

@@ -1,3 +1 @@
<!-- <svg width="128" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M27.429 63.638c0-2.508-.893-4.65-2.679-6.424-1.786-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.465 2.662-1.785 1.774-2.678 3.916-2.678 6.424 0 2.508.893 4.65 2.678 6.424 1.786 1.775 3.94 2.662 6.465 2.662 2.524 0 4.678-.887 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zm13.714-31.801c0-2.508-.893-4.65-2.679-6.424-1.785-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zM71.714 65.98l7.215-27.116c.285-1.23.107-2.378-.536-3.443-.643-1.064-1.56-1.762-2.75-2.094-1.19-.33-2.333-.177-3.429.462-1.095.639-1.81 1.573-2.143 2.804l-7.214 27.116c-2.857.237-5.405 1.266-7.643 3.088-2.238 1.822-3.738 4.152-4.5 6.992-.952 3.644-.476 7.098 1.429 10.364 1.905 3.265 4.69 5.37 8.357 6.317 3.667.947 7.143.474 10.429-1.42 3.285-1.892 5.404-4.66 6.357-8.305.762-2.84.619-5.607-.429-8.305-1.047-2.697-2.762-4.85-5.143-6.46zm47.143-2.342c0-2.508-.893-4.65-2.678-6.424-1.786-1.775-3.94-2.662-6.465-2.662-2.524 0-4.678.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.786 1.775 3.94 2.662 6.464 2.662 2.524 0 4.679-.887 6.465-2.662 1.785-1.775 2.678-3.916 2.678-6.424zm-45.714-45.43c0-2.509-.893-4.65-2.679-6.425C68.68 10.01 66.524 9.122 64 9.122c-2.524 0-4.679.887-6.464 2.661-1.786 1.775-2.679 3.916-2.679 6.425 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zm32 13.629c0-2.508-.893-4.65-2.679-6.424-1.785-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zM128 63.638c0 12.351-3.357 23.78-10.071 34.286-.905 1.372-2.19 2.058-3.858 2.058H13.93c-1.667 0-2.953-.686-3.858-2.058C3.357 87.465 0 76.037 0 63.638c0-8.613 1.69-16.847 5.071-24.703C8.452 31.08 13 24.312 18.714 18.634c5.715-5.68 12.524-10.199 20.429-13.559C47.048 1.715 55.333.035 64 .035c8.667 0 16.952 1.68 24.857 5.04 7.905 3.36 14.714 7.88 20.429 13.559 5.714 5.678 10.262 12.446 13.643 20.301 3.38 7.856 5.071 16.09 5.071 24.703z"/></svg> -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g clip-path="url(#a)"><path fill="#646A73" d="M9.052 14.604h-.003c-.644-.002-.98-.652-1.143-.966-.19-.365-.385-.841-.575-1.3-.15-.366-.307-.743-.452-1.048a4.647 4.647 0 0 0-.138-.272 3.918 3.918 0 0 0-.464.455c-.277.309-.48.593-.483.595a.748.748 0 1 1-1.219-.872c.012-.016.3-.42.677-.825.626-.675 1.151-.989 1.648-.994h.007c.307 0 .586.146.827.432.12.143.242.33.368.574.207.394.415.898.614 1.383.087.21.21.506.33.78.195-.403.413-.895.575-1.254 1.027-2.306 1.559-3.417 2.442-3.417.807 0 1.477.802 2.482 2.121.174.227.406.532.584.74.26-.229.773-.768 1.692-2.003.764-1.027 1.418-2.013 1.425-2.023a.748.748 0 1 1 1.25.827 49.49 49.49 0 0 1-1.622 2.29 20.042 20.042 0 0 1-1.325 1.61c-.628.668-1.061.94-1.497.94-.42 0-.734-.293-1.013-.607-.208-.236-.44-.541-.689-.867-.279-.366-.567-.745-.841-1.052a4.075 4.075 0 0 0-.34-.347c-.09.131-.213.342-.382.675a38.405 38.405 0 0 0-.797 1.718c-.27.605-.523 1.174-.75 1.612a4.62 4.62 0 0 1-.359.6c-.089.125-.363.495-.83.495Z"/><path fill-opacity=".2" fill="#000" d="M9.052 14.604h-.003c-.644-.002-.98-.652-1.143-.966-.19-.365-.385-.841-.575-1.3-.15-.366-.307-.743-.452-1.048a4.647 4.647 0 0 0-.138-.272 3.918 3.918 0 0 0-.464.455c-.277.309-.48.593-.483.595a.748.748 0 1 1-1.219-.872c.012-.016.3-.42.677-.825.626-.675 1.151-.989 1.648-.994h.007c.307 0 .586.146.827.432.12.143.242.33.368.574.207.394.415.898.614 1.383.087.21.21.506.33.78.195-.403.413-.895.575-1.254 1.027-2.306 1.559-3.417 2.442-3.417.807 0 1.477.802 2.482 2.121.174.227.406.532.584.74.26-.229.773-.768 1.692-2.003.764-1.027 1.418-2.013 1.425-2.023a.748.748 0 1 1 1.25.827 49.49 49.49 0 0 1-1.622 2.29 20.042 20.042 0 0 1-1.325 1.61c-.628.668-1.061.94-1.497.94-.42 0-.734-.293-1.013-.607-.208-.236-.44-.541-.689-.867-.279-.366-.567-.745-.841-1.052a4.075 4.075 0 0 0-.34-.347c-.09.131-.213.342-.382.675a38.405 38.405 0 0 0-.797 1.718c-.27.605-.523 1.174-.75 1.612a4.62 4.62 0 0 1-.359.6c-.089.125-.363.495-.83.495Z"/><path fill="#646A73" d="M1 3.5a.5.5 0 0 1 .5-.5h21a.5.5 0 0 1 .5.5v14a.5.5 0 0 1-.5.5h-21a.5.5 0 0 1-.5-.5v-14ZM3 5v11h18V5H3Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M1 3.5a.5.5 0 0 1 .5-.5h21a.5.5 0 0 1 .5.5v14a.5.5 0 0 1-.5.5h-21a.5.5 0 0 1-.5-.5v-14ZM3 5v11h18V5H3Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill="#646A73" d="M22 21.5a.5.5 0 0 1-.5.5h-19a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h19a.5.5 0 0 1 .5.5v1Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M22 21.5a.5.5 0 0 1-.5.5h-19a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h19a.5.5 0 0 1 .5.5v1Z" clip-rule="evenodd" fill-rule="evenodd"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h24v24H0z"/></clipPath></defs></svg>
<svg t="1711619639548" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13591" width="200" height="200"><path d="M800 896c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32H224c-17.673 0-32-14.327-32-32 0-17.673 14.327-32 32-32h576z m64-832c53.02 0 96 42.98 96 96v576c0 53.02-42.98 96-96 96H160c-53.02 0-96-42.98-96-96V160c0-53.02 42.98-96 96-96h704z m0.53 64H160c-17.496 0-31.713 14.042-32 31.47V736c0 17.496 14.042 31.713 31.47 32H864c17.496 0 31.713-14.042 32-31.47V160c0-17.496-14.042-31.713-31.47-32z m-54.965 252.753l0.315 0.426c10.29 14.15 7.296 33.906-6.633 44.386l-0.426 0.315L644.158 541.27c-20.98 15.258-49.093 16.343-71.185 2.748l-161.395-99.32a16 16 0 0 0-18.209 0.997L275.646 537.26c-13.81 10.742-33.654 8.386-44.577-5.198l-0.328-0.415c-10.742-13.81-8.386-33.654 5.198-44.577l0.415-0.328 126.483-98.376c21.07-16.388 50.1-17.978 72.834-3.988l161.716 99.517a16 16 0 0 0 17.796-0.687L765.18 374.12c14.15-10.29 33.906-7.296 44.386 6.633z" fill="#000000" p-id="13592"></path></svg>

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -135,7 +135,7 @@ export default {
return [
{
name: 'update',
title: this.$t('Update'),
title: this.$t('Edit'),
icon: 'el-icon-edit-outline',
size: 'small',
can: this.validActions.canUpdate,

View File

@@ -36,7 +36,7 @@ export default {
[this.$t('Other'), ['comment']]
],
initial: {
is_periodic: true,
is_periodic: false,
interval: 24,
categories: []
},

View File

@@ -17,7 +17,7 @@ export default {
node_ids: [],
asset_ids: [],
initial: {
is_periodic: true,
is_periodic: false,
password_rules: {
length: 30
},

View File

@@ -1,7 +1,7 @@
<template>
<el-row :gutter="24">
<el-col :md="24" :sm="24">
<BaseList :url="url" :columns-show="columnsShow" />
<BaseList :columns-show="columnsShow" :url="url" />
</el-col>
</el-row>
</template>
@@ -26,8 +26,8 @@ export default {
columnsShow: {
min: ['id'],
default: [
'id', 'user', 'asset', 'account', 'remote_addr', 'protocol',
'command_amount', 'date_start', 'duration'
'id', 'user', 'asset', 'account',
'date_start', 'duration'
]
}
}

View File

@@ -114,7 +114,6 @@ export default {
display: none!important;
}
b, strong {
font-weight: 700;
font-size: 13px;
}
tr td {
@@ -130,11 +129,12 @@ export default {
border-bottom: 1px solid #e7eaec;
padding: 4px 8px;
display: block;
&:last-child {
border-bottom: 0;
}
//&:last-child {
// border-bottom: 0;
//}
}
.box-margin {
margin-bottom: 20px;
}
</style>

View File

@@ -16,7 +16,7 @@ export default {
const vm = this
return {
initial: {
is_periodic: true,
is_periodic: false,
interval: 24,
hostname_strategy: 'instance_name_partial_ip',
ip_network_segment_group: ['*']