perf: Translate

This commit is contained in:
feng
2024-06-25 19:09:01 +08:00
parent f06d28dab1
commit 7acf008adc
9 changed files with 22 additions and 50 deletions

View File

@@ -258,7 +258,7 @@ export default [
name: 'ZoneDetail',
component: () => import('@/views/assets/Domain/DomainDetail'),
hidden: true,
meta: { title: i18n.t('ZoneDetail') }
meta: { title: i18n.t('Zone') }
}
]
},

View File

@@ -28,8 +28,8 @@ export default {
titlePrefix: this.$t('AccountGatherDetail'),
actions: {
deleteSuccessRoute: 'AccountGatherList',
canUpdate: 'accounts.change_gatheraccountsautomation',
canDelete: 'accounts.delete_gatheraccountsautomation'
canUpdate: this.$hasPerm('accounts.change_gatheraccountsautomation'),
canDelete: this.$hasPerm('accounts.delete_gatheraccountsautomation')
},
submenu: [
{

View File

@@ -65,7 +65,7 @@ export default {
},
domain: {
...meta.domain,
label: this.$t('Zone'),
label: this.$tc('Zone'),
disabled: exclude.includes(this.category)
},
labels: {

View File

@@ -226,8 +226,8 @@ export default {
},
extraMoreActions: [
{
name: 'BulkVerify',
title: this.$t('common.BulkVerify'),
name: 'TestSelected',
title: this.$t('TestSelected'),
type: 'primary',
icon: 'fa fa-link',
can: ({ selectedRows }) =>

View File

@@ -197,7 +197,7 @@ export default {
[this.$t('CloudSource'), ['regions']],
[this.$t('SaveSetting'), [
'hostname_strategy', 'ip_network_segment_group', 'sync_ip_type',
'is_always_update', 'fully_synchronous', 'release_assets'
'is_always_update', 'fully_synchronous'
]],
[this.$t('SyncStrategy'), ['strategy']],
[this.$t('Periodic'), ['is_periodic', 'interval', 'crontab']]
@@ -218,11 +218,6 @@ export default {
label: this.$t('FullySynchronous'),
helpTip: this.$t('FullySynchronousHelpTip')
},
release_assets: {
type: 'switch',
label: this.$t('ReleaseAssets'),
helpTips: this.$t('ReleaseAssetsHelpTips')
},
regions: {
component: Checkbox,
el: {

View File

@@ -59,28 +59,6 @@ export default {
url: `/api/v1/xpack/cloud/accounts/${this.object.id}/`,
excludes: ['attrs', 'task'],
quickEditActions: [
{
title: this.$t('ReleaseAssets'),
type: 'switcher',
attrs: {
model: this.object.task.release_assets,
tip: this.$t('ReleaseAssetsHelpTips'),
type: 'primary',
disabled: !this.hasEditPerm()
},
callbacks: {
change: function(val) {
this.$axios.patch(
`/api/v1/xpack/cloud/sync-instance-tasks/${this.object.task.id}/`,
{ 'release_assets': val }
).then(res => {
this.$message.success(this.$t('UpdateSuccessMsg'))
}).catch(err => {
this.$message.error(this.$t('UpdateErrorMsg' + ' ' + err))
})
}.bind(this)
}
},
{
title: this.$t('IpType'),
type: 'updateSelect',
@@ -205,10 +183,6 @@ export default {
</div>)
}
},
{
key: this.$t('ReleaseAssets'),
value: this.object?.task.release_assets
},
{
key: this.$t('DateLastSync'),
value: this.object?.task?.date_last_sync ? toSafeLocalDateStr(this.object?.task.date_created) : ''

View File

@@ -12,7 +12,12 @@
<i class="el-icon-more el-icon--right" style="color: var(--color-text-primary)" />
</el-link>
<el-dropdown-menu default="dropdown">
<el-dropdown-item v-for="action in actions" :key="action.name" @click.native="action.callback">
<el-dropdown-item
v-for="action in actions"
:key="action.name"
:class="{ 'is-disabled': action.disabled }"
@click.native="!action.disabled && action.callback"
>
<i v-if="action.icon" :class="action.icon" /> {{ action.name }}
</el-dropdown-item>
</el-dropdown-menu>
@@ -93,17 +98,20 @@ export default {
{
name: this.$tc('Update'),
icon: 'el-icon-edit',
callback: this.handleUpdate
callback: this.handleUpdate,
disabled: !this.$hasPerm('xpack.change_account')
},
{
name: this.$tc('Delete'),
icon: 'el-icon-delete',
callback: this.handleDelete
callback: this.handleDelete,
disabled: !this.$hasPerm('xpack.delete_account')
},
{
name: this.$tc('SyncOnline'),
icon: 'el-icon-thumb',
callback: this.handleOnlineExecute
callback: this.handleOnlineExecute,
disabled: !this.$hasPerm('xpack.change_syncinstancetask')
}
]
}

View File

@@ -26,7 +26,7 @@ export default {
[this.$t('xpack.Cloud.CloudSource'), ['account', 'regions']],
[this.$t('xpack.Cloud.SaveSetting'), [
'hostname_strategy', 'ip_network_segment_group',
'sync_ip_type', 'is_always_update', 'fully_synchronous', 'release_assets'
'sync_ip_type', 'is_always_update', 'fully_synchronous'
]],
[this.$t('xpack.Cloud.SyncStrategy'), ['strategy']],
[this.$t('xpack.Timer'), ['is_periodic', 'crontab', 'interval']],
@@ -68,11 +68,6 @@ export default {
label: this.$t('xpack.Cloud.FullySynchronous'),
helpTips: this.$t('xpack.Cloud.FullySynchronousHelpTips')
},
release_assets: {
type: 'switch',
label: this.$t('xpack.Cloud.ReleaseAssets'),
helpTips: this.$t('xpack.Cloud.ReleaseAssetsHelpTips')
},
regions: {
component: Select2,
el: {

View File

@@ -5,7 +5,7 @@
v-if="visible"
:show-cancel="false"
:show-confirm="false"
:title="$tc('Template')"
:title="$tc('EmailTemplate')"
:visible.sync="visible"
width="70%"
@confirm="onConfirm()"
@@ -31,7 +31,7 @@ export default {
visible: false,
fields: [
[this.$t('General'), ['EMAIL_SUBJECT_PREFIX']],
[this.$t('User creation'),
[this.$t('CreateUserContent'),
[
'EMAIL_CUSTOM_USER_CREATED_SUBJECT', 'EMAIL_CUSTOM_USER_CREATED_HONORIFIC', 'EMAIL_CUSTOM_USER_CREATED_BODY'
]