diff --git a/booklore-api/src/main/java/com/adityachandel/booklore/controller/AppSettingController.java b/booklore-api/src/main/java/com/adityachandel/booklore/controller/AppSettingController.java index 04aaa17c9..403992e47 100644 --- a/booklore-api/src/main/java/com/adityachandel/booklore/controller/AppSettingController.java +++ b/booklore-api/src/main/java/com/adityachandel/booklore/controller/AppSettingController.java @@ -17,8 +17,8 @@ public class AppSettingController { } @PutMapping("/api/settings") - public void updateSetting(@RequestParam String category, @RequestParam String name, @RequestParam String newValue) { - appSettingService.updateSetting(category, name, newValue); + public void updateSetting(@RequestParam String category, @RequestParam String name, @RequestParam String val) { + appSettingService.updateSetting(category, name, val); } } \ No newline at end of file diff --git a/booklore-api/src/main/java/com/adityachandel/booklore/service/AppSettingService.java b/booklore-api/src/main/java/com/adityachandel/booklore/service/AppSettingService.java index de94cfe64..5ffac11a0 100644 --- a/booklore-api/src/main/java/com/adityachandel/booklore/service/AppSettingService.java +++ b/booklore-api/src/main/java/com/adityachandel/booklore/service/AppSettingService.java @@ -33,10 +33,10 @@ public class AppSettingService { } @Transactional - public void updateSetting(String category, String name, String newValue) { + public void updateSetting(String category, String name, String val) { AppSettingEntity setting = appSettingsRepository.findByCategoryAndName(category, name); if (setting != null) { - setting.setVal(newValue); + setting.setVal(val); appSettingsRepository.save(setting); } else { throw new IllegalArgumentException("Setting not found for category: " + category + " and key: " + name); diff --git a/booklore-ui/src/app/core/component/settings/settings.component.html b/booklore-ui/src/app/core/component/settings/settings.component.html index 22f39e383..6c767e08d 100644 --- a/booklore-ui/src/app/core/component/settings/settings.component.html +++ b/booklore-ui/src/app/core/component/settings/settings.component.html @@ -1,11 +1,59 @@
Preferences
PDF Reader Settings
++ Book Reader Settings: Global or Per-Book + + +
Page Spread:
+PDF:
+Epub:
++ PDF Reader: Global Preferences + +
+ +Page Spread:
Page Zoom:
+Page Zoom:
Show Sidebar:
+Show Sidebar:
ePUB Reader Settings
++ Epub Reader: Global Preferences + +
Theme:
+Theme:
Font:
+Font:
Font Size:
+Font Size:
{{ fontSize }}%
diff --git a/booklore-ui/src/app/core/component/settings/settings.component.ts b/booklore-ui/src/app/core/component/settings/settings.component.ts index 2f6baa458..e027919d3 100644 --- a/booklore-ui/src/app/core/component/settings/settings.component.ts +++ b/booklore-ui/src/app/core/component/settings/settings.component.ts @@ -9,6 +9,7 @@ import {ToggleSwitch} from 'primeng/toggleswitch'; import {RadioButton} from 'primeng/radiobutton'; import {Divider} from 'primeng/divider'; import {Button} from 'primeng/button'; +import {Tooltip} from 'primeng/tooltip'; @Component({ selector: 'app-settings', @@ -20,7 +21,8 @@ import {Button} from 'primeng/button'; ToggleSwitch, RadioButton, Divider, - Button + Button, + Tooltip ], styleUrls: ['./settings.component.scss'] }) @@ -56,10 +58,12 @@ export class SettingsComponent implements OnInit { selectedTheme!: any; fontSize: number = 100; selectedFont: any; + selectedPdf!: string; + selectedEpub!: string; private appSettingsService = inject(AppSettingsService); appSettings$: Observable