启用webp:
+
{{ $t('app.clickChangeLogo') }}
+
{{ $t('app.enableWebP') }}:
- 将图片转换为webp格式存储,在不降低图片质量的情况下,极大降低图片文件的体积,建议开启.
- 什么是webp?
-
-
重建索引:
+ {{ $t('app.storageWebP') }}
+
+
{{ $t('app.rebuildIndex') }}:
- 正在同步文件基本信息: {{ syncPercent }}%
- 正在为文件内容创建索引: {{ indexingPercent }}%
+ {{ $t('app.rebuildIndexStep1') }}: {{ syncPercent }}%
+ {{ $t('app.rebuildIndexStep2') }}: {{ indexingPercent }}%
-
重建索引分为两步: 1.同步文件基本信息, 2.为文件内容创建索引
-
重置角色、菜单:
+
{{ $t('app.rebuildIndexDesc') }}
+
{{ $t('app.resetMenuAndRole') }}:
-
一般用于初始化角色、菜单数据
+
{{ $t('app.resetMenuAndRoleDesc') }}
-
当前版本:v{{currentVersion}}
+
{{ $t('app.currentVersion') }}:v{{currentVersion}}
-
最新版本:{{newVersion ? newVersion : 'v' + currentVersion}}
- 在github上更新
+ {{ $t('app.latestVersion') }}:{{newVersion ? newVersion : 'v' + currentVersion}}
+ {{ $t('app.updateOnGithub') }}
@@ -70,21 +69,26 @@
-
+
-
+
-
+
+
+
+
+
+
@@ -98,6 +102,7 @@ import settingApi, { getSetting } from "@/api/setting-api";
import Logo from "@/components/Logo";
import getPageTitle from "@/utils/get-page-title";
import UploadImageInput from "@/components/input/UploadImageInput.vue";
+import LanguageConfig from '@/views/setting/cloudSetting/languageConfig.vue'
import PreviewConfig from '@/views/setting/cloudSetting/previewConfig.vue'
import {mapGetters, mapState} from "vuex";
import store from "@/store";
@@ -107,19 +112,19 @@ import TranscodeConfig from "@/views/setting/cloudSetting/transcodeConfig.vue";
import OfficeConfig from "@/views/setting/cloudSetting/officeConfig.vue";
export default {
- components: { PreviewConfig, OfficeConfig, TranscodeConfig, LdapConfig, TaskProgress, UploadImageInput, Logo},
+ components: { LanguageConfig, PreviewConfig, OfficeConfig, TranscodeConfig, LdapConfig, TaskProgress, UploadImageInput, Logo},
data() {
return {
activeName: '1',
uploadUrl: `${process.env.VUE_APP_BASE_API}/user/setting/upload_logo?jmal-token=${this.$store.state.user.token}&name=${this.$store.state.user.name}`,
- title: '网盘管理',
+ title: this.$t('app.setting'),
syncLoading: false,
clickSync: false,
indexingPercent: 100,
syncPercent: 100,
resetLoading: false,
webpEnabled: false,
- logoFileName: '',
+ logoFileName: this.$store.state.user.netdiskLogo || '',
netdiskName: 'JmalCloud',
showAckBtn: false,
inputNetdiskNameWidth: 150,
@@ -133,8 +138,6 @@ export default {
this.getIsSync()
if (this.$route.query.tab) {
this.activeName = this.$route.query.tab
- if (this.activeName === '2') {
- }
}
},
computed: {
@@ -171,10 +174,11 @@ export default {
const correctFormat = this.logoFileTypeList.includes(file.type);
const isLtOneM = file.size / 1024 < 128;
if (!correctFormat) {
- this.$message.error('网盘Logo只能是 SVG|JPG|JPEG|PNG 格式!');
+ this.$message.error(this.$t('msg.netDiskLogoRuleFormat').toString());
+ return correctFormat && isLtOneM;
}
if (!isLtOneM) {
- this.$message.error('网盘Logo大小不能超过 128k!');
+ this.$message.error(this.$t('msg.netDiskLogoRuleSize').toString());
}
return correctFormat && isLtOneM;
},
@@ -204,7 +208,7 @@ export default {
// 修改网盘名称
updateNetdiskName() {
if (!this.netdiskName) {
- this.$message.warning("网盘名称不能为空")
+ this.$message.warning(this.$t('msg.netDiskNameRuleEmpty').toString())
return
}
//中文,数字,字母,下划线
@@ -218,13 +222,13 @@ export default {
store.dispatch('updateMessage', {event: 'updateLogo'})
document.title = getPageTitle(this.$route.meta.title)
})
- this.$message.success("网盘名称 修改成功")
+ this.$message.success(`${this.$t('app.netDiskName')} ${this.$t('common.modifiedSuccessfully')}`)
this.setInputBlur()
}).catch(() => {
this.setInputBlur()
})
} else {
- this.$message.warning("网盘名称 只能包含中文,数字,字母,下划线")
+ this.$message.warning(`${this.$t('msg.netDiskNameRule')}`)
}
},
getInfo() {
@@ -252,9 +256,9 @@ export default {
this.syncLoading = !((this.syncPercent === 100 && this.indexingPercent === 100) || (this.syncPercent === 0 && this.indexingPercent === 0));
},
sync() {
- this.$confirm('是否开始扫描? ', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
+ this.$confirm(`${this.$t('app.startSync')}`, `${this.$t('common.tips')}`, {
+ confirmButtonText: `${this.$t('common.confirm')}`,
+ cancelButtonText: `${this.$t('common.cancel')}`,
type: 'warning'
}).then(() => {
this.syncLoading = true
@@ -269,14 +273,14 @@ export default {
},
// 重置角色菜单
resetMenuAndRole() {
- this.$confirm('您确定要删除当前角色、菜单吗? ', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
+ this.$confirm(`${this.$t('app.confirmDeleteMenuAndRole')}`, `${this.$t('common.tips')}`, {
+ confirmButtonText: `${this.$t('common.confirm')}`,
+ cancelButtonText: `${this.$t('common.cancel')}`,
type: 'warning'
}).then(() => {
this.resetLoading = true
settingApi.resetMenuAndRole().then(() => {
- this.$message.success("重置完成")
+ this.$message.success(this.$t('app.resetSuccessfully').toString())
this.resetLoading = false
}).catch(() => {
this.resetLoading = false
@@ -287,7 +291,7 @@ export default {
},
webpChange(webpEnabled) {
settingApi.disabledWebp({userId: this.$store.state.user.userId, disabled: !webpEnabled}).then(() => {
- webpEnabled ? this.$message.success('webp 已启用') : this.$message.warning('webp 已禁用')
+ webpEnabled ? this.$message.success(`WebP ${this.$t('msg.enabled')}`) : this.$message.warning(`WebP ${this.$t('msg.disabled')}`)
}).catch(() => {
this.webpEnabled = !this.webpEnabled
})
diff --git a/src/views/setting/cloudSetting/languageConfig.vue b/src/views/setting/cloudSetting/languageConfig.vue
new file mode 100644
index 0000000..4e9f16e
--- /dev/null
+++ b/src/views/setting/cloudSetting/languageConfig.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+