mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Copy 'relaxed api url' functionality over to webui
This commit is contained in:
@@ -6,6 +6,10 @@ import {
|
|||||||
setGenerationParamsFromPreset,
|
setGenerationParamsFromPreset,
|
||||||
} from "../script.js";
|
} from "../script.js";
|
||||||
|
|
||||||
|
import {
|
||||||
|
power_user,
|
||||||
|
} from "./power-user.js";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
textgenerationwebui_settings,
|
textgenerationwebui_settings,
|
||||||
loadTextGenSettings,
|
loadTextGenSettings,
|
||||||
@@ -98,9 +102,10 @@ function selectPreset(name) {
|
|||||||
function formatTextGenURL(value) {
|
function formatTextGenURL(value) {
|
||||||
try {
|
try {
|
||||||
const url = new URL(value);
|
const url = new URL(value);
|
||||||
if (url.pathname.endsWith('/api')) {
|
if (!power_user.relaxed_api_urls) {
|
||||||
return url.toString();
|
url.pathname = '/api';
|
||||||
}
|
}
|
||||||
|
return url.toString();
|
||||||
} catch { } // Try and Catch both fall through to the same return.
|
} catch { } // Try and Catch both fall through to the same return.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user