mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-02-15 20:34:43 +08:00
feat: Refactor settings management into a dedicated page with new configuration options
This commit is contained in:
@@ -119,11 +119,6 @@ class RemoteControlService {
|
||||
public async startServer(): Promise<string> {
|
||||
console.log('[RemoteControl] Attempting to start server...');
|
||||
|
||||
if (this.httpServer.getIsRunning()) {
|
||||
console.log('[RemoteControl] Server is already running.');
|
||||
throw new Error('Server is already running.');
|
||||
}
|
||||
|
||||
try {
|
||||
const url = await this.httpServer.start();
|
||||
console.log(`[RemoteControl] Server started successfully at: ${url}`);
|
||||
|
||||
@@ -96,10 +96,6 @@ class TCPHttpServer {
|
||||
}
|
||||
|
||||
public async start(): Promise<string> {
|
||||
if (this.isRunning) {
|
||||
throw new Error('Server is already running');
|
||||
}
|
||||
|
||||
const netState = await NetInfo.fetch();
|
||||
let ipAddress: string | null = null;
|
||||
|
||||
@@ -111,6 +107,11 @@ class TCPHttpServer {
|
||||
throw new Error('无法获取IP地址,请确认设备已连接到WiFi或以太网。');
|
||||
}
|
||||
|
||||
if (this.isRunning) {
|
||||
console.log('[TCPHttpServer] Server is already running.');
|
||||
return `http://${ipAddress}:${PORT}`;
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
this.server = TcpSocket.createServer((socket: TcpSocket.Socket) => {
|
||||
|
||||
Reference in New Issue
Block a user