浏览代码

增加翻译

vothin 1 年之前
父节点
当前提交
677bcff59d
共有 6 个文件被更改,包括 123 次插入43 次删除
  1. 21 1
      languages/en.js
  2. 21 1
      languages/es.js
  3. 21 1
      languages/ru-RU.js
  4. 21 1
      languages/zh-CN.js
  5. 1 1
      src/router/index.js
  6. 38 38
      src/views/mysql-backups/index.vue

+ 21 - 1
languages/en.js

@@ -1615,6 +1615,26 @@ module.exports = {
     androidSerial1: 'Android serial port 1',
     androidSerial1: 'Android serial port 1',
     androidSerial2: 'Android serial port 2',
     androidSerial2: 'Android serial port 2',
     androidSerial3: 'Android serial port 3',
     androidSerial3: 'Android serial port 3',
-    choiceSerial: 'Select serial port'
+    choiceSerial: 'Select serial port',
+    dataBackup: 'Data backup',
+    newBackup: 'New backup',
+    flushed: 'flushed',
+    backupMsg: 'Note: 1. This function can only be used in the official environment, and there will be problems in other environments;2. The storage address is /opt/v70/api/upload by default, because of the mapping relationship, the backup file can be found in /mnt/ncs/upload on the physical machine;3. Because of the asynchronous relationship, the data needs to be manually refreshed after the operation is completed.',
+    database: 'database',
+    backupAddress: 'Backup address',
+    inputBackupAddress: 'Please enter a backup address',
+    operationsNumber: 'The number of operations',
+    recoveryTime: 'Recovery time',
+    backupTime: 'Backup time',
+    normal: 'normal',
+    fileError: 'The file does not exist',
+    restore: 'restore',
+    restoreMsg: 'restore....',
+    restoreMsg2: 'Are you sure you want to restore the restoration?',
+    inputDatabaseMsg: 'Please select or enter a database',
+    inputContainerName: 'Please enter a container name',
+    inputFileAddress: 'Please enter a file storage address',
+    inputMysqlAddress: 'Please enter the address of the MySQL server',
+    deleteSqlMsg: 'The data is not recoverable after the deletion operation, are you sure you want to delete this data?',
   }
   }
 }
 }

+ 21 - 1
languages/es.js

@@ -1615,6 +1615,26 @@ module.exports = {
     androidSerial1: 'Puerto serie Android 1',
     androidSerial1: 'Puerto serie Android 1',
     androidSerial2: 'Puerto serie Android 2',
     androidSerial2: 'Puerto serie Android 2',
     androidSerial3: 'Puerto serie Android 3',
     androidSerial3: 'Puerto serie Android 3',
-    choiceSerial: 'Seleccionar puerto serie'
+    choiceSerial: 'Seleccionar puerto serie',
+    dataBackup: 'Copia de seguridad de datos',
+    newBackup: 'Nueva copia de seguridad',
+    flushed: 'Enrojecida',
+    backupMsg: 'Nota: 1. Esta función solo se puede utilizar en el entorno oficial y habrá problemas en otros entornos;2. La dirección de almacenamiento es /opt/v70/api/upload De forma predeterminada, debido a la relación de asignación, el archivo de copia de seguridad se puede encontrar en /mnt/ncs/upload en la máquina física;3. Debido a la relación asincrónica, los datos deben actualizarse manualmente una vez completada la operación.',
+    database: 'base de datos',
+    backupAddress: 'Dirección de copia de seguridad',
+    inputBackupAddress: 'Introduzca una dirección de copia de seguridad',
+    operationsNumber: 'El número de operaciones',
+    recoveryTime: 'Tiempo de recuperación',
+    backupTime: 'Tiempo de copia de seguridad',
+    normal: 'normal',
+    fileError: 'El archivo no existe',
+    restore: 'restaurar',
+    restoreMsg: 'restaurar....',
+    restoreMsg2: '¿Estás seguro de que quieres restaurar la restauración?',
+    inputDatabaseMsg: 'Seleccione o ingrese a una base de datos',
+    inputContainerName: 'Introduzca un nombre de contenedor',
+    inputFileAddress: 'Introduzca una dirección de almacenamiento de archivos',
+    inputMysqlAddress: 'Introduzca la dirección del servidor MySQL',
+    deleteSqlMsg: 'Los datos no se pueden recuperar después de la operación de eliminación, ¿está seguro de que desea eliminar estos datos?',
   }
   }
 }
 }

文件差异内容过多而无法显示
+ 21 - 1
languages/ru-RU.js


+ 21 - 1
languages/zh-CN.js

