Add server log file rotation settings

This commit is contained in:
schroda
2024-09-01 03:04:34 +02:00
parent fe8043c232
commit 274c4c6489
7 changed files with 94 additions and 10 deletions

View File

@@ -997,6 +997,20 @@
} }
}, },
"misc": { "misc": {
"log_files": {
"file_cleanup": {
"title": "Log file cleanup",
"value": "Delete backups that are older than $t(global.date.value.label.day)"
},
"file_size": {
"description": "Example for possible values: 1 (bytes), 1KB (kilobytes), 1MB (megabytes), 1GB (gigabytes)",
"title": "Maximum log file size"
},
"total_size": {
"description": "$t(settings.server.misc.log_files.file_size.description)",
"title": "Maximum size of all log files"
}
},
"log_level": { "log_level": {
"graphql": { "graphql": {
"label": { "label": {

View File

@@ -27,6 +27,7 @@ export type TextSettingDialogProps = {
placeholder?: string; placeholder?: string;
isDialogOpen: boolean; isDialogOpen: boolean;
setIsDialogOpen: (open: boolean) => void; setIsDialogOpen: (open: boolean) => void;
validate?: (value: string) => boolean;
}; };
export const TextSettingDialog = ({ export const TextSettingDialog = ({
@@ -39,10 +40,12 @@ export const TextSettingDialog = ({
placeholder = '', placeholder = '',
isDialogOpen, isDialogOpen,
setIsDialogOpen, setIsDialogOpen,
validate = () => true,
}: TextSettingDialogProps) => { }: TextSettingDialogProps) => {
const { t } = useTranslation(); const { t } = useTranslation();
const [dialogValue, setDialogValue] = useState(value ?? ''); const [dialogValue, setDialogValue] = useState(value ?? '');
const [isValidValue, setIsValidValue] = useState(true);
const TextFieldComponent = useMemo(() => (isPassword ? PasswordTextField : TextField), [isPassword]); const TextFieldComponent = useMemo(() => (isPassword ? PasswordTextField : TextField), [isPassword]);
@@ -82,14 +85,21 @@ export const TextSettingDialog = ({
autoFocus autoFocus
placeholder={placeholder} placeholder={placeholder}
value={dialogValue} value={dialogValue}
onChange={(e) => setDialogValue(e.target.value)} error={!isValidValue}
helperText={!isValidValue ? t('global.error.label.invalid_input') : ''}
onChange={(e) => {
const newValue = e.target.value;
setIsValidValue(validate(newValue));
setDialogValue(newValue);
}}
/> />
</DialogContent> </DialogContent>
<DialogActions> <DialogActions>
<Button onClick={() => closeDialog()} color="primary"> <Button onClick={() => closeDialog()} color="primary">
{t('global.button.cancel')} {t('global.button.cancel')}
</Button> </Button>
<Button onClick={() => updateSetting()} color="primary"> <Button onClick={() => updateSetting()} disabled={!isValidValue} color="primary">
{t('global.button.ok')} {t('global.button.ok')}
</Button> </Button>
</DialogActions> </DialogActions>

View File

@@ -60,6 +60,9 @@ export const SERVER_SETTINGS = gql`
debugLogsEnabled debugLogsEnabled
gqlDebugLogsEnabled gqlDebugLogsEnabled
systemTrayEnabled systemTrayEnabled
maxLogFileSize
maxLogFiles
maxLogFolderSize
# backup # backup
backupPath backupPath

View File

@@ -522,7 +522,7 @@ export type PageInfoFieldPolicy = {
hasPreviousPage?: FieldPolicy<any> | FieldReadFunction<any>, hasPreviousPage?: FieldPolicy<any> | FieldReadFunction<any>,
startCursor?: FieldPolicy<any> | FieldReadFunction<any> startCursor?: FieldPolicy<any> | FieldReadFunction<any>
}; };
export type PartialSettingsTypeKeySpecifier = ('autoDownloadAheadLimit' | 'autoDownloadIgnoreReUploads' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrAsResponseFallback' | '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 PartialSettingsTypeKeySpecifier = ('autoDownloadAheadLimit' | 'autoDownloadIgnoreReUploads' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrAsResponseFallback' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | 'localSourcePath' | 'maxLogFileSize' | 'maxLogFiles' | 'maxLogFolderSize' | 'maxSourcesInParallel' | 'port' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPassword' | 'socksProxyPort' | 'socksProxyUsername' | 'socksProxyVersion' | 'systemTrayEnabled' | 'updateMangas' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | PartialSettingsTypeKeySpecifier)[];
export type PartialSettingsTypeFieldPolicy = { export type PartialSettingsTypeFieldPolicy = {
autoDownloadAheadLimit?: FieldPolicy<any> | FieldReadFunction<any>, autoDownloadAheadLimit?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadIgnoreReUploads?: FieldPolicy<any> | FieldReadFunction<any>, autoDownloadIgnoreReUploads?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -555,6 +555,9 @@ export type PartialSettingsTypeFieldPolicy = {
initialOpenInBrowserEnabled?: FieldPolicy<any> | FieldReadFunction<any>, initialOpenInBrowserEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
ip?: FieldPolicy<any> | FieldReadFunction<any>, ip?: FieldPolicy<any> | FieldReadFunction<any>,
localSourcePath?: FieldPolicy<any> | FieldReadFunction<any>, localSourcePath?: FieldPolicy<any> | FieldReadFunction<any>,
maxLogFileSize?: FieldPolicy<any> | FieldReadFunction<any>,
maxLogFiles?: FieldPolicy<any> | FieldReadFunction<any>,
maxLogFolderSize?: FieldPolicy<any> | FieldReadFunction<any>,
maxSourcesInParallel?: FieldPolicy<any> | FieldReadFunction<any>, maxSourcesInParallel?: FieldPolicy<any> | FieldReadFunction<any>,
port?: FieldPolicy<any> | FieldReadFunction<any>, port?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyEnabled?: FieldPolicy<any> | FieldReadFunction<any>, socksProxyEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -661,7 +664,7 @@ export type SetSourceMetaPayloadFieldPolicy = {
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>, clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
meta?: FieldPolicy<any> | FieldReadFunction<any> meta?: FieldPolicy<any> | FieldReadFunction<any>
}; };
export type SettingsKeySpecifier = ('autoDownloadAheadLimit' | 'autoDownloadIgnoreReUploads' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrAsResponseFallback' | '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 SettingsKeySpecifier = ('autoDownloadAheadLimit' | 'autoDownloadIgnoreReUploads' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrAsResponseFallback' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | 'localSourcePath' | 'maxLogFileSize' | 'maxLogFiles' | 'maxLogFolderSize' | 'maxSourcesInParallel' | 'port' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPassword' | 'socksProxyPort' | 'socksProxyUsername' | 'socksProxyVersion' | 'systemTrayEnabled' | 'updateMangas' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | SettingsKeySpecifier)[];
export type SettingsFieldPolicy = { export type SettingsFieldPolicy = {
autoDownloadAheadLimit?: FieldPolicy<any> | FieldReadFunction<any>, autoDownloadAheadLimit?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadIgnoreReUploads?: FieldPolicy<any> | FieldReadFunction<any>, autoDownloadIgnoreReUploads?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -694,6 +697,9 @@ export type SettingsFieldPolicy = {
initialOpenInBrowserEnabled?: FieldPolicy<any> | FieldReadFunction<any>, initialOpenInBrowserEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
ip?: FieldPolicy<any> | FieldReadFunction<any>, ip?: FieldPolicy<any> | FieldReadFunction<any>,
localSourcePath?: FieldPolicy<any> | FieldReadFunction<any>, localSourcePath?: FieldPolicy<any> | FieldReadFunction<any>,
maxLogFileSize?: FieldPolicy<any> | FieldReadFunction<any>,
maxLogFiles?: FieldPolicy<any> | FieldReadFunction<any>,
maxLogFolderSize?: FieldPolicy<any> | FieldReadFunction<any>,
maxSourcesInParallel?: FieldPolicy<any> | FieldReadFunction<any>, maxSourcesInParallel?: FieldPolicy<any> | FieldReadFunction<any>,
port?: FieldPolicy<any> | FieldReadFunction<any>, port?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyEnabled?: FieldPolicy<any> | FieldReadFunction<any>, socksProxyEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -709,7 +715,7 @@ export type SettingsFieldPolicy = {
webUIInterface?: FieldPolicy<any> | FieldReadFunction<any>, webUIInterface?: FieldPolicy<any> | FieldReadFunction<any>,
webUIUpdateCheckInterval?: FieldPolicy<any> | FieldReadFunction<any> webUIUpdateCheckInterval?: FieldPolicy<any> | FieldReadFunction<any>
}; };
export type SettingsTypeKeySpecifier = ('autoDownloadAheadLimit' | 'autoDownloadIgnoreReUploads' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrAsResponseFallback' | '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 SettingsTypeKeySpecifier = ('autoDownloadAheadLimit' | 'autoDownloadIgnoreReUploads' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrAsResponseFallback' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | 'localSourcePath' | 'maxLogFileSize' | 'maxLogFiles' | 'maxLogFolderSize' | 'maxSourcesInParallel' | 'port' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPassword' | 'socksProxyPort' | 'socksProxyUsername' | 'socksProxyVersion' | 'systemTrayEnabled' | 'updateMangas' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | SettingsTypeKeySpecifier)[];
export type SettingsTypeFieldPolicy = { export type SettingsTypeFieldPolicy = {
autoDownloadAheadLimit?: FieldPolicy<any> | FieldReadFunction<any>, autoDownloadAheadLimit?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadIgnoreReUploads?: FieldPolicy<any> | FieldReadFunction<any>, autoDownloadIgnoreReUploads?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -742,6 +748,9 @@ export type SettingsTypeFieldPolicy = {
initialOpenInBrowserEnabled?: FieldPolicy<any> | FieldReadFunction<any>, initialOpenInBrowserEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
ip?: FieldPolicy<any> | FieldReadFunction<any>, ip?: FieldPolicy<any> | FieldReadFunction<any>,
localSourcePath?: FieldPolicy<any> | FieldReadFunction<any>, localSourcePath?: FieldPolicy<any> | FieldReadFunction<any>,
maxLogFileSize?: FieldPolicy<any> | FieldReadFunction<any>,
maxLogFiles?: FieldPolicy<any> | FieldReadFunction<any>,
maxLogFolderSize?: FieldPolicy<any> | FieldReadFunction<any>,
maxSourcesInParallel?: FieldPolicy<any> | FieldReadFunction<any>, maxSourcesInParallel?: FieldPolicy<any> | FieldReadFunction<any>,
port?: FieldPolicy<any> | FieldReadFunction<any>, port?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyEnabled?: FieldPolicy<any> | FieldReadFunction<any>, socksProxyEnabled?: FieldPolicy<any> | FieldReadFunction<any>,

View File

@@ -1474,6 +1474,9 @@ export type PartialSettingsType = Settings & {
initialOpenInBrowserEnabled?: Maybe<Scalars['Boolean']['output']>; initialOpenInBrowserEnabled?: Maybe<Scalars['Boolean']['output']>;
ip?: Maybe<Scalars['String']['output']>; ip?: Maybe<Scalars['String']['output']>;
localSourcePath?: Maybe<Scalars['String']['output']>; localSourcePath?: Maybe<Scalars['String']['output']>;
maxLogFileSize?: Maybe<Scalars['String']['output']>;
maxLogFiles?: Maybe<Scalars['Int']['output']>;
maxLogFolderSize?: Maybe<Scalars['String']['output']>;
maxSourcesInParallel?: Maybe<Scalars['Int']['output']>; maxSourcesInParallel?: Maybe<Scalars['Int']['output']>;
port?: Maybe<Scalars['Int']['output']>; port?: Maybe<Scalars['Int']['output']>;
socksProxyEnabled?: Maybe<Scalars['Boolean']['output']>; socksProxyEnabled?: Maybe<Scalars['Boolean']['output']>;
@@ -1521,6 +1524,9 @@ export type PartialSettingsTypeInput = {
initialOpenInBrowserEnabled?: InputMaybe<Scalars['Boolean']['input']>; initialOpenInBrowserEnabled?: InputMaybe<Scalars['Boolean']['input']>;
ip?: InputMaybe<Scalars['String']['input']>; ip?: InputMaybe<Scalars['String']['input']>;
localSourcePath?: InputMaybe<Scalars['String']['input']>; localSourcePath?: InputMaybe<Scalars['String']['input']>;
maxLogFileSize?: InputMaybe<Scalars['String']['input']>;
maxLogFiles?: InputMaybe<Scalars['Int']['input']>;
maxLogFolderSize?: InputMaybe<Scalars['String']['input']>;
maxSourcesInParallel?: InputMaybe<Scalars['Int']['input']>; maxSourcesInParallel?: InputMaybe<Scalars['Int']['input']>;
port?: InputMaybe<Scalars['Int']['input']>; port?: InputMaybe<Scalars['Int']['input']>;
socksProxyEnabled?: InputMaybe<Scalars['Boolean']['input']>; socksProxyEnabled?: InputMaybe<Scalars['Boolean']['input']>;
@@ -1892,6 +1898,9 @@ export type Settings = {
initialOpenInBrowserEnabled?: Maybe<Scalars['Boolean']['output']>; initialOpenInBrowserEnabled?: Maybe<Scalars['Boolean']['output']>;
ip?: Maybe<Scalars['String']['output']>; ip?: Maybe<Scalars['String']['output']>;
localSourcePath?: Maybe<Scalars['String']['output']>; localSourcePath?: Maybe<Scalars['String']['output']>;
maxLogFileSize?: Maybe<Scalars['String']['output']>;
maxLogFiles?: Maybe<Scalars['Int']['output']>;
maxLogFolderSize?: Maybe<Scalars['String']['output']>;
maxSourcesInParallel?: Maybe<Scalars['Int']['output']>; maxSourcesInParallel?: Maybe<Scalars['Int']['output']>;
port?: Maybe<Scalars['Int']['output']>; port?: Maybe<Scalars['Int']['output']>;
socksProxyEnabled?: Maybe<Scalars['Boolean']['output']>; socksProxyEnabled?: Maybe<Scalars['Boolean']['output']>;
@@ -1942,6 +1951,9 @@ export type SettingsType = Settings & {
initialOpenInBrowserEnabled: Scalars['Boolean']['output']; initialOpenInBrowserEnabled: Scalars['Boolean']['output'];
ip: Scalars['String']['output']; ip: Scalars['String']['output'];
localSourcePath: Scalars['String']['output']; localSourcePath: Scalars['String']['output'];
maxLogFileSize: Scalars['String']['output'];
maxLogFiles: Scalars['Int']['output'];
maxLogFolderSize: Scalars['String']['output'];
maxSourcesInParallel: Scalars['Int']['output']; maxSourcesInParallel: Scalars['Int']['output'];
port: Scalars['Int']['output']; port: Scalars['Int']['output'];
socksProxyEnabled: Scalars['Boolean']['output']; socksProxyEnabled: Scalars['Boolean']['output'];
@@ -2745,7 +2757,7 @@ export type MangaScreenFieldsFragment = { __typename?: 'MangaType', artist?: str
export type MangaLibraryDuplicateScreenFieldsFragment = { __typename?: 'MangaType', description?: string | null, id: number, title: string, thumbnailUrl?: string | null, thumbnailUrlLastFetched?: string | null, inLibrary: boolean, initialized: boolean, sourceId: string, unreadCount: number, downloadCount: number, bookmarkCount: number, hasDuplicateChapters: boolean, chapters: { __typename?: 'ChapterNodeList', totalCount: number } }; export type MangaLibraryDuplicateScreenFieldsFragment = { __typename?: 'MangaType', description?: string | null, id: number, title: string, thumbnailUrl?: string | null, thumbnailUrlLastFetched?: string | null, inLibrary: boolean, initialized: boolean, sourceId: string, unreadCount: number, downloadCount: number, bookmarkCount: number, hasDuplicateChapters: boolean, chapters: { __typename?: 'ChapterNodeList', totalCount: number } };
export type ServerSettingsFragment = { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads?: boolean | null, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, basicAuthEnabled: boolean, basicAuthUsername: string, basicAuthPassword: string, debugLogsEnabled: boolean, gqlDebugLogsEnabled: boolean, systemTrayEnabled: boolean, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean }; export type ServerSettingsFragment = { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads?: boolean | null, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, basicAuthEnabled: boolean, basicAuthUsername: string, basicAuthPassword: string, debugLogsEnabled: boolean, gqlDebugLogsEnabled: boolean, systemTrayEnabled: boolean, maxLogFileSize: string, maxLogFiles: number, maxLogFolderSize: string, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean };
export type SourceBaseFieldsFragment = { __typename?: 'SourceType', id: string, name: string, displayName: string }; export type SourceBaseFieldsFragment = { __typename?: 'SourceType', id: string, name: string, displayName: string };
@@ -3099,14 +3111,14 @@ export type ResetServerSettingsMutationVariables = Exact<{
}>; }>;
export type ResetServerSettingsMutation = { __typename?: 'Mutation', resetSettings: { __typename?: 'ResetSettingsPayload', settings: { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads?: boolean | null, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, basicAuthEnabled: boolean, basicAuthUsername: string, basicAuthPassword: string, debugLogsEnabled: boolean, gqlDebugLogsEnabled: boolean, systemTrayEnabled: boolean, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean } } }; export type ResetServerSettingsMutation = { __typename?: 'Mutation', resetSettings: { __typename?: 'ResetSettingsPayload', settings: { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads?: boolean | null, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, basicAuthEnabled: boolean, basicAuthUsername: string, basicAuthPassword: string, debugLogsEnabled: boolean, gqlDebugLogsEnabled: boolean, systemTrayEnabled: boolean, maxLogFileSize: string, maxLogFiles: number, maxLogFolderSize: string, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean } } };
export type UpdateServerSettingsMutationVariables = Exact<{ export type UpdateServerSettingsMutationVariables = Exact<{
input: SetSettingsInput; input: SetSettingsInput;
}>; }>;
export type UpdateServerSettingsMutation = { __typename?: 'Mutation', setSettings: { __typename?: 'SetSettingsPayload', settings: { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads?: boolean | null, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, basicAuthEnabled: boolean, basicAuthUsername: string, basicAuthPassword: string, debugLogsEnabled: boolean, gqlDebugLogsEnabled: boolean, systemTrayEnabled: boolean, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean } } }; export type UpdateServerSettingsMutation = { __typename?: 'Mutation', setSettings: { __typename?: 'SetSettingsPayload', settings: { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads?: boolean | null, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, basicAuthEnabled: boolean, basicAuthUsername: string, basicAuthPassword: string, debugLogsEnabled: boolean, gqlDebugLogsEnabled: boolean, systemTrayEnabled: boolean, maxLogFileSize: string, maxLogFiles: number, maxLogFolderSize: string, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean } } };
export type GetSourceMangasFetchMutationVariables = Exact<{ export type GetSourceMangasFetchMutationVariables = Exact<{
input: FetchSourceMangaInput; input: FetchSourceMangaInput;
@@ -3466,7 +3478,7 @@ export type GetWebuiUpdateStatusQuery = { __typename?: 'Query', getWebUIUpdateSt
export type GetServerSettingsQueryVariables = Exact<{ [key: string]: never; }>; export type GetServerSettingsQueryVariables = Exact<{ [key: string]: never; }>;
export type GetServerSettingsQuery = { __typename?: 'Query', settings: { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads?: boolean | null, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, basicAuthEnabled: boolean, basicAuthUsername: string, basicAuthPassword: string, debugLogsEnabled: boolean, gqlDebugLogsEnabled: boolean, systemTrayEnabled: boolean, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean } }; export type GetServerSettingsQuery = { __typename?: 'Query', settings: { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads?: boolean | null, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, basicAuthEnabled: boolean, basicAuthUsername: string, basicAuthPassword: string, debugLogsEnabled: boolean, gqlDebugLogsEnabled: boolean, systemTrayEnabled: boolean, maxLogFileSize: string, maxLogFiles: number, maxLogFolderSize: string, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean } };
export type GetSourceBrowseQueryVariables = Exact<{ export type GetSourceBrowseQueryVariables = Exact<{
id: Scalars['LongString']['input']; id: Scalars['LongString']['input'];

View File

@@ -14,6 +14,7 @@ import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText'; import ListItemText from '@mui/material/ListItemText';
import Switch from '@mui/material/Switch'; import Switch from '@mui/material/Switch';
import ListSubheader from '@mui/material/ListSubheader'; import ListSubheader from '@mui/material/ListSubheader';
import { t as translate } from 'i18next';
import { NavBarContext } from '@/components/context/NavbarContext.tsx'; import { NavBarContext } from '@/components/context/NavbarContext.tsx';
import { requestManager } from '@/lib/requests/RequestManager.ts'; import { requestManager } from '@/lib/requests/RequestManager.ts';
import { useLocalStorage } from '@/util/useStorage.tsx'; import { useLocalStorage } from '@/util/useStorage.tsx';
@@ -43,6 +44,9 @@ type ServerSettingsType = Pick<
| 'debugLogsEnabled' | 'debugLogsEnabled'
| 'gqlDebugLogsEnabled' | 'gqlDebugLogsEnabled'
| 'systemTrayEnabled' | 'systemTrayEnabled'
| 'maxLogFiles'
| 'maxLogFileSize'
| 'maxLogFolderSize'
| 'basicAuthEnabled' | 'basicAuthEnabled'
| 'basicAuthUsername' | 'basicAuthUsername'
| 'basicAuthPassword' | 'basicAuthPassword'
@@ -66,6 +70,9 @@ const extractServerSettings = (settings: GqlServerSettings): ServerSettingsType
debugLogsEnabled: settings.debugLogsEnabled, debugLogsEnabled: settings.debugLogsEnabled,
gqlDebugLogsEnabled: settings.gqlDebugLogsEnabled, gqlDebugLogsEnabled: settings.gqlDebugLogsEnabled,
systemTrayEnabled: settings.systemTrayEnabled, systemTrayEnabled: settings.systemTrayEnabled,
maxLogFiles: settings.maxLogFiles,
maxLogFileSize: settings.maxLogFileSize,
maxLogFolderSize: settings.maxLogFolderSize,
basicAuthEnabled: settings.basicAuthEnabled, basicAuthEnabled: settings.basicAuthEnabled,
basicAuthUsername: settings.basicAuthUsername, basicAuthUsername: settings.basicAuthUsername,
basicAuthPassword: settings.basicAuthPassword, basicAuthPassword: settings.basicAuthPassword,
@@ -77,6 +84,14 @@ const extractServerSettings = (settings: GqlServerSettings): ServerSettingsType
flareSolverrAsResponseFallback: settings.flareSolverrAsResponseFallback, flareSolverrAsResponseFallback: settings.flareSolverrAsResponseFallback,
}); });
const getLogFilesCleanupDisplayValue = (ttl: number): string => {
if (ttl === 0) {
return translate('global.label.never');
}
return translate('settings.server.misc.log_files.file_cleanup.value', { days: ttl, count: ttl });
};
export const ServerSettings = () => { export const ServerSettings = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const { setTitle, setAction } = useContext(NavBarContext); const { setTitle, setAction } = useContext(NavBarContext);
@@ -408,6 +423,27 @@ export const ServerSettings = () => {
onChange={(e) => updateSetting('systemTrayEnabled', e.target.checked)} onChange={(e) => updateSetting('systemTrayEnabled', e.target.checked)}
/> />
</ListItem> </ListItem>
<NumberSetting
settingTitle={t('settings.server.misc.log_files.file_cleanup.title')}
settingValue={getLogFilesCleanupDisplayValue(serverSettings.maxLogFiles)}
value={serverSettings.maxLogFiles}
valueUnit={t('global.date.label.day_one')}
handleUpdate={(maxFiles) => updateSetting('maxLogFiles', maxFiles)}
/>
<TextSetting
settingName={t('settings.server.misc.log_files.file_size.title')}
value={serverSettings.maxLogFileSize}
dialogDescription={t('settings.server.misc.log_files.file_size.description')}
validate={(value) => !!value.match(/^[0-9]+(|kb|KB|mb|MB|gb|GB)$/g)}
handleChange={(maxLogFileSize) => updateSetting('maxLogFileSize', maxLogFileSize)}
/>
<TextSetting
settingName={t('settings.server.misc.log_files.total_size.title')}
value={serverSettings.maxLogFolderSize}
dialogDescription={t('settings.server.misc.log_files.total_size.description')}
validate={(value) => !!value.match(/^[0-9]+(|kb|KB|mb|MB|gb|GB)$/g)}
handleChange={(maxLogFolderSize) => updateSetting('maxLogFolderSize', maxLogFolderSize)}
/>
</List> </List>
</List> </List>
); );

View File

@@ -1,7 +1,7 @@
[ [
{ {
"uiVersion": "PREVIEW", "uiVersion": "PREVIEW",
"serverVersion": "r1548" "serverVersion": "r1566"
}, },
{ {
"tag": "v1.1.0", "tag": "v1.1.0",