Files
suwayomi-material-you-webui/src/lib/graphql/fragments/SettingsFragments.ts
Zeedif 84cfa6bea5 Update KOReader Sync settings (#1030)
* feat(settings): refactor and implement KOReader Sync settings page

Refactors the KOReader Sync settings section into its own dedicated page and implements the full connection and configuration flow.

The previous implementation in the main server settings was outdated and incomplete. This change aligns the frontend with the latest backend logic and provides a complete user experience.

Key changes include:
- Separated the UI into two states: a login form for initial connection and a configuration panel for existing connections.
- Implemented `connectKoSyncAccount` and `logoutKoSyncAccount` mutations to handle authentication with the KOReader Sync server.
- Updated the `SERVER_SETTINGS` GraphQL fragment to use the new `koreaderSyncStrategyForward` and `koreaderSyncStrategyBackward` fields, removing the deprecated `koreaderSyncStrategy`.
- Moved all KOReader Sync settings from the generic Server Settings page to a dedicated route at `/settings/koreader-sync`.
- Restructured and improved i18n keys for better clarity and consistency.

Ran `yarn gql:codegen` to regenerate GraphQL types and helpers.

* Extract credentials login into component

* Update to server changes and cleanup

---------

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
2025-12-06 19:59:39 +01:00

113 lines
2.5 KiB
TypeScript

/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
export const SERVER_SETTINGS = gql`
fragment SERVER_SETTINGS on SettingsType {
# Server ip and port bindings
ip
port
# Socks proxy
socksProxyEnabled
socksProxyVersion
socksProxyHost
socksProxyPort
socksProxyUsername
socksProxyPassword
# webUI
webUIFlavor
initialOpenInBrowserEnabled
webUIInterface
electronPath
webUIChannel
webUIUpdateCheckInterval
# downloader
downloadAsCbz
downloadsPath
autoDownloadNewChapters
excludeEntryWithUnreadChapters
autoDownloadNewChaptersLimit
autoDownloadIgnoreReUploads
downloadConversions {
mimeType
target
compressionLevel
}
# extensions
extensionRepos
# requests
maxSourcesInParallel
# updater
excludeUnreadChapters
excludeNotStarted
excludeCompleted
globalUpdateInterval
updateMangas
# Authentication
authMode
authPassword
authUsername
jwtAudience
jwtTokenExpiry
jwtRefreshExpiry
# misc
debugLogsEnabled
systemTrayEnabled
maxLogFileSize
maxLogFiles
maxLogFolderSize
# backup
backupPath
backupTime
backupInterval
backupTTL
# local source
localSourcePath
# Cloudflare bypass
flareSolverrEnabled
flareSolverrUrl
flareSolverrTimeout
flareSolverrSessionName
flareSolverrSessionTtl
flareSolverrAsResponseFallback
# OPDS
opdsUseBinaryFileSizes
opdsItemsPerPage
opdsEnablePageReadProgress
opdsMarkAsReadOnDownload
opdsShowOnlyUnreadChapters
opdsShowOnlyDownloadedChapters
opdsChapterSortOrder
# KOReader sync
koreaderSyncChecksumMethod
koreaderSyncStrategyBackward
koreaderSyncStrategyForward
koreaderSyncPercentageTolerance
# Database
databaseType
databaseUrl
databaseUsername
databasePassword
}
`;