feat: React 프론트엔드 기능 대폭 확장
- 월별근무표: 휴일/근무일 관리, 자동 초기화 - 메일양식: 템플릿 CRUD, To/CC/BCC 설정 - 그룹정보: 부서 관리, 비트 연산 기반 권한 설정 - 업무일지: 수정 성공 메시지 제거, 오늘 근무시간 필터링 수정 - 웹소켓 메시지 type 충돌 버그 수정 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -20,12 +20,102 @@ namespace Project.Web
|
||||
public partial class MachineBridge
|
||||
{
|
||||
// Reference to the main form to update logic
|
||||
private Dialog.fDashboardNew _host;
|
||||
private Dialog.fDashboard _host;
|
||||
|
||||
public MachineBridge(Dialog.fDashboardNew host)
|
||||
// WebSocket 서버 인스턴스
|
||||
private static Project.Web.WebSocketServer _wsServer;
|
||||
private static readonly object _wsLock = new object();
|
||||
|
||||
private const int WS_PORT = 8082;
|
||||
|
||||
public MachineBridge(Dialog.fDashboard host)
|
||||
{
|
||||
_host = host;
|
||||
StartWebSocketServer();
|
||||
}
|
||||
|
||||
#region WebSocket Server Control
|
||||
|
||||
/// <summary>
|
||||
/// WebSocket 서버 시작
|
||||
/// </summary>
|
||||
private void StartWebSocketServer()
|
||||
{
|
||||
lock (_wsLock)
|
||||
{
|
||||
if (_wsServer != null)
|
||||
{
|
||||
Console.WriteLine("[WS] WebSocket server already running");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string url = $"http://localhost:{WS_PORT}/";
|
||||
_wsServer = new Project.Web.WebSocketServer(url, this);
|
||||
_wsServer.Start();
|
||||
Console.WriteLine($"[WS] WebSocket server started on port {WS_PORT}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[WS] Failed to start WebSocket server: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WebSocket 서버 중지
|
||||
/// </summary>
|
||||
public static void StopWebSocketServer()
|
||||
{
|
||||
lock (_wsLock)
|
||||
{
|
||||
if (_wsServer != null)
|
||||
{
|
||||
_wsServer.Stop();
|
||||
_wsServer = null;
|
||||
Console.WriteLine("[WS] WebSocket server stopped");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WebSocket 서버 실행 여부 확인
|
||||
/// </summary>
|
||||
public static bool IsWebSocketServerRunning()
|
||||
{
|
||||
lock (_wsLock)
|
||||
{
|
||||
return _wsServer != null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region App Info
|
||||
|
||||
/// <summary>
|
||||
/// 애플리케이션 버전 정보 반환
|
||||
/// </summary>
|
||||
public string GetAppVersion()
|
||||
{
|
||||
try
|
||||
{
|
||||
return JsonConvert.SerializeObject(new
|
||||
{
|
||||
Success = true,
|
||||
ProductName = Application.ProductName,
|
||||
ProductVersion = Application.ProductVersion,
|
||||
DisplayVersion = $"{Application.ProductName} v{Application.ProductVersion}"
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return JsonConvert.SerializeObject(new { Success = false, Message = ex.Message });
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user