Use password and select config fields

This commit is contained in:
shamoon
2025-04-24 13:54:42 -07:00
parent f5fc04cfe2
commit 9f8b8a9f20
5 changed files with 37 additions and 16 deletions

View File

@@ -44,6 +44,7 @@ export enum ConfigOptionType {
Boolean = 'boolean',
JSON = 'json',
File = 'file',
Password = 'password',
}
export const ConfigCategory = {
@@ -53,6 +54,11 @@ export const ConfigCategory = {
AI: $localize`AI Settings`,
}
export const LLMBackendConfig = {
OPENAI: 'openai',
OLLAMA: 'ollama',
}
export interface ConfigOption {
key: string
title: string
@@ -267,7 +273,8 @@ export const PaperlessConfigOptions: ConfigOption[] = [
{
key: 'llm_backend',
title: $localize`LLM Backend`,
type: ConfigOptionType.String,
type: ConfigOptionType.Select,
choices: mapToItems(LLMBackendConfig),
config_key: 'PAPERLESS_LLM_BACKEND',
category: ConfigCategory.AI,
},
@@ -281,7 +288,7 @@ export const PaperlessConfigOptions: ConfigOption[] = [
{
key: 'llm_api_key',
title: $localize`LLM API Key`,
type: ConfigOptionType.String,
type: ConfigOptionType.Password,
config_key: 'PAPERLESS_LLM_API_KEY',
category: ConfigCategory.AI,
},