优化目录结构

This commit is contained in:
2026-05-25 20:37:36 +08:00
parent bbe7e71274
commit 40fd7f7e08
101 changed files with 108 additions and 110 deletions

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 472 KiB

After

Width:  |  Height:  |  Size: 472 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 166 KiB

View File

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 152 KiB

View File

Before

Width:  |  Height:  |  Size: 274 KiB

After

Width:  |  Height:  |  Size: 274 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -1,13 +1,13 @@
import { createLogger } from './logger.js';
import { createLogger } from '../../shared/logger.js';
const logger = createLogger('chat');
/**
* 消息模块
* 处理聊天消息的发送接收和显示
*/
import { showNotification, generateId } from './utils.js';
import store from './store.js';
import { mockMessages } from './models.js';
import { showNotification, generateId } from '../../shared/utils.js';
import store from '../store.js';
import { mockMessages } from '../models.js';
const MAX_IMAGE_SIZE = 5 * 1024 * 1024; // 5MB

View File

@@ -1,13 +1,13 @@
import { showNotification } from './utils.js';
import { showNotification } from '../shared/utils.js';
import store from './store.js';
import {
fetchConnectionDirectory,
fetchOnlineUsers,
renderConnectionIds,
renderOnlineUsers
} from './connect-directory.js';
import { createProfileSettingsController } from './profile-settings.js';
import { createLogger } from './logger.js';
} from './signaling/connect-directory.js';
import { createProfileSettingsController } from './controllers/profile-settings.js';
import { createLogger } from '../shared/logger.js';
const logger = createLogger('connectview');

View File

@@ -1,4 +1,4 @@
import { createLogger } from './logger.js';
import { createLogger } from '../../shared/logger.js';
const logger = createLogger('invite');
const DEFAULT_CALLER_NAME = '\u9080\u8bf7\u65b9';

View File

@@ -1,4 +1,4 @@
import { createLogger } from './logger.js';
import { createLogger } from '../../shared/logger.js';
const logger = createLogger('profile');
const DEFAULT_AVATAR = '/images/p1.png';

View File

@@ -7,7 +7,7 @@
<title>VideoCall - 一对一视频通话</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="/styles/style.css">
</head>
<body class="h-screen w-screen flex flex-col text-white bg-grid relative">
@@ -726,8 +726,8 @@
</div>
<!-- 引入模块化JavaScript文件 -->
<script type="module" src="connectview.js"></script>
<script type="module" src="main.js"></script>
<script type="module" src="/call/connectview.js"></script>
<script type="module" src="/call/main.js"></script>
</body>

View File

@@ -1,15 +1,15 @@
import store from './store.js';
import UIRenderer from './renderer.js';
import { showNotification, randomMeetingId } from './utils.js';
import chatMessage from './chatmessage.js';
import { createCallViewController } from './call-view-controller.js';
import UIRenderer from './renderers/renderer.js';
import { showNotification, randomMeetingId } from '../shared/utils.js';
import chatMessage from './chat/chatmessage.js';
import { createCallViewController } from './controllers/call-view-controller.js';
import {
bindConnectViewEvents,
initWebSocket,
loadUserSettings
} from './connectview.js';
import { createInviteController } from './invite-controller.js';
import { createLogger } from './logger.js';
import { createInviteController } from './controllers/invite-controller.js';
import { createLogger } from '../shared/logger.js';
const logger = createLogger('main');

View File

@@ -1,5 +1,5 @@
import { createParticipantTile, getParticipantTile } from './renderer-participant-grid.js';
import { createLogger } from './logger.js';
import { createParticipantTile, getParticipantTile } from '../participants/renderer-participant-grid.js';
import { createLogger } from '../../shared/logger.js';
const logger = createLogger('renderer-media');

View File

