feat: TCP server/client mode config, protocol display in settings

This commit is contained in:
2026-07-27 19:09:53 +08:00
parent f715cb85e6
commit 759d35bc93
3 changed files with 32 additions and 7 deletions
+6 -1
View File
@@ -221,7 +221,12 @@ const PageSettings = {
_gamePortListHtml(games, cfg) {
const gamePorts = cfg.game_ports || {};
return games.map(g => '<div class="game-port-row" style="display:flex;gap:8px;align-items:center;margin-bottom:6px"><span class="gp-id" style="width:140px;font-size:13px;color:var(--text-secondary)">' + g.name + '</span><input class="gp-port" type="number" value="' + (gamePorts[g.id] || g.default_port || 20777) + '" min="1024" max="65535" style="width:100px"><span style="font-size:11px;color:var(--text-tertiary)">默认: ' + (g.default_port || 20777) + '</span></div>').join('');
return games.map(g => {
const proto = g.protocol || 'udp';
const mode = g.mode || (proto === 'tcp' ? 'server' : '');
const protoLabel = proto.toUpperCase() + (mode ? '/' + mode : '');
return '<div class="game-port-row" style="display:flex;gap:8px;align-items:center;margin-bottom:6px"><span class="gp-id" style="width:120px;font-size:13px;color:var(--text-secondary)">' + g.name + '</span><span style="width:70px;font-size:11px;color:var(--text-tertiary)">' + protoLabel + '</span><input class="gp-port" type="number" value="' + (gamePorts[g.id] || g.default_port || (proto==='tcp'?cfg.tcp_port||20778:20777)) + '" min="1024" max="65535" style="width:100px"><span style="font-size:11px;color:var(--text-tertiary)">默认: ' + (g.default_port || (proto==='tcp'?cfg.tcp_port||20778:20777)) + '</span></div>';
}).join('');
},
_forwardListHtml(forwards) {