mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-02-10 09:55:11 +08:00
[feature] Clean info page; Fix eslint; For bug 76861
This commit is contained in:
@ -4,10 +4,8 @@ build
|
||||
coverage
|
||||
.next
|
||||
out
|
||||
branding/info/ai/**
|
||||
branding/info/js/plugin-stub.js
|
||||
branding/info/js/plugins.js
|
||||
branding/info/js/plugins-ui.js
|
||||
AdminPanel/client/src/pages/AiIntegration/ai/**
|
||||
AdminPanel/client/src/pages/AiIntegration/js/**
|
||||
*.min.js
|
||||
*.min.css
|
||||
package-lock.json
|
||||
|
||||
@ -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
|
||||
};
|
||||
|
||||
@ -294,8 +294,6 @@ docsCoServer.install(server, app, () => {
|
||||
app.post('/docbuilder', utils.checkClientIp, rawFileParser, (req, res) => {
|
||||
converterService.builder(req, res);
|
||||
});
|
||||
app.get('/info/plugin/settings', utils.checkClientIp, aiProxyHandler.requestSettings);
|
||||
app.post('/info/plugin/models', utils.checkClientIp, rawFileParser, aiProxyHandler.requestModels);
|
||||
// Shared Info router (provides /info.json)
|
||||
app.use('/info', infoRouter());
|
||||
app.put('/internal/cluster/inactive', utils.checkClientIp, docsCoServer.shutdown);
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=IE8" />
|
||||
<link href="img/favicon.ico" rel="icon" type="image/x-icon" />
|
||||
<link rel="stylesheet" href="css/ai-integration.css" />
|
||||
|
||||
<style type="text/css">
|
||||
html {
|
||||
@ -597,7 +596,5 @@
|
||||
} catch (e) {}
|
||||
})();
|
||||
</script>
|
||||
<script type="text/javascript" src="js/ai-integration.js"></script>
|
||||
<script type="text/javascript" src="js/ai-interface.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -18,8 +18,8 @@ module.exports = [
|
||||
'coverage/',
|
||||
'.next/',
|
||||
'out/',
|
||||
'branding/info/ai/**',
|
||||
'branding/info/js/**',
|
||||
'AdminPanel/client/src/pages/AiIntegration/ai/**',
|
||||
'AdminPanel/client/src/pages/AiIntegration/js/**',
|
||||
'*.min.js',
|
||||
'package-lock.json',
|
||||
'npm-shrinkwrap.json',
|
||||
|
||||
Reference in New Issue
Block a user