Separate Kobold Horde status function

This commit is contained in:
valadaptive 2023-12-10 20:16:07 -05:00
parent 23e6a10cb5
commit 1fbf4394c8
2 changed files with 26 additions and 31 deletions

View File

@ -868,8 +868,7 @@ export async function clearItemizedPrompts() {
}
}
async function getStatusKobold() {
if (main_api == 'koboldhorde') {
async function getStatusHorde() {
try {
const hordeStatus = await checkHordeStatus();
online_status = hordeStatus ? 'Connected' : 'no_connection';
@ -881,8 +880,7 @@ async function getStatusKobold() {
return resultCheckStatus();
}
const url = '/getstatus';
async function getStatusKobold() {
let endpoint = api_server;
if (!endpoint) {
@ -891,7 +889,7 @@ async function getStatusKobold() {
}
try {
const response = await fetch(url, {
const response = await fetch('/getstatus', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify({
@ -903,7 +901,6 @@ async function getStatusKobold() {
const data = await response.json();
online_status = data?.result;
if (!online_status) {
@ -5378,7 +5375,7 @@ function changeMainAPI() {
}
if (main_api == 'koboldhorde') {
getStatusKobold();
getStatusHorde();
getHordeModels();
}

View File

@ -661,7 +661,6 @@ app.post('/getstatus', jsonParser, async function (request, response) {
let version = '';
let koboldVersion = {};
if (request.body.main_api == 'kobold') {
try {
version = (await fetchJSON(api_server + '/v1/info/version')).result;
}
@ -677,7 +676,6 @@ app.post('/getstatus', jsonParser, async function (request, response) {
version: '0.0',
};
}
}
try {
let data = await fetchJSON(url, args);