Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/settings add new socks proxy settings #617

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/components/settings/SelectSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import InfoIcon from '@mui/icons-material/Info';
import { TranslationKey } from '@/typings.ts';

export type SelectSettingValueDisplayInfo = {
text: TranslationKey;
description?: TranslationKey;
disclaimer?: TranslationKey;
text: TranslationKey | string;
description?: TranslationKey | string;
disclaimer?: TranslationKey | string;
};

export type SelectSettingValue<Value> = [Value: Value, DisplayInfo: SelectSettingValueDisplayInfo];
Expand Down Expand Up @@ -85,7 +85,7 @@ export const SelectSetting = <SettingValue extends string | number>({
<ListItemButton disabled={disabled} onClick={() => setIsDialogOpen(true)}>
<ListItemText
primary={settingName}
secondary={valueDisplayText ? t(valueDisplayText) : t('global.label.loading')}
secondary={valueDisplayText ? t(valueDisplayText as TranslationKey) : t('global.label.loading')}
secondaryTypographyProps={{ style: { display: 'flex', flexDirection: 'column' } }}
/>
</ListItemButton>
Expand All @@ -105,7 +105,7 @@ export const SelectSetting = <SettingValue extends string | number>({
whiteSpace: 'pre-line',
}}
>
{t(dialogValueDisplayInfo.description)}
{t(dialogValueDisplayInfo.description as TranslationKey)}
</Typography>
)}
{dialogValueDisplayInfo.disclaimer && (
Expand All @@ -119,7 +119,7 @@ export const SelectSetting = <SettingValue extends string | number>({
whiteSpace: 'pre-line',
}}
>
{t(dialogValueDisplayInfo.disclaimer)}
{t(dialogValueDisplayInfo.disclaimer as TranslationKey)}
</Typography>
</Stack>
)}
Expand All @@ -133,7 +133,7 @@ export const SelectSetting = <SettingValue extends string | number>({
>
{values.map(([selectValue, { text: selectText }]) => (
<MenuItem key={selectValue} value={selectValue}>
{t(selectText)}
{t(selectText as TranslationKey)}
</MenuItem>
))}
</Select>
Expand Down
9 changes: 6 additions & 3 deletions src/i18n/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -888,9 +888,12 @@
},
"socks_proxy": {
"label": {
"enable": "Use SOCKS5 proxy",
"host": "SOCKS5 host",
"port": "SOCKS5 port"
"enable": "Use SOCKS proxy",
"host": "SOCKS host",
"password": "SOCKS password",
"port": "SOCKS port",
"username": "SOCKS username",
"version": "SOCKS version"
},
"title": "SOCKS proxy"
},
Expand Down
3 changes: 3 additions & 0 deletions src/lib/graphql/Fragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,11 @@ export const SERVER_SETTINGS = gql`

# Socks proxy
socksProxyEnabled
socksProxyVersion
socksProxyHost
socksProxyPort
socksProxyUsername
socksProxyPassword

# webUI
webUIFlavor
Expand Down
18 changes: 14 additions & 4 deletions src/lib/graphql/generated/apollo-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ export type PageInfoFieldPolicy = {
hasPreviousPage?: FieldPolicy<any> | FieldReadFunction<any>,
startCursor?: FieldPolicy<any> | FieldReadFunction<any>
};
export type PartialSettingsTypeKeySpecifier = ('autoDownloadAheadLimit' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | 'localSourcePath' | 'maxSourcesInParallel' | 'port' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPort' | 'systemTrayEnabled' | 'updateMangas' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | PartialSettingsTypeKeySpecifier)[];
export type PartialSettingsTypeKeySpecifier = ('autoDownloadAheadLimit' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | 'localSourcePath' | 'maxSourcesInParallel' | 'port' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPassword' | 'socksProxyPort' | 'socksProxyUsername' | 'socksProxyVersion' | 'systemTrayEnabled' | 'updateMangas' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | PartialSettingsTypeKeySpecifier)[];
export type PartialSettingsTypeFieldPolicy = {
autoDownloadAheadLimit?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadNewChapters?: FieldPolicy<any> | FieldReadFunction<any>,
Expand Down Expand Up @@ -547,7 +547,10 @@ export type PartialSettingsTypeFieldPolicy = {
port?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyHost?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyPassword?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyPort?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyUsername?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyVersion?: FieldPolicy<any> | FieldReadFunction<any>,
systemTrayEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
updateMangas?: FieldPolicy<any> | FieldReadFunction<any>,
webUIChannel?: FieldPolicy<any> | FieldReadFunction<any>,
Expand Down Expand Up @@ -646,7 +649,7 @@ export type SetSourceMetaPayloadFieldPolicy = {
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
meta?: FieldPolicy<any> | FieldReadFunction<any>
};
export type SettingsKeySpecifier = ('autoDownloadAheadLimit' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | 'localSourcePath' | 'maxSourcesInParallel' | 'port' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPort' | 'systemTrayEnabled' | 'updateMangas' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | SettingsKeySpecifier)[];
export type SettingsKeySpecifier = ('autoDownloadAheadLimit' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | 'localSourcePath' | 'maxSourcesInParallel' | 'port' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPassword' | 'socksProxyPort' | 'socksProxyUsername' | 'socksProxyVersion' | 'systemTrayEnabled' | 'updateMangas' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | SettingsKeySpecifier)[];
export type SettingsFieldPolicy = {
autoDownloadAheadLimit?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadNewChapters?: FieldPolicy<any> | FieldReadFunction<any>,
Expand Down Expand Up @@ -681,15 +684,18 @@ export type SettingsFieldPolicy = {
port?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyHost?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyPassword?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyPort?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyUsername?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyVersion?: FieldPolicy<any> | FieldReadFunction<any>,
systemTrayEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
updateMangas?: FieldPolicy<any> | FieldReadFunction<any>,
webUIChannel?: FieldPolicy<any> | FieldReadFunction<any>,
webUIFlavor?: FieldPolicy<any> | FieldReadFunction<any>,
webUIInterface?: FieldPolicy<any> | FieldReadFunction<any>,
webUIUpdateCheckInterval?: FieldPolicy<any> | FieldReadFunction<any>
};
export type SettingsTypeKeySpecifier = ('autoDownloadAheadLimit' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | 'localSourcePath' | 'maxSourcesInParallel' | 'port' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPort' | 'systemTrayEnabled' | 'updateMangas' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | SettingsTypeKeySpecifier)[];
export type SettingsTypeKeySpecifier = ('autoDownloadAheadLimit' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | 'localSourcePath' | 'maxSourcesInParallel' | 'port' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPassword' | 'socksProxyPort' | 'socksProxyUsername' | 'socksProxyVersion' | 'systemTrayEnabled' | 'updateMangas' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | SettingsTypeKeySpecifier)[];
export type SettingsTypeFieldPolicy = {
autoDownloadAheadLimit?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadNewChapters?: FieldPolicy<any> | FieldReadFunction<any>,
Expand Down Expand Up @@ -724,7 +730,10 @@ export type SettingsTypeFieldPolicy = {
port?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyHost?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyPassword?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyPort?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyUsername?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyVersion?: FieldPolicy<any> | FieldReadFunction<any>,
systemTrayEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
updateMangas?: FieldPolicy<any> | FieldReadFunction<any>,
webUIChannel?: FieldPolicy<any> | FieldReadFunction<any>,
Expand Down Expand Up @@ -871,12 +880,13 @@ export type TrackerNodeListFieldPolicy = {
pageInfo?: FieldPolicy<any> | FieldReadFunction<any>,
totalCount?: FieldPolicy<any> | FieldReadFunction<any>
};
export type TrackerTypeKeySpecifier = ('authUrl' | 'icon' | 'id' | 'isLoggedIn' | 'name' | 'scores' | 'statuses' | 'trackRecords' | TrackerTypeKeySpecifier)[];
export type TrackerTypeKeySpecifier = ('authUrl' | 'icon' | 'id' | 'isLoggedIn' | 'isTokenExpired' | 'name' | 'scores' | 'statuses' | 'trackRecords' | TrackerTypeKeySpecifier)[];
export type TrackerTypeFieldPolicy = {
authUrl?: FieldPolicy<any> | FieldReadFunction<any>,
icon?: FieldPolicy<any> | FieldReadFunction<any>,
id?: FieldPolicy<any> | FieldReadFunction<any>,
isLoggedIn?: FieldPolicy<any> | FieldReadFunction<any>,
isTokenExpired?: FieldPolicy<any> | FieldReadFunction<any>,
name?: FieldPolicy<any> | FieldReadFunction<any>,
scores?: FieldPolicy<any> | FieldReadFunction<any>,
statuses?: FieldPolicy<any> | FieldReadFunction<any>,
Expand Down
Loading
Loading