fix: 将对外 IP 固定为 121.40.164.32
修改内容: - 移除 IP 输入框,改为静态显示 - 固定 externalIp 为 121.40.164.32 - 移除 saveExternalIp() 函数 - 所有 localhost 链接将自动替换为对外 IP
This commit is contained in:
14
app.py
14
app.py
@@ -1636,7 +1636,7 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
|||||||
<div class="flex items-center gap-3">
|
<div class="flex items-center gap-3">
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<span class="text-gray-400 text-sm">对外IP:</span>
|
<span class="text-gray-400 text-sm">对外IP:</span>
|
||||||
<input type="text" id="externalIp" value="192.168.2.17" class="bg-gray-700 text-gray-200 px-2 py-1 rounded text-sm w-28" onchange="saveExternalIp()">
|
<span class="text-cyan-400 font-medium text-sm">121.40.164.32</span>
|
||||||
</div>
|
</div>
|
||||||
<button onclick="refreshAll()" class="btn bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-lg flex items-center gap-2">
|
<button onclick="refreshAll()" class="btn bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-lg flex items-center gap-2">
|
||||||
<i class="ri-refresh-line"></i> 刷新
|
<i class="ri-refresh-line"></i> 刷新
|
||||||
@@ -2386,10 +2386,11 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
|||||||
let cronTasks = [];
|
let cronTasks = [];
|
||||||
let currentTab = 'projects';
|
let currentTab = 'projects';
|
||||||
let currentFilter = 'all';
|
let currentFilter = 'all';
|
||||||
let externalIp = localStorage.getItem('externalIp') || '192.168.2.17';
|
let externalIp = '121.40.164.32'; // 对外访问IP(固定)
|
||||||
let enableLogs = localStorage.getItem('enableLogs') === 'true';
|
let enableLogs = localStorage.getItem('enableLogs') === 'true';
|
||||||
|
|
||||||
document.getElementById('externalIp').value = externalIp;
|
// 不再显示IP输入框(已固定)
|
||||||
|
// document.getElementById('externalIp').value = externalIp;
|
||||||
document.getElementById('enableLogs').checked = enableLogs;
|
document.getElementById('enableLogs').checked = enableLogs;
|
||||||
|
|
||||||
// Tab 切换
|
// Tab 切换
|
||||||
@@ -2753,13 +2754,6 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IP 保存
|
|
||||||
function saveExternalIp() {
|
|
||||||
externalIp = document.getElementById('externalIp').value.trim();
|
|
||||||
localStorage.setItem('externalIp', externalIp);
|
|
||||||
renderProjects();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 项目加载和渲染(保持原有逻辑)
|
// 项目加载和渲染(保持原有逻辑)
|
||||||
async function loadProjects() {
|
async function loadProjects() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
16
logs/app.log
16
logs/app.log
@@ -1,8 +1,8 @@
|
|||||||
[2026-06-01 11:29:23] ==================================================
|
[2026-06-01 11:36:47] ==================================================
|
||||||
[2026-06-01 11:29:23] 项目服务管理面板 v2.0.0 启动
|
[2026-06-01 11:36:47] 项目服务管理面板 v2.0.0 启动
|
||||||
[2026-06-01 11:29:23] 访问地址: http://localhost:16022
|
[2026-06-01 11:36:47] 访问地址: http://localhost:16022
|
||||||
[2026-06-01 11:29:23] 进程PID: 772725
|
[2026-06-01 11:36:47] 进程PID: 773965
|
||||||
[2026-06-01 11:29:23] ==================================================
|
[2026-06-01 11:36:47] ==================================================
|
||||||
* Serving Flask app 'app'
|
* Serving Flask app 'app'
|
||||||
* Debug mode: off
|
* Debug mode: off
|
||||||
[31m[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.[0m
|
[31m[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.[0m
|
||||||
@@ -10,7 +10,5 @@
|
|||||||
* Running on http://127.0.0.1:16022
|
* Running on http://127.0.0.1:16022
|
||||||
* Running on http://192.168.0.101:16022
|
* Running on http://192.168.0.101:16022
|
||||||
[33mPress CTRL+C to quit[0m
|
[33mPress CTRL+C to quit[0m
|
||||||
127.0.0.1 - - [01/Jun/2026 11:29:31] "GET /api/docker/containers HTTP/1.1" 200 -
|
127.0.0.1 - - [01/Jun/2026 11:37:01] "GET / HTTP/1.1" 200 -
|
||||||
127.0.0.1 - - [01/Jun/2026 11:29:38] "GET /api/docker/container/641688a330c1/stats HTTP/1.1" 200 -
|
127.0.0.1 - - [01/Jun/2026 11:37:01] "GET /api/projects HTTP/1.1" 200 -
|
||||||
127.0.0.1 - - [01/Jun/2026 11:30:08] "GET / HTTP/1.1" 200 -
|
|
||||||
127.0.0.1 - - [01/Jun/2026 11:30:08] "GET /api/projects HTTP/1.1" 200 -
|
|
||||||
|
|||||||
Reference in New Issue
Block a user