@@ -1615,6 +1615,26 @@ module.exports = {
     androidSerial1: '安卓串口1',
     androidSerial1: '安卓串口1',
     androidSerial2: '安卓串口2',
     androidSerial2: '安卓串口2',
     androidSerial3: '安卓串口3',
     androidSerial3: '安卓串口3',
-    choiceSerial: '选择串口'
+    choiceSerial: '选择串口',
+    dataBackup: '数据备份',
+    newBackup: '新增备份',
+    flushed: '刷新',
+    backupMsg: '注意:1、该功能只能在正式环境中使用,其他环境会出现问题;2、存储地址默认是/opt/v70/api/upload,因为映射的关系,在物理机上/mnt/ncs/upload可以找到备份文件;3、因为异步的关系,操作完成需要手动刷新数据。',
+    database: '数据库',
+    backupAddress: '备份地址',
+    inputBackupAddress: '请输入备份地址',
+    operationsNumber: '操作次数',
+    recoveryTime: '恢复时间',
+    backupTime: '备份时间',
+    normal: '正常',
+    fileError: '文件不存在',
+    restore: '还原',
+    restoreMsg: '还原....',
+    restoreMsg2: '您确定要恢复还原吗?',
+    inputDatabaseMsg: '请选择或输入数据库',
+    inputContainerName: '请输入容器名称',
+    inputFileAddress: '请输入文件存储地址',
+    inputMysqlAddress: '请输入mysql服务器地址',
+    deleteSqlMsg: '删除操作后数据不可复原,您确定要删除此数据?',
   }
   }
 }
 }

+ 1 - 1
src/router/index.js

@@ -799,7 +799,7 @@ export const adminRoutes = [
         path: 'index',
         path: 'index',
         component: () => import('@/views/mysql-backups/index'),
         component: () => import('@/views/mysql-backups/index'),
         name: 'mysql-backups-index',
         name: 'mysql-backups-index',
-        meta: { title: '数据备份', icon: 'el-icon-refresh', noCache: true }
+        meta: { title: i18n.t('zy20240205.dataBackup'), icon: 'el-icon-refresh', noCache: true }
       }
       }
     ]
     ]
   },
   },

+ 38 - 38
src/views/mysql-backups/index.vue

@@ -4,33 +4,33 @@
       <el-select v-model="databaseName" @change="changeSearch" filterable allow-create default-first-option clearable>
       <el-select v-model="databaseName" @change="changeSearch" filterable allow-create default-first-option clearable>
         <el-option v-for="(item, index) in databaseOptions" :key="index" :label="item" :value="item" />
         <el-option v-for="(item, index) in databaseOptions" :key="index" :label="item" :value="item" />
       </el-select>
       </el-select>
-      <el-button style="margin-left: 20px" size="mini" type="primary" @click="addLog">新增备份</el-button>
-      <el-button style="margin-left: 20px" size="mini" type="" @click="clickSearch">刷新</el-button>
-      <span style="color: red; font-size: 12px;margin-left: 20px">注意:1、该功能只能在正式环境中使用,其他环境会出现问题;2、存储地址默认是/opt/v70/api/upload,因为映射的关系,在物理机上/mnt/ncs/upload可以找到备份文件;3、因为异步的关系,操作完成需要手动刷新数据。</span>
+      <el-button style="margin-left: 20px" size="mini" type="primary" @click="addLog">{{ this.$t('zy20240205.newBackup') }}</el-button>
+      <el-button style="margin-left: 20px" size="mini" type="" @click="clickSearch">{{ this.$t('zy20240205.flushed') }}</el-button>
+      <span style="color: red; font-size: 12px;margin-left: 20px">{{ this.$t('zy20240205.backupMsg') }}</span>
     </div>
     </div>
     <div class="table-wrapper" style="padding-bottom: 10px;padding-left: 10px">
     <div class="table-wrapper" style="padding-bottom: 10px;padding-left: 10px">
       <el-table :data="tableData.data" id="myTableId" stripe border style="width: 100%" ref="refTable" height="520">
       <el-table :data="tableData.data" id="myTableId" stripe border style="width: 100%" ref="refTable" height="520">
 <!--        <el-table-column type="selection" width="55"></el-table-column>-->
 <!--        <el-table-column type="selection" width="55"></el-table-column>-->
-        <el-table-column prop="database_name" min-width="100" label="数据库" align="center" />
+        <el-table-column prop="database_name" min-width="100" :label="this.$t('zy20240205.database')" align="center" />
 <!--        <el-table-column prop="container_name" label="容器名称" min-width="100" align="center" />-->
 <!--        <el-table-column prop="container_name" label="容器名称" min-width="100" align="center" />-->
