Skip to content
Merged

1 #3

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a2a387f
控制台更新 修复 增肌linux下载 mongb功能
SANYOU-hash Nov 11, 2025
8ae95c1
在学校机房提交Readme
Ink-dark Nov 20, 2025
1a1ee2f
提交更新修改#1 from Ink-dark/docs(文件修改),在学校机房审核
Ink-dark Nov 20, 2025
0d850e5
Update contact emails in README.md
Ink-dark Nov 22, 2025
31ded48
合并PR #2 from Ink-dark/Ink-dark-patch-1
Ink-dark Nov 22, 2025
244f0f3
feat(聊天): 实现本地消息存储和历史记录功能
Ink-dark Dec 6, 2025
77d1c22
feat(聊天服务): 添加消息重发机制和WebSocket连接优化
Ink-dark Dec 6, 2025
1446622
Merge branch 'main' of https://github.com/Ink-dark/HalloChat
Ink-dark Dec 6, 2025
a5d4c3c
style(ChatWindow): 修复历史消息加载函数的缩进问题
Ink-dark Dec 6, 2025
7d6a04a
refactor: 优化表单验证和样式结构
Ink-dark Dec 6, 2025
10420be
refactor(登录组件): 移除未使用的确认密码状态及相关验证
Ink-dark Dec 6, 2025
cc7d4ad
feat(登录): 添加密码复杂度验证规则
Ink-dark Dec 6, 2025
e306aa5
进一步优化登录页面ui 修复更换服务器时的小bug
SANYOU-hash Dec 8, 2025
13b0208
更新自述文件
SANYOU-hash Jan 3, 2026
90cb2c2
Update README.md
SANYOU-hash Jan 3, 2026
d30c099
更新 Readme 中 部分信息
Ink-dark Jan 3, 2026
f7b0195
添加多语言支持:简体中文 繁体中文 俄文 英文 (后续继续支持其他语言)
SANYOU-hash Jan 18, 2026
71b964b
添加管理员进入测试 (正式发布时取消)
SANYOU-hash Jan 18, 2026
539bdd0
增加登录页面背景更换功能
SANYOU-hash Jan 18, 2026
65afa01
对ui进行大型改动 添加uid功能
SANYOU-hash Jan 19, 2026
6066b8a
docs(更新文件说明)
Ink-dark Jan 24, 2026
2397a49
update
Ink-dark Jan 24, 2026
181dd5c
feat(窗口管理): 添加服务器选择窗口和聊天窗口功能
Ink-dark Jan 25, 2026
8ed2a3a
fix(ServerSelectionWindow): 将 destroyOnClose 改为 destroyOnHidden 以修复模态…
Ink-dark Jan 25, 2026
19e179a
update README.md.
MoDa-Browser Jan 31, 2026
4f7d013
集成 Electron 主进程窗口创建逻辑
MoDa-Browser Jan 31, 2026
a47d838
Merge branch 'main' of https://gitee.com/moranqidarkseven/hallochat-g…
MoDa-Browser Jan 31, 2026
68578b1
Revise README with project updates and links
Ink-dark Feb 6, 2026
4721c19
更新Readme.md
MoDa-Browser Mar 25, 2026
5547810
update README.md.
MoDa-Browser Mar 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

HalloChat 是一款实时聊天应用,客户端版本:v0.2.0

