diff --git a/frontend/src/i18n/en_US.js b/frontend/src/i18n/en_US.js
index fbb1829393..3992d2caf5 100644
--- a/frontend/src/i18n/en_US.js
+++ b/frontend/src/i18n/en_US.js
@@ -3,10 +3,20 @@ const en_US = {
'workspace': 'Workspace',
'name': 'Name',
'description': 'Description',
- 'save': 'Save'
+ 'save': 'Save',
+ 'save_success': 'Saved successfully',
+ 'delete_success': 'Deleted successfully',
+ 'confirm': 'Confirm',
+ 'cancel': 'Cancel',
+ 'prompt': 'Prompt',
},
workspace: {
'create': 'Create Workspace',
+ 'delete_confirm': 'Are you sure you want to delete this workspace?',
+ 'add': 'Add Workspace',
+ 'input_name': 'Please enter a workspace name',
+ 'input_name_2_50': '2 to 50 characters in length',
+ 'search_by_name': 'Search by name',
},
i18n: {
'home': 'Home',
diff --git a/frontend/src/i18n/zh_CN.js b/frontend/src/i18n/zh_CN.js
index 5345fd596e..ccb94cac38 100644
--- a/frontend/src/i18n/zh_CN.js
+++ b/frontend/src/i18n/zh_CN.js
@@ -3,10 +3,20 @@ const zh_CN = {
'workspace': '工作空间',
'name': '名称',
'description': '描述',
- 'save': '保存'
+ 'save': '保存',
+ 'save_success': '保存成功',
+ 'delete_success': '删除成功',
+ 'confirm': '确定',
+ 'cancel': '取消',
+ 'prompt': '提示',
},
workspace: {
'create': '创建工作空间',
+ 'delete_confirm': '这个工作空间确定要删除吗?',
+ 'add': '添加工作空间',
+ 'input_name': '请输入工作空间名称',
+ 'input_name_2_50': '长度在 2 到 50 个字符',
+ 'search_by_name': '根据名称搜索',
},
i18n: {
'home': '首页',
diff --git a/frontend/src/performance/components/settings/Workspace.vue b/frontend/src/performance/components/settings/Workspace.vue
index f90b35ecf7..42af8aa707 100644
--- a/frontend/src/performance/components/settings/Workspace.vue
+++ b/frontend/src/performance/components/settings/Workspace.vue
@@ -8,7 +8,8 @@
-
@@ -83,7 +84,7 @@
this.$post("/workspace/" + saveType, this.form, () => {
this.createVisible = false;
this.list();
- Message.success('保存成功');
+ Message.success(this.$t('commons.save_success'));
});
} else {
return false;
@@ -92,7 +93,8 @@
},
edit(row) {
this.createVisible = true;
- this.form = row;
+ // copy user
+ this.form = Object.assign({}, row);
// let self = this;
// let getUser1 = this.$get("/test/user");
@@ -103,13 +105,13 @@
// });
},
del(row) {
- this.$confirm('这个工作空间确定要删除吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
+ this.$confirm(this.$t('workspace.delete_confirm'), this.$t('commons.prompt'), {
+ confirmButtonText: this.$t('commons.confirm'),
+ cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.$get('/workspace/delete/' + row.id, () => {
- Message.success('删除成功');
+ Message.success(this.$t('commons.delete_success'));
this.list();
});
}).catch(() => {
@@ -138,7 +140,7 @@
result: {},
loading: false,
createVisible: false,
- btnTips: "添加工作空间",
+ btnTips: this.$t('workspace.add'),
condition: "",
items: [],
currentPage: 1,
@@ -150,8 +152,8 @@
},
rules: {
name: [
- {required: true, message: '请输入工作空间名称', trigger: 'blur'},
- {min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur'}
+ {required: true, message: this.$t('workspace.input_name'), trigger: 'blur'},
+ {min: 2, max: 50, message: this.$t('workspace.input_name_2_50'), trigger: 'blur'}
]
},
}