修正一些显示bug
This commit is contained in:
1 parent
fd059a6db1
commit
394c2f16ef
6 files changed
+23
-31
No files matched your search
+2
-2
@@ -82,8 +82,8 @@ import { renderUserList, // 渲染用户列表 / Render user list
|
||||
// 设置全局配置参数
|
||||
// Set global configuration parameters
|
||||
window.config = {
|
||||
//wsAddress: `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}`, // WebSocket 服务器地址 / WebSocket server address
|
||||
wsAddress: `ws://127.0.0.1:8787`,
|
||||
wsAddress: `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}`, // WebSocket 服务器地址 / WebSocket server address
|
||||
//wsAddress: `ws://127.0.0.1:8787`,
|
||||
debug: true // 是否开启调试模式 / Enable debug mode
|
||||
};
|
||||
|
||||
|
||||
+1
-4
@@ -365,7 +365,4 @@ export function exitRoom() {
|
||||
return false
|
||||
}
|
||||
|
||||
export {
|
||||
roomsData,
|
||||
activeRoomIndex
|
||||
};
|
||||
export { roomsData, activeRoomIndex };
|
||||
+9
-19
@@ -1,14 +1,7 @@
|
||||
// Import necessary modules
|
||||
// 导入必要的模块
|
||||
import {
|
||||
$,
|
||||
$id,
|
||||
createElement,
|
||||
on,
|
||||
addClass,
|
||||
removeClass
|
||||
} from './util.dom.js';
|
||||
import { deflate, inflate } from 'fflate';
|
||||
import { showFileUploadModal } from './util.fileUpload.js';
|
||||
|
||||
// File transfer state management
|
||||
// 文件传输状态管理
|
||||
@@ -360,17 +353,14 @@ export function setupFileSend({
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
// Import and show upload modal
|
||||
import('./util.fileUpload.js').then(({ showFileUploadModal }) => {
|
||||
showFileUploadModal(async (files) => {
|
||||
// 传递 userName 给 onSend
|
||||
const userName = window.roomsData && window.activeRoomIndex >= 0
|
||||
? (window.roomsData[window.activeRoomIndex]?.myUserName || '')
|
||||
: '';
|
||||
await handleFilesUpload(files, (msg) => {
|
||||
// 合并 userName 字段
|
||||
onSend({ ...msg, userName });
|
||||
});
|
||||
showFileUploadModal(async (files) => {
|
||||
// 传递 userName 给 onSend
|
||||
const userName = window.roomsData && window.activeRoomIndex >= 0
|
||||
? (window.roomsData[window.activeRoomIndex]?.myUserName || '')
|
||||
: '';
|
||||
await handleFilesUpload(files, (msg) => {
|
||||
// 合并 userName 字段
|
||||
onSend({ ...msg, userName });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
+10
-2
@@ -254,10 +254,18 @@ export function updateStaticTexts() {
|
||||
loginFormContainer.innerHTML = generateLoginForm(false);
|
||||
});
|
||||
}
|
||||
// Update sidebar username label
|
||||
|
||||
// Update sidebar username label
|
||||
const sidebarUsername = document.getElementById('sidebar-username');
|
||||
if (sidebarUsername) {
|
||||
sidebarUsername.textContent = t('ui.my_name', 'My Name');
|
||||
import('./room.js').then(roomMod => {
|
||||
const roomsData = roomMod.roomsData;
|
||||
const activeRoomIndex = roomMod.activeRoomIndex;
|
||||
const rd = roomsData && roomsData.length > 0 && activeRoomIndex >= 0 ? roomsData[activeRoomIndex] : null;
|
||||
sidebarUsername.textContent = rd && rd.myUserName ? rd.myUserName : t('ui.my_name', 'My Name');
|
||||
}).catch(() => {
|
||||
sidebarUsername.textContent = t('ui.my_name', 'My Name');
|
||||
});
|
||||
}
|
||||
// Update "Enter a Node" text in sidebar
|
||||
const joinRoomText = document.getElementById('join-room-text');
|
||||
|
||||
@@ -50,9 +50,6 @@ export default defineConfig({
|
||||
if (/aes-js|elliptic|js-chacha20|js-sha256/.test(id)) {
|
||||
return 'crypto-libs'
|
||||
}
|
||||
if (id.includes('buffer')) {
|
||||
return 'vendor'
|
||||
}
|
||||
if (id.includes('emoji-picker-element')) {
|
||||
return 'emoji-libs'
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
name = "nodecrypt"
|
||||
name = "nodecrypt-test"
|
||||
main = "worker/index.js"
|
||||
compatibility_date = "2024-09-23"
|
||||
compatibility_flags = ["nodejs_compat"]
|
||||
|
||||
Reference in new issue
Block a user