diff --git a/bun.lockb b/bun.lockb index f5f509f..4828188 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 987b18b..427ef01 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "html2canvas": "^1.4.1", "linqts": "^2.0.0", "mitt": "^3.0.1", + "monaco-editor": "^0.52.0", "music-metadata-browser": "^2.5.11", "peerjs": "^1.5.4", "pinia": "^2.2.6", @@ -43,6 +44,7 @@ "unplugin-vue-markdown": "^0.26.2", "uuid": "^11.0.2", "vite": "^5.4.10", + "vite-plugin-monaco-editor": "^1.1.0", "vite-svg-loader": "^5.1.0", "vue": "3.5.12", "vue-echarts": "^7.0.3", diff --git a/src/api/api-models.ts b/src/api/api-models.ts index 40b2ce0..1643cab 100644 --- a/src/api/api-models.ts +++ b/src/api/api-models.ts @@ -229,6 +229,7 @@ export interface Setting_QuestionDisplay { borderColor?: string borderWidth?: number + syncScroll: boolean currentQuestion?: number } diff --git a/src/components/MonacoEditorComponent.vue b/src/components/MonacoEditorComponent.vue new file mode 100644 index 0000000..4a04860 --- /dev/null +++ b/src/components/MonacoEditorComponent.vue @@ -0,0 +1,32 @@ + + + \ No newline at end of file diff --git a/src/components/VideoCollectInfoCard.vue b/src/components/VideoCollectInfoCard.vue index b5f0b9d..37b4582 100644 --- a/src/components/VideoCollectInfoCard.vue +++ b/src/components/VideoCollectInfoCard.vue @@ -1,5 +1,6 @@ diff --git a/src/views/manage/DanmujiManageView.vue b/src/views/manage/DanmujiManageView.vue new file mode 100644 index 0000000..45a25ca --- /dev/null +++ b/src/views/manage/DanmujiManageView.vue @@ -0,0 +1,37 @@ + + + + + \ No newline at end of file diff --git a/src/views/manage/QuestionBoxManageView.vue b/src/views/manage/QuestionBoxManageView.vue index 1610211..c0d937d 100644 --- a/src/views/manage/QuestionBoxManageView.vue +++ b/src/views/manage/QuestionBoxManageView.vue @@ -1,11 +1,12 @@ - - + + 保存二维码 @@ -469,20 +462,12 @@ onActivated(async () => { - + - + 最低为一小时 diff --git a/src/views/obs/DanmujiOBS.vue b/src/views/obs/DanmujiOBS.vue index 42828f8..dc6c171 100644 --- a/src/views/obs/DanmujiOBS.vue +++ b/src/views/obs/DanmujiOBS.vue @@ -76,7 +76,7 @@ const defaultConfig: DanmujiConfig = { } as DanmujiConfig let textEmoticons: { keyword: string, url: string }[] = [] const config = ref(JSON.parse(JSON.stringify(defaultConfig))) -const rtc = useWebRTC().Init('slave') +const rtc = await useWebRTC().Init('slave') const emoticonsTrie = computed(() => { let res = new trie.Trie() diff --git a/src/views/obs/MusicRequestOBS.vue b/src/views/obs/MusicRequestOBS.vue index 9401de1..935878e 100644 --- a/src/views/obs/MusicRequestOBS.vue +++ b/src/views/obs/MusicRequestOBS.vue @@ -23,7 +23,7 @@ const route = useRoute() const currentId = computed(() => { return props.id ?? route.query.id }) -const rtc = useWebRTC().Init('slave') +const rtc = await useWebRTC().Init('slave') const listContainerRef = ref() const footerRef = ref() diff --git a/src/views/obs/QuestionDisplayOBS.vue b/src/views/obs/QuestionDisplayOBS.vue index 7eb03db..15049b8 100644 --- a/src/views/obs/QuestionDisplayOBS.vue +++ b/src/views/obs/QuestionDisplayOBS.vue @@ -9,11 +9,13 @@ import { useWebRTC } from '@/store/useRTC' const hash = ref('') const token = useRouteQuery('token') -const rtc = useWebRTC().Init('slave') +const rtc = await useWebRTC().Init('slave') const question = ref() const setting = ref({} as Setting_QuestionDisplay) +const cardRef = ref() + async function checkIfChanged() { try { const data = await QueryGetAPI(QUESTION_API_URL + 'get-hash', { @@ -45,6 +47,9 @@ async function getQuestionAndSetting() { console.log(err) } } +function handleScroll(value: { clientHeight: number, scrollHeight: number, scrollTop: number }) { + cardRef.value?.setScroll(value) +} const visiable = ref(true) const active = ref(true) @@ -66,12 +71,16 @@ onMounted(() => { active.value = a } } + + rtc?.on('function.question.sync-scroll', handleScroll) }) onUnmounted(() => { clearInterval(timer) + + rtc?.off('function.question.sync-scroll', handleScroll) }) diff --git a/src/views/obs/QueueOBS.vue b/src/views/obs/QueueOBS.vue index fb873fd..4318880 100644 --- a/src/views/obs/QueueOBS.vue +++ b/src/views/obs/QueueOBS.vue @@ -29,7 +29,7 @@ const route = useRoute() const currentId = computed(() => { return props.id ?? route.query.id }) -const rtc = useWebRTC().Init('slave') +const rtc = await useWebRTC().Init('slave') const listContainerRef = ref() const footerRef = ref() diff --git a/src/views/open_live/LiveRequest.vue b/src/views/open_live/LiveRequest.vue index a782d7c..f4f3ff1 100644 --- a/src/views/open_live/LiveRequest.vue +++ b/src/views/open_live/LiveRequest.vue @@ -15,7 +15,7 @@ import { import { QueryGetAPI, QueryPostAPI, QueryPostAPIWithParams } from '@/api/query' import SongPlayer from '@/components/SongPlayer.vue' import { RoomAuthInfo } from '@/data/DanmakuClient' -import { SONG_REQUEST_API_URL } from '@/data/constants' +import { CURRENT_HOST, SONG_REQUEST_API_URL } from '@/data/constants' import { useDanmakuClient } from '@/store/useDanmakuClient' import { Checkmark12Regular, @@ -633,24 +633,24 @@ const columns = [ () => [ data.status == SongRequestStatus.Finish || data.status == SongRequestStatus.Cancel ? h(NTooltip, null, { - trigger: () => - h( - NButton, - { - size: 'small', - type: 'info', - circle: true, - loading: isLoading.value, - onClick: () => { - updateSongStatus(data, SongRequestStatus.Waiting) - }, + trigger: () => + h( + NButton, + { + size: 'small', + type: 'info', + circle: true, + loading: isLoading.value, + onClick: () => { + updateSongStatus(data, SongRequestStatus.Waiting) }, - { - icon: () => h(NIcon, { component: ReloadCircleSharp }), - }, - ), - default: () => '重新放回等待列表', - }) + }, + { + icon: () => h(NIcon, { component: ReloadCircleSharp }), + }, + ), + default: () => '重新放回等待列表', + }) : undefined, h( NPopconfirm, @@ -731,7 +731,7 @@ async function updateActive() { message.error('无法获取点播队列: ' + data.message) return [] } - } catch (err) {} + } catch (err) { } } function blockUser(item: SongRequestInfo) { if (item.from != SongRequestFrom.Danmaku) { @@ -793,15 +793,11 @@ onUnmounted(() => { - + @@ -939,26 +918,16 @@ onUnmounted(() => { - + {{ song.user?.guard_level == 1 ? '总督' : song.user?.guard_level == 2 ? '提督' : '舰长' }} - + SC | {{ song.price }} - + Gift | {{ song.price }} @@ -973,13 +942,8 @@ onUnmounted(() => {