-        <el-table-column prop="backups_path" label="备份地址" min-width="130" align="center" />
-        <el-table-column prop="backups_name" label="文件名" min-width="130" align="center" />
-        <el-table-column prop="operation" label="操作次数" width="100" align="center" />
-        <el-table-column prop="recovery_time" label="恢复时间" width="170" align="center" :formatter="fortDate"/>
-        <el-table-column prop="create_time" label="备份时间" width="170" align="center" :formatter="fortDate" />
-        <el-table-column prop="state" label="状态" width="100" align="center">
+        <el-table-column prop="backups_path" :label="this.$t('zy20240205.backupAddress')" min-width="130" align="center" />
+        <el-table-column prop="backups_name" :label="this.$t('action.uploadFileName')" min-width="130" align="center" />
+        <el-table-column prop="operation" :label="this.$t('zy20240205.operationsNumber')" width="100" align="center" />
+        <el-table-column prop="recovery_time" :label="this.$t('zy20240205.recoveryTime')" width="170" align="center" :formatter="fortDate"/>
+        <el-table-column prop="create_time" :label="this.$t('zy20240205.backupTime')" width="170" align="center" :formatter="fortDate" />
+        <el-table-column prop="state" :label="this.$t('action.state')" width="100" align="center">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-tag v-if="scope.row.status === 0" type="success" disable-transitions>正常</el-tag>
-            <el-tag v-if="scope.row.status === 1" type="danger" disable-transitions>文件不存在</el-tag>
+            <el-tag v-if="scope.row.status === 0" type="success" disable-transitions>{{ this.$t('zy20240205.normal') }}</el-tag>
+            <el-tag v-if="scope.row.status === 1" type="danger" disable-transitions>{{ this.$t('zy20240205.fileError') }}</el-tag>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column style="text-align: left;" label="操作" width="120" fixed="right">
+        <el-table-column style="text-align: left;" :label="this.$t('action.handle')" width="120" fixed="right">
           <template slot-scope="scope">
           <template slot-scope="scope">
             <el-button v-if="scope.row.status === 0" type="success" size="mini" @click="handlerEdit(scope.row)">
             <el-button v-if="scope.row.status === 0" type="success" size="mini" @click="handlerEdit(scope.row)">
-              还原
+              {{ this.$t('zy20240205.restore') }}
             </el-button>
             </el-button>
             <el-button v-else type="info" size="mini" @click="handlerDel(scope.row.id)">
             <el-button v-else type="info" size="mini" @click="handlerDel(scope.row.id)">
-              删除
+              {{ this.$t('action.delete') }}
             </el-button>
             </el-button>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
@@ -47,10 +47,10 @@
           :total="tableData.data_total">
           :total="tableData.data_total">
       </el-pagination>
       </el-pagination>
     </div>
     </div>
-    <el-dialog title="新增备份" :visible.sync="fromDialog" width="700px" :close-on-click-modal="false" :close-on-press-escape="false">
+    <el-dialog :title="this.$t('zy20240205.newBackup')" :visible.sync="fromDialog" width="700px" :close-on-click-modal="false" :close-on-press-escape="false">
       <el-form :model="myForm" ref="myForm" :rules="formRules" label-width="140px">
       <el-form :model="myForm" ref="myForm" :rules="formRules" label-width="140px">
-        <el-form-item label="数据库" prop="database_name">
-          <el-select v-model="myForm.database_name" filterable allow-create default-first-option placeholder="请选择或输入数据库">
+        <el-form-item :label="this.$t('zy20240205.database')" prop="database_name">
+          <el-select v-model="myForm.database_name" filterable allow-create default-first-option :placeholder="this.$t('zy20240205.inputDatabaseMsg')">
             <el-option v-for="(item, index) in databaseOptions" :key="index" :label="item" :value="item"></el-option>
             <el-option v-for="(item, index) in databaseOptions" :key="index" :label="item" :value="item"></el-option>
           </el-select>
           </el-select>
         </el-form-item>
         </el-form-item>
@@ -63,8 +63,8 @@
 <!--        <el-form-item v-if="myForm.bool_docker" label="容器名称" prop="container_name">-->
 <!--        <el-form-item v-if="myForm.bool_docker" label="容器名称" prop="container_name">-->
 <!--          <el-input v-model="myForm.container_name" placeholder="默认mysql" />-->
 <!--          <el-input v-model="myForm.container_name" placeholder="默认mysql" />-->
 <!--        </el-form-item>-->
 <!--        </el-form-item>-->
-        <el-form-item label="备份地址" prop="backups_path">
-          <el-input v-model="myForm.backups_path" placeholder="请输入备份地址" clearable />
+        <el-form-item :label="this.$t('zy20240205.backupAddress')" prop="backups_path">
+          <el-input v-model="myForm.backups_path" :placeholder="this.$t('zy20240205.inputBackupAddress')" clearable />
         </el-form-item>
         </el-form-item>
 <!--        <el-form-item label="mysql服务器地址">-->
 <!--        <el-form-item label="mysql服务器地址">-->
 <!--          <el-input v-model="myForm.mysql_ip" placeholder="mysql服务器地址" />-->
 <!--          <el-input v-model="myForm.mysql_ip" placeholder="mysql服务器地址" />-->
