feat: enhance song management and notification features

- Updated SongList.vue to enable default sorting with a boolean flag.
- Modified TempComponent.vue to include useNotification for better user feedback.
- Refined useLiveRequest.ts to enforce type safety on song request settings.
- Adjusted RTCClient.ts to improve event handling and connection logic.
- Enhanced useVTsuruHub.ts to ensure SignalR connection is awaited during initialization.
- Improved ManageLayout.vue by reorganizing menu options for better user experience.
- Added folder scanning functionality in SongListManageView.vue for importing songs from local directories.
- Implemented OBS notification system in various OBS-related components for real-time updates.
- Removed outdated documentation files related to local question saving functionality.
- Introduced a new store useOBSNotification.ts to manage OBS notifications effectively.
This commit is contained in:
Megghy
2025-10-13 04:12:42 +08:00
parent 4ad9766043
commit 902926f28f
19 changed files with 585 additions and 410 deletions

View File

@@ -46,6 +46,7 @@ export abstract class BaseRTCClient {
this.send('VTsuru.RTCEvent.On', eventName)
}
public off(eventName: string, listener: (args: any) => void) {
if (this.events[eventName]) {
const index = this.events[eventName].indexOf(listener)
@@ -99,14 +100,14 @@ export class SlaveRTCClient extends BaseRTCClient {
type: 'slave' = 'slave' as const
protected async getAllRTC(): Promise<ComponentsEventHubModel[]> {
return await this.vhub.invoke<ComponentsEventHubModel[]>('GetAllRTC') || []
return await this.vhub.invoke<ComponentsEventHubModel[]>('GetOnlineRTC') || []
}
public async connectToAllMaster() {
const masters = (await this.getAllRTC()).filter(
(item: ComponentsEventHubModel) =>
item.IsMaster
&& item.Token != this.peer!.id
&& item.Token != this.peer.id
&& !this.connections.some(conn => conn.peer == item.Token),
)
masters.forEach((item: ComponentsEventHubModel) => {