diff --git a/App.tsx b/App.tsx index c32ab55..b8575b4 100644 --- a/App.tsx +++ b/App.tsx @@ -17,6 +17,15 @@ const App: React.FC = () => { const [errorMsg, setErrorMsg] = useState(null); // Polling Logic + useEffect(() => { + try { + // @ts-ignore + (window.adsbygoogle = window.adsbygoogle || []).push({}); + } catch (e) { + console.error("AdSense error", e); + } + }, []); + useEffect(() => { let isMounted = true; let timeoutId: number; @@ -32,9 +41,9 @@ const App: React.FC = () => { if (isMounted) setBasicInfo(parsedBasic); // Delay 500ms - await new Promise(r => setTimeout(r, 500)); + await new Promise(r => setTimeout(r, 500)); if (!isMounted) return; - + // 2. Get Cell Info const cellData = await serialService.sendCommand(CMD_CELL_INFO); const parsedCells = JBDProtocol.parseCellInfo(cellData); @@ -103,7 +112,7 @@ const App: React.FC = () => { try { const newCharge = type === 'charge' ? !currentState : basicInfo.mosfetStatus.charge; const newDischarge = type === 'discharge' ? !currentState : basicInfo.mosfetStatus.discharge; - + await serialService.toggleMosfet(newCharge, newDischarge); } catch (e: any) { alert("MOSFET 제어 실패: " + e.message); @@ -123,7 +132,7 @@ const App: React.FC = () => { return (
- + {/* Sidebar */}
@@ -136,32 +145,46 @@ const App: React.FC = () => { + {/* AdSense Unit */} +
+
Sponsored
+ + + + +
+
{connectionState === ConnectionState.CONNECTED ? ( - ) : ( - )} @@ -190,58 +213,58 @@ const App: React.FC = () => { {activeTab === 'dashboard' ? '개요 (Overview)' : '설정 (Configuration)'}
- {connectionState === ConnectionState.CONNECTED && ( -
-
- CONNECTED -
- )} - {connectionState === ConnectionState.DISCONNECTED && ( -
-
- OFFLINE -
- )} + {connectionState === ConnectionState.CONNECTED && ( +
+
+ CONNECTED +
+ )} + {connectionState === ConnectionState.DISCONNECTED && ( +
+
+ OFFLINE +
+ )}
{/* Content Body with Right Sidebar */}
- {/* Main View */} -
- {errorMsg && ( -
- - {errorMsg} -
- )} + {/* Main View */} +
+ {errorMsg && ( +
+ + {errorMsg} +
+ )} - {renderContent()} - - {/* Empty State Overlay */} - {connectionState !== ConnectionState.CONNECTED && ( -
-
- -
-

장치가 연결되지 않았습니다

-

- JBD BMS를 UART-to-USB 어댑터로 연결하여 실시간 상태를 확인하고 설정을 변경하세요. -

- -
- )} -
+ {renderContent()} - {/* Right Terminal Panel */} - + {/* Empty State Overlay */} + {connectionState !== ConnectionState.CONNECTED && ( +
+
+ +
+

장치가 연결되지 않았습니다

+

+ JBD BMS를 UART-to-USB 어댑터로 연결하여 실시간 상태를 확인하고 설정을 변경하세요. +

+ +
+ )} +
+ + {/* Right Terminal Panel */} +