fix:path rewriting & model list
This commit is contained in:
@@ -2328,6 +2328,8 @@ var ApiKeyList = class {
|
||||
const actionConfig = this._getQuickActionConfig(action);
|
||||
if (actionConfig && actionConfig.requiresConfirm) {
|
||||
const result = await Swal.fire({
|
||||
backdrop: `rgba(0,0,0,0.5)`,
|
||||
heightAuto: false,
|
||||
target: "#main-content-wrapper",
|
||||
title: "\u8BF7\u786E\u8BA4\u64CD\u4F5C",
|
||||
html: actionConfig.confirmText,
|
||||
@@ -853,13 +853,15 @@ var SystemLogTerminal = class {
|
||||
this.shouldAutoScroll = true;
|
||||
this.reconnectAttempts = 0;
|
||||
this.maxReconnectAttempts = 5;
|
||||
this.isConnected = false;
|
||||
this.elements = {
|
||||
output: this.container.querySelector("#log-terminal-output"),
|
||||
statusIndicator: this.controlsContainer.querySelector("#terminal-status-indicator"),
|
||||
clearBtn: this.controlsContainer.querySelector('[data-action="clear-terminal"]'),
|
||||
pauseBtn: this.controlsContainer.querySelector('[data-action="toggle-pause-terminal"]'),
|
||||
scrollBtn: this.controlsContainer.querySelector('[data-action="toggle-scroll-terminal"]'),
|
||||
disconnectBtn: this.controlsContainer.querySelector('[data-action="disconnect-terminal"]')
|
||||
connectBtn: this.controlsContainer.querySelector('[data-action="toggle-connect-terminal"]'),
|
||||
settingsBtn: this.controlsContainer.querySelector('[data-action="terminal-settings"]')
|
||||
};
|
||||
this._initEventListeners();
|
||||
}
|
||||
@@ -867,7 +869,15 @@ var SystemLogTerminal = class {
|
||||
this.elements.clearBtn.addEventListener("click", () => this.clear());
|
||||
this.elements.pauseBtn.addEventListener("click", () => this.togglePause());
|
||||
this.elements.scrollBtn.addEventListener("click", () => this.toggleAutoScroll());
|
||||
this.elements.disconnectBtn.addEventListener("click", () => this.disconnect());
|
||||
this.elements.connectBtn.addEventListener("click", () => this.toggleConnect());
|
||||
this.elements.settingsBtn.addEventListener("click", () => this.openSettings());
|
||||
}
|
||||
toggleConnect() {
|
||||
if (this.isConnected) {
|
||||
this.disconnect();
|
||||
} else {
|
||||
this.connect();
|
||||
}
|
||||
}
|
||||
connect() {
|
||||
this.clear();
|
||||
@@ -880,6 +890,9 @@ var SystemLogTerminal = class {
|
||||
this._appendMessage("info", "\u2713 \u5DF2\u8FDE\u63A5\u5230\u7CFB\u7EDF\u65E5\u5FD7\u6D41");
|
||||
this._updateStatus("connected", "\u5DF2\u8FDE\u63A5");
|
||||
this.reconnectAttempts = 0;
|
||||
this.isConnected = true;
|
||||
this.elements.connectBtn.title = "\u65AD\u5F00";
|
||||
this.elements.connectBtn.querySelector("i").classList.replace("fa-plug", "fa-minus-circle");
|
||||
};
|
||||
this.ws.onmessage = (event) => {
|
||||
if (this.isPaused) return;
|
||||
@@ -888,7 +901,7 @@ var SystemLogTerminal = class {
|
||||
const levelColors = {
|
||||
"error": "text-red-500",
|
||||
"warning": "text-yellow-400",
|
||||
"info": "text-blue-400",
|
||||
"info": "text-green-400",
|
||||
"debug": "text-zinc-400"
|
||||
};
|
||||
const color = levelColors[data.level] || "text-zinc-200";
|
||||
@@ -906,6 +919,9 @@ var SystemLogTerminal = class {
|
||||
this.ws.onclose = () => {
|
||||
this._appendMessage("error", "\u2717 \u8FDE\u63A5\u5DF2\u65AD\u5F00");
|
||||
this._updateStatus("disconnected", "\u672A\u8FDE\u63A5");
|
||||
this.isConnected = false;
|
||||
this.elements.connectBtn.title = "\u8FDE\u63A5";
|
||||
this.elements.connectBtn.querySelector("i").classList.replace("fa-minus-circle", "fa-plug");
|
||||
if (this.reconnectAttempts < this.maxReconnectAttempts) {
|
||||
this.reconnectAttempts++;
|
||||
setTimeout(() => {
|
||||
@@ -921,7 +937,10 @@ var SystemLogTerminal = class {
|
||||
this.ws = null;
|
||||
}
|
||||
this.reconnectAttempts = this.maxReconnectAttempts;
|
||||
this.isConnected = false;
|
||||
this._updateStatus("disconnected", "\u672A\u8FDE\u63A5");
|
||||
this.elements.connectBtn.title = "\u8FDE\u63A5";
|
||||
this.elements.connectBtn.querySelector("i").classList.replace("fa-minus-circle", "fa-plug");
|
||||
}
|
||||
clear() {
|
||||
if (this.elements.output) {
|
||||
@@ -930,24 +949,21 @@ var SystemLogTerminal = class {
|
||||
}
|
||||
togglePause() {
|
||||
this.isPaused = !this.isPaused;
|
||||
const span = this.elements.pauseBtn.querySelector("span");
|
||||
const icon = this.elements.pauseBtn.querySelector("i");
|
||||
if (this.isPaused) {
|
||||
span.textContent = "\u7EE7\u7EED";
|
||||
this.elements.pauseBtn.title = "\u7EE7\u7EED";
|
||||
icon.classList.replace("fa-pause", "fa-play");
|
||||
} else {
|
||||
span.textContent = "\u6682\u505C";
|
||||
this.elements.pauseBtn.title = "\u6682\u505C";
|
||||
icon.classList.replace("fa-play", "fa-pause");
|
||||
}
|
||||
}
|
||||
toggleAutoScroll() {
|
||||
this.shouldAutoScroll = !this.shouldAutoScroll;
|
||||
const span = this.elements.scrollBtn.querySelector("span");
|
||||
if (this.shouldAutoScroll) {
|
||||
span.textContent = "\u81EA\u52A8\u6EDA\u52A8";
|
||||
} else {
|
||||
span.textContent = "\u624B\u52A8\u6EDA\u52A8";
|
||||
}
|
||||
this.elements.scrollBtn.title = this.shouldAutoScroll ? "\u81EA\u52A8\u6EDA\u52A8" : "\u624B\u52A8\u6EDA\u52A8";
|
||||
}
|
||||
openSettings() {
|
||||
console.log("\u6253\u5F00\u8BBE\u7F6E");
|
||||
}
|
||||
_appendMessage(colorClass, text) {
|
||||
if (!this.elements.output) return;
|
||||
@@ -1085,12 +1101,22 @@ var LogsPage = class {
|
||||
this.elements.systemControls
|
||||
);
|
||||
Swal.fire({
|
||||
title: "\u5B9E\u65F6\u7CFB\u7EDF\u65E5\u5FD7",
|
||||
text: "\u60A8\u5373\u5C06\u8FDE\u63A5\u5230\u5B9E\u65F6\u65E5\u5FD7\u6D41\u3002\u8FD9\u4F1A\u4E0E\u670D\u52A1\u5668\u5EFA\u7ACB\u4E00\u4E2A\u6301\u7EED\u7684\u8FDE\u63A5\u3002",
|
||||
icon: "info",
|
||||
confirmButtonText: "\u6211\u660E\u767D\u4E86\uFF0C\u5F00\u59CB\u8FDE\u63A5",
|
||||
width: "20rem",
|
||||
backdrop: `rgba(0,0,0,0.5)`,
|
||||
heightAuto: false,
|
||||
customClass: {
|
||||
popup: `swal2-custom-style ${document.documentElement.classList.contains("dark") ? "swal2-dark" : ""}`
|
||||
},
|
||||
title: "\u7CFB\u7EDF\u7EC8\u7AEF\u65E5\u5FD7",
|
||||
text: "\u60A8\u5373\u5C06\u8FDE\u63A5\u5230\u5B9E\u65F6\u7CFB\u7EDF\u65E5\u5FD7\u6D41\u7A97\u53E3\u3002",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: "\u786E\u8BA4",
|
||||
cancelButtonText: "\u53D6\u6D88",
|
||||
reverseButtons: false,
|
||||
confirmButtonColor: "rgba(31, 102, 255, 0.8)",
|
||||
cancelButtonColor: "#6b7280",
|
||||
focusConfirm: false,
|
||||
focusCancel: false,
|
||||
target: "#main-content-wrapper"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
@@ -181,8 +181,8 @@ var pageModules = {
|
||||
// 键 'dashboard' 对应一个函数,该函数调用 import() 返回一个 Promise
|
||||
// esbuild 看到这个 import() 语法,就会自动将 dashboard.js 及其依赖打包成一个独立的 chunk 文件
|
||||
"dashboard": () => import("./dashboard-XFUWX3IN.js"),
|
||||
"keys": () => import("./keys-HRP4JR7B.js"),
|
||||
"logs": () => import("./logs-43KF5HY3.js")
|
||||
"keys": () => import("./keys-2IUHJHHE.js"),
|
||||
"logs": () => import("./logs-MNVRT6ND.js")
|
||||
// 'settings': () => import('./pages/settings.js'), // 未来启用 settings 页面
|
||||
// 未来新增的页面,只需在这里添加一行映射,esbuild会自动处理
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user