mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-29 21:28:52 +00:00
perf: update i18n
This commit is contained in:
@@ -162,6 +162,7 @@ export default {
|
||||
account: {},
|
||||
secretUrl: '',
|
||||
quickFilters: accountQuickFilters,
|
||||
tabDeactivated: false,
|
||||
tableConfig: {
|
||||
url: this.url,
|
||||
permissions: {
|
||||
@@ -205,15 +206,7 @@ export default {
|
||||
},
|
||||
asset: {
|
||||
formatter: row => {
|
||||
const to = {
|
||||
name: 'AssetDetail',
|
||||
params: { id: row.asset.id }
|
||||
}
|
||||
if (vm.$hasPerm('assets.view_asset')) {
|
||||
return <router-link to={to}>{row.asset.name}</router-link>
|
||||
} else {
|
||||
return <span>{row.asset.name}</span>
|
||||
}
|
||||
return <span>{row.asset.name}</span>
|
||||
}
|
||||
},
|
||||
platform: {
|
||||
@@ -254,9 +247,9 @@ export default {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
hasUpdate: false, // can set function(row, value)
|
||||
hasDelete: false, // can set function(row, value)
|
||||
hasDelete: true, // can set function(row, value)
|
||||
hasClone: false,
|
||||
canClone: true,
|
||||
canDelete: () => vm.$hasPerm('accounts.delete_account'),
|
||||
moreActionsTitle: this.$t('More'),
|
||||
extraActions: accountOtherActions(this)
|
||||
}
|
||||
@@ -319,7 +312,7 @@ export default {
|
||||
name: 'TestSelected',
|
||||
title: this.$t('TestSelected'),
|
||||
type: 'primary',
|
||||
icon: 'fa-link',
|
||||
icon: 'verify',
|
||||
can: ({ selectedRows }) => {
|
||||
return selectedRows.length > 0 &&
|
||||
['clickhouse', 'redis', 'website', 'chatgpt'].indexOf(selectedRows[0].asset.type.value) === -1 &&
|
||||
@@ -399,12 +392,12 @@ export default {
|
||||
},
|
||||
activated() {
|
||||
// 由于组件嵌套较深,有可能导致 Error in activated hook: "TypeError: Cannot read properties of undefined (reading 'getList')" 的问题
|
||||
setTimeout(() => {
|
||||
this.refresh()
|
||||
}, 300)
|
||||
if (this.tabDeactivated) {
|
||||
setTimeout(() => this.refresh(), 300)
|
||||
}
|
||||
},
|
||||
deactivated() {
|
||||
this.deactive = true
|
||||
this.tabDeactivated = true
|
||||
},
|
||||
methods: {
|
||||
setActions() {
|
||||
@@ -417,31 +410,6 @@ export default {
|
||||
actionColumn.formatterArgs.extraActions.push(item)
|
||||
}
|
||||
}
|
||||
if (this.hasDeleteAction) {
|
||||
this.tableConfig.columnsMeta.actions.formatterArgs.extraActions.push(
|
||||
{
|
||||
name: 'Delete',
|
||||
title: this.$t('Delete'),
|
||||
can: this.$hasPerm('accounts.delete_account'),
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
const msg = this.$t('AccountDeleteConfirmMsg')
|
||||
this.$confirm(msg, this.$tc('Info'), {
|
||||
type: 'warning',
|
||||
confirmButtonClass: 'el-button--danger',
|
||||
beforeClose: async(action, instance, done) => {
|
||||
if (action !== 'confirm') return done()
|
||||
this.$axios.delete(`/api/v1/accounts/accounts/${row.id}/`).then(() => {
|
||||
done()
|
||||
this.$refs.ListTable.reloadTable()
|
||||
this.$message.success(this.$tc('DeleteSuccessMsg'))
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
onUpdateAuthDone(account) {
|
||||
Object.assign(this.account, account)
|
||||
|
||||
@@ -30,6 +30,7 @@ export const accountOtherActions = (vm) => [
|
||||
title: vm.$t('View'),
|
||||
can: vm.$hasPerm('accounts.view_accountsecret'),
|
||||
type: 'primary',
|
||||
order: 1,
|
||||
callback: ({ row }) => {
|
||||
// debugger
|
||||
vm.secretUrl = `/api/v1/accounts/account-secrets/${row.id}/`
|
||||
@@ -58,9 +59,28 @@ export const accountOtherActions = (vm) => [
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Clone',
|
||||
title: vm.$t('Duplicate'),
|
||||
can: vm.$hasPerm('accounts.add_account') && !vm.$store.getters.currentOrgIsRoot,
|
||||
callback: ({ row }) => {
|
||||
const data = {
|
||||
...vm.asset,
|
||||
...row.asset
|
||||
}
|
||||
vm.account = row
|
||||
vm.iAsset = data
|
||||
vm.showAddDialog = false
|
||||
vm.accountCreateUpdateTitle = vm.$t('DuplicateAccount')
|
||||
setTimeout(() => {
|
||||
vm.showAddDialog = true
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Test',
|
||||
title: vm.$t('验证密文'),
|
||||
divided: true,
|
||||
can: ({ row }) =>
|
||||
!vm.$store.getters.currentOrgIsRoot &&
|
||||
vm.$hasPerm('accounts.verify_account') &&
|
||||
@@ -104,10 +124,11 @@ export const accountOtherActions = (vm) => [
|
||||
},
|
||||
{
|
||||
name: 'CopyToOther',
|
||||
title: '复制到其他资产',
|
||||
title: vm.$t('CopyToOther'),
|
||||
type: 'primary',
|
||||
divided: true,
|
||||
callback: ({ row }) => {
|
||||
vm.accountCreateUpdateTitle = vm.$t('CopyToOther')
|
||||
vm.$route.query.flag = 'copy'
|
||||
vm.iAsset = vm.asset
|
||||
vm.account = row
|
||||
@@ -116,19 +137,15 @@ export const accountOtherActions = (vm) => [
|
||||
},
|
||||
{
|
||||
name: 'MoveToOther',
|
||||
title: '移动到其他资产',
|
||||
title: vm.$t('MoveToOther'),
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
vm.accountCreateUpdateTitle = vm.$t('MoveToOther')
|
||||
vm.$route.query.flag = 'move'
|
||||
vm.iAsset = vm.asset
|
||||
vm.account = row
|
||||
vm.showAddDialog = true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Clone',
|
||||
title: vm.$t('Duplicate'),
|
||||
divided: true
|
||||
}
|
||||
]
|
||||
|
||||
@@ -186,7 +203,7 @@ export const accountQuickFilters = [
|
||||
{
|
||||
label: '弱密码',
|
||||
filter: {
|
||||
risk: 'week_password'
|
||||
risk: 'weak_password'
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -100,7 +100,7 @@ export default {
|
||||
extraQuery: extraQuery,
|
||||
actionInit: this.headerActions.has === false,
|
||||
initQuery: {},
|
||||
filterExpand: localStorage.getItem('filterExpand') === '1'
|
||||
filterExpand: localStorage.getItem('filterExpand') !== '0'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<span v-if="realValue" :class="formatterArgs.actionLeft ? 'left' : 'right'" class="action">
|
||||
<span :class="formatterArgs.actionLeft ? 'left' : 'right'" class="action">
|
||||
<template v-for="(item, index) in iActions">
|
||||
<el-tooltip
|
||||
v-if="item.has"
|
||||
|
||||
5
src/icons/svg/activate.svg
Normal file
5
src/icons/svg/activate.svg
Normal file
@@ -0,0 +1,5 @@
|
||||
<svg t="1736148692584" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="41075" width="200" height="200">
|
||||
<path d="M512.034996 927.992188c-229.350883 0-415.937195-186.646305-415.937196-415.927196 0-229.290891 186.586312-415.937195 415.937196-415.937196s415.927197 186.646305 415.927196 415.937196c0 229.280892-186.576314 415.927197-415.927196 415.927196z m0-927.862205C229.330886 0.129983 0.099987 229.360882 0.099987 512.064992s229.230898 511.935008 511.935009 511.935008 511.935008-229.2209 511.935008-511.935008c0-282.70411-229.2209-511.935008-511.935008-511.935009z m209.893353 352.33527c-12.948356-0.539931-26.016697 3.789519-35.895443 13.728258L464.03109 588.195327 337.977093 462.131331c-9.878746-9.878746-22.947087-14.208196-35.835451-13.728257-11.628524 0.479939-23.127064 4.819388-32.045931 13.728257-8.848877 8.848877-13.188326 20.417408-13.668265 32.045932-0.479939 12.888364 3.849511 25.956705 13.668265 35.83545l159.969691 159.959693c9.388808 9.338814 21.677248 14.028219 33.905695 14.028219 12.28844 0 24.57688-4.699403 33.905696-14.028219l255.967504-255.967504c9.878746-9.878746 14.218195-22.947087 13.738256-35.835451-0.479939-11.628524-4.819388-23.187056-13.738256-32.045932-8.908869-8.838878-20.297423-13.238319-31.915948-13.658266z"
|
||||
fill="#515151" p-id="41076"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
5
src/icons/svg/disable.svg
Normal file
5
src/icons/svg/disable.svg
Normal file
@@ -0,0 +1,5 @@
|
||||
<svg t="1736148729915" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="42152" width="200" height="200">
|
||||
<path d="M512 0a512 512 0 1 0 0 1024A512 512 0 0 0 512 0zM113.777778 512a398.222222 398.222222 0 0 1 398.222222-398.222222c89.429333 0 171.690667 29.809778 238.193778 79.587555L193.422222 750.136889A395.377778 395.377778 0 0 1 113.777778 512z m398.222222 398.222222a395.719111 395.719111 0 0 1-238.136889-79.587555L830.577778 273.806222A396.060444 396.060444 0 0 1 910.222222 512a398.222222 398.222222 0 0 1-398.222222 398.222222z"
|
||||
fill="#515151" p-id="42153"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 642 B |
@@ -1,9 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="184px" height="184px" viewBox="0 0 184 184" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>编组</title>
|
||||
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="编组" fill="#333333" fill-rule="nonzero">
|
||||
<path d="M91.6666666,183.341458 C41.0405646,183.341458 -6.9388939e-15,142.300894 -6.9388939e-15,91.6747917 C0.0535397665,70.505775 7.41237071,50.0040719 20.8333332,33.6331251 C23.6218122,30.2086156 27.7168568,28.1082053 32.125,27.8414583 C36.6727552,27.6410729 41.0978101,29.347664 44.3333332,32.5497917 L97.5416666,85.7997917 C100.373139,89.1061274 100.182768,94.0347428 97.1046929,97.112818 C94.0266177,100.190893 89.0980023,100.381265 85.7916666,97.5497917 L33.0833332,44.8831251 C22.4640203,58.1678232 16.6752268,74.6673541 16.6666666,91.6747917 C16.634797,112.309451 25.1059247,132.045685 40.0857285,146.237078 C55.0655324,160.428471 75.2305194,167.821188 95.8333332,166.674792 C133.947312,164.34614 164.338015,133.955437 166.666667,95.8414583 C167.813062,75.2386445 160.420346,55.0736575 146.228953,40.0938537 C132.03756,25.1140498 112.301325,16.6429221 91.6666666,16.6747917 C85.0987008,16.6886637 78.5594988,17.5428207 72.2083332,19.2164583 C67.9277344,19.9697568 63.787032,17.3066153 62.6970126,13.0991407 C61.6069933,8.89166618 63.9337598,4.55301463 68.0416666,3.13312512 C96.4092432,-4.47902134 126.706595,1.9631523 149.522872,20.4586022 C172.33915,38.9540521 184.910974,67.2627144 183.333333,96.5914583 C180.529036,143.291305 143.283179,180.537161 96.5833332,183.341458 L91.6666666,183.341458 Z" id="路径"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<svg width="184px" height="184px" viewBox="0 0 184 184" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path d="M91.6666666,183.341458 C41.0405646,183.341458 -6.9388939e-15,142.300894 -6.9388939e-15,91.6747917 C0.0535397665,70.505775 7.41237071,50.0040719 20.8333332,33.6331251 C23.6218122,30.2086156 27.7168568,28.1082053 32.125,27.8414583 C36.6727552,27.6410729 41.0978101,29.347664 44.3333332,32.5497917 L97.5416666,85.7997917 C100.373139,89.1061274 100.182768,94.0347428 97.1046929,97.112818 C94.0266177,100.190893 89.0980023,100.381265 85.7916666,97.5497917 L33.0833332,44.8831251 C22.4640203,58.1678232 16.6752268,74.6673541 16.6666666,91.6747917 C16.634797,112.309451 25.1059247,132.045685 40.0857285,146.237078 C55.0655324,160.428471 75.2305194,167.821188 95.8333332,166.674792 C133.947312,164.34614 164.338015,133.955437 166.666667,95.8414583 C167.813062,75.2386445 160.420346,55.0736575 146.228953,40.0938537 C132.03756,25.1140498 112.301325,16.6429221 91.6666666,16.6747917 C85.0987008,16.6886637 78.5594988,17.5428207 72.2083332,19.2164583 C67.9277344,19.9697568 63.787032,17.3066153 62.6970126,13.0991407 C61.6069933,8.89166618 63.9337598,4.55301463 68.0416666,3.13312512 C96.4092432,-4.47902134 126.706595,1.9631523 149.522872,20.4586022 C172.33915,38.9540521 184.910974,67.2627144 183.333333,96.5914583 C180.529036,143.291305 143.283179,180.537161 96.5833332,183.341458 L91.6666666,183.341458 Z"
|
||||
id="路径"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.5 KiB |
6
src/icons/svg/verify.svg
Normal file
6
src/icons/svg/verify.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
||||
<g stroke="#515151" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5">
|
||||
<path d="m8.38 12 2.41 2.42 4.83-4.84004"/>
|
||||
<path d="m10.75 2.44995c.69-.59 1.82-.59 2.52 0l1.58 1.36c.3.26.86.47 1.26.47h1.7c1.06 0 1.93.87 1.93 1.93v1.7c0 .39.21.96.47 1.26l1.36 1.57995c.59.69.59 1.82 0 2.52l-1.36 1.58c-.26.3-.47.86-.47 1.26v1.7c0 1.06-.87 1.93-1.93 1.93h-1.7c-.39 0-.96.21-1.26.47l-1.58 1.36c-.69.59-1.82.59-2.52 0l-1.58-1.36c-.3-.26-.86-.47-1.26-.47h-1.73c-1.06 0-1.93-.87-1.93-1.93v-1.71c0-.39-.21-.95-.46-1.25l-1.35-1.59c-.58-.69-.58-1.81 0-2.5l1.35-1.58995c.25-.3.46-.86.46-1.25v-1.72c0-1.06.87-1.93 1.93-1.93h1.73c.39 0 .96-.21 1.26-.47z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 785 B |
@@ -174,9 +174,17 @@ export default {
|
||||
margin-bottom: 5px;
|
||||
|
||||
.el-tabs__item {
|
||||
i.pre-icon {
|
||||
.pre-icon {
|
||||
width: 16px;
|
||||
display: inline-block;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
.pre-icon {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-tabs__nav-next {
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import {
|
||||
ActionsFormatter,
|
||||
ArrayFormatter,
|
||||
ChoicesFormatter,
|
||||
DetailFormatter,
|
||||
PlatformFormatter,
|
||||
ProtocolsFormatter
|
||||
ActionsFormatter, ArrayFormatter, ChoicesFormatter, DetailFormatter, PlatformFormatter, ProtocolsFormatter
|
||||
} from '@/components/Table/TableFormatters'
|
||||
import HostInfoFormatter from '@/components/Table/TableFormatters/HostInfoFormatter.vue'
|
||||
import AmountFormatter from '@/components/Table/TableFormatters/AmountFormatter.vue'
|
||||
@@ -33,6 +28,7 @@ export function getDefaultConfig(vm) {
|
||||
name: 'TestSelected',
|
||||
title: vm.$t('TestSelected'),
|
||||
type: 'primary',
|
||||
icon: 'verify',
|
||||
can: ({ selectedRows }) =>
|
||||
vm.$hasPerm('assets.test_assetconnectivity') &&
|
||||
!vm.$store.getters.currentOrgIsRoot &&
|
||||
@@ -56,7 +52,7 @@ export function getDefaultConfig(vm) {
|
||||
name: 'DeactiveSelected',
|
||||
title: vm.$t('DisableSelected'),
|
||||
type: 'primary',
|
||||
icon: 'fa fa-ban',
|
||||
icon: 'disable',
|
||||
can: ({ selectedRows }) => {
|
||||
return selectedRows.length > 0 && vm.$hasPerm('assets.change_asset')
|
||||
},
|
||||
@@ -76,7 +72,7 @@ export function getDefaultConfig(vm) {
|
||||
name: 'ActiveSelected',
|
||||
title: vm.$t('ActivateSelected'),
|
||||
type: 'primary',
|
||||
icon: 'fa fa-check-circle-o',
|
||||
icon: 'activate',
|
||||
can: ({ selectedRows }) => {
|
||||
return selectedRows.length > 0 && vm.$hasPerm('assets.change_asset')
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user