WIP: App Settings
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
package com.adityachandel.booklore.controller;
|
||||
|
||||
import com.adityachandel.booklore.model.dto.settings.AppSettings;
|
||||
import com.adityachandel.booklore.service.AppSettingService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
public class AppSettingController {
|
||||
|
||||
private AppSettingService appSettingService;
|
||||
|
||||
@GetMapping("/api/settings")
|
||||
public AppSettings getAppSettings() {
|
||||
return appSettingService.getAppSettings();
|
||||
}
|
||||
|
||||
@PutMapping("/api/settings")
|
||||
public void updateSetting(@RequestParam String category, @RequestParam String key, @RequestParam String newValue) {
|
||||
appSettingService.updateSetting(category, key, newValue);
|
||||
}
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.adityachandel.booklore.convertor;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import jakarta.persistence.AttributeConverter;
|
||||
import jakarta.persistence.Converter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
@Converter(autoApply = true)
|
||||
public class MapToStringConverter implements AttributeConverter<Map<String, String>, String> {
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public String convertToDatabaseColumn(Map<String, String> attribute) {
|
||||
try {
|
||||
return objectMapper.writeValueAsString(attribute);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException("Error converting Map to String", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> convertToEntityAttribute(String dbData) {
|
||||
try {
|
||||
return objectMapper.readValue(dbData, Map.class);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException("Error converting String to Map", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.adityachandel.booklore.model.dto.settings;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AppSettings {
|
||||
private EpubSettings epub;
|
||||
private PdfSettings pdf;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class EpubSettings {
|
||||
private String theme;
|
||||
private String fontSize;
|
||||
private String font;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class PdfSettings {
|
||||
private String spread;
|
||||
private String zoom;
|
||||
private boolean sidebar;
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.adityachandel.booklore.model.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Entity
|
||||
@Table(name = "app_settings")
|
||||
@Data
|
||||
public class AppSettingEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "category", nullable = false)
|
||||
private String category;
|
||||
|
||||
@Column(name = "key1", nullable = false)
|
||||
private String key;
|
||||
|
||||
@Column(name = "value", nullable = false, columnDefinition = "TEXT")
|
||||
private String value;
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.adityachandel.booklore.repository;
|
||||
|
||||
import com.adityachandel.booklore.model.entity.AppSettingEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface AppSettingsRepository extends JpaRepository<AppSettingEntity, Long> {
|
||||
AppSettingEntity findByCategoryAndKey(String category, String key);;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.adityachandel.booklore.service;
|
||||
|
||||
import com.adityachandel.booklore.model.dto.settings.AppSettings;
|
||||
import com.adityachandel.booklore.model.entity.AppSettingEntity;
|
||||
import com.adityachandel.booklore.repository.AppSettingsRepository;
|
||||
import jakarta.transaction.Transactional;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AppSettingService {
|
||||
|
||||
private AppSettingsRepository appSettingsRepository;
|
||||
|
||||
public AppSettings getAppSettings() {
|
||||
List<AppSettingEntity> settings = appSettingsRepository.findAll();
|
||||
Map<String, Map<String, String>> settingsMap = settings.stream().collect(Collectors.groupingBy(AppSettingEntity::getCategory, Collectors.toMap(AppSettingEntity::getKey, AppSettingEntity::getValue)));
|
||||
AppSettings appSettings = new AppSettings();
|
||||
if (settingsMap.containsKey("epub")) {
|
||||
Map<String, String> epubSettings = settingsMap.get("epub");
|
||||
appSettings.setEpub(new AppSettings.EpubSettings(epubSettings.get("theme"), epubSettings.get("fontSize"), epubSettings.get("font")));
|
||||
}
|
||||
if (settingsMap.containsKey("pdf")) {
|
||||
Map<String, String> pdfSettings = settingsMap.get("pdf");
|
||||
appSettings.setPdf(new AppSettings.PdfSettings(pdfSettings.get("spread"), pdfSettings.get("zoom"), Boolean.parseBoolean(pdfSettings.get("sidebar"))));
|
||||
}
|
||||
return appSettings;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void updateSetting(String category, String key, String newValue) {
|
||||
AppSettingEntity setting = appSettingsRepository.findByCategoryAndKey(category, key);
|
||||
if (setting != null) {
|
||||
setting.setValue(newValue);
|
||||
appSettingsRepository.save(setting);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Setting not found for category: " + category + " and key: " + key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,4 +102,13 @@ CREATE TABLE IF NOT EXISTS book_shelf_mapping
|
||||
PRIMARY KEY (book_id, shelf_id),
|
||||
CONSTRAINT fk_book_shelf_mapping_book FOREIGN KEY (book_id) REFERENCES book (id) ON DELETE CASCADE,
|
||||
CONSTRAINT fk_book_shelf_mapping_shelf FOREIGN KEY (shelf_id) REFERENCES shelf (id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE app_settings
|
||||
(
|
||||
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
category VARCHAR(255) NOT NULL,
|
||||
key1 VARCHAR (255) NOT NULL,
|
||||
value TEXT NOT NULL,
|
||||
UNIQUE (category, key1)
|
||||
);
|
||||
@@ -1 +1,12 @@
|
||||
INSERT INTO booklore.shelf (name, icon) VALUES ('Favorites', 'heart');
|
||||
INSERT INTO booklore.shelf (name, icon)
|
||||
VALUES ('Favorites', 'heart');
|
||||
|
||||
INSERT INTO app_settings (category, key1, value)
|
||||
VALUES ('epub', 'theme', 'white'),
|
||||
('epub', 'fontSize', '120'),
|
||||
('epub', 'font', 'serif');
|
||||
|
||||
INSERT INTO app_settings (category, key1, value)
|
||||
VALUES ('pdf', 'spread', 'even_spread'),
|
||||
('pdf', 'zoom', 'page_fit'),
|
||||
('pdf', 'sidebar', 'true');
|
||||
@@ -4,6 +4,7 @@ import {BookBrowserComponent} from './book/components/book-browser/book-browser.
|
||||
import {MainDashboardComponent} from './dashboard/components/main-dashboard/main-dashboard.component';
|
||||
import {AppLayoutComponent} from './layout/component/layout-main/app.layout.component';
|
||||
import {EpubViewerComponent} from './epub-viewer/component/epub-viewer.component';
|
||||
import {SettingsComponent} from './core/component/settings/settings.component';
|
||||
|
||||
export const routes: Routes = [
|
||||
{
|
||||
@@ -15,6 +16,9 @@ export const routes: Routes = [
|
||||
{
|
||||
path: 'all-books', component: BookBrowserComponent,
|
||||
},
|
||||
{
|
||||
path: 'settings', component: SettingsComponent,
|
||||
},
|
||||
{
|
||||
path: 'library/:libraryId/books', component: BookBrowserComponent,
|
||||
},
|
||||
|
||||
@@ -77,7 +77,7 @@ export class BookBrowserComponent implements OnInit {
|
||||
EntityType = EntityType;
|
||||
|
||||
stateOptions: any[] = [{label: 'Grid', value: 'grid'}, {label: 'Table', value: 'table'}];
|
||||
value: string = 'table';
|
||||
value: string = 'grid';
|
||||
|
||||
@ViewChild(BookTableComponent) bookTableComponent!: BookTableComponent;
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {LogNotification} from '../shared/websocket/model/log-notification.model';
|
||||
import {EventService} from '../shared/websocket/event.service';
|
||||
import {LogNotification} from '../../../shared/websocket/model/log-notification.model';
|
||||
import {EventService} from '../../../shared/websocket/event.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-live-notification-box',
|
||||
@@ -0,0 +1,83 @@
|
||||
<p class="text-3xl font-semibold">Preferences</p>
|
||||
<p-divider></p-divider>
|
||||
|
||||
<p class="text-xl font-medium pb-4 pt-6">PDF Reader Settings</p>
|
||||
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||
|
||||
<p class="text-lg font-medium py-1">Page Spread:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<div *ngFor="let spread of spreads" class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="spread.key"
|
||||
name="spread"
|
||||
[value]="spread.key"
|
||||
[(ngModel)]="selectedSpread"
|
||||
(ngModelChange)="onSpreadChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="spread.key">{{ spread.name }}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="text-lg font-medium py-1">Page Zoom:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<div *ngFor="let zoom of zooms" class="flex items-center gap-2">
|
||||
<p-radiobutton
|
||||
[inputId]="zoom.key"
|
||||
name="zoom"
|
||||
[value]="zoom.key"
|
||||
[(ngModel)]="selectedZoom"
|
||||
(ngModelChange)="onZoomChange()">
|
||||
</p-radiobutton>
|
||||
<label [for]="zoom.key">{{ zoom.name }}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="text-lg font-medium py-1">Show Sidebar:</p>
|
||||
<div class="flex justify-start">
|
||||
<p-toggleswitch
|
||||
[(ngModel)]="showSidebar"
|
||||
(ngModelChange)="onSidebarChange()">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p-divider></p-divider>
|
||||
|
||||
<p class="text-xl font-medium pb-4 pt-4">ePUB Reader Settings</p>
|
||||
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||
|
||||
<p class="text-lg font-medium">Theme:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<p-select
|
||||
[options]="themes"
|
||||
[(ngModel)]="selectedTheme"
|
||||
optionLabel="name"
|
||||
optionValue="key"
|
||||
placeholder="Select a Theme"
|
||||
class="w-full md:w-56"
|
||||
(ngModelChange)="onThemeChange()">
|
||||
</p-select>
|
||||
</div>
|
||||
|
||||
<p class="text-lg font-medium">Font:</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<p-select
|
||||
[options]="fonts"
|
||||
[(ngModel)]="selectedFont"
|
||||
optionLabel="name"
|
||||
optionValue="key"
|
||||
placeholder="Select a Font"
|
||||
class="w-full md:w-56"
|
||||
(ngModelChange)="onFontChange()">
|
||||
</p-select>
|
||||
</div>
|
||||
|
||||
<p class="text-lg font-medium py-1">Font Size:</p>
|
||||
<div class="flex gap-4 justify-start items-center">
|
||||
<p-button icon="pi pi-minus" rounded="true" (click)="decreaseFontSize()"></p-button>
|
||||
<p>{{ fontSize }}%</p>
|
||||
<p-button icon="pi pi-plus" rounded="true" (click)="increaseFontSize()"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,132 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {AppSettingsService} from '../../service/app-settings.service';
|
||||
import {Observable} from 'rxjs';
|
||||
import {AppSettings} from '../../model/app-settings.model';
|
||||
import {Select} from 'primeng/select';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {NgForOf} from '@angular/common';
|
||||
import {ToggleSwitch} from 'primeng/toggleswitch';
|
||||
import {RadioButton} from 'primeng/radiobutton';
|
||||
import {Divider} from 'primeng/divider';
|
||||
import {Button} from 'primeng/button';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
templateUrl: './settings.component.html',
|
||||
imports: [
|
||||
Select,
|
||||
FormsModule,
|
||||
NgForOf,
|
||||
ToggleSwitch,
|
||||
RadioButton,
|
||||
Divider,
|
||||
Button
|
||||
],
|
||||
styleUrls: ['./settings.component.scss']
|
||||
})
|
||||
export class SettingsComponent implements OnInit {
|
||||
spreads = [
|
||||
{name: 'Even Spread', key: 'even_spread'},
|
||||
{name: 'Odd Spread', key: 'odd_spread'},
|
||||
{name: 'No Spread', key: 'no_spread'}
|
||||
];
|
||||
zooms = [
|
||||
{name: 'Auto Zoom', key: 'auto_zoom'},
|
||||
{name: 'Page Fit', key: 'page_fit'},
|
||||
{name: 'Page Width', key: 'page_width'},
|
||||
{name: 'Actual Size', key: 'actual_size'}
|
||||
];
|
||||
themes = [
|
||||
{name: 'White', key: 'white'},
|
||||
{name: 'Black', key: 'black'},
|
||||
{name: 'Grey', key: 'grey'},
|
||||
{name: 'Sepia', key: 'sepia'}
|
||||
];
|
||||
fonts = [
|
||||
{name: 'Serif', key: 'serif'},
|
||||
{name: 'Sans Serif', key: 'sans-serif'},
|
||||
{name: 'Roboto', key: 'roboto'},
|
||||
{name: 'Cursive', key: 'cursive'},
|
||||
{name: 'Monospace', key: 'monospace'}
|
||||
];
|
||||
|
||||
selectedSpread: any;
|
||||
selectedZoom: any;
|
||||
showSidebar = false;
|
||||
selectedTheme!: any;
|
||||
fontSize: number = 100;
|
||||
selectedFont: any;
|
||||
|
||||
appSettings$!: Observable<AppSettings | null>;
|
||||
|
||||
constructor(private appSettingsService: AppSettingsService) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.appSettings$ = this.appSettingsService.appSettings$;
|
||||
this.appSettings$.subscribe(settings => {
|
||||
if (settings) {
|
||||
this.populateSettings(settings);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
populateSettings(settings: AppSettings): void {
|
||||
if (settings.pdf) {
|
||||
const pdfSettings = settings.pdf;
|
||||
console.log(pdfSettings)
|
||||
|
||||
|
||||
this.selectedSpread = this.spreads.find(s => s.key === pdfSettings.spread)?.key;
|
||||
this.selectedZoom = this.zooms.find(z => z.key === pdfSettings.zoom)?.key;
|
||||
this.showSidebar = pdfSettings.sidebar;
|
||||
}
|
||||
|
||||
if (settings.epub) {
|
||||
const epubSettings = settings.epub;
|
||||
this.selectedTheme = this.themes.find(t => t.key === epubSettings.theme)?.key;
|
||||
|
||||
console.log(epubSettings.fontSize)
|
||||
this.fontSize = parseInt(epubSettings.fontSize, 10);
|
||||
this.selectedFont = this.fonts.find(f => f.key === epubSettings.font)?.key;
|
||||
}
|
||||
}
|
||||
|
||||
onThemeChange(): void {
|
||||
this.appSettingsService.saveAppSetting('epub', 'theme', this.selectedTheme);
|
||||
}
|
||||
|
||||
onFontChange(): void {
|
||||
this.appSettingsService.saveAppSetting('epub', 'font', this.selectedFont);
|
||||
}
|
||||
|
||||
onSpreadChange(): void {
|
||||
this.appSettingsService.saveAppSetting('pdf', 'spread', this.selectedSpread);
|
||||
}
|
||||
|
||||
onZoomChange(): void {
|
||||
this.appSettingsService.saveAppSetting('pdf', 'zoom', this.selectedZoom);
|
||||
}
|
||||
|
||||
onSidebarChange(): void {
|
||||
this.appSettingsService.saveAppSetting('pdf', 'sidebar', this.showSidebar.toString());
|
||||
}
|
||||
|
||||
onFontSizeChange(): void {
|
||||
this.appSettingsService.saveAppSetting('epub', 'fontSize', this.fontSize.toString());
|
||||
}
|
||||
|
||||
increaseFontSize(): void {
|
||||
if (this.fontSize < 250) {
|
||||
this.fontSize += 10;
|
||||
this.onFontSizeChange();
|
||||
}
|
||||
}
|
||||
|
||||
decreaseFontSize(): void {
|
||||
if (this.fontSize > 50) {
|
||||
this.fontSize -= 10;
|
||||
this.onFontSizeChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
export interface EpubSettings {
|
||||
theme: string;
|
||||
fontSize: string;
|
||||
font: string;
|
||||
}
|
||||
|
||||
export interface PdfSettings {
|
||||
spread: string;
|
||||
zoom: string;
|
||||
sidebar: boolean;
|
||||
}
|
||||
|
||||
export interface AppSettings {
|
||||
epub?: EpubSettings;
|
||||
pdf?: PdfSettings;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {HttpClient, HttpParams} from '@angular/common/http';
|
||||
import {BehaviorSubject} from 'rxjs';
|
||||
import {AppSettings} from '../model/app-settings.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AppSettingsService {
|
||||
private apiUrl = 'http://localhost:8080/api/settings';
|
||||
|
||||
private appSettingsSubject = new BehaviorSubject<AppSettings | null>(null);
|
||||
appSettings$ = this.appSettingsSubject.asObservable();
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
this.loadAppSettings();
|
||||
}
|
||||
|
||||
loadAppSettings(): void {
|
||||
this.http.get<AppSettings>(this.apiUrl).subscribe({
|
||||
next: (settings: AppSettings) => {
|
||||
this.appSettingsSubject.next(settings);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error loading app settings:', error);
|
||||
this.appSettingsSubject.next(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
saveAppSetting(category: string, key: string, newValue: string): void {
|
||||
const params = new HttpParams()
|
||||
.set('category', category)
|
||||
.set('key', key)
|
||||
.set('newValue', newValue);
|
||||
|
||||
this.http.put(this.apiUrl, null, { params }).subscribe({
|
||||
next: () => {
|
||||
console.log('Setting saved successfully');
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error saving setting:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
<label for="font-type">Font Type:</label>
|
||||
<p-dropdown id="font-type" [options]="fontTypes" [(ngModel)]="selectedFontType" (onChange)="changeFontType($event)"></p-dropdown>
|
||||
<p-divider></p-divider>
|
||||
<label for="theme">Font Type:</label>
|
||||
<label for="theme">Theme:</label>
|
||||
<p-dropdown id="theme" [options]="themes" [(ngModel)]="selectedTheme" (onChange)="changeThemes($event)"></p-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -119,8 +119,8 @@ export class EpubViewerComponent implements OnInit, OnDestroy {
|
||||
|
||||
increaseFontSize(): void {
|
||||
this.fontSize += 10;
|
||||
if (this.fontSize > 200) {
|
||||
this.fontSize = 200;
|
||||
if (this.fontSize > 300) {
|
||||
this.fontSize = 300;
|
||||
}
|
||||
this.updateFontSize();
|
||||
}
|
||||
@@ -205,7 +205,7 @@ export class EpubViewerComponent implements OnInit, OnDestroy {
|
||||
"body": {"background-color": "#000000", "color": "#f9f9f9", "font-family": "Arial, sans-serif"},
|
||||
"p": {"color": "#f9f9f9"},
|
||||
"h1, h2, h3, h4, h5, h6": {"color": "#f9f9f9"},
|
||||
"a": {"color": "#f9f9f9", "text-decoration": "underline"},
|
||||
"a": {"color": "#f9f9f9"},
|
||||
"img": {
|
||||
"-webkit-filter": "invert(1) hue-rotate(180deg)",
|
||||
"filter": "invert(1) hue-rotate(180deg)"
|
||||
@@ -218,7 +218,7 @@ export class EpubViewerComponent implements OnInit, OnDestroy {
|
||||
"body": {"background-color": "#f4ecd8", "color": "#6e4b3a", "font-family": "Georgia, serif"},
|
||||
"p": {"color": "#6e4b3a"},
|
||||
"h1, h2, h3, h4, h5, h6": {"color": "#6e4b3a"},
|
||||
"a": {"color": "#8b4513", "text-decoration": "underline"},
|
||||
"a": {"color": "#8b4513"},
|
||||
"img": {
|
||||
"-webkit-filter": "sepia(1) contrast(1.5)",
|
||||
"filter": "sepia(1) contrast(1.5)"
|
||||
@@ -231,7 +231,7 @@ export class EpubViewerComponent implements OnInit, OnDestroy {
|
||||
"body": {"background-color": "white", "color": "black", "font-family": "Arial, sans-serif"},
|
||||
"p": {"color": "black"},
|
||||
"h1, h2, h3, h4, h5, h6": {"color": "black"},
|
||||
"a": {"color": "#1e90ff", "text-decoration": "underline"},
|
||||
"a": {"color": "#1e90ff"},
|
||||
"img": {
|
||||
"-webkit-filter": "none",
|
||||
"filter": "none"
|
||||
@@ -244,7 +244,7 @@ export class EpubViewerComponent implements OnInit, OnDestroy {
|
||||
"body": {"background-color": "#404040", "color": "#d3d3d3", "font-family": "Arial, sans-serif"},
|
||||
"p": {"color": "#d3d3d3"},
|
||||
"h1, h2, h3, h4, h5, h6": {"color": "#d3d3d3"},
|
||||
"a": {"color": "#1e90ff", "text-decoration": "underline"},
|
||||
"a": {"color": "#1e90ff"},
|
||||
"img": {
|
||||
"filter": "none"
|
||||
},
|
||||
|
||||
@@ -33,6 +33,12 @@
|
||||
pTooltip="Upload book" tooltipPosition="top"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="topbar-item">
|
||||
<i class="pi pi-cog text-surface-700 dark:text-surface-100" (click)="navigateToSettings()"
|
||||
pTooltip="Upload book" tooltipPosition="top"></i>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<p-divider layout="vertical" />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Component, ElementRef, OnDestroy, ViewChild} from '@angular/core';
|
||||
import {MenuItem} from 'primeng/api';
|
||||
import {LayoutService} from '../layout-main/service/app.layout.service';
|
||||
import {RouterLink} from '@angular/router';
|
||||
import {Router, RouterLink} from '@angular/router';
|
||||
import {DialogService as PrimeDialogService, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {LibraryCreatorComponent} from '../../../book/components/library-creator/library-creator.component';
|
||||
import {TooltipModule} from 'primeng/tooltip';
|
||||
@@ -15,7 +15,7 @@ import {Button} from 'primeng/button';
|
||||
import {StyleClass} from 'primeng/styleclass';
|
||||
import {Divider} from 'primeng/divider';
|
||||
import {ThemeConfiguratorComponent} from '../theme-configurator/theme-configurator.component';
|
||||
import {LiveNotificationBoxComponent} from '../../../live-notification-box/live-notification-box.component';
|
||||
import {LiveNotificationBoxComponent} from '../../../core/component/live-notification-box/live-notification-box.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-topbar',
|
||||
@@ -47,7 +47,8 @@ export class AppTopBarComponent implements OnDestroy {
|
||||
@ViewChild('topbarmenubutton') topbarMenuButton!: ElementRef;
|
||||
@ViewChild('topbarmenu') menu!: ElementRef;
|
||||
|
||||
constructor(public layoutService: LayoutService, public dialogService: PrimeDialogService, private eventService: EventService) {
|
||||
constructor(public layoutService: LayoutService, public dialogService: PrimeDialogService,
|
||||
private eventService: EventService, private router: Router) {
|
||||
this.eventService.eventHighlight$.subscribe(highlight => {
|
||||
this.eventHighlight = highlight;
|
||||
});
|
||||
@@ -106,4 +107,8 @@ export class AppTopBarComponent implements OnDestroy {
|
||||
}
|
||||
clearTimeout(this.eventTimeout);
|
||||
}
|
||||
|
||||
navigateToSettings() {
|
||||
this.router.navigate(['/settings']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
gap: 0.5rem;
|
||||
gap: 0.3rem;
|
||||
align-items: center;
|
||||
|
||||
li {
|
||||
|
||||
Reference in New Issue
Block a user