增加openai 相容 api 測試support

This commit is contained in:
danlee
2026-03-12 08:54:13 +08:00
parent 55bfed41ef
commit 0aadefaebb
3 changed files with 19 additions and 2 deletions
+3
View File
@@ -654,6 +654,9 @@ export function Sidebar() {
<div>
<div className="text-sm font-bold text-[var(--text)] tracking-wide">OPENCLAW</div>
<div className="text-[10px] text-[var(--text-muted)] tracking-wider">BOT DASHBOARD</div>
{process.env.NEXT_PUBLIC_DASHBOARD_VERSION && (
<div className="text-[9px] text-[var(--text-muted)] opacity-60 tracking-wide">v{process.env.NEXT_PUBLIC_DASHBOARD_VERSION}</div>
)}
</div>
</Link>
<button
+2 -1
View File
@@ -193,7 +193,8 @@ function extractErrorMessage(payload: any, fallback: string): string {
async function probeModelDirect(params: ProbeModelParams): Promise<DirectProbeResult | null> {
const providerCfg = loadProviderConfig(params.providerId);
if (!providerCfg?.baseUrl || !providerCfg.api || !providerCfg.apiKey) return null;
if (!providerCfg?.baseUrl || !providerCfg.apiKey) return null;
if (!providerCfg.api) providerCfg.api = "openai-completions";
const timeoutMs = params.timeoutMs ?? DEFAULT_MODEL_PROBE_TIMEOUT_MS;
const headers: Record<string, string> = {
+14 -1
View File
@@ -1,3 +1,16 @@
import { execSync } from "child_process";
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
env: {
NEXT_PUBLIC_DASHBOARD_VERSION: (() => {
try {
return execSync("git log -1 --format=%cd --date=format:%y.%m%d", { encoding: "utf8" }).trim();
} catch {
return "";
}
})(),
},
};
export default nextConfig;