perf: 修改图标

This commit is contained in:
ibuler 2024-02-06 15:34:26 +08:00
parent bb66fe6e98
commit e224f30de6
28 changed files with 134 additions and 99 deletions

View File

@ -85,7 +85,7 @@
td .el-button.el-button--mini {
padding: 1px 5px;
padding: 1px 3px;
line-height: 1.5;
}

View File

@ -10,7 +10,7 @@ export const accountFieldsMeta = (vm) => {
assets: {
rules: [Required],
component: AssetSelect,
label: vm.$t('assets.Asset'),
label: vm.$t('Asset'),
el: {
multiple: false
},
@ -36,14 +36,14 @@ export const accountFieldsMeta = (vm) => {
},
on_invalid: {
rules: [Required],
label: vm.$t('accounts.AccountPolicy'),
helpText: vm.$t('accounts.BulkCreateStrategy'),
label: vm.$t('AccountPolicy'),
helpText: vm.$t('BulkCreateStrategy'),
hidden: () => {
return vm.platform || vm.asset
}
},
name: {
label: vm.$t('common.Name'),
label: vm.$t('Name'),
rules: [RequiredChange],
on: {
input: ([value], updateForm) => {
@ -82,7 +82,7 @@ export const accountFieldsMeta = (vm) => {
}
},
privileged: {
label: vm.$t('assets.Privileged'),
label: vm.$t('Privileged'),
hidden: () => {
return vm.addTemplate
}
@ -104,13 +104,13 @@ export const accountFieldsMeta = (vm) => {
}
},
su_from_username: {
label: vm.$t('assets.UserSwitchFrom'),
label: vm.$t('UserSwitchFrom'),
hidden: (formValue) => {
return vm.platform || vm.asset || vm.addTemplate
}
},
password: {
label: vm.$t('assets.Password'),
label: vm.$t('Password'),
component: UpdateToken,
hidden: (formValue) => {
console.log('formValue: ', formValue)
@ -118,29 +118,29 @@ export const accountFieldsMeta = (vm) => {
}
},
ssh_key: {
label: vm.$t('assets.PrivateKey'),
label: vm.$t('PrivateKey'),
component: UploadSecret,
hidden: (formValue) => formValue.secret_type !== 'ssh_key' || vm.addTemplate
},
passphrase: {
label: vm.$t('assets.Passphrase'),
label: vm.$t('Passphrase'),
component: UpdateToken,
hidden: (formValue) => formValue.secret_type !== 'ssh_key' || vm.addTemplate
},
token: {
label: vm.$t('assets.Token'),
label: vm.$t('Token'),
component: UploadSecret,
hidden: (formValue) => formValue.secret_type !== 'token' || vm.addTemplate
},
access_key: {
id: 'access_key',
label: vm.$t('assets.AccessKey'),
label: vm.$t('AccessKey'),
component: UploadSecret,
hidden: (formValue) => formValue.secret_type !== 'access_key' || vm.addTemplate
},
api_key: {
id: 'api_key',
label: vm.$t('assets.ApiKey'),
label: vm.$t('ApiKey'),
component: UploadSecret,
hidden: (formValue) => formValue.secret_type !== 'api_key' || vm.addTemplate
},
@ -152,7 +152,7 @@ export const accountFieldsMeta = (vm) => {
}
},
push_now: {
helpText: vm.$t('accounts.AccountPush.WindowsPushHelpText'),
helpText: vm.$t('AccountPush.WindowsPushHelpText'),
hidden: (formValue) => {
const automation = vm.iPlatform.automation || {}
return !automation.push_account_enabled ||
@ -163,7 +163,7 @@ export const accountFieldsMeta = (vm) => {
}
},
params: {
label: vm.$t('assets.PushParams'),
label: vm.$t('PushParams'),
component: AutomationParamsForm,
el: {
method: vm.asset?.auto_config?.push_account_method
@ -179,10 +179,10 @@ export const accountFieldsMeta = (vm) => {
}
},
is_active: {
label: vm.$t('common.IsActive')
label: vm.$t('IsActive')
},
comment: {
label: vm.$t('common.Comment'),
label: vm.$t('Comment'),
hidden: () => {
return vm.addTemplate
}

View File

@ -348,7 +348,7 @@ export default {
extraMoreActions: [
{
name: 'BulkVerify',
title: this.$t('accounts.BulkVerify'),
title: this.$t('BulkVerify'),
type: 'primary',
fa: 'fa-handshake-o',
can: ({ selectedRows }) => {
@ -361,7 +361,7 @@ export default {
{ action: 'verify', accounts: ids }).then(res => {
openTaskPage(res['task'])
}).catch(err => {
this.$message.error(this.$tc('common.bulkVerifyErrorMsg' + ' ' + err))
this.$message.error(this.$tc('BulkVerifyErrorMsg' + ' ' + err))
})
}.bind(this)
},
@ -386,7 +386,7 @@ export default {
},
{
name: 'actionUpdateSelected',
title: this.$t('accounts.AccountBatchUpdate'),
title: this.$t('AccountBatchUpdate'),
fa: 'batch-update',
can: ({ selectedRows }) => {
return selectedRows.length > 0 &&

View File

@ -5,7 +5,7 @@ import Switcher from '@/components/Form/FormFields/Switcher.vue'
import rules from '@/components/Form/DataForm/rules'
import BasicTree from '@/components/Form/FormFields/BasicTree.vue'
import JsonEditor from '@/components/Form/FormFields/JsonEditor.vue'
import { assignIfNot, capitalizeFirst } from '@/utils/common'
import { assignIfNot, toSentenceCase } from '@/utils/common'
import TagInput from '@/components/Form/FormFields/TagInput.vue'
import TransferSelect from '@/components/Form/FormFields/TransferSelect.vue'
@ -172,7 +172,7 @@ export class FormFieldGenerator {
field = Object.assign(field, fieldMeta)
field.el = el
field.rules = rules
field.label = capitalizeFirst(field.label)
field.label = toSentenceCase(field.label)
_.set(field, 'attrs.error', '')
Vue.$log.debug('Generate field: ', name, field)
return field

View File

@ -367,7 +367,7 @@ export default {
submitFill() {
const crontabDiffMin = this.crontabDiff / 1000 / 60
if (crontabDiffMin > 0 && crontabDiffMin < 10) {
const msg = this.$tc('common.crontabDiffError')
const msg = this.$tc('CrontabDiffError')
this.$message.error(msg)
return
}

View File

@ -19,12 +19,12 @@
<el-autocomplete
v-if="item.type === 'input' &&item.el && item.el.autoComplete"
v-model="item.value"
:placeholder="item.placeholder"
:fetch-suggestions="item.el.query"
:placeholder="item.placeholder"
class="inline-input"
size="mini"
@select="item.callback(item.value)"
@change="item.callback(item.value)"
@select="item.callback(item.value)"
/>
<el-input
v-else-if="item.type==='input'"
@ -94,10 +94,10 @@
</div>
<div v-if="toolbar.hasOwnProperty('fold')" class="fold">
<el-tooltip :content="$tc('common.MoreActions')" placement="top">
<el-tooltip :content="$tc('MoreActions')" placement="top">
<i
class="fa"
:class="[isFold ? 'fa-angle-double-right': 'fa-angle-double-down']"
class="fa"
@click="onChangeFold"
/>
</el-tooltip>

View File

@ -26,7 +26,7 @@ import {
ObjectRelatedFormatter
} from '@/components/Table/TableFormatters'
import i18n from '@/i18n/i18n'
import { capitalizeFirst, newURL, replaceAllUUID } from '@/utils/common'
import { newURL, replaceAllUUID, toSentenceCase } from '@/utils/common'
import ColumnSettingPopover from './components/ColumnSettingPopover.vue'
import LabelsFormatter from '@/components/Table/TableFormatters/LabelsFormatter.vue'
@ -284,7 +284,10 @@ export default {
col = this.addHelpTipsIfNeed(col)
col = this.addFilterIfNeed(col)
col = this.addOrderingIfNeed(col)
col.label = capitalizeFirst(col.label).replace(' Amount', '').replace('数量', '')
col.label = toSentenceCase(col.label)
.replace(' Amount', '')
.replace(' amount', '')
.replace('数量', '')
col = this.setDefaultWidthIfNeed(col)
return col
},

View File

@ -212,7 +212,7 @@ export default {
&>>> .action-item.el-dropdown {
height: 33px;
&> .el-button {
height: 100%;
//height: 100%;
}
}
}

View File

@ -62,7 +62,7 @@ export default {
},
items() {
if (this.formatterArgs.async && !this.asyncGetDone) {
return [this.$t('common.tree.Loading') + '...']
return [this.$t('Loading') + '...']
}
const getItem = this.formatterArgs.getItem || (item => item.name)
let data = this.data.map(item => getItem(item)) || []

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#646A73" d="M11.703 2.052a.87.87 0 0 1 .594 0l9.09 3.293A.95.95 0 0 1 22 6.24a.951.951 0 0 1-.606.902l-9.09 3.374a.87.87 0 0 1-.608 0l-9.09-3.374A.951.951 0 0 1 2 6.24a.95.95 0 0 1 .612-.896l9.09-3.293ZM5.66 6.256 12 8.609l6.339-2.353-6.34-2.296-6.338 2.296Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M11.703 2.052a.87.87 0 0 1 .594 0l9.09 3.293A.95.95 0 0 1 22 6.24a.951.951 0 0 1-.606.902l-9.09 3.374a.87.87 0 0 1-.608 0l-9.09-3.374A.951.951 0 0 1 2 6.24a.95.95 0 0 1 .612-.896l9.09-3.293ZM5.66 6.256 12 8.609l6.339-2.353-6.34-2.296-6.338 2.296Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill="#646A73" d="M2.051 11.685c.166-.496.685-.758 1.158-.584L12 14.324l8.791-3.223c.474-.174.993.088 1.159.584.165.497-.084 1.04-.558 1.214l-9.09 3.333a.87.87 0 0 1-.602 0L2.61 12.9c-.474-.174-.724-.717-.558-1.214Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M2.051 11.685c.166-.496.685-.758 1.158-.584L12 14.324l8.791-3.223c.474-.174.993.088 1.159.584.165.497-.084 1.04-.558 1.214l-9.09 3.333a.87.87 0 0 1-.602 0L2.61 12.9c-.474-.174-.724-.717-.558-1.214Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill="#646A73" d="M2.051 17.4c.166-.497.685-.758 1.158-.585L12 20.04l8.791-3.224c.474-.173.993.088 1.159.585.165.496-.084 1.04-.558 1.213l-9.09 3.334a.87.87 0 0 1-.602 0l-9.09-3.334c-.474-.174-.724-.717-.558-1.213Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M2.051 17.4c.166-.497.685-.758 1.158-.585L12 20.04l8.791-3.224c.474-.173.993.088 1.159.585.165.496-.084 1.04-.558 1.213l-9.09 3.334a.87.87 0 0 1-.602 0l-9.09-3.334c-.474-.174-.724-.717-.558-1.213Z" clip-rule="evenodd" fill-rule="evenodd"/></svg>
<svg t="1707190169322" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17866" width="230" height="240"><path d="M895.36 113.376a64 64 0 0 1 64 64V896a64 64 0 0 1-64 64H522.144a63.68 63.68 0 0 1-32.064-8.576c-9.408 5.44-20.352 8.576-32 8.576H183.68a64 64 0 0 1-64-64V391.424a64 64 0 0 1 64-64h274.432V177.344a64 64 0 0 1 64-64H895.36z m0 64H522.144V896h373.152V177.376z m-437.28 214.08H183.712V896h274.368V391.424zM812.48 735.264v64h-207.36v-64h207.36z m-400.96 0v64H233.28v-64h178.24z m400.96-106.432v64h-207.36v-64h207.36z m-400.96 0v64H233.28v-64h178.24z m400.96-106.432v64h-207.36v-64h207.36z" fill="#000000" p-id="17867"></path></svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 683 B

View File

@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg width="32" height="32" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="none" stroke="#616266" stroke-width="4" stroke-linejoin="round"/><circle cx="14" cy="24" r="3" fill="#616266"/><circle cx="24" cy="24" r="3" fill="#616266"/><circle cx="34" cy="24" r="3" fill="#616266"/></svg>
<?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="none" stroke="#525252" stroke-width="4" stroke-linejoin="round"/><circle cx="14" cy="24" r="3" fill="#525252"/><circle cx="24" cy="24" r="3" fill="#525252"/><circle cx="34" cy="24" r="3" fill="#525252"/></svg>

Before

Width:  |  Height:  |  Size: 472 B

After

Width:  |  Height:  |  Size: 473 B

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#646A73" d="M11.724.54a1 1 0 0 1 .56 0l8.996 2.628a1 1 0 0 1 .72.96v5.389c0 6.095-3.9 11.505-9.683 13.432a1 1 0 0 1-.632 0A14.16 14.16 0 0 1 2 9.514V4.128a1 1 0 0 1 .72-.96L11.724.54ZM4 4.878v4.636a12.16 12.16 0 0 0 8.001 11.427A12.158 12.158 0 0 0 20 9.517v-4.64l-7.996-2.335L4 4.878Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M11.724.54a1 1 0 0 1 .56 0l8.996 2.628a1 1 0 0 1 .72.96v5.389c0 6.095-3.9 11.505-9.683 13.432a1 1 0 0 1-.632 0A14.16 14.16 0 0 1 2 9.514V4.128a1 1 0 0 1 .72-.96L11.724.54ZM4 4.878v4.636a12.16 12.16 0 0 0 8.001 11.427A12.158 12.158 0 0 0 20 9.517v-4.64l-7.996-2.335L4 4.878Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill="#646A73" d="M8.5 10a3.5 3.5 0 1 1 6.057 2.39l.435 3.486A1 1 0 0 1 14 17h-4a1 1 0 0 1-.992-1.124l.435-3.486A3.49 3.49 0 0 1 8.5 10ZM12 8.5a1.5 1.5 0 0 0-.9 2.7 1 1 0 0 1 .392.924L11.132 15h1.735l-.359-2.876a1 1 0 0 1 .392-.924 1.5 1.5 0 0 0-.9-2.7Z" clip-rule="evenodd" fill-rule="evenodd"/><path fill-opacity=".2" fill="#000" d="M8.5 10a3.5 3.5 0 1 1 6.057 2.39l.435 3.486A1 1 0 0 1 14 17h-4a1 1 0 0 1-.992-1.124l.435-3.486A3.49 3.49 0 0 1 8.5 10ZM12 8.5a1.5 1.5 0 0 0-.9 2.7 1 1 0 0 1 .392.924L11.132 15h1.735l-.359-2.876a1 1 0 0 1 .392-.924 1.5 1.5 0 0 0-.9-2.7Z" clip-rule="evenodd" fill-rule="evenodd"/></svg>
<?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 9.25564L24.0086 4L42 9.25564V20.0337C42 31.3622 34.7502 41.4194 24.0026 45.0005C13.2521 41.4195 6 31.36 6 20.0287V9.25564Z" fill="none" stroke="#525252" stroke-width="4" stroke-linejoin="round"/><path d="M15 23L22 30L34 18" stroke="#525252" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 457 B

View File

@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg width="37" height="37" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M42.1691 29.2451L29.2631 42.1511C28.5879 42.8271 27.6716 43.2069 26.7161 43.2069C25.7606 43.2069 24.8444 42.8271 24.1691 42.1511L8 26V8H26L42.1691 24.1691C43.5649 25.5732 43.5649 27.841 42.1691 29.2451Z" fill="none" stroke="#4a4a4a" stroke-width="4" stroke-linejoin="miter"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18.5 21C19.8807 21 21 19.8807 21 18.5C21 17.1193 19.8807 16 18.5 16C17.1193 16 16 17.1193 16 18.5C16 19.8807 17.1193 21 18.5 21Z" fill="#4a4a4a"/></svg>
<svg t="1707202056979" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="67247" width="200" height="200"><path d="M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-0.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-0.2-4.7 0.6-6.3 2.3L137.7 444.8c-3.1 3.1-3.1 8.2 0 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0z m62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9z" p-id="67248"></path><path d="M605.958852 324.826232a48 48 0 1 0 67.881066-67.883435 48 48 0 1 0-67.881066 67.883435Z" p-id="67249"></path><path d="M889.7 539.8l-39.6-39.5c-3.1-3.1-8.2-3.1-11.3 0l-362 361.3-237.6-237c-3.1-3.1-8.2-3.1-11.3 0l-39.6 39.5c-3.1 3.1-3.1 8.2 0 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z" p-id="67250"></path></svg>

Before

Width:  |  Height:  |  Size: 620 B

After

Width:  |  Height:  |  Size: 799 B

View File

@ -80,7 +80,11 @@ export default {
getTitle: {
type: Function,
default: function(obj) {
const objectType = this.$route.meta.title.replace('Detail', '').replace('详情', '')
const objectType = this.$route.meta.title
.replace('Details', '')
.replace('Detail', '')
.replace('详情', '')
.trim()
this.$log.debug('Object is: ', obj)
const titlePrefix = this.titlePrefix || objectType
const objectName = this.getObjectName(obj)
@ -132,6 +136,7 @@ export default {
{
name: 'update',
title: this.$t('Update'),
icon: 'el-icon-edit-outline',
can: this.validActions.canUpdate,
has: this.validActions.hasUpdate,
callback: this.validActions.updateCallback.bind(this)
@ -141,6 +146,7 @@ export default {
title: this.$t('Delete'),
type: 'danger',
plain: true,
icon: 'el-icon-delete',
can: this.validActions.canDelete,
has: this.validActions.hasDelete,
callback: this.validActions.deleteCallback.bind(this)

View File

@ -1,5 +1,5 @@
<script>
import { capitalizeFirst } from '@/utils/common'
import { toTitleCase } from '@/utils/common'
export default {
name: 'MenuItem',
@ -16,21 +16,17 @@ export default {
},
render(h, context) {
const { icon, title } = context.props
const vnodes = []
const vNodes = []
if (icon) {
// const cls = 'fa fa-' + icon
// vnodes.push(<i class={cls} />)
vnodes.push(<svg-icon icon-class={icon}/>)
vNodes.push(<svg-icon icon-class={icon}/>)
}
if (title) {
const iTitle = title.split(' ').map(item => {
return capitalizeFirst(item)
}).join(' ')
vnodes.push(<span slot='title'>{iTitle}</span>)
const iTitle = toTitleCase(title)
vNodes.push(<span slot='title'>{iTitle}</span>)
}
return vnodes
return vNodes
}
}
</script>

View File

@ -21,7 +21,7 @@
>
<span slot="label">
<i v-if="item.icon" :class="item.icon" class="fa " />
{{ capitalizeFirst(item.title) }}
{{ toSentenceCase(item.title) }}
<slot :tab="item.name" name="badge" />
</span>
</el-tab-pane>
@ -42,7 +42,7 @@
<script>
import Page from '../Page/'
import merge from 'webpack-merge'
import { capitalizeFirst } from '@/utils/common'
import { toSentenceCase } from '@/utils/common'
const ACTIVE_TAB_KEY = 'activeTab'
@ -64,7 +64,7 @@ export default {
data() {
return {
loading: true,
capitalizeFirst: capitalizeFirst
toSentenceCase: toSentenceCase
}
},
computed: {

View File

@ -79,7 +79,7 @@ export default [
name: 'AccountTemplateList',
component: () => import('@/views/accounts/AccountTemplate/AccountTemplateList'),
meta: {
title: i18n.t('AccountTemplate'),
title: i18n.t('AccountTemplateList'),
permissions: ['accounts.view_accounttemplate']
}
},

View File

@ -316,3 +316,16 @@ input[type=file] {
.el-select-group__title {
color: $--color-primary !important;
}
.el-button.el-button--small, .el-button--small.is-round {
font-weight: 400;
//line-height: 1.5;
padding: 8px 12px;
}
.el-button.el-button--mini, .el-button--mini.is-round {
font-weight: 400;
font-size: 0.7rem;
padding: 0.2rem 0.4rem;
}

View File

@ -59,9 +59,11 @@
.svg-icon {
margin-right: 16px;
vertical-align: middle;
width: 13px;
height: 13px;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
width: 14px;
height: 14px;
}
.el-menu {

View File

@ -415,11 +415,25 @@ export function formatFileSize(bytes) {
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]
}
export function capitalizeFirst(string) {
export function toTitleCase(string) {
if (!string) return string
return string.trim().split(' ').map(item => {
return item[0].toUpperCase() + item.slice(1)
}).join(' ')
}
export function toSentenceCase(string) {
if (!string) return string
const s = string.trim().split(' ').map(item => {
if (item.length === 0) return ''
if (item.length === 1) return item.toLowerCase()
if (item[0] === item[0].toUpperCase() && item[1] === item[1].toUpperCase()) {
return item
}
return item.toLowerCase()
}).join(' ')
return s[0].toUpperCase() + s.slice(1)
}
export { BASE_URL }

View File

@ -88,7 +88,7 @@ export default {
exportOptions: {
url: '/api/v1/accounts/account-template-secrets/',
mfaVerifyRequired: true,
tips: this.$t('accounts.AccountExportTips')
tips: this.$t('AccountExportTips')
},
createRoute: () => {
return {

View File

@ -52,7 +52,7 @@ export default {
},
data() {
return {
title: this.$t('accounts.QuickTest'),
title: this.$t('QuickTest'),
templateDialogVisible: false,
headerExtraActions: [
{
@ -66,10 +66,10 @@ export default {
],
quickActions: [
{
title: this.$t('accounts.BulkVerify'),
title: this.$t('BulkVerify'),
attrs: {
type: 'primary',
label: this.$tc('accounts.Test')
label: this.$tc('Test')
},
callbacks: Object.freeze({
click: () => {

View File

@ -36,7 +36,7 @@ export default {
hidden: () => !this.$hasPerm('assets.view_gateway')
},
{
title: this.$t('assets.AssetList'),
title: this.$t('AssetList'),
name: 'AssetList',
hidden: () => !this.$hasPerm('assets.view_asset')
}

View File

@ -45,11 +45,11 @@ export default {
extraActions: [
{
name: 'download',
title: this.$t('sessions.download'),
title: this.$t('Download'),
type: 'primary',
can: ({ row }) => { return row.has_file },
tip: ({ row }) => {
return row.has_file ? this.$t('sessions.download') : this.$t('sessions.DownloadFTPFileTip')
return row.has_file ? this.$t('Download') : this.$t('.DownloadFTPFileTip')
},
callback: function({ row }) {
//

View File

@ -66,7 +66,7 @@ export default {
},
AUTH_LDAP_SYNC_RECEIVERS: {
component: Select2,
label: this.$t('AccountChangeSecret.Addressee'),
label: this.$t('Address'),
el: {
value: [],
multiple: true,

View File

@ -113,7 +113,7 @@ export default {
},
org_roles: {
component: Select2,
label: this.$t('users.OrgRoles'),
label: this.$t('OrgRoles'),
rules: this.$store.getters.currentOrgIsRoot ? [] : [rules.RequiredChange],
el: {
multiple: true,
@ -147,7 +147,7 @@ export default {
component: PhoneInput
},
is_active: {
label: this.$t('users.IsActive'),
label: this.$t('IsActive'),
el: {}
}
},
@ -200,7 +200,7 @@ export default {
if (this.user.id === this.currentUser.id) {
const fieldsToUpdate = ['system_roles', 'org_roles', 'is_active']
fieldsToUpdate.forEach(field => {
const msg = this.$t('users.disallowSelfUpdateFields', { attr: this.fieldsMeta[field]['label'] })
const msg = this.$t('disallowSelfUpdateFields', { attr: this.fieldsMeta[field]['label'] })
this.fieldsMeta[field].el.disabled = true
this.fieldsMeta[field].helpTips = msg
})

View File

@ -53,38 +53,7 @@ export default {
}
}
},
{
title: this.$t('ResetMFA'),
attrs: {
type: 'primary',
disabled: !vm.$hasPerm('users.change_user'),
label: this.$t('Reset')
},
callbacks: {
click: function() {
const warnMsg = vm.$t('ResetMFAWarningMsg')
const warnTitle = vm.$t('Info')
const url = `/api/v1/users/users/${vm.object.id}/mfa/reset/`
const successMsg = vm.$t('ResetMFAdSuccessMsg')
vm.$confirm(warnMsg, warnTitle, {
type: 'warning',
confirmButtonClass: 'el-button--warning',
showCancelButton: true,
beforeClose: async(action, instance, done) => {
if (action !== 'confirm') return done()
instance.confirmButtonLoading = true
try {
await vm.$axios.get(url)
done()
vm.$message.success(successMsg)
} finally {
instance.confirmButtonLoading = false
}
}
})
}
}
},
{
title: this.$t('ResetPassword'),
attrs: {
@ -149,6 +118,38 @@ export default {
}
}
},
{
title: this.$t('ResetMFA'),
attrs: {
type: 'primary',
disabled: !vm.$hasPerm('users.change_user'),
label: this.$t('Reset')
},
callbacks: {
click: function() {
const warnMsg = vm.$t('ResetMFAWarningMsg')
const warnTitle = vm.$t('Info')
const url = `/api/v1/users/users/${vm.object.id}/mfa/reset/`
const successMsg = vm.$t('ResetMFAdSuccessMsg')
vm.$confirm(warnMsg, warnTitle, {
type: 'warning',
confirmButtonClass: 'el-button--warning',
showCancelButton: true,
beforeClose: async(action, instance, done) => {
if (action !== 'confirm') return done()
instance.confirmButtonLoading = true
try {
await vm.$axios.get(url)
done()
vm.$message.success(successMsg)
} finally {
instance.confirmButtonLoading = false
}
}
})
}
}
},
{
title: this.$t('UnblockUser'),
attrs: {

View File

@ -54,8 +54,8 @@ export default {
columnsShow: {
min: ['name', 'username', 'actions'],
default: [
'name', 'username', 'email', 'groups', 'system_roles',
'org_roles', 'is_valid', 'actions'
'name', 'username', 'email',
'groups', 'is_valid', 'actions'
]
},
columnsMeta: {