ces
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**本仓库近期因为一些原因重建,丢失了原有所有的commit记录,仅有Gitee仓库留有完整备份。现在已经重建成功,欢迎提交。**
## 新项目友链
**我们正在开发以Dear Imgui + C++的HalloChat客户端,使用GNU-LGPL许可证!**
新仓库链接:[HalloChat-DearImgui](https://github.com/Ink-dark/HalloChat-cpp-on-imgui)

**注意:**
1. 本项目为测试版本,存在已知问题和功能缺失,且不定期更新,如果有发现问题请及时提交issues联系我,感谢支持。
## 特别须知
1. 本项目尚处于测试版本,存在已知问题和功能缺失,且不定期更新,如果有发现问题请及时提交issues联系我,感谢支持。
2. 本项目使用GitHub Actions 进行企业微信机器人通知(仅Push事件),用于通知项目维护者有新的代码提交。
- 企业微信机器人Webhook URL:`https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${{ secrets.WECHAT_QIYE_WEBHOOK_URL }}`
- 请将上述URL添加到您的项目的GitHub Actions Secrets 中,名称为 `WECHAT_QIYE_WEBHOOK_URL`。
Expand All @@ -21,12 +24,21 @@ HalloChat 是一款实时聊天应用,客户端版本:v0.2.0
// 版权所有 © 2025 Ink-dark(墨染柒DarkSeven)
// 遵循 MIT 开源许可证
```
## 项目开发者
### 墨染柒DarkSeven
- 邮箱:moranqidarkseven@hallochat.cn
- 个人博客:[墨染柒的个人博客-GitHub Pages(可能停止更新)](Ink-dark.github.io)

### SANYOU (LUCA.NEX)
- 邮箱:you.san1@icloud.com
- 个人网站:[lucanex.top](https://www.lucanex.top/)

## 联系我们
- 项目仓库:[HalloChat](https://github.com/Ink-dark/HalloChat)
- 问题反馈:[Issues](https://github.com/Ink-dark/HalloChat/issues)
- 邮件联系:
1. hallochatdev@hanjiang88luntan.eu.org(项目开发团队)
2. d16671480856@163.com(项目开发者Ink-dark/墨染柒DarkSeven)
1. dev@hallochat.cn(项目开发团队)
2. moranqidarkseven@hallochat.cn(项目开发者Ink-dark/墨染柒DarkSeven)
3. 企业微信:(正在配置中)

## 项目概述
Expand Down Expand Up @@ -277,6 +289,9 @@ JWT_REFRESH_SECRET=your_refresh_secret
> **注意**:上述所有命令需在管理员模式下的PowerShell中执行。

## 加入我们

注意:因企业微信企业账号封禁,我们已改用飞书进行协作。飞书的企业名称为“比特火炬”。

如果你对HalloChat项目感兴趣,欢迎加入我们的开发团队。你可以通过以下方式联系我们,我们会在一定时间内回复,请在邮件中包含以下信息:
- 你的姓名(可以不要求真实姓名,昵称即可)
- 你的邮箱(用于回复和项目合作)
Expand All @@ -287,11 +302,11 @@ JWT_REFRESH_SECRET=your_refresh_secret
- 参与项目的技术讨论和决策
- 项目进度的及时更新通知
- 项目相关的技术支持和帮助
- 项目团队企业微信(要求提供手机号,用于加入项目团队)
- 项目团队飞书(要求提供手机号,用于加入项目团队)

当你做好了以上准备,你可以通过以下方式联系我们:
1. hallochatdev@hanjiang88luntan.eu.org(项目开发团队)
2. d16671480856@163.com(项目开发者Ink-dark/墨染柒DarkSeven)
3. 企业微信:(因企业微信限制,目前暂无法直接提供添加方式)
1. dev@hallochat.cn(项目开发团队)
2. moranqidarkseven@hallochoat.cn(项目开发者Ink-dark/墨染柒DarkSeven)

再次感谢每一个为项目做出贡献的开发者!

4 changes: 2 additions & 2 deletions client/.npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
registry=https://registry.npmmirror.com/
electron_mirror=https://cdn.npmmirror.com/binaries/electron/
electron_builder_binaries_mirror=https://npmmirror.com/mirrors/electron-builder-binaries/
# Electron mirrors should be set via environment variables to avoid npm warnings
# e.g., ELECTRON_MIRROR="https://cdn.npmmirror.com/binaries/electron/"
275 changes: 275 additions & 0 deletions client/electron-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ function saveWindowConfig(windowName, bounds) {
// 全局引用,防止窗口被垃圾回收
let loginWindow = null;
let mainWindow = null;
let serverSelectionWindow = null;
let settingsWindow = null;
let chatWindows = {}; // 存储多个聊天窗口

// 创建登录窗口
function createLoginWindow() {
Expand Down Expand Up @@ -261,6 +264,278 @@ ipcMain.on('show-error-box', (event, title, content) => {
dialog.showErrorBox(title, content);
});

// 监听打开设置窗口事件
ipcMain.on('open-settings-window', () => {
log.info('打开设置窗口');
createSettingsWindow();
});

// 监听打开服务器选择窗口事件
ipcMain.on('open-server-selection-window', () => {
log.info('打开服务器选择窗口');
createServerSelectionWindow();
});

// 监听打开聊天窗口事件
ipcMain.on('open-chat-window', (event, { chatId, chatType, chatName }) => {
log.info('打开聊天窗口:', { chatId, chatType, chatName });
createChatWindow(chatId, chatType, chatName);
});

// 监听关闭聊天窗口事件
ipcMain.on('close-chat-window', (event, chatId) => {
log.info('关闭聊天窗口:', chatId);
if (chatWindows[chatId] && !chatWindows[chatId].isDestroyed()) {
chatWindows[chatId].close();
}
});

// 创建设置窗口
function createSettingsWindow() {
const config = loadWindowConfig();
const settingsConfig = config.settings || {};

// 如果窗口已存在,先关闭
if (settingsWindow && !settingsWindow.isDestroyed()) {
settingsWindow.focus();
return;
}

settingsWindow = new BrowserWindow({
...settingsConfig,
width: settingsConfig.width || 600,
height: settingsConfig.height || 600,
minWidth: 400,
minHeight: 500,
title: 'HalloChat - 设置',
parent: mainWindow,
modal: false,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true,
webSecurity: false,
allowRunningInsecureContent: true
},
icon: path.join(__dirname, 'public/favicon.ico')
});

// 加载URL
try {
const forceLocalFile = app.isPackaged;

if (forceLocalFile) {
const possiblePaths = [
path.join(__dirname, 'build', 'index.html'),
path.join(process.resourcesPath, 'build', 'index.html'),
path.join(__dirname, '..', 'build', 'index.html')
];

let foundPath = null;
for (const p of possiblePaths) {
log.info('尝试加载文件:', p);
try {
settingsWindow.loadFile(p, { query: { view: 'settings' } });
foundPath = p;
break;
} catch (err) {
log.warn('文件加载失败:', p, err.message);
}
}

if (!foundPath) {
throw new Error('无法找到有效的index.html文件');
}
} else {
settingsWindow.loadURL('http://localhost:3000/?view=settings');
}
} catch (error) {
log.error('加载窗口内容失败:', error);
dialog.showErrorBox('加载失败', '无法加载应用内容: ' + error.message);
}

// 保存窗口大小和位置
settingsWindow.on('resize', () => {
if (!settingsWindow.isMaximized()) {
saveWindowConfig('settings', settingsWindow.getBounds());
}
});

settingsWindow.on('move', () => {
if (!settingsWindow.isMaximized()) {
saveWindowConfig('settings', settingsWindow.getBounds());
}
});

settingsWindow.on('closed', () => {
settingsWindow = null;
});
}

// 创建设服务器选择窗口
function createServerSelectionWindow() {
const config = loadWindowConfig();
const serverConfig = config.serverSelection || {};

// 如果窗口已存在,先关闭
if (serverSelectionWindow && !serverSelectionWindow.isDestroyed()) {
serverSelectionWindow.focus();
return;
}

serverSelectionWindow = new BrowserWindow({
...serverConfig,
width: serverConfig.width || 500,
height: serverConfig.height || 400,
minWidth: 400,
minHeight: 300,
title: 'HalloChat - 选择服务器',
parent: mainWindow || loginWindow,
modal: false,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true,
webSecurity: false,
allowRunningInsecureContent: true
},
icon: path.join(__dirname, 'public/favicon.ico')
});

// 加载URL
try {
const forceLocalFile = app.isPackaged;

if (forceLocalFile) {
const possiblePaths = [
path.join(__dirname, 'build', 'index.html'),
path.join(process.resourcesPath, 'build', 'index.html'),
path.join(__dirname, '..', 'build', 'index.html')
];

let foundPath = null;
for (const p of possiblePaths) {
log.info('尝试加载文件:', p);
try {
serverSelectionWindow.loadFile(p, { query: { view: 'serverSelection' } });
foundPath = p;
break;
} catch (err) {
log.warn('文件加载失败:', p, err.message);
}
}

if (!foundPath) {
throw new Error('无法找到有效的index.html文件');
}
} else {
serverSelectionWindow.loadURL('http://localhost:3000/?view=serverSelection');
}
} catch (error) {
log.error('加载窗口内容失败:', error);
dialog.showErrorBox('加载失败', '无法加载应用内容: ' + error.message);
}

// 保存窗口大小和位置
serverSelectionWindow.on('resize', () => {
if (!serverSelectionWindow.isMaximized()) {
saveWindowConfig('serverSelection', serverSelectionWindow.getBounds());
}
});

serverSelectionWindow.on('move', () => {
if (!serverSelectionWindow.isMaximized()) {
saveWindowConfig('serverSelection', serverSelectionWindow.getBounds());
}
});

serverSelectionWindow.on('closed', () => {
serverSelectionWindow = null;
});
}

// 创建聊天窗口
function createChatWindow(chatId, chatType, chatName) {
const config = loadWindowConfig();
const chatConfig = config[`chat_${chatId}`] || {};

// 如果窗口已存在,先关闭
if (chatWindows[chatId] && !chatWindows[chatId].isDestroyed()) {
chatWindows[chatId].focus();
return;
}

chatWindows[chatId] = new BrowserWindow({
...chatConfig,
width: chatConfig.width || 800,
height: chatConfig.height || 600,
minWidth: 600,
minHeight: 400,
title: `HalloChat - ${chatName}`,
parent: mainWindow,
modal: false,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true,
webSecurity: false,
allowRunningInsecureContent: true
},
icon: path.join(__dirname, 'public/favicon.ico')
});

// 加载URL
try {
const forceLocalFile = app.isPackaged;

if (forceLocalFile) {
const possiblePaths = [
path.join(__dirname, 'build', 'index.html'),
path.join(process.resourcesPath, 'build', 'index.html'),
path.join(__dirname, '..', 'build', 'index.html')
];

let foundPath = null;
for (const p of possiblePaths) {
log.info('尝试加载文件:', p);
try {
chatWindows[chatId].loadFile(p, { query: { view: 'chat', chatId, chatType, chatName } });
foundPath = p;
break;
} catch (err) {
log.warn('文件加载失败:', p, err.message);
}
}

if (!foundPath) {
throw new Error('无法找到有效的index.html文件');
}
} else {
chatWindows[chatId].loadURL(`http://localhost:3000/?view=chat&chatId=${chatId}&chatType=${chatType}&chatName=${encodeURIComponent(chatName)}`);
}
} catch (error) {
log.error('加载窗口内容失败:', error);
dialog.showErrorBox('加载失败', '无法加载应用内容: ' + error.message);
}

// 保存窗口大小和位置
chatWindows[chatId].on('resize', () => {
if (!chatWindows[chatId].isMaximized()) {
saveWindowConfig(`chat_${chatId}`, chatWindows[chatId].getBounds());
}
});

chatWindows[chatId].on('move', () => {
if (!chatWindows[chatId].isMaximized()) {
saveWindowConfig(`chat_${chatId}`, chatWindows[chatId].getBounds());
}
});

chatWindows[chatId].on('closed', () => {
delete chatWindows[chatId];
});
}

// 应用就绪后创建登录窗口
app.whenReady().then(() => {
try {
Expand Down
5 changes: 5 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
"browserify-fs": "^1.0.0",
"crypto-js": "^4.2.0",
"electron-log": "^5.4.3",
"i18next": "^25.7.4",
"path-browserify": "^1.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^16.5.3",
"react-router-dom": "^7.9.3",
"react-scripts": "5.0.1",
"socket.io-client": "^4.7.2",
Expand All @@ -66,6 +68,9 @@
"react-app/jest"
]
},
"overrides": {
"typescript": "^4.9.5"
},
"browserslist": {
"production": [
">0.2%",
Expand Down
Binary file added client/public/HalloChat.ico
Binary file not shown.
Loading