add: libretranslate
This commit is contained in:
parent
c5440c20c6
commit
40599190f7
8 changed files with 190 additions and 59 deletions
|
|
@ -459,6 +459,14 @@ export const meta = {
|
|||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
libreTranslateURL: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
libreTranslateKey: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
defaultDarkTheme: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
|
|
@ -652,7 +660,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
defaultLike: instance.defaultLike,
|
||||
enableEmail: instance.enableEmail,
|
||||
enableServiceWorker: instance.enableServiceWorker,
|
||||
translatorAvailable: instance.deeplAuthKey != null,
|
||||
translatorAvailable: instance.deeplAuthKey != null || instance.libreTranslateURL != null || instance.deeplFreeMode && instance.deeplFreeInstance != null,
|
||||
cacheRemoteFiles: instance.cacheRemoteFiles,
|
||||
cacheRemoteSensitiveFiles: instance.cacheRemoteSensitiveFiles,
|
||||
pinnedUsers: instance.pinnedUsers,
|
||||
|
|
@ -700,6 +708,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
deeplIsPro: instance.deeplIsPro,
|
||||
deeplFreeMode: instance.deeplFreeMode,
|
||||
deeplFreeInstance: instance.deeplFreeInstance,
|
||||
libreTranslateURL: instance.libreTranslateURL,
|
||||
libreTranslateKey: instance.libreTranslateKey,
|
||||
enableIpLogging: instance.enableIpLogging,
|
||||
enableActiveEmailValidation: instance.enableActiveEmailValidation,
|
||||
enableVerifymailApi: instance.enableVerifymailApi,
|
||||
|
|
|
|||
|
|
@ -107,6 +107,8 @@ export const paramDef = {
|
|||
deeplIsPro: { type: 'boolean' },
|
||||
deeplFreeMode: { type: 'boolean' },
|
||||
deeplFreeInstance: { type: 'string', nullable: true },
|
||||
libreTranslateURL: { type: 'string', nullable: true },
|
||||
libreTranslateKey: { type: 'string', nullable: true },
|
||||
enableEmail: { type: 'boolean' },
|
||||
email: { type: 'string', nullable: true },
|
||||
smtpSecure: { type: 'boolean' },
|
||||
|
|
@ -577,6 +579,22 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
}
|
||||
}
|
||||
|
||||
if (ps.libreTranslateURL !== undefined) {
|
||||
if (ps.libreTranslateURL === '') {
|
||||
set.libreTranslateURL = null;
|
||||
} else {
|
||||
set.libreTranslateURL = ps.libreTranslateURL;
|
||||
}
|
||||
}
|
||||
|
||||
if (ps.libreTranslateKey !== undefined) {
|
||||
if (ps.libreTranslateKey === '') {
|
||||
set.libreTranslateKey = null;
|
||||
} else {
|
||||
set.libreTranslateKey = ps.libreTranslateKey;
|
||||
}
|
||||
}
|
||||
|
||||
if (ps.enableIpLogging !== undefined) {
|
||||
set.enableIpLogging = ps.enableIpLogging;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue