perf: i18n Tools

This commit is contained in:
Bai
2024-05-27 15:08:32 +08:00
10 changed files with 88 additions and 25 deletions

View File

@@ -17,7 +17,7 @@
ref="SearchInput"
v-model.trim="filterValue"
:fetch-suggestions="autocomplete"
:placeholder="this.$t('EnterToContinue')"
:placeholder="this.iPlaceholder"
:type="inputType"
class="search-input"
@blur="focus = false"
@@ -85,6 +85,12 @@ export default {
component: this.autocomplete ? 'el-autocomplete' : 'el-input'
}
},
computed: {
iPlaceholder() {
return `${this.placeholder} ( ${this.$t('EnterToContinue')} )`
}
},
watch: {
value(val) {
this.filterTags = val

View File

@@ -248,9 +248,25 @@ export default {
permissions: ['ops.view_playbook'],
activeMenu: '/workbench/ops/templates'
}
},
}
]
},
{
path: '/workbench/system-tools',
component: empty,
name: 'More',
alwaysShow: true,
meta: {
title: i18n.t('MenuMore'),
icon: 'more',
permissions: [],
hidden: () => {
return !store.getters.publicSettings['TOOL_USER_ENABLED']
}
},
children: [
{
path: '/workbench/system-tools',
path: '',
name: 'SystemTools',
component: () => import('@/views/settings/Tool'),
meta: {

View File

@@ -38,7 +38,7 @@ export default {
getSubmenu() {
return [
{
title: this.$t('GenericSetting'),
title: this.$t('General'),
name: 'Lina'
},
{

View File

@@ -0,0 +1,36 @@
<template>
<IBox>
<GenericCreateUpdateForm
:has-detail-in-msg="false"
:submit-method="submitMethod"
v-bind="$data"
/>
</IBox>
</template>
<script>
import { IBox } from '@/components'
import GenericCreateUpdateForm from '@/layout/components/GenericCreateUpdateForm/index.vue'
export default {
name: 'Basic',
components: {
GenericCreateUpdateForm,
IBox
},
data() {
return {
fields: ['TOOL_USER_ENABLED'],
url: '/api/v1/settings/setting/?category=tool'
}
},
methods: {
submitMethod() {
return 'patch'
}
}
}
</script>
<style scoped>
</style>

View File

@@ -18,8 +18,7 @@ export default {
fields: [
{
name: 'dest_ips',
label: this.$t('DestinationIP'),
tip: this.$t('IP'),
label: this.$t('DA'),
el: {
placeholder: this.$t('DestinationIP')
}
@@ -27,9 +26,10 @@ export default {
{
name: 'dest_ports',
component: TagInput,
label: this.$t('DestinationPort'),
label: this.$t('DP'),
el: {
inputType: 'number'
inputType: 'number',
placeholder: this.$t('DestinationPort')
}
}
],

View File

@@ -16,8 +16,7 @@ export default {
taskType: 'ping',
fields: [{
name: 'dest_ips',
label: this.$t('DestinationIP'),
tip: this.$t('IP'),
label: this.$t('DA'),
el: {
placeholder: this.$t('DestinationIP')
}

View File

@@ -22,8 +22,7 @@ export default {
},
{
name: 'src_ips',
label: this.$t('SourceIP'),
tip: this.$t('IP'),
label: this.$t('SA'),
el: {
placeholder: this.$t('SourceIP')
}
@@ -31,15 +30,15 @@ export default {
{
name: 'src_ports',
component: TagInput,
label: this.$t('SourcePort'),
label: this.$t('SP'),
el: {
inputType: 'number'
inputType: 'number',
placeholder: this.$t('SourcePort')
}
},
{
name: 'dest_ips',
label: this.$t('DestinationIP'),
tip: this.$t('IP'),
label: this.$t('DA'),
el: {
placeholder: this.$t('DestinationIP')
}
@@ -47,9 +46,10 @@ export default {
{
name: 'dest_ports',
component: TagInput,
label: this.$t('DestinationPort'),
label: this.$t('DP'),
el: {
inputType: 'number'
inputType: 'number',
placeholder: this.$t('DestinationPort')
}
}
]

View File

@@ -17,15 +17,14 @@ export default {
fields: [
{
name: 'dest_ips',
label: this.$t('DestinationIP'),
tip: this.$t('IP'),
label: this.$t('DA'),
el: {
placeholder: this.$t('DestinationIP')
}
},
{
name: 'dest_port',
label: this.$t('DestinationPort'),
label: this.$t('DP'),
el: {
type: 'number',
placeholder: this.$t('DestinationPort')

View File

@@ -16,8 +16,7 @@ export default {
taskType: 'traceroute',
fields: [{
name: 'dest_ips',
label: this.$t('DestinationIP'),
tip: this.$t('IP'),
label: this.$t('DA'),
el: {
placeholder: this.$t('DestinationIP')
}

View File

@@ -18,6 +18,7 @@ import Telnet from './Telnet'
import Nmap from './Nmap'
import Tcpdump from './Tcpdump'
import Traceroute from './Traceroute'
import Basic from './Basic'
export default {
components: {
@@ -26,15 +27,21 @@ export default {
Telnet,
Nmap,
Tcpdump,
Traceroute
Traceroute,
Basic
},
data() {
return {
timer: null,
currentTime: '',
loading: true,
activeMenu: 'Ping',
activeMenu: 'Basic',
submenu: [
{
title: this.$t('Basic'),
name: 'Basic',
hidden: () => !this.$route?.fullPath?.startsWith('/settings/tools')
},
{
title: 'Ping',
name: 'Ping'
@@ -64,6 +71,7 @@ export default {
}
},
created() {
console.log('>>>', this.$route)
if (this.timer) {
clearInterval(this.timer)
}