Files
Cleanuparr/code/frontend/src/app/features/settings/general/general-settings.component.html
T

153 lines
7.2 KiB
HTML

<app-page-header
title="General Settings"
subtitle="Core application configuration"
/>
@if (loadError()) {
<app-empty-state
icon="tablerPlugConnectedX"
heading="Could not connect to server"
description="Failed to load settings. Please check that the server is running and try again."
>
<app-button variant="primary" size="sm" (clicked)="retry()">
Retry
</app-button>
</app-empty-state>
} @else if (loader.showSpinner()) {
<app-loading-state message="Loading settings..." />
} @else if (!loader.loading()) {
<div class="settings-form">
<app-card header="General">
<div class="form-stack">
<app-toggle label="Dry Run Mode" [formField]="genForm.dryRun"
hint="When enabled, actions will be logged without being executed (e.g. download removal)"
helpKey="general:dryRun" />
<app-toggle label="Display Support Banner" [formField]="genForm.displaySupportBanner"
hint="Show the support section on the dashboard with links to GitHub and sponsors"
helpKey="general:displaySupportBanner" />
<app-toggle label="Status Check" [formField]="genForm.statusCheckEnabled"
hint="When enabled, Cleanuparr will periodically check for new versions. Disable this if your environment has restricted outbound network access."
helpKey="general:statusCheckEnabled" />
<div class="form-divider"></div>
<app-chip-input
label="Ignored Downloads"
placeholder="Add download pattern..."
hint="Downloads matching these patterns will be ignored (e.g. hash, tag, category, label, tracker)"
[formField]="genForm.ignoredDownloads"
helpKey="general:ignoredDownloads"
/>
</div>
</app-card>
<app-card header="Authentication">
<div class="form-stack">
<app-toggle label="Disable Authentication for Local Addresses" [formField]="genForm.authDisableLocalAuth"
hint="When enabled, requests from local network addresses (localhost, 192.168.x.x, 10.x.x.x, 172.16-31.x.x) will bypass authentication"
helpKey="general:auth.disableLocalAuth" />
@if (genForm.authDisableLocalAuth().value()) {
<app-toggle label="Trust Forwarded Headers" [formField]="genForm.authTrustForwardedHeaders"
hint="When behind a reverse proxy, trust X-Forwarded-For and X-Real-IP headers to determine the client's real IP address. Only enable this if you are using a reverse proxy."
helpKey="general:auth.trustForwardedHeaders" />
<app-chip-input
label="Additional Trusted Networks"
placeholder="e.g. 192.168.1.0/24"
hint="Add custom IP addresses or CIDR ranges that should bypass authentication"
[formField]="genForm.authTrustedNetworks"
helpKey="general:auth.trustedNetworks"
/>
}
</div>
</app-card>
<app-card header="HTTP Settings">
<div class="form-stack">
<div class="form-row">
<app-number-input label="Max Retries" [formField]="genForm.httpMaxRetries"
hint="Number of retry attempts for failed HTTPS requests"
[error]="genForm.httpMaxRetries().errors()[0]?.message"
helpKey="general:httpMaxRetries" />
<app-number-input label="Timeout" [formField]="genForm.httpTimeout" suffix="seconds"
hint="Timeout duration for HTTP requests in seconds"
[error]="genForm.httpTimeout().errors()[0]?.message"
helpKey="general:httpTimeout" />
<app-select label="Certificate Validation" [options]="certOptions" [formField]="genForm.httpCertificateValidation"
hint="Enable or disable certificate validation for HTTPS requests"
helpKey="general:httpCertificateValidation" />
</div>
</div>
</app-card>
<app-card header="State Management">
<div class="form-stack">
<app-number-input label="Strike Inactivity Window" [formField]="genForm.strikeInactivityWindowHours" suffix="hours"
hint="Strikes for a download are cleared after it goes this many hours without receiving a new strike. As long as new strikes keep occurring, all strikes for that download are retained."
[error]="genForm.strikeInactivityWindowHours().errors()[0]?.message"
helpKey="general:strikeInactivityWindowHours" />
<div class="form-divider"></div>
<div class="purge-section">
<div class="purge-section__info">
<span class="purge-section__label">Purge All Strikes</span>
<span class="purge-section__hint">Permanently deletes all strike data for every download. Strike counts will reset to zero.</span>
</div>
<app-button variant="destructive" size="sm" [loading]="purgingStrikes()" [disabled]="purgingStrikes()" (clicked)="confirmPurgeStrikes()">
Purge Strikes
</app-button>
</div>
</div>
</app-card>
<app-accordion header="Logging" subtitle="Log file settings" [(expanded)]="logExpanded">
<div class="form-stack">
<app-select label="Log Level" [options]="logLevelOptions" [formField]="genForm.logLevel"
hint="Select the minimum log level to display"
helpKey="general:log.level" />
<div class="form-divider"></div>
<div class="form-row">
<app-number-input label="Rolling Size" [formField]="genForm.logRollingSizeMB" suffix="MB"
hint="Maximum size of each log file in megabytes (0 = disabled)"
[error]="genForm.logRollingSizeMB().errors()[0]?.message"
helpKey="general:log.rollingSizeMB" />
<app-number-input label="Retained Files" [formField]="genForm.logRetainedFileCount"
hint="Number of old log files to retain (0 = unlimited)"
[error]="genForm.logRetainedFileCount().errors()[0]?.message"
helpKey="general:log.retainedFileCount" />
<app-number-input label="Time Limit" [formField]="genForm.logTimeLimitHours" suffix="hours"
hint="Maximum age of old log files in hours (0 = unlimited)"
[error]="genForm.logTimeLimitHours().errors()[0]?.message"
helpKey="general:log.timeLimitHours" />
</div>
<div class="form-divider"></div>
<app-toggle label="Archive Enabled" [formField]="genForm.logArchiveEnabled"
hint="Enable archiving of old log files"
helpKey="general:log.archiveEnabled" />
@if (genForm.logArchiveEnabled().value()) {
<div class="form-row">
<app-number-input label="Archive Retained Count" [formField]="genForm.logArchiveRetainedCount"
hint="Number of archive files to retain (0 = unlimited)"
[error]="genForm.logArchiveRetainedCount().errors()[0]?.message"
helpKey="general:log.archiveRetainedCount" />
<app-number-input label="Archive Time Limit" [formField]="genForm.logArchiveTimeLimitHours" suffix="hours"
hint="Maximum age of archive files in hours (0 = unlimited)"
[error]="genForm.logArchiveTimeLimitHours().errors()[0]?.message"
helpKey="general:log.archiveTimeLimitHours" />
</div>
}
</div>
</app-accordion>
<div class="form-actions">
<app-button variant="primary" [glowing]="dirty()" [loading]="saving()" [disabled]="saving() || saved() || hasErrors()" (clicked)="save()">
{{ saved() ? 'Saved!' : 'Save Settings' }}
</app-button>
</div>
</div>
}