implemented proxy preset manager

This commit is contained in:
based
2024-01-27 06:21:00 +10:00
parent 354a6b76c7
commit aa976d0de2
3 changed files with 181 additions and 38 deletions

View File

@ -93,6 +93,9 @@ import {
chat_completion_sources,
getChatCompletionModel,
isOpenRouterWithInstruct,
proxies,
loadProxyPresets,
selected_proxy,
} from './scripts/openai.js';
import {
@ -5650,6 +5653,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);
@ -5728,7 +5734,6 @@ async function saveSettings(type) {
}
//console.log('Entering settings with name1 = '+name1);
return jQuery.ajax({
type: 'POST',
url: '/api/settings/save',
@ -5756,6 +5761,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,