updated Multi Language for a few pages

This commit is contained in:
Marvin Zhang
2019-03-27 12:35:22 +08:00
parent 3af510a417
commit d44e5d2518
13 changed files with 118 additions and 75 deletions

View File

@@ -3,7 +3,7 @@
<!--filter-->
<div class="filter">
<el-input prefix-icon="el-icon-search"
placeholder="Search"
:placeholder="$t('Search')"
class="filter-search"
v-model="filter.keyword"
@change="onSearch">
@@ -13,7 +13,7 @@
icon="el-icon-refresh"
class="refresh"
@click="onRefresh">
Refresh
{{$t('Refresh')}}
</el-button>
</div>
</div>
@@ -26,7 +26,7 @@
<template v-for="col in columns">
<el-table-column v-if="col.name === 'spider_name'"
:key="col.name"
:label="col.label"
:label="$t(col.label)"
:sortable="col.sortable"
align="center"
:width="col.width">
@@ -36,7 +36,7 @@
</el-table-column>
<el-table-column v-else-if="col.name === 'node_id'"
:key="col.name"
:label="col.label"
:label="$t(col.label)"
:sortable="col.sortable"
align="center"
:width="col.width">
@@ -47,15 +47,15 @@
<el-table-column v-else
:key="col.name"
:property="col.name"
:label="col.label"
:label="$t(col.label)"
:sortable="col.sortable"
align="center"
:width="col.width">
</el-table-column>
</template>
<el-table-column label="Action" align="center" width="160">
<el-table-column :label="$t('Action')" align="center" width="160">
<template slot-scope="scope">
<el-tooltip content="View" placement="top">
<el-tooltip :content="$t('View')" placement="top">
<el-button type="primary" icon="el-icon-search" size="mini" @click="onView(scope.row)"></el-button>
</el-tooltip>
</template>

View File

@@ -9,7 +9,7 @@
</el-col>
<el-col :span="18" class="text-col">
<el-row>
<label class="label">{{m.label}}</label>
<label class="label">{{$t(m.label)}}</label>
</el-row>
<el-row>
<div class="value">{{overviewStats[m.name]}}</div>
@@ -21,7 +21,7 @@
</el-row>
<el-row>
<el-card shadow="hover">
<h4 class="title">Daily New Tasks</h4>
<h4 class="title">{{$t('Daily New Tasks')}}</h4>
<div id="echarts-daily-tasks" class="echarts-box"></div>
</el-card>
</el-row>

View File

@@ -9,7 +9,7 @@
</span>
<el-dropdown-menu slot="dropdown" class="user-dropdown">
<el-dropdown-item>
<span style="display:block;" @click="logout">LogOut</span>
<span style="display:block;" @click="logout">{{$t('Logout')}}</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>

View File

@@ -6,14 +6,14 @@
<app-link :to="resolvePath(onlyOneChild.path)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<item v-if="onlyOneChild.meta" :icon="onlyOneChild.meta.icon||item.meta.icon"
:title="onlyOneChild.meta.title"/>
:title="$t(onlyOneChild.meta.title)"/>
</el-menu-item>
</app-link>
</template>
<el-submenu v-else :index="resolvePath(item.path)">
<template slot="title">
<item v-if="item.meta" :icon="item.meta.icon" :title="item.meta.title"/>
<item v-if="item.meta" :icon="item.meta.icon" :title="$t(item.meta.title)"/>
</template>
<template v-for="child in item.children">
@@ -26,7 +26,7 @@
class="nest-menu"/>
<app-link v-else :to="resolvePath(child.path)" :key="child.name">
<el-menu-item :index="resolvePath(child.path)">
<item v-if="child.meta" :icon="child.meta.icon" :title="child.meta.title"/>
<item v-if="child.meta" :icon="child.meta.icon" :title="$t(child.meta.title)"/>
</el-menu-item>
</app-link>
</template>

View File

@@ -3,7 +3,7 @@
<!--filter-->
<div class="filter">
<el-input prefix-icon="el-icon-search"
placeholder="Search"
:placeholder="$t('Search')"
class="filter-search"
v-model="filter.keyword"
@change="onSearch">
@@ -13,7 +13,7 @@
icon="el-icon-refresh"
class="refresh"
@click="onRefresh">
Refresh
{{$t('Refresh')}}
</el-button>
</div>
</div>
@@ -26,34 +26,34 @@
<template v-for="col in columns">
<el-table-column v-if="col.name === 'status'"
:key="col.name"
:label="col.label"
:label="$t(col.label)"
:sortable="col.sortable"
align="center"
:width="col.width">
<template slot-scope="scope">
<el-tag type="info" v-if="scope.row.status === 'offline'">Offline</el-tag>
<el-tag type="success" v-else-if="scope.row.status === 'online'">Online</el-tag>
<el-tag type="danger" v-else>Unavailable</el-tag>
<el-tag type="info" v-if="scope.row.status === 'offline'">{{$t('Offline')}}</el-tag>
<el-tag type="success" v-else-if="scope.row.status === 'online'">{{$t('Online')}}</el-tag>
<el-tag type="danger" v-else>{{$t('Unavailable')}}</el-tag>
</template>
</el-table-column>
<el-table-column v-else
:key="col.name"
:property="col.name"
:label="col.label"
:label="$t(col.label)"
:sortable="col.sortable"
align="center"
:width="col.width">
</el-table-column>
</template>
<el-table-column label="Action" align="center" width="160">
<el-table-column :label="$t('Action')" align="center" width="160">
<template slot-scope="scope">
<el-tooltip content="View" placement="top">
<el-tooltip :content="$t('View')" placement="top">
<el-button type="primary" icon="el-icon-search" size="mini" @click="onView(scope.row)"></el-button>
</el-tooltip>
<el-tooltip content="Edit" placement="top">
<el-tooltip :content="$t('Edit')" placement="top">
<el-button type="warning" icon="el-icon-edit" size="mini" @click="onView(scope.row)"></el-button>
</el-tooltip>
<el-tooltip content="Edit" placement="top">
<el-tooltip :content="$t('Remove')" placement="top">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="onRemove(scope.row)"></el-button>
</el-tooltip>
</template>
@@ -165,9 +165,9 @@ export default {
this.dialogVisible = true
},
onRemove (row) {
this.$confirm('Are you sure to delete this node?', 'Notification', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
this.$confirm(this.$t('Are you sure to delete this node?'), this.$t('Notification'), {
confirmButtonText: this.$t('Confirm'),
cancelButtonText: this.$t('Cancel'),
type: 'warning'
}).then(() => {
this.$store.dispatch('node/deleteNode', row._id)

View File

@@ -228,9 +228,9 @@ export default {
this.dialogVisible = true
},
onRemove (row) {
this.$confirm('Are you sure to delete this spider?', 'Notification', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
this.$confirm(this.$t('Are you sure to delete this spider?)', this.$t('Notification'), {
confirmButtonText: this.$t('Confirm'),
cancelButtonText: this.$t('Cancel'),
type: 'warning'
}).then(() => {
this.$store.dispatch('spider/deleteSpider', row._id)

View File

@@ -219,9 +219,9 @@ export default {
this.dialogVisible = true
},
onRemove (row) {
this.$confirm('Are you sure to delete this spider?', 'Notification', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
this.$confirm(this.$t('Are you sure to delete this spider?'), this.$t('Notification'), {
confirmButtonText: this.$t('Confirm'),
cancelButtonText: this.$t('Cancel'),
type: 'warning'
}).then(() => {
this.$store.dispatch('spider/deleteSpider', row._id)
@@ -234,9 +234,9 @@ export default {
})
},
onDeploy (row) {
this.$confirm('Are you sure to deploy this spider?', 'Notification', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
this.$confirm(this.$t('Are you sure to deploy this spider?'), this.$t('Notification'), {
confirmButtonText: this.$t('Confirm'),
cancelButtonText: this.$t('Cancel'),
type: 'warning'
}).then(() => {
this.$store.dispatch('spider/deploySpider', row._id)
@@ -249,14 +249,14 @@ export default {
})
},
onCrawl (row) {
this.$confirm('Are you sure to run this spider', 'Notice', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel'
this.$confirm(this.$t('Are you sure to run this spider?'), this.$t('Notification'), {
confirmButtonText: this.$t('Confirm'),
cancelButtonText: this.$t('Cancel')
})
.then(() => {
this.$store.dispatch('spider/crawlSpider', row._id)
.then(() => {
this.$message.success(`Running spider "${row._id}" has been scheduled`)
this.$message.success(this.$t(`Spider task has been scheduled`))
})
})
},
@@ -290,15 +290,15 @@ export default {
this.dialogVisible = true
},
onDeployAll () {
this.$confirm('Are you sure to deploy all spiders to active nodes?', 'Notice', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
this.$confirm(this.$t('Are you sure to deploy all spiders to active nodes?'), this.$t('Notification'), {
confirmButtonText: this.$t('Confirm'),
cancelButtonText: this.$t('Cancel'),
type: 'warning'
})
.then(() => {
this.$store.dispatch('spider/deployAll')
.then(() => {
this.$message.success('Deployed all spiders successfully')
this.$message.success(this.$t('Deployed all spiders successfully'))
})
})
}

View File

@@ -166,9 +166,9 @@ export default {
this.$store.dispatch('task/getTaskList')
},
onRemove (row) {
this.$confirm('Are you sure to delete this task?', 'Notification', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
this.$confirm(this.$t('Are you sure to delete this task?'), this.$t('Notification'), {
confirmButtonText: this.$t('Confirm'),
cancelButtonText: this.$t('Cancel'),
type: 'warning'
}).then(() => {
this.$store.dispatch('task/deleteTask', row._id)