2024-01-15 15:40:36 -08:00
< pngx-page-header
title = "Application Configuration"
i18n-title
info = "Global app configuration options which apply to <strong>every</strong> user of this install of Paperless-ngx. Options can also be set using environment variables or the configuration file but the value here will always take precedence."
i18n-info
infoLink = "configuration" >
</ pngx-page-header >
2023-12-29 15:42:56 -08:00
< form [ formGroup ]=" configForm " ( ngSubmit )=" saveConfig ()" class = "pb-4" >
< ul ngbNav # nav = "ngbNav" class = "nav-tabs" >
@for (category of optionCategories; track category) {
< li [ ngbNavItem ]=" category " >
2024-05-29 07:04:01 +00:00
< a ngbNavLink > {{category}}</ a >
2023-12-29 15:42:56 -08:00
< ng-template ngbNavContent >
< div class = "p-3" >
< div class = "row row-cols-1 row-cols-md-2 row-cols-lg-3 g-2" >
@for (option of getCategoryOptions(category); track option.key) {
< div class = "col" >
< div class = "card bg-light" >
< div class = "card-body" >
2026-02-26 10:03:54 -08:00
< div class = "card-title d-flex align-items-center" >
< h6 class = "mb-0" >
{{option.title}}
2023-12-29 15:42:56 -08:00
</ h6 >
2026-02-26 10:03:54 -08:00
< a class = "btn btn-sm btn-link" title = "Read the documentation about this setting" i18n-title [ href ]=" getDocsUrl ( option . config_key )" target = "_blank" referrerpolicy = "no-referrer" >
< i-bs name = "info-circle" ></ i-bs >
</ a >
@if (isSet(option.key)) {
< button type = "button" class = "btn btn-sm btn-link text-danger ms-auto pe-0" title = "Reset" i18n-title ( click )=" resetOption ( option . key )" >
< i-bs class = "me-1" name = "x" ></ i-bs >< ng-container i18n > Reset</ ng-container >
</ button >
}
2023-12-29 15:42:56 -08:00
</ div >
< div class = "mb-n3" >
@switch (option.type) {
@case (ConfigOptionType.Select) { < pngx-input-select [ formControlName ]=" option . key " [ error ]=" errors [ option . key ]" [ items ]=" option . choices " [ allowNull ]=" true " ></ pngx-input-select > }
@case (ConfigOptionType.Number) { < pngx-input-number [ formControlName ]=" option . key " [ error ]=" errors [ option . key ]" [ showAdd ]=" false " ></ pngx-input-number > }
2024-01-10 15:34:20 -08:00
@case (ConfigOptionType.Boolean) { < pngx-input-switch [ formControlName ]=" option . key " [ error ]=" errors [ option . key ]" [ showUnsetNote ]=" true " [ horizontal ]=" true " title = "Enable" i18n-title ></ pngx-input-switch > }
2023-12-29 15:42:56 -08:00
@case (ConfigOptionType.String) { < pngx-input-text [ formControlName ]=" option . key " [ error ]=" errors [ option . key ]" ></ pngx-input-text > }
@case (ConfigOptionType.JSON) { < pngx-input-text [ formControlName ]=" option . key " [ error ]=" errors [ option . key ]" ></ pngx-input-text > }
2024-01-13 11:57:25 -08:00
@case (ConfigOptionType.File) { < pngx-input-file [ formControlName ]=" option . key " ( upload )=" uploadFile ($ event , option . key )" [ error ]=" errors [ option . key ]" ></ pngx-input-file > }
2026-01-13 08:24:42 -08:00
@case (ConfigOptionType.Password) { < pngx-input-password [ formControlName ]=" option . key " [ error ]=" errors [ option . key ]" ></ pngx-input-password > }
2023-12-29 15:42:56 -08:00
}
</ div >
2026-01-13 08:24:42 -08:00
@if (option.note) {
< div class = "form-text fst-italic" > {{option.note}}</ div >
}
2023-12-29 15:42:56 -08:00
</ div >
</ div >
</ div >
}
</ div >
</ div >
</ ng-template >
</ li >
}
</ ul >
< div [ ngbNavOutlet ]=" nav " class = "border-start border-end border-bottom p-3 mb-3 shadow-sm" ></ div >
< div class = "btn-toolbar" role = "toolbar" >
< div class = "btn-group me-2" >
2026-03-17 08:23:08 -07:00
< button type = "button" ( click )=" discardChanges ()" class = "btn btn-outline-secondary" [ disabled ]=" loading || ( isDirty $ | async ) === false " i18n > Cancel</ button >
2023-12-29 15:42:56 -08:00
</ div >
< div class = "btn-group" >
< button type = "submit" class = "btn btn-primary" [ disabled ]=" loading || ! configForm . valid || ( isDirty $ | async ) === false " i18n > Save</ button >
</ div >
</ div >
</ form >