@@ -1,7 +1,7 @@
import { formatTime, formatTimestamp, toggleElement, toggleButtonState } from './utils.js';
import { mockCallSession } from './models.js';
import chatMessage from './chatmessage.js';
import store from './store.js';
import { formatTime, formatTimestamp, toggleElement, toggleButtonState } from '../../shared/utils.js';
import { mockCallSession } from '../models.js';
import chatMessage from '../chat/chatmessage.js';
import store from '../store.js';
import {
buildUserCountLabel,
createUserEntryElement,
@@ -10,11 +10,11 @@ import {
getNetworkQualityDisplay,
getRemoteVideoPlaceholderText
} from './renderer-ui.js';
import { renderChatMessagesInto } from './renderer-chat.js';
import { renderChatMessagesInto } from '../chat/renderer-chat.js';
import {
updateParticipantTileName as syncParticipantTileName,
updateParticipantTilePlaceholder
} from './renderer-participant-grid.js';
} from '../participants/renderer-participant-grid.js';
import {
adjustVideoSize,
clearParticipantGrid,
@@ -22,8 +22,8 @@ import {
removeParticipantTile,
renderParticipantStreamMedia,
renderSingleRemoteStreamMedia
} from './renderer-media.js';
import { createLogger } from './logger.js';
} from '../media/renderer-media.js';
import { createLogger } from '../../shared/logger.js';
const logger = createLogger('renderer');
@@ -513,7 +513,7 @@ class UIRenderer {
renderCallEnded() {
logger.debug('Call ended');
clearParticipantGrid(this.elements.participantGrid);
window.location.href = './endcall/endcall.html';
window.location.href = '/endcall/';
}
renderParticipantLeft(connectionId) {

View File

@@ -1,5 +1,5 @@
import { Signaling, WebSocketSignaling } from "../../module/signaling.js";
import { createLogger } from './logger.js';
import { Signaling, WebSocketSignaling } from '/module/core/signaling.js';
import { createLogger } from '../../shared/logger.js';
const logger = createLogger('signaling');

View File

@@ -1,15 +1,15 @@
import { mockCallSession } from './models.js';
import { RenderStreaming } from "../../module/renderstreaming.js";
import { getServerConfig, getRTCConfiguration } from "../js/config.js";
import { showNotification, generateId } from './utils.js';
import chatMessage from './chatmessage.js';
import { DEFAULT_PARTICIPANT_AVATAR, DEFAULT_PARTICIPANT_NAME, buildParticipantsSyncData, omitParticipant, removeParticipant, upsertParticipant } from './participants.js';
import { AUDIO_CONFIG, VAD_CONFIG, VIDEO_ONLY_CONSTRAINT, buildVideoConstraints, getAdaptiveVideoBitrate, getResolutionLabel, getTargetResolutionBitrate } from './media-config.js';
import { buildStatsLogPayload, createAudioAnalyser, getAudioLevel } from './media-monitoring.js';
import { bindInviteSocketEvents, buildSocketUserInfoPayload, createSignalingInstance, ensureSignalingStarted, getActiveSignalingInstance, sendInviteSignal, sendSocketUserInfo } from './signaling-session.js';
import { getNetworkQualityFromSummary, summarizeInboundStats } from './webrtc-stats.js';
import { createLogger } from './logger.js';
import { MeetingRecorder } from './meeting-recorder.js';
import { RenderStreaming } from '/module/core/renderstreaming.js';
import { getServerConfig, getRTCConfiguration } from '../render-streaming/config.js';
import { showNotification, generateId } from '../shared/utils.js';
import chatMessage from './chat/chatmessage.js';
import { DEFAULT_PARTICIPANT_AVATAR, DEFAULT_PARTICIPANT_NAME, buildParticipantsSyncData, omitParticipant, removeParticipant, upsertParticipant } from './participants/participants.js';
import { AUDIO_CONFIG, VAD_CONFIG, VIDEO_ONLY_CONSTRAINT, buildVideoConstraints, getAdaptiveVideoBitrate, getResolutionLabel, getTargetResolutionBitrate } from './media/media-config.js';
import { buildStatsLogPayload, createAudioAnalyser, getAudioLevel } from './media/media-monitoring.js';
import { bindInviteSocketEvents, buildSocketUserInfoPayload, createSignalingInstance, ensureSignalingStarted, getActiveSignalingInstance, sendInviteSignal, sendSocketUserInfo } from './signaling/signaling-session.js';
import { getNetworkQualityFromSummary, summarizeInboundStats } from './media/webrtc-stats.js';
import { createLogger } from '../shared/logger.js';
import { MeetingRecorder } from './media/meeting-recorder.js';
const logger = createLogger('store');
class CallStateManager {

View File

@@ -1,4 +1,4 @@
import { createLogger } from '../logger.js';
import { createLogger } from '../shared/logger.js';
const logger = createLogger('legacy-connect');
/**
@@ -6,7 +6,7 @@ const logger = createLogger('legacy-connect');
* 处理初始连接、创建通话和加入通话的功能
*/
import { showNotification, randomMeetingId } from '../utils.js';
import { showNotification, randomMeetingId } from '../shared/utils.js';
const MAX_AVATAR_SIZE = 2 * 1024 * 1024; // 2MB
@@ -20,7 +20,7 @@ function joinCall() {
localStorage.setItem('connectionId', connectionId);
// 跳转到通话界面
window.location.href = '../index.html';
window.location.href = '/';
} else {
showNotification('请输入连接ID', 'error');
}
@@ -39,7 +39,7 @@ function createCall() {
localStorage.setItem('connectionId', connectionId);
// 跳转到通话界面
window.location.href = '../index.html';
window.location.href = '/';
}

View File

@@ -6,7 +6,7 @@
<title>VideoCall - 重定向</title>
<script>
// 重定向到SPA入口页面index.html
window.location.href = '../index.html';
window.location.href = '/';
</script>
</head>
<body>

View File

@@ -3,14 +3,14 @@
* 处理通话结束后的操作,如重新连接或返回连接界面
*/
import { showNotification } from '../utils.js';
import { showNotification } from '../shared/utils.js';
// 重新连接
function reconnectCall() {
showNotification('正在重新连接...');
// 跳转到通话界面
window.location.href = '../index.html';
window.location.href = '/';
}
// 离开
@@ -19,7 +19,7 @@ function leaveCall() {
localStorage.removeItem('connectionId');
// 跳转到连接界面
window.location.href = '../connect/connect.html';
window.location.href = '/connect/';
}
// 绑定事件监听器

View File

@@ -6,7 +6,7 @@
<title>VideoCall - 通话结束</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="/styles/style.css">
</head>
<body class="h-screen w-screen flex flex-col text-white bg-grid relative">
<!--

View File

@@ -7,7 +7,7 @@
<title>VideoCall - 录制管理</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/styles/style.css">
</head>
<body class="min-h-screen w-screen text-white bg-grid recordings-page">

View File

@@ -1,5 +1,5 @@
import { Observer, Sender } from "../module/sender.js";
import { InputRemoting } from "../module/inputremoting.js";
import { Observer, Sender } from "/module/core/sender.js";
import { InputRemoting } from "/module/input/inputremoting.js";
export class VideoPlayer {
constructor() {
@@ -210,4 +210,4 @@ export class VideoPlayer {
await new Promise(resolve => setTimeout(resolve, 100));
this.inputRemoting.startSending();
}
}
}

View File

@@ -1,4 +1,4 @@
import * as Logger from "./logger.js";
import * as Logger from "../utils/logger.js";
export default class Peer extends EventTarget {
constructor(connectionId, polite, config, resendIntervalMsec = 5000) {

View File

@@ -1,5 +1,5 @@
import Peer from "./peer.js";
import * as Logger from "./logger.js";
import * as Logger from "../utils/logger.js";
function uuid4() {
var temp_url = URL.createObjectURL(new Blob());
@@ -314,4 +314,4 @@ export class RenderStreaming {
this._signaling = null;
}
}
}
}

View File

@@ -5,11 +5,11 @@ import {
Touchscreen,
StateEvent,
TextEvent
} from "./inputdevice.js";
} from "../input/inputdevice.js";
import { LocalInputManager } from "./inputremoting.js";
import { GamepadHandler } from "./gamepadhandler.js";
import { PointerCorrector } from "./pointercorrect.js";
import { LocalInputManager } from "../input/inputremoting.js";
import { GamepadHandler } from "../input/gamepadhandler.js";
import { PointerCorrector } from "../input/pointercorrect.js";
export class Sender extends LocalInputManager {
constructor(elem) {

View File

@@ -1,4 +1,4 @@
import * as Logger from "./logger.js";
import * as Logger from "../utils/logger.js";
export class Signaling extends EventTarget {

View File

@@ -1,8 +1,8 @@
import {
MemoryHelper,
} from "./memoryhelper.js";
} from "../utils/memoryhelper.js";
import { CharNumber } from "./charnumber.js";
import { CharNumber } from "../utils/charnumber.js";
import { Keymap } from "./keymap.js";
import { MouseButton } from "./mousebutton.js";
import { GamepadButton } from "./gamepadbutton.js";

View File

@@ -4,7 +4,7 @@ import {
import {
MemoryHelper
} from "./memoryhelper.js";
} from "../utils/memoryhelper.js";
export class LocalInputManager {
constructor() {

View File

@@ -1,4 +1,4 @@
import { sleep } from "./testutils";
import { sleep } from "../helpers/testutils.js";
/** @type {MockPrivateSignalingManager | MockPublicSignalingManager} */
let manager;

View File

@@ -1,4 +1,4 @@
import { sleep, getUniqueId } from './testutils';
import { sleep, getUniqueId } from '../helpers/testutils.js';
export class PeerConnectionMock extends EventTarget {
constructor(config) {
@@ -313,4 +313,4 @@ export class IceCandidateMock {
candidate;
sdpMLineIndex;
sdpMid;
}
}

View File

@@ -11,7 +11,7 @@ import {
StateEvent,
InputEvent,
TextEvent
} from "../src/inputdevice.js";
} from "../../src/input/inputdevice.js";
describe(`FourCC`, () => {
test('toInt32', () => {

View File

@@ -4,7 +4,7 @@ import {
KeyboardState,
TouchscreenState,
GamepadState
} from "../src/inputdevice.js";
} from "../../src/input/inputdevice.js";
import {
MessageType,
@@ -12,14 +12,14 @@ import {
NewEventsMsg,
RemoveDeviceMsg,
InputRemoting,
} from "../src/inputremoting.js";
} from "../../src/input/inputremoting.js";
import {
Sender,
Observer
} from "../src/sender.js";
} from "../../src/core/sender.js";
import {DOMRect} from "./domrect.js";
import {DOMRect} from "../helpers/domrect.js";
describe(`InputRemoting`, () => {
let sender = null;
@@ -129,4 +129,4 @@ test('create RemoveDeviceMsg', () => {
expect(msg.data).toBeInstanceOf(ArrayBuffer);
expect(msg.data.byteLength).toBeGreaterThan(0);
});

View File

@@ -1,4 +1,4 @@
import { MeetingRecorder } from '../public/meeting-recorder.js';
import { MeetingRecorder } from '../../public/call/media/meeting-recorder.js';
class MediaStreamMock {
constructor(tracks = []) {

View File

@@ -1,6 +1,6 @@
import {
MemoryHelper
} from "../src/memoryhelper.js";
} from "../../src/utils/memoryhelper.js";
describe(`MemoryHelper.writeSingleBit`, () => {
test('turn on with offset 0', () => {
@@ -64,4 +64,4 @@ describe(`MemoryHelper.writeSingleBit`, () => {
expect(view[1]).toBe(0);
expect(view[2]).toBe(0);
});
});
});

View File

@@ -1,5 +1,5 @@
import Peer from "../src/peer.js";
import { waitFor, sleep, getUniqueId, getRTCConfiguration } from "./testutils.js";
import Peer from "../../src/core/peer.js";
import { waitFor, sleep, getUniqueId, getRTCConfiguration } from "../helpers/testutils.js";
describe(`peer connection test`, () => {

View File

@@ -1,10 +1,10 @@
import {
LetterBoxType,
PointerCorrector
} from "../src/pointercorrect.js";
} from "../../src/input/pointercorrect.js";
import {DOMRect} from "./domrect.js";
import {DOMHTMLVideoElement} from "./domvideoelement.js";
import {DOMRect} from "../helpers/domrect.js";
import {DOMHTMLVideoElement} from "../helpers/domvideoelement.js";
describe(`PointerCorrector.map`, () => {
test('letterboxType', () => {

View File

@@ -1,6 +1,6 @@
import { MockSignaling, reset } from "./mocksignaling.js";
import { waitFor, getUniqueId, getRTCConfiguration } from "./testutils.js";
import { RenderStreaming } from "../src/renderstreaming.js";
import { MockSignaling, reset } from "../mocks/mocksignaling.js";
import { waitFor, getUniqueId, getRTCConfiguration } from "../helpers/testutils.js";
import { RenderStreaming } from "../../src/core/renderstreaming.js";
describe.each([
{ mode: "private" },

View File

@@ -1,14 +1,14 @@
import {
InputRemoting,
} from "../src/inputremoting.js";
} from "../../src/input/inputremoting.js";
import {
Sender,
Observer
} from "../src/sender.js";
} from "../../src/core/sender.js";
import {jest} from '@jest/globals';
import {DOMRect} from "./domrect.js";
import {DOMRect} from "../helpers/domrect.js";
// mock
@@ -140,4 +140,4 @@ describe(`Sender`, () => {
describe('gamepad', () => {
//todo
});
});
});

View File

@@ -1,9 +1,9 @@
import { jest } from '@jest/globals';
import * as Path from 'path';
import { setup, teardown } from 'jest-dev-server';
import { Signaling, WebSocketSignaling } from "../src/signaling.js";
import { MockSignaling, reset } from "./mocksignaling.js";
import { waitFor, sleep, serverExeName } from "./testutils.js";
import { Signaling, WebSocketSignaling } from "../../src/core/signaling.js";
import { MockSignaling, reset } from "../mocks/mocksignaling.js";
import { waitFor, sleep, serverExeName } from "../helpers/testutils.js";
const portNumber = 8081;
jest.setTimeout(10000);