Merge pull request #1751 from kingbased/proxypreset

Reverse proxy presets
This commit is contained in:
Cohee
2024-01-29 22:09:33 +02:00
committed by GitHub
4 changed files with 200 additions and 50 deletions

View File

@@ -93,6 +93,9 @@ import {
chat_completion_sources,
getChatCompletionModel,
isOpenRouterWithInstruct,
proxies,
loadProxyPresets,
selected_proxy,
} from './scripts/openai.js';
import {
@@ -5664,6 +5667,9 @@ async function getSettings() {
// Load background
loadBackgroundSettings(settings);
// Load proxy presets
loadProxyPresets(settings);
// Allow subscribers to mutate settings
eventSource.emit(event_types.SETTINGS_LOADED_AFTER, settings);
@@ -5742,7 +5748,6 @@ async function saveSettings(type) {
}
//console.log('Entering settings with name1 = '+name1);
return jQuery.ajax({
type: 'POST',
url: '/api/settings/save',
@@ -5770,6 +5775,8 @@ async function saveSettings(type) {
kai_settings: kai_settings,
oai_settings: oai_settings,
background: background_settings,
proxies: proxies,
selected_proxy: selected_proxy,
}, null, 4),
beforeSend: function () { },
cache: false,