[feature] Clean info page; Fix eslint; For bug 76861

This commit is contained in:
Sergey Konovalov
2025-09-18 10:12:17 +03:00
parent 0f638688a2
commit d1f831eabd
5 changed files with 5 additions and 46 deletions

View File

@ -474,42 +474,8 @@ async function getPluginSettingsForInterface(ctx) {
return pluginSettings;
}
async function requestSettings(req, res) {
const ctx = new operationContext.Context();
ctx.initFromRequest(req);
try {
await ctx.initTenantCache();
const result = await getPluginSettings(ctx);
res.json(result);
} catch (error) {
ctx.logger.error('getSettings error: %s', error.stack);
res.sendStatus(400);
}
}
async function requestModels(req, res) {
const ctx = new operationContext.Context();
ctx.initFromRequest(req);
try {
await ctx.initTenantCache();
const body = JSON.parse(req.body);
if (AI.Providers[body.name]) {
AI.Providers[body.name].key = body.key;
AI.Providers[body.name].url = body.url;
}
const getRes = await AI.getModels(body);
getRes.modelsApi = AI.TmpProviderForModels?.models;
res.json(getRes);
} catch (error) {
ctx.logger.error('getModels error: %s', error.stack);
res.sendStatus(400);
}
}
module.exports = {
proxyRequest,
getPluginSettings,
getPluginSettingsForInterface,
requestSettings,
requestModels
getPluginSettingsForInterface
};