@@ -73,8 +73,8 @@
 
 
       </el-form>
       </el-form>
       <div slot="footer" class="dialog-footer">
       <div slot="footer" class="dialog-footer">
-        <el-button @click="fromDialog = false">取 消</el-button>
-        <el-button type="primary" @click="handleConfirm">确 定</el-button>
+        <el-button @click="fromDialog = false">{{ this.$t('action.cancel') }}</el-button>
+        <el-button type="primary" @click="handleConfirm">{{ this.$t('action.yes') }}</el-button>
       </div>
       </div>
     </el-dialog>
     </el-dialog>
   </div>
   </div>
@@ -107,10 +107,10 @@ export default {
         bool_docker: false
         bool_docker: false
       },
       },
       formRules: {
       formRules: {
-        database_name: [{ required: true, message: '请选择或输入数据库', trigger: 'change' }],
-        container_name: [{ required: true, message: '请输入容器名称', trigger: 'blur' }],
-        backups_path: [{ required: true, message: '请输入文件存储地址', trigger: 'blur' }],
-        mysql_ip: [{ required: true, message: '请输入mysql服务器地址', trigger: 'blur' }]
+        database_name: [{ required: true, message: this.$t('zy20240205.inputDatabaseMsg'), trigger: 'change' }],
+        container_name: [{ required: true, message: this.$t('zy20240205.inputContainerName'), trigger: 'blur' }],
+        backups_path: [{ required: true, message: this.$t('zy20240205.inputFileAddress'), trigger: 'blur' }],
+        mysql_ip: [{ required: true, message: this.$t('zy20240205.inputMysqlAddress'), trigger: 'blur' }]
       },
       },
       databaseOptions:['wdkl_ncs', 'wdkl_nfc', 'kea'],
       databaseOptions:['wdkl_ncs', 'wdkl_nfc', 'kea'],
       databaseName: '',
       databaseName: '',
@@ -146,14 +146,14 @@ export default {
     },
     },
     /** 点击每页显示数量 **/
     /** 点击每页显示数量 **/
     fortDate(row, column, cellValue, index) {
     fortDate(row, column, cellValue, index) {
-      if (!cellValue) return '暂无'
+      if (!cellValue) return this.$t('customerManage.null')
       return unix2Date(cellValue * 1000)
       return unix2Date(cellValue * 1000)
     },
     },
     handlerEdit(row) {
     handlerEdit(row) {
-      console.log('还原....',row)
-      this.$confirm('您确定要恢复还原吗?', '警告', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
+      console.log(this.$t('zy20240205.restoreMsg'), row)
+      this.$confirm(this.$t('zy20240205.restoreMsg2'), this.$t('action.waring'), {
+        confirmButtonText: this.$t('action.yes'),
+        cancelButtonText: this.$t('action.cancel'),
         type: 'warning'
         type: 'warning'
       }).then(() => {
       }).then(() => {
         // if (row.mysql_ip === this.API_GetIP()) {
         // if (row.mysql_ip === this.API_GetIP()) {
@@ -171,14 +171,14 @@ export default {
         //   })
         //   })
         // }
         // }
       }).catch(() => {
       }).catch(() => {
-        console.log('取消删除')
+        console.log(this.$t('action.cancelDelete'))
       })
       })
     },
     },
     /** 单条数据删除处理 */
     /** 单条数据删除处理 */
     handlerDel(ids) {
     handlerDel(ids) {
-      this.$confirm('删除操作后数据不可复原,您确定要删除此数据?', '警告', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
+      this.$confirm(this.$t('zy20240205.deleteSqlMsg'), this.$t('action.waring'), {
+        confirmButtonText: this.$t('action.yes'),
+        cancelButtonText: this.$t('action.cancel'),
         type: 'warning'
         type: 'warning'
       }).then(() => {
       }).then(() => {
         API_MysqlBackups.remove(ids).then(
         API_MysqlBackups.remove(ids).then(
@@ -186,12 +186,12 @@ export default {
               this.GET_List()
               this.GET_List()
               this.$message({
               this.$message({
                 type: 'success',
                 type: 'success',
-                message: '删除成功!'
+                message: this.$t('action.cancel')
               })
               })
             }
             }
         )
         )
       }).catch(() => {
       }).catch(() => {
-        console.log('取消删除')
+        console.log(this.$t('action.cancelDelete'))
       })
       })
     },
     },
     handleConfirm() {
     handleConfirm() {
@@ -205,7 +205,7 @@ export default {
             _this.$message.info(res.message)
             _this.$message.info(res.message)
           })
           })
         } else {
         } else {
-          this.$message.error('表单填写有误,请检查!')
+          this.$message.error(this.$t('action.fromError'))
         }
         }
       })
       })
     },
     },