mirror of
https://github.com/ONLYOFFICE/onlyoffice.github.io.git
synced 2026-02-10 18:05:06 +08:00
Fix typo (previous release)
This commit is contained in:
@ -134,3 +134,6 @@
|
||||
## 3.0.1
|
||||
* Bug fix.
|
||||
* Translations added.
|
||||
|
||||
## 3.0.2
|
||||
* Bug fix.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"nameLocale": {
|
||||
"ru": "ИИ",
|
||||
"fr": "AI",
|
||||
"es": "IA",
|
||||
"es": "AI",
|
||||
"de": "AI",
|
||||
"cs": "AI",
|
||||
"zh": "AI",
|
||||
@ -17,7 +17,7 @@
|
||||
},
|
||||
|
||||
"guid" : "asc.{9DC93CDB-B576-4F0C-B55E-FCC9C48DD007}",
|
||||
"version": "3.0.1",
|
||||
"version": "3.0.2",
|
||||
"minVersion" : "8.2.0",
|
||||
|
||||
"variations" : [
|
||||
|
||||
Binary file not shown.
@ -574,29 +574,35 @@ window.Asc.plugin.init = async function() {
|
||||
|
||||
if (this.sendEvent) {
|
||||
this.sendEvent("ai_onInit", {});
|
||||
this.attachEditorEvent("ai_onCustomProviders", function(providers) {
|
||||
|
||||
|
||||
function onLoadCustomExternalProviders(providers) {
|
||||
for (let i = 0, len = providers.length; i < len; i++) {
|
||||
let item = providers[i];
|
||||
if (!item.name)
|
||||
continue;
|
||||
|
||||
if (!item.content) {
|
||||
let url = item.url || "[external]";
|
||||
let key = item.key || "";
|
||||
let addon = item.addon || "";
|
||||
|
||||
item.content = "\"use strict\";\n\
|
||||
class Provider extends AI.Provider {\n\
|
||||
constructor() {\n\
|
||||
super(\"" + item.name + "\", \"[external]\", \"\", \"\");\n\
|
||||
super(\"" + item.name + "\", \"" + url + "\", \"" + key + "\", \"" + addon + "\");\n\
|
||||
}\n\
|
||||
}";
|
||||
let isError = !AI.addCustomProvider(item.content);
|
||||
}"; }
|
||||
|
||||
if (!isError) {
|
||||
customProvidersWindow && customProvidersWindow.command('onSetCustomProvider', AI.getCustomProviders());
|
||||
aiModelEditWindow && aiModelEditWindow.command('onProvidersUpdate', { providers : AI.serializeProviders() });
|
||||
}
|
||||
}
|
||||
let isError = !AI.addCustomProvider(item.content);
|
||||
if (!isError) {
|
||||
customProvidersWindow && customProvidersWindow.command('onSetCustomProvider', AI.getCustomProviders());
|
||||
aiModelEditWindow && aiModelEditWindow.command('onProvidersUpdate', { providers : AI.serializeProviders() });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.attachEditorEvent("ai_onCustomProviders", function(providers) {
|
||||
onLoadCustomExternalProviders(providers);
|
||||
});
|
||||
|
||||
this.attachEditorEvent("ai_onCustomInit", function(obj) {
|
||||
@ -632,9 +638,14 @@ class Provider extends AI.Provider {\n\
|
||||
|
||||
let isUpdate = false;
|
||||
if (obj.providers) {
|
||||
let customProviders = [];
|
||||
for (let type in obj.providers) {
|
||||
AI.Providers[type] = obj.providers[type];
|
||||
if (!obj.providers[type].name)
|
||||
continue;
|
||||
customProviders.push(obj.providers[type]);
|
||||
}
|
||||
if (customProviders.length > 0)
|
||||
onLoadCustomExternalProviders(customProviders);
|
||||
isUpdate = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user