diff --git a/src/api/setting-api.js b/src/api/setting-api.js index cde7def..2547ea1 100644 --- a/src/api/setting-api.js +++ b/src/api/setting-api.js @@ -1,6 +1,20 @@ import request from '@/utils/request' export default { + getTranscodeConfig(params) { + return request({ + url: '/cloud/setting/transcode/config', + method: 'get', + params + }) + }, + setTranscodeConfig(data) { + return request({ + url: '/cloud/setting/transcode/config', + method: 'put', + data + }) + }, syncUser(params) { return request({ url: '/user/setting/sync', diff --git a/src/components/TaskProgress/index.vue b/src/components/TaskProgress/index.vue index e94bcde..fd337db 100644 --- a/src/components/TaskProgress/index.vue +++ b/src/components/TaskProgress/index.vue @@ -69,4 +69,7 @@ export default { diff --git a/src/components/preview/VideoPreview.vue b/src/components/preview/VideoPreview.vue index bfa7617..321aef2 100644 --- a/src/components/preview/VideoPreview.vue +++ b/src/components/preview/VideoPreview.vue @@ -45,6 +45,7 @@ export default { return { pc: this.$pc, art: null, + switchQuality: false, option: { url: '', title: '', // 视频标题,目前会出现在 视频截图 和 迷你模式 下 @@ -137,8 +138,9 @@ export default { } } this.option.url = videoUrl + if (this.file.m3u8) { - const supported = ['flv', 'mp4', 'ogg', 'mkv', 'webm', 'hls', 'mov'] + const supported = ['mp4', 'ogg', 'mkv', 'webm', 'hls', 'mov'] if (supported.includes(this.file.suffix.toLowerCase())) { this.option.quality = [ { @@ -156,7 +158,10 @@ export default { m3u8: this.playM3u8 } } + if (this.file.contentType.indexOf('flv') > -1) { + this.option.url = originUrl + this.option.quality = [] this.option.customType = { flv: this.playFlv } @@ -166,6 +171,11 @@ export default { this.title = this.file.name this.option.id = this.file.id this.show = true + this.switchQuality = true + } else { + this.option.url = '' + this.videoLink = '' + this.option.quality = [] } } }, diff --git a/src/views/setting/cloudManager.vue b/src/views/setting/cloudManager.vue index 03ce11e..699a778 100644 --- a/src/views/setting/cloudManager.vue +++ b/src/views/setting/cloudManager.vue @@ -65,66 +65,20 @@ + +
+ +
+
- - - - - - - - - - - - - - - - - - - - - - - - 测试链接 - - - - - - - - - - - - - - - - - 保存配置 - - +
- +
@@ -146,14 +100,14 @@ import settingApi, { getSetting, getTaskProgress } from "@/api/setting-api"; import Logo from "@/components/Logo"; import getPageTitle from "@/utils/get-page-title"; import UploadImageInput from "@/components/input/UploadImageInput.vue"; -import roleApi from "@/api/role"; -import { loadLdapConfig, testLdapConfig, updateLdapConfig} from '@/api/user' import {mapGetters, mapState} from "vuex"; import store from "@/store"; import TaskProgress from "@/components/TaskProgress/index.vue"; +import LdapConfig from "@/views/setting/ldapConfig.vue"; +import TranscodeConfig from "@/views/setting/transcodeConfig.vue"; export default { - components: {TaskProgress, UploadImageInput, Logo}, + components: {TranscodeConfig, LdapConfig, TaskProgress, UploadImageInput, Logo}, data() { return { activeName: '1', @@ -171,44 +125,7 @@ export default { showAckBtn: false, inputNetdiskNameWidth: 150, logoFileTypeList: ['image/svg+xml', 'image/jpg', 'image/png', 'image/jpeg'], - ldapFormData: { - enable: true, - ldapServer: '', - defaultRoleList: [], - baseDN: '', - userDN: '', - password: '', - loginName: '' - }, currentVersion: config.version, - roleList: [], - ldapStatusOptions: [{ - value: true, - label: '启用' - }, { - value: false, - label: '禁用' - }], - rules: { - ldapServer: [ - {required: true, message: '请填写LDAP服务器', trigger: 'submit'} - ], - defaultRoleList: [ - {required: true, message: '请选择默认角色', trigger: 'submit'} - ], - baseDN: [ - {required: true, message: '请填写 Base DN', trigger: 'submit'} - ], - userDN: [ - {required: true, message: '请填写 管理员账号', trigger: 'submit'} - ], - loginName: [ - {required: true, message: '请填写登录名', trigger: 'submit'} - ] - }, - testLdapConfigLoading: false, - saveLdapConfigLoading: false, - testLdapConfigResult: -1, } }, mounted() { @@ -218,8 +135,6 @@ export default { if (this.$route.query.tab) { this.activeName = this.$route.query.tab if (this.activeName === '2') { - this.getRoleList() - this.getLdapConfig() } } getTaskProgress().then(res => { @@ -231,12 +146,6 @@ export default { ...mapGetters([ 'newVersion' ]), - ldapTestBtn() { - return !(this.ldapFormData.ldapServer.length > 0 && this.ldapFormData.baseDN.length > 0 && (this.ldapFormData.password ? this.ldapFormData.password.length > 0 : false)) - }, - ldapSaveBtn() { - return !(!this.ldapTestBtn && this.ldapFormData.defaultRoleList.length > 0 && this.ldapFormData.loginName.length > 0) - } }, watch: { message(msg) { @@ -246,32 +155,8 @@ export default { } }, methods: { - doTestLdapConfig() { - this.testLdapConfigLoading = true - testLdapConfig(this.ldapFormData).then(() => { - this.testLdapConfigLoading = false - this.testLdapConfigResult = 0 - this.$message.success("连接成功") - }).catch(() => { - this.testLdapConfigResult = 1 - this.testLdapConfigLoading = false - }); - }, - saveLdapConfig() { - this.saveLdapConfigLoading = true - updateLdapConfig(this.ldapFormData).then(() => { - this.saveLdapConfigLoading = false - this.$message.success("保存成功") - }).catch(() => { - this.saveLdapConfigLoading = false - }); - }, handleClick(tab) { this.$router.push({query: {tab: tab.name}}) - if (tab.name === '2') { - this.getRoleList() - this.getLdapConfig() - } }, handleAvatarSuccess(res) { if (res.code === 0) { @@ -310,18 +195,6 @@ export default { } }) }, - getRoleList() { - roleApi.roleList().then(res => { - this.roleList = res.data; - }) - }, - getLdapConfig() { - loadLdapConfig().then(res => { - if (res.data) { - this.ldapFormData = res.data; - } - }) - }, inputNetdiskName(input) { if (input) { this.showAckBtn = true @@ -430,7 +303,7 @@ export default { diff --git a/src/views/setting/ldapConfig.vue b/src/views/setting/ldapConfig.vue new file mode 100644 index 0000000..94138af --- /dev/null +++ b/src/views/setting/ldapConfig.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/src/views/setting/transcodeConfig.vue b/src/views/setting/transcodeConfig.vue new file mode 100644 index 0000000..60306fb --- /dev/null +++ b/src/views/setting/transcodeConfig.vue @@ -0,0 +1,89 @@ + + + + +