mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-01 15:07:43 +00:00
[Update] 去掉i18n的过度包装
This commit is contained in:
@@ -41,7 +41,7 @@ export default {
|
||||
moreActionsTitle: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$ttc('moreActions')
|
||||
return this.$t('common.moreActions')
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -66,7 +66,7 @@ export default {
|
||||
return actions
|
||||
},
|
||||
iMoreActionsTitle() {
|
||||
return this.moreActionsTitle || this.$ttc('moreActions')
|
||||
return this.moreActionsTitle || this.$t('common.moreActions')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@@ -50,7 +50,7 @@ export default {
|
||||
case 'actions':
|
||||
col = {
|
||||
prop: 'id',
|
||||
label: this.$ttc('actions'),
|
||||
label: this.$t('common.actions'),
|
||||
align: 'center',
|
||||
formatter: ActionsFormatter,
|
||||
width: '150px',
|
||||
@@ -58,7 +58,7 @@ export default {
|
||||
}
|
||||
break
|
||||
case 'is_valid':
|
||||
col.label = this.$ttc('validity')
|
||||
col.label = this.$t('common.validity')
|
||||
col.formatter = BooleanFormatter
|
||||
col.align = 'center'
|
||||
col.width = '80px'
|
||||
|
@@ -14,8 +14,8 @@
|
||||
|
||||
<el-form-item>
|
||||
<el-button v-for="button in moreButtons" :key="button.title" size="small" v-bind="button" @click="handleClick(button)">{{ button.title }}</el-button>
|
||||
<el-button v-if="defaultButton" size="small" @click="resetForm('form')">{{ $ttc('reset') }}</el-button>
|
||||
<el-button v-if="defaultButton" size="small" type="primary" @click="submitForm('form')">{{ $ttc('submit') }}</el-button>
|
||||
<el-button v-if="defaultButton" size="small" @click="resetForm('form')">{{ $t('common.reset') }}</el-button>
|
||||
<el-button v-if="defaultButton" size="small" type="primary" @click="submitForm('form')">{{ $t('common.submit') }}</el-button>
|
||||
</el-form-item>
|
||||
</ElFormRender>
|
||||
</template>
|
||||
|
@@ -53,7 +53,7 @@ export default {
|
||||
}
|
||||
if (res.length === 0) {
|
||||
res.push({
|
||||
name: this.$tco('empty')
|
||||
name: this.$t('common.empty')
|
||||
})
|
||||
}
|
||||
this.zTree = $.fn.zTree.init($('#ztree'), this.treeSetting, res)
|
||||
|
@@ -22,7 +22,7 @@ export default {
|
||||
title: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$ttc('basicInfo')
|
||||
return this.$t('common.basicInfo')
|
||||
}
|
||||
},
|
||||
items: {
|
||||
|
@@ -7,8 +7,8 @@
|
||||
<slot />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<slot name="footer">
|
||||
<el-button size="small" @click="onCancel">{{ $ttc('cancel') }}</el-button>
|
||||
<el-button type="primary" size="small" @click="onConfirm">{{ $ttc('confirm') }}</el-button>
|
||||
<el-button size="small" @click="onCancel">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" size="small" @click="onConfirm">{{ $t('common.confirm') }}</el-button>
|
||||
</slot>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<Dialog :title="$ttc('export')" :visible.sync="showExportDialog" center @confirm="handleDialogConfirm('export')" @cancel="handleDialogCancel('export')">
|
||||
<Dialog :title="$t('common.export')" :visible.sync="showExportDialog" center @confirm="handleDialogConfirm('export')" @cancel="handleDialogCancel('export')">
|
||||
<el-form>
|
||||
<el-form-item :label="this.$t('action.ExportRange')" :label-width="'100px'">
|
||||
<el-radio v-model="exportOption" class="export-item" label="1">{{ this.$t('action.ExportAll') }}</el-radio>
|
||||
@@ -12,8 +12,8 @@
|
||||
<Dialog :title="importTitle" :visible.sync="showImportDialog" center @confirm="handleDialogConfirm('import')" @cancel="handleDialogCancel('import')">
|
||||
<el-form>
|
||||
<el-form-item :label="importTitle" :label-width="'100px'">
|
||||
<el-radio v-model="importOption" class="export-item" label="1">{{ this.$ttc('import') }}</el-radio>
|
||||
<el-radio v-model="importOption" class="export-item" label="2">{{ this.$ttc('update') }}</el-radio>
|
||||
<el-radio v-model="importOption" class="export-item" label="1">{{ this.$t('common.import') }}</el-radio>
|
||||
<el-radio v-model="importOption" class="export-item" label="2">{{ this.$t('common.update') }}</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div v-if="importOption==='1'" style="margin-bottom:20px;margin-left: 55px;">{{ this.$t('action.downloadTheImportedTemplateOrUseTheExportedCSVFormat') }} <a style="color: #428bca;" :href="downloadImportTempUrl">{{ this.$t('action.DownloadImportTemplate') }}</a></div>
|
||||
@@ -69,9 +69,9 @@ export default {
|
||||
},
|
||||
importTitle() {
|
||||
if (this.importOption === '1') {
|
||||
return this.$ttc('import')
|
||||
return this.$t('common.import')
|
||||
} else {
|
||||
return this.$ttc('update')
|
||||
return this.$t('common.update')
|
||||
}
|
||||
},
|
||||
upLoadUrl() {
|
||||
|
@@ -68,7 +68,7 @@ export default {
|
||||
label: this.$t('assets.systemUsers'),
|
||||
align: 'center',
|
||||
formatter: (row, col, value) => {
|
||||
const title = this.$ttc('show')
|
||||
const title = this.$t('common.show')
|
||||
// Todo: 显示真正的系统用户
|
||||
const show = function() {
|
||||
console.log('hello: ', value)
|
||||
|
@@ -102,7 +102,7 @@ export default {
|
||||
defaultActions: [
|
||||
{
|
||||
name: 'actionCreate',
|
||||
title: this.$ttc('create'),
|
||||
title: this.$t('common.create'),
|
||||
type: 'primary',
|
||||
has: this.hasCreate,
|
||||
can: true,
|
||||
@@ -111,13 +111,13 @@ export default {
|
||||
],
|
||||
defaultMoreActions: [
|
||||
{
|
||||
title: this.$ttc('deleteSelected'),
|
||||
title: this.$t('common.deleteSelected'),
|
||||
name: 'actionDeleteSelected',
|
||||
has: this.hasBulkDelete,
|
||||
callback: this.defaultBulkDeleteCallback
|
||||
},
|
||||
{
|
||||
title: this.$ttc('updateSelected'),
|
||||
title: this.$t('common.updateSelected'),
|
||||
name: 'actionUpdateSelected',
|
||||
has: this.hasBulkUpdate,
|
||||
callback: this.handleBulkUpdate
|
||||
@@ -164,7 +164,7 @@ export default {
|
||||
},
|
||||
defaultBulkDeleteCallback(rows) {
|
||||
const msg = this.$tc('Are you sure to delete') + ' ' + rows.length + ' ' + this.$tc('rows')
|
||||
const title = this.$ttc('info')
|
||||
const title = this.$t('common.info')
|
||||
const performDelete = this.performBulkDelete || this.defaultPerformBulkDelete
|
||||
this.$alert(msg, title, {
|
||||
type: 'warning',
|
||||
|
@@ -18,8 +18,8 @@ const defaultUpdateCallback = function({ row, col }) {
|
||||
}
|
||||
|
||||
const defaultDeleteCallback = function({ row, col, cellValue, reload }) {
|
||||
const msg = this.$ttc('deleteWarningMsg') + ' "' + row.name + '"'
|
||||
const title = this.$ttc('info')
|
||||
const msg = this.$t('common.deleteWarningMsg') + ' "' + row.name + '"'
|
||||
const title = this.$t('common.info')
|
||||
const performDelete = this.colActions.performDelete
|
||||
this.$alert(msg, title, {
|
||||
type: 'warning',
|
||||
@@ -32,9 +32,9 @@ const defaultDeleteCallback = function({ row, col, cellValue, reload }) {
|
||||
await performDelete.bind(this)({ row: row, col: col })
|
||||
done()
|
||||
reload()
|
||||
this.$message.success(this.$tco('Delete success'))
|
||||
this.$message.success(this.$t('common.Delete success'))
|
||||
} catch (error) {
|
||||
this.$message.error(this.$tco('Delete failed' + ' ' + error))
|
||||
this.$message.error(this.$t('common.Delete failed' + ' ' + error))
|
||||
} finally {
|
||||
instance.confirmButtonLoading = false
|
||||
}
|
||||
@@ -71,7 +71,7 @@ export default {
|
||||
const defaultActions = [
|
||||
{
|
||||
name: 'update',
|
||||
title: this.$ttc('update'),
|
||||
title: this.$t('common.update'),
|
||||
type: 'primary',
|
||||
has: colActions.hasUpdate,
|
||||
can: colActions.canUpdate,
|
||||
@@ -79,7 +79,7 @@ export default {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
title: this.$ttc('delete'),
|
||||
title: this.$t('common.delete'),
|
||||
type: 'danger',
|
||||
has: colActions.hasDelete,
|
||||
can: colActions.canDelete,
|
||||
|
@@ -19,10 +19,10 @@ export default {
|
||||
onDelete(col, row, cellValue, reload) {
|
||||
const url = col.deleteUrl + cellValue
|
||||
this.$axios.delete(url).then(res => {
|
||||
this.$message.success(this.$tco('Delete success'))
|
||||
this.$message.success(this.$t('common.Delete success'))
|
||||
reload()
|
||||
}).catch(error => {
|
||||
this.$message.error(this.$tco('Delete failed' + ' ' + error))
|
||||
this.$message.error(this.$t('common.Delete failed' + ' ' + error))
|
||||
})
|
||||
},
|
||||
iCanDelete() {
|
||||
|
@@ -23,7 +23,7 @@ export default {
|
||||
title: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$tco('quickUpdate')
|
||||
return this.$t('common.quickUpdate')
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
@@ -8,7 +8,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<el-button :type="type" size="small" :loading="submitLoading" @click="addObjects">{{ $ttc('add') }}</el-button>
|
||||
<el-button :type="type" size="small" :loading="submitLoading" @click="addObjects">{{ $t('common.add') }}</el-button>
|
||||
</td>
|
||||
</tr>
|
||||
<template v-if="showHasObjects">
|
||||
@@ -25,7 +25,7 @@
|
||||
<td colspan="2">
|
||||
<el-button :type="type" size="small" style="width: 100%" @click="loadMore">
|
||||
<i class="fa fa-arrow-down" />
|
||||
{{ $ttc('more') }}
|
||||
{{ $t('common.more') }}
|
||||
</el-button>
|
||||
</td>
|
||||
</tr>
|
||||
|
@@ -20,23 +20,4 @@ Vue.prototype.$tr = (key) => {
|
||||
return i18n.t('route.' + key)
|
||||
}
|
||||
|
||||
Vue.prototype.$tcap = (key) => {
|
||||
// Cap case
|
||||
return _.capitalize(i18n.t(key))
|
||||
}
|
||||
|
||||
Vue.prototype.$tt = (key) => {
|
||||
// Title Case
|
||||
return _.startCase(_.camelCase(i18n.t(key)))
|
||||
}
|
||||
|
||||
Vue.prototype.$tco = (key) => {
|
||||
// Translate Common
|
||||
return i18n.t('common.' + key)
|
||||
}
|
||||
|
||||
Vue.prototype.$ttc = (key) => {
|
||||
return _.startCase(_.camelCase(i18n.t('common.' + key)))
|
||||
}
|
||||
|
||||
export default i18n
|
||||
|
@@ -52,13 +52,13 @@ export default {
|
||||
createSuccessMsg: {
|
||||
type: String,
|
||||
default: function() {
|
||||
return this.$tcap('common.createSuccessMsg')
|
||||
return this.$t('common.createSuccessMsg')
|
||||
}
|
||||
},
|
||||
updateSuccessMsg: {
|
||||
type: String,
|
||||
default: function() {
|
||||
return this.$tcap('common.updateSuccessMsg')
|
||||
return this.$t('common.updateSuccessMsg')
|
||||
}
|
||||
},
|
||||
createSuccessNextRoute: {
|
||||
|
@@ -95,13 +95,13 @@ export default {
|
||||
return [
|
||||
{
|
||||
name: 'update',
|
||||
title: this.$ttc('update'),
|
||||
title: this.$t('common.update'),
|
||||
can: this.validActions.canUpdate,
|
||||
callback: this.validActions.updateCallback.bind(this)
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
title: this.$ttc('delete'),
|
||||
title: this.$t('common.delete'),
|
||||
can: this.validActions.canDelete,
|
||||
callback: this.validActions.deleteCallback.bind(this)
|
||||
}
|
||||
@@ -129,8 +129,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
defaultDelete() {
|
||||
const msg = this.$ttc('deleteWarningMsg') + ' ' + this.iTitle + ' ?'
|
||||
const title = this.$ttc('info')
|
||||
const msg = this.$t('common.deleteWarningMsg') + ' ' + this.iTitle + ' ?'
|
||||
const title = this.$t('common.info')
|
||||
const performDelete = async function() {
|
||||
const url = this.validActions.deleteApiUrl
|
||||
this.$log.debug('Start perform delete: ', url)
|
||||
@@ -146,10 +146,10 @@ export default {
|
||||
try {
|
||||
await performDelete.bind(this)()
|
||||
done()
|
||||
this.$message.success(this.$tco('Delete success'))
|
||||
this.$message.success(this.$t('common.Delete success'))
|
||||
this.$router.push({ name: this.validActions.deleteSuccessRoute })
|
||||
} catch (error) {
|
||||
this.$message.error(this.$tco('Delete failed' + ' ' + error))
|
||||
this.$message.error(this.$t('common.Delete failed' + ' ' + error))
|
||||
} finally {
|
||||
instance.confirmButtonLoading = false
|
||||
}
|
||||
|
@@ -7,10 +7,10 @@
|
||||
<i class="el-icon-arrow-down el-icon--right" />
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-user" command="profile">{{ $ttc('profile') }}</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-guide" command="changePage">{{ $ttc('userPage') }}</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-key" command="apiKey">{{ $ttc('apiKey') }}</el-dropdown-item>
|
||||
<el-dropdown-item divided command="logout">{{ $ttc('logout') }}</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-user" command="profile">{{ $t('common.profile') }}</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-guide" command="changePage">{{ $t('common.userPage') }}</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-key" command="apiKey">{{ $t('common.apiKey') }}</el-dropdown-item>
|
||||
<el-dropdown-item divided command="logout">{{ $t('common.logout') }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
@@ -7,18 +7,18 @@
|
||||
<div class="header-item">
|
||||
<el-dropdown>
|
||||
<span class="el-dropdown-link">
|
||||
{{ $ttc('help') }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
{{ $t('common.help') }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-plus">{{ $ttc('docs') }}</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-circle-plus">{{ $ttc('support') }}</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-plus">{{ $t('common.docs') }}</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-circle-plus">{{ $t('common.support') }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
<el-dropdown>
|
||||
<span class="el-dropdown-link">
|
||||
{{ $ttc('language') }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
{{ $t('common.language') }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="changeLangToZH">中文(简体)</el-dropdown-item>
|
||||
|
@@ -49,7 +49,7 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
formatter: ActionsFormatter,
|
||||
width: '200px',
|
||||
|
@@ -17,28 +17,28 @@ export default {
|
||||
columns: [
|
||||
{
|
||||
prop: 'name',
|
||||
label: this.$tt('common.name'),
|
||||
label: this.$t('common.name'),
|
||||
formatter: DetailFormatter,
|
||||
sortable: true,
|
||||
route: 'AdminUserDetail'
|
||||
},
|
||||
{
|
||||
prop: 'username',
|
||||
label: this.$tt('common.username'),
|
||||
label: this.$t('common.username'),
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
prop: 'assets_amount',
|
||||
label: this.$tt('assets.assets')
|
||||
label: this.$t('assets.assets')
|
||||
},
|
||||
{
|
||||
prop: 'comment',
|
||||
label: this.$tt('common.comment'),
|
||||
label: this.$t('common.comment'),
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
formatter: ActionsFormatter,
|
||||
width: '200px',
|
||||
|
@@ -58,7 +58,7 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
formatter: ActionsFormatter,
|
||||
width: '200px',
|
||||
|
@@ -44,7 +44,7 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
formatter: ActionsFormatter,
|
||||
width: '200px',
|
||||
@@ -79,7 +79,7 @@ export default {
|
||||
extraActions: [
|
||||
{
|
||||
name: 'actionCreate',
|
||||
title: this.$tco('Create'),
|
||||
title: this.$t('common.Create'),
|
||||
type: 'primary',
|
||||
has: this.hasCreate,
|
||||
can: true,
|
||||
|
@@ -37,7 +37,7 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
formatter: ActionsFormatter,
|
||||
width: '200px',
|
||||
|
@@ -39,7 +39,7 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
formatter: ActionsFormatter,
|
||||
width: '200px',
|
||||
|
@@ -48,7 +48,7 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
formatter: ActionsFormatter,
|
||||
width: '200px',
|
||||
|
@@ -31,7 +31,7 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
formatter: ActionsFormatter,
|
||||
width: '200px',
|
||||
|
@@ -34,7 +34,7 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
formatter: ActionsFormatter,
|
||||
width: '200px',
|
||||
|
@@ -23,10 +23,10 @@ export default {
|
||||
|
||||
},
|
||||
fields: [
|
||||
[this.$ttc('basicInfo'), ['name', 'login_mode', 'username', 'username_same_with_user', 'priority', 'protocol']],
|
||||
[this.$tco('Auth'), ['auto_generate_key', 'password', 'auto_push']],
|
||||
[this.$tco('Command filter'), ['cmd_filters']],
|
||||
[this.$tco('Others'), ['sftp_root', 'sudo', 'shell', 'comment']]
|
||||
[this.$t('common.basicInfo'), ['name', 'login_mode', 'username', 'username_same_with_user', 'priority', 'protocol']],
|
||||
[this.$t('common.Auth'), ['auto_generate_key', 'password', 'auto_push']],
|
||||
[this.$t('common.Command filter'), ['cmd_filters']],
|
||||
[this.$t('common.Others'), ['sftp_root', 'sudo', 'shell', 'comment']]
|
||||
],
|
||||
fieldsMeta: {
|
||||
login_mode: {
|
||||
|
@@ -133,7 +133,7 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
formatter: CustomActionsFormatter,
|
||||
actions: {
|
||||
|
@@ -47,9 +47,9 @@ export default {
|
||||
HandleChangeAction(index, row) {
|
||||
this.$axios.patch(this.url, { auto_push: row.auto_push }
|
||||
).then(res => {
|
||||
this.$message.success(this.$ttc('updateSuccessMsg'))
|
||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||
}).catch(err => {
|
||||
this.$message.error(this.$ttc('updateFailedMsg' + ' ' + err))
|
||||
this.$message.error(this.$t('common.updateFailedMsg' + ' ' + err))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@@ -17,39 +17,39 @@ export default {
|
||||
columns: [
|
||||
{
|
||||
prop: 'name',
|
||||
label: this.$tt('common.name'),
|
||||
label: this.$t('common.name'),
|
||||
formatter: DetailFormatter,
|
||||
sortable: true,
|
||||
route: 'SystemUserDetail'
|
||||
},
|
||||
{
|
||||
prop: 'username',
|
||||
label: this.$tt('common.username'),
|
||||
label: this.$t('common.username'),
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
prop: 'protocol',
|
||||
label: this.$tt('assets.protocol'),
|
||||
label: this.$t('assets.protocol'),
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
prop: 'login_mode_display',
|
||||
label: this.$tt('assets.loginMode'),
|
||||
label: this.$t('assets.loginMode'),
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
prop: 'assets_amount',
|
||||
label: this.$tt('assets.assets'),
|
||||
label: this.$t('assets.assets'),
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
prop: 'comment',
|
||||
label: this.$tt('common.comment'),
|
||||
label: this.$t('common.comment'),
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
formatter: ActionsFormatter,
|
||||
width: '200px',
|
||||
|
@@ -54,7 +54,7 @@ export default {
|
||||
},
|
||||
actions: {
|
||||
prop: 'id',
|
||||
abel: this.$ttc('action'),
|
||||
abel: this.$t('common.action'),
|
||||
formatter: ActionsFormatter,
|
||||
actions: {
|
||||
hasEdit: false,
|
||||
|
@@ -58,7 +58,7 @@ export default {
|
||||
},
|
||||
actions: {
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
formatter: ActionsFormatter,
|
||||
actions: {
|
||||
hasEdit: false,
|
||||
|
@@ -60,7 +60,7 @@ export default {
|
||||
},
|
||||
actions: {
|
||||
prop: 'id',
|
||||
abel: this.$ttc('action'),
|
||||
abel: this.$t('common.action'),
|
||||
formatter: ActionsFormatter,
|
||||
actions: {
|
||||
hasEdit: false,
|
||||
|
@@ -18,7 +18,7 @@ export default {
|
||||
columns: ['name', 'runtimes', 'host_amount', 'is_success', 'date_start', 'time', 'actions'],
|
||||
columnsMeta: {
|
||||
name: {
|
||||
label: this.$tco('Name'),
|
||||
label: this.$t('common.Name'),
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
runtimes: {
|
||||
@@ -61,7 +61,7 @@ export default {
|
||||
},
|
||||
actions: {
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
formatter: ActionsFormatter,
|
||||
actions: {
|
||||
hasUpdate: false,
|
||||
|
@@ -21,8 +21,8 @@ export default {
|
||||
[this.$t('perms.' + 'Basic'), ['name']],
|
||||
[this.$t('perms.' + 'User'), ['users', 'user_groups']],
|
||||
[this.$t('perms.' + 'Asset'), ['assets', 'nodes', 'system_users']],
|
||||
[this.$ttc('action'), ['actions']],
|
||||
[this.$tco('Other'), ['is_active', 'date_expired', 'comment']]
|
||||
[this.$t('common.action'), ['actions']],
|
||||
[this.$t('common.Other'), ['is_active', 'date_expired', 'comment']]
|
||||
],
|
||||
url: '/api/v1/perms/asset-permissions/',
|
||||
fieldsMeta: {
|
||||
|
@@ -45,7 +45,7 @@ export default {
|
||||
},
|
||||
delete_action: {
|
||||
prop: 'asset',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
width: 150,
|
||||
objects: this.object.assets,
|
||||
|
@@ -30,7 +30,7 @@ export default {
|
||||
return {
|
||||
quickActions: [
|
||||
{
|
||||
title: this.$ttc('active'),
|
||||
title: this.$t('common.active'),
|
||||
type: 'switcher',
|
||||
attrs: {
|
||||
model: this.object.is_active
|
||||
|
@@ -42,7 +42,7 @@ export default {
|
||||
},
|
||||
delete_action: {
|
||||
prop: 'user',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
width: 150,
|
||||
objects: this.object.users,
|
||||
|
@@ -29,9 +29,9 @@ export default {
|
||||
hasSelection: false,
|
||||
hasTree: true,
|
||||
tagSearch: [
|
||||
{ label: this.$tco('Name'), key: 'name' },
|
||||
{ label: this.$t('common.Name'), key: 'name' },
|
||||
{ label: this.$t('perms.IsValid'), key: 'is_valid' },
|
||||
{ label: this.$tco('username'), key: 'username' },
|
||||
{ label: this.$t('common.username'), key: 'username' },
|
||||
{ label: this.$t('perms.UserGroups'), key: 'user_group' },
|
||||
{ label: this.$t('perms.IP'), key: 'ip' },
|
||||
{ label: this.$t('perms.Hostname'), key: 'hostname' },
|
||||
|
@@ -18,7 +18,7 @@ export default {
|
||||
[this.$t('perms.' + 'Basic'), ['name']],
|
||||
[this.$t('perms.' + 'User'), ['users', 'user_groups']],
|
||||
[this.$t('perms.' + 'DatabaseApp'), ['database_apps', 'system_users']],
|
||||
[this.$tco('Other'), ['is_active', 'date_expired', 'comment']]
|
||||
[this.$t('common.Other'), ['is_active', 'date_expired', 'comment']]
|
||||
],
|
||||
url: '/api/v1/perms/database-app-permissions/',
|
||||
fieldsMeta: {
|
||||
|
@@ -42,7 +42,7 @@ export default {
|
||||
},
|
||||
delete_action: {
|
||||
prop: 'databaseapp',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
width: 150,
|
||||
objects: this.object.database_apps,
|
||||
|
@@ -30,7 +30,7 @@ export default {
|
||||
return {
|
||||
quickActions: [
|
||||
{
|
||||
title: this.$ttc('active'),
|
||||
title: this.$t('common.active'),
|
||||
type: 'switcher',
|
||||
attrs: {
|
||||
model: this.object.is_active
|
||||
|
@@ -43,7 +43,7 @@ export default {
|
||||
},
|
||||
delete_action: {
|
||||
prop: 'user',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
align: 'center',
|
||||
width: 150,
|
||||
objects: this.object.users,
|
||||
|
@@ -18,7 +18,7 @@ export default {
|
||||
[this.$t('perms.' + 'Basic'), ['name']],
|
||||
[this.$t('perms.' + 'User'), ['users', 'user_groups']],
|
||||
[this.$t('perms.' + 'RemoteApp'), ['remote_apps', 'system_users']],
|
||||
[this.$tco('Other'), ['is_active', 'date_expired', 'comment']]
|
||||
[this.$t('common.Other'), ['is_active', 'date_expired', 'comment']]
|
||||
],
|
||||
url: '/api/v1/perms/remote-app-permissions/',
|
||||
fieldsMeta: {
|
||||
|
@@ -30,7 +30,7 @@ export default {
|
||||
return {
|
||||
quickActions: [
|
||||
{
|
||||
title: this.$ttc('active'),
|
||||
title: this.$t('common.active'),
|
||||
type: 'switcher',
|
||||
attrs: {
|
||||
model: this.object.is_active
|
||||
|
@@ -21,10 +21,10 @@ export default {
|
||||
],
|
||||
columnsMeta: {
|
||||
users_amount: {
|
||||
label: this.$tt('users.users')
|
||||
label: this.$t('users.users')
|
||||
},
|
||||
user_groups_amount: {
|
||||
label: this.$tt('users.userGroups')
|
||||
label: this.$t('users.userGroups')
|
||||
},
|
||||
remote_apps_amount: {
|
||||
label: this.$t('assets.remoteApps')
|
||||
|
@@ -50,7 +50,7 @@ export default {
|
||||
},
|
||||
actions: {
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
formatter: ActionsFormatter,
|
||||
actions: {
|
||||
hasEdit: false,
|
||||
|
@@ -48,7 +48,7 @@ export default {
|
||||
},
|
||||
actions: {
|
||||
prop: 'id',
|
||||
label: this.$ttc('action'),
|
||||
label: this.$t('common.action'),
|
||||
formatter: ActionsFormatter,
|
||||
actions: {
|
||||
hasEdit: false,
|
||||
|
@@ -16,7 +16,7 @@ export default {
|
||||
url: '/api/v1/terminal/terminals/',
|
||||
fields: [
|
||||
[this.$t('sessions.info'), ['name', 'remote_addr', 'command_storage', 'replay_storage']],
|
||||
[this.$tco('Other'), ['comment']]
|
||||
[this.$t('common.Other'), ['comment']]
|
||||
],
|
||||
fieldsMeta: {
|
||||
command_storage: {
|
||||
|
@@ -42,8 +42,8 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="dialogVisible = false">{{ $tco('cancel') }}</el-button>
|
||||
<el-button type="primary" @click="testUerLoginClick">{{ $tco('confirm') }}</el-button>
|
||||
<el-button @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="testUerLoginClick">{{ $t('common.confirm') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogLdapUserImport" center>
|
||||
@@ -58,8 +58,8 @@
|
||||
@error="handlerListTableXHRError($event)"
|
||||
/>
|
||||
<div slot="footer">
|
||||
<el-button @click="dialogLdapUserImport = false">{{ $tco('cancel') }}</el-button>
|
||||
<el-button type="primary" @click="importUserClick">{{ $tco('import') }}</el-button>
|
||||
<el-button @click="dialogLdapUserImport = false">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="importUserClick">{{ $t('common.import') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
@@ -27,7 +27,7 @@ export default {
|
||||
return {
|
||||
relationConfig: {
|
||||
icon: 'fa-user',
|
||||
title: this.$ttc('members'),
|
||||
title: this.$t('common.members'),
|
||||
objectsAjax: {
|
||||
url: '/api/v1/users/users/?fields_size=mini&order=name',
|
||||
processResults(data) {
|
||||
@@ -64,19 +64,19 @@ export default {
|
||||
detailItems() {
|
||||
return [
|
||||
{
|
||||
key: this.$ttc('name'),
|
||||
key: this.$t('common.name'),
|
||||
value: this.object.name
|
||||
},
|
||||
{
|
||||
key: this.$ttc('createdBy'),
|
||||
key: this.$t('common.createdBy'),
|
||||
value: this.object.created_by
|
||||
},
|
||||
{
|
||||
key: this.$ttc('dateCreated'),
|
||||
key: this.$t('common.dateCreated'),
|
||||
value: this.object.date_created
|
||||
},
|
||||
{
|
||||
key: this.$ttc('comment'),
|
||||
key: this.$t('common.comment'),
|
||||
value: this.object.comment
|
||||
}
|
||||
]
|
||||
|
@@ -25,11 +25,11 @@ export default {
|
||||
activeMenu: 'GroupInfo',
|
||||
submenu: [
|
||||
{
|
||||
title: this.$ttc('basicInfo'),
|
||||
title: this.$t('common.basicInfo'),
|
||||
name: 'GroupInfo'
|
||||
},
|
||||
{
|
||||
title: this.$tt('users.grantedAssets'),
|
||||
title: this.$t('users.grantedAssets'),
|
||||
name: 'GroupGrantedAssets'
|
||||
}
|
||||
],
|
||||
|
@@ -22,7 +22,7 @@ export default {
|
||||
[this.$t('users.' + 'Account'), ['name', 'username', 'email', 'groups']],
|
||||
[this.$t('users.' + 'Authentication'), ['password_strategy', 'password', 'public_key', 'mfa_level', 'source']],
|
||||
[this.$t('users.' + 'Secure'), ['role', 'date_expired']],
|
||||
[this.$tco('Other'), ['phone', 'wechat', 'comment']]
|
||||
[this.$t('common.Other'), ['phone', 'wechat', 'comment']]
|
||||
],
|
||||
url: '/api/v1/users/users/',
|
||||
fieldsMeta: {
|
||||
|
@@ -31,7 +31,7 @@ export default {
|
||||
return {
|
||||
quickActions: [
|
||||
{
|
||||
title: this.$ttc('active'),
|
||||
title: this.$t('common.active'),
|
||||
type: 'switcher',
|
||||
attrs: {
|
||||
model: this.object.is_active
|
||||
@@ -50,12 +50,12 @@ export default {
|
||||
title: this.$t('users.resetMFATitle'),
|
||||
attrs: {
|
||||
type: 'primary',
|
||||
label: this.$ttc('reset')
|
||||
label: this.$t('common.reset')
|
||||
},
|
||||
callbacks: {
|
||||
click: function() {
|
||||
const warnMsg = vm.$t('users.resetMFAWarningMsg')
|
||||
const warnTitle = vm.$ttc('info')
|
||||
const warnTitle = vm.$t('common.info')
|
||||
const url = `/api/v1/users/users/${vm.object.id}/otp/reset/`
|
||||
const successMsg = vm.$t('users.resetMFAdSuccessMsg')
|
||||
vm.$confirm(warnMsg, warnTitle, {
|
||||
@@ -81,12 +81,12 @@ export default {
|
||||
title: this.$t('users.resetPasswordTitle'),
|
||||
attrs: {
|
||||
type: 'primary',
|
||||
label: this.$ttc('send')
|
||||
label: this.$t('common.send')
|
||||
},
|
||||
callbacks: {
|
||||
click: function() {
|
||||
const warnMsg = vm.$t('users.resetPasswordWarningMsg')
|
||||
const warnTitle = vm.$ttc('Info')
|
||||
const warnTitle = vm.$t('common.Info')
|
||||
const url = `/api/v1/users/users/${vm.object.id}/password/reset/`
|
||||
const successMsg = vm.$t('users.resetPasswordSuccessMsg')
|
||||
vm.$confirm(warnMsg, warnTitle, {
|
||||
@@ -112,12 +112,12 @@ export default {
|
||||
title: this.$t('users.resetPublicKeyTitle'),
|
||||
attrs: {
|
||||
type: 'primary',
|
||||
label: this.$ttc('send')
|
||||
label: this.$t('common.send')
|
||||
},
|
||||
callbacks: {
|
||||
click: function() {
|
||||
const warnMsg = vm.$t('users.resetPublicKeyWarningMsg')
|
||||
const warnTitle = vm.$ttc('info')
|
||||
const warnTitle = vm.$t('common.info')
|
||||
const url = `/api/v1/users/users/${vm.object.id}/pubkey/reset/`
|
||||
const successMsg = vm.$t('users.resetPasswordSuccessMsg')
|
||||
vm.$confirm(warnMsg, warnTitle, {
|
||||
@@ -140,10 +140,10 @@ export default {
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$tt('users.unblockUser'),
|
||||
title: this.$t('users.unblockUser'),
|
||||
attrs: {
|
||||
type: 'primary',
|
||||
label: this.$ttc('unblock'),
|
||||
label: this.$t('common.unblock'),
|
||||
disabled: !this.object.login_blocked
|
||||
},
|
||||
callbacks: {
|
||||
@@ -160,7 +160,7 @@ export default {
|
||||
],
|
||||
relationConfig: {
|
||||
icon: 'fa-user',
|
||||
title: this.$tt('users.userGroups'),
|
||||
title: this.$t('users.userGroups'),
|
||||
objectsAjax: {
|
||||
url: '/api/v1/users/groups/?fields_size=mini&order=name'
|
||||
},
|
||||
@@ -189,51 +189,51 @@ export default {
|
||||
detailItems() {
|
||||
return [
|
||||
{
|
||||
key: this.$ttc('name'),
|
||||
key: this.$t('common.name'),
|
||||
value: this.object.name
|
||||
},
|
||||
{
|
||||
key: this.$ttc('username'),
|
||||
key: this.$t('common.username'),
|
||||
value: this.object.username
|
||||
},
|
||||
{
|
||||
key: this.$ttc('email'),
|
||||
key: this.$t('common.email'),
|
||||
value: this.object.email
|
||||
},
|
||||
{
|
||||
key: this.$ttc('role'),
|
||||
key: this.$t('common.role'),
|
||||
value: this.object.role_display
|
||||
},
|
||||
{
|
||||
key: this.$tt('users.MFA'),
|
||||
key: this.$t('users.MFA'),
|
||||
value: this.object.mfa_level_display
|
||||
},
|
||||
{
|
||||
key: this.$tt('users.source'),
|
||||
key: this.$t('users.source'),
|
||||
value: this.object.source_display
|
||||
},
|
||||
{
|
||||
key: this.$ttc('dateExpired'),
|
||||
key: this.$t('common.dateExpired'),
|
||||
value: this.object.date_expired
|
||||
},
|
||||
{
|
||||
key: this.$ttc('createdBy'),
|
||||
key: this.$t('common.createdBy'),
|
||||
value: this.object.created_by
|
||||
},
|
||||
{
|
||||
key: this.$ttc('dateCreated'),
|
||||
key: this.$t('common.dateCreated'),
|
||||
value: this.object.date_joined
|
||||
},
|
||||
{
|
||||
key: this.$tt('users.dateLastLogin'),
|
||||
key: this.$t('users.dateLastLogin'),
|
||||
value: this.object.last_login
|
||||
},
|
||||
{
|
||||
key: this.$tt('users.datePasswordUpdated'),
|
||||
key: this.$t('users.datePasswordUpdated'),
|
||||
value: this.object.date_password_last_updated
|
||||
},
|
||||
{
|
||||
key: this.$ttc('comment'),
|
||||
key: this.$t('common.comment'),
|
||||
value: this.object.comment
|
||||
}
|
||||
]
|
||||
|
@@ -26,13 +26,13 @@ export default {
|
||||
route: 'RemoteAppPermissionDetail'
|
||||
},
|
||||
users: {
|
||||
label: this.$tt('users.users'),
|
||||
label: this.$t('users.users'),
|
||||
formatter(row, col, colValue) {
|
||||
return colValue.length
|
||||
}
|
||||
},
|
||||
user_groups: {
|
||||
label: this.$tt('users.userGroups'),
|
||||
label: this.$t('users.userGroups'),
|
||||
formatter(row, col, colValue) {
|
||||
return colValue.length
|
||||
}
|
||||
|
@@ -35,31 +35,31 @@ export default {
|
||||
activeMenu: 'UserInfo',
|
||||
submenu: [
|
||||
{
|
||||
title: this.$ttc('basicInfo'),
|
||||
title: this.$t('common.basicInfo'),
|
||||
name: 'UserInfo'
|
||||
},
|
||||
{
|
||||
title: this.$tt('perms.grantedAssets'),
|
||||
title: this.$t('perms.grantedAssets'),
|
||||
name: 'UserGrantedAssets'
|
||||
},
|
||||
{
|
||||
title: this.$tt('perms.assetPermissionRules'),
|
||||
title: this.$t('perms.assetPermissionRules'),
|
||||
name: 'UserAssetPermissionRules'
|
||||
},
|
||||
{
|
||||
title: this.$tt('perms.grantedRemoteApps'),
|
||||
title: this.$t('perms.grantedRemoteApps'),
|
||||
name: 'UserGrantedRemoteApps'
|
||||
},
|
||||
{
|
||||
title: this.$tt('perms.remoteAppsPermissionRules'),
|
||||
title: this.$t('perms.remoteAppsPermissionRules'),
|
||||
name: 'UserRemoteAppPermissionRules'
|
||||
},
|
||||
{
|
||||
title: this.$tt('perms.grantedDatabases'),
|
||||
title: this.$t('perms.grantedDatabases'),
|
||||
name: 'UserGrantedDatabases'
|
||||
},
|
||||
{
|
||||
title: this.$tt('perms.databasePermissionRules'),
|
||||
title: this.$t('perms.databasePermissionRules'),
|
||||
name: 'UserDatabasePermissionRules'
|
||||
}
|
||||
],
|
||||
|
@@ -33,14 +33,14 @@ export default {
|
||||
extraMoreActions: [
|
||||
{
|
||||
name: 'disableSelected',
|
||||
title: this.$ttc('disableSelected'),
|
||||
title: this.$t('common.disableSelected'),
|
||||
callback: () => {
|
||||
console.log('disableSelected')
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'activeSelected',
|
||||
title: this.$ttc('activeSelected'),
|
||||
title: this.$t('common.activeSelected'),
|
||||
callback: () => {
|
||||
console.log('activeSelected')
|
||||
}
|
||||
|
Reference in New Issue
Block a user