Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion plugins/admin/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7087,6 +7087,7 @@ <h2 id="governance-review-title">Confirm governance change</h2>
$("onboarding-oauth-summary").textContent = configured.length
? configured.map((item) => connectorName(item.provider)).join(", ") + " available in the web UI."
: "Add Google, GitHub, Notion, or other OAuth clients to make those connectors available.";
await loadCustomProviders();
viewLoadedAt.onboarding = Date.now();
}
$("onboarding-model-provider").onchange = () => renderOnboardingModelOptions();
Expand Down Expand Up @@ -7228,7 +7229,12 @@ <h2 id="governance-review-title">Confirm governance change</h2>
const saved = await api("PUT", "/api/custom-providers/" + encodeURIComponent(id), body);
$("custom-provider-save").disabled = false;
if (!saved.ok) {
setStatus("st-custom-provider", saved.data?.message || "Could not save this provider.", "err", true);
setStatus(
"st-custom-provider",
saved.data?.message || (saved.data?.error ? "Error: " + saved.data.error : "Could not save this provider."),
"err",
true,
);
return;
}
$("custom-provider-key").value = "";
Expand Down
5 changes: 4 additions & 1 deletion plugins/admin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ async function handle(req: IncomingMessage, res: ServerResponse): Promise<void>
res.setHeader("x-frame-options", "DENY");
res.setHeader("content-security-policy", ADMIN_CSP);
const url = new URL(req.url ?? "/", "http://localhost");
const { pathname } = url;
let pathname = url.pathname;
if (ADMIN_BASE_PATH && (pathname === ADMIN_BASE_PATH || pathname.startsWith(ADMIN_BASE_PATH + "/"))) {
pathname = pathname.slice(ADMIN_BASE_PATH.length) || "/";
}
const method = req.method ?? "GET";

const serveShell = async (): Promise<void> => {
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const server = createServer(built.app, {
modelProviders: modelProviderAvailabilityFor(config.harness, providerKeysPresent(config)),
providerKeys: providerKeysPresent(config),
modelCredentials: built.modelCredentials,
customProviders: built.customProviders,
refreshCustomProviders: built.refreshCustomProviders,
...(config.brandingDefault ? { brandingDefault: config.brandingDefault } : {}),
harnessId: config.harness,
connectorTokens: built.connectorTokens,
Expand Down