From 363d4d7518aa6db00d545fb21b119ef69398f7a3 Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 27 Oct 2024 03:44:06 +0100 Subject: [PATCH] Add Compression options for Images --- Website/modules/Settings.tsx | 37 +++++++++++++++++-- .../modules/interfaces/IBackendSettings.tsx | 2 + 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/Website/modules/Settings.tsx b/Website/modules/Settings.tsx index 6760f1e..6964c24 100644 --- a/Website/modules/Settings.tsx +++ b/Website/modules/Settings.tsx @@ -120,6 +120,24 @@ export default function Settings({backendConnected, apiUri, settings, changeSett }) } + const SetCompressImages : ChangeEventHandler = (e) => { + console.info(`Updating ImageCompression ${e.target.checked}`); + postData(`${apiUri}/v2/Settings/CompressImages`, {value: e.target.checked}) + .then((json) => { + //console.info(`Successfully updated ImageCompression ${e.target.checked}`); + UpdateBackendSettings(); + }) + } + + const SetBWImages : ChangeEventHandler = (e) => { + console.info(`Updating B/W Images ${e.target.checked}`); + postData(`${apiUri}/v2/Settings/BWImages`, {value: e.target.checked}) + .then((json) => { + //console.info(`Successfully updated B/W Images ${e.target.checked}`); + UpdateBackendSettings(); + }) + } + function RefreshInputs(){ alert("Saved."); setShowSettings(false); @@ -141,14 +159,25 @@ export default function Settings({backendConnected, apiUri, settings, changeSett
API Settings - + - + Reset + checked={backendSettings?.aprilFoolsMode ?? false} + onChange={SetAprilFoolsMode}/> + + + +
Rate Limits diff --git a/Website/modules/interfaces/IBackendSettings.tsx b/Website/modules/interfaces/IBackendSettings.tsx index 00e522a..cf7be3f 100644 --- a/Website/modules/interfaces/IBackendSettings.tsx +++ b/Website/modules/interfaces/IBackendSettings.tsx @@ -7,6 +7,8 @@ export default interface IBackendSettings { "bufferNotifications": boolean; "version": number; "aprilFoolsMode": boolean; + "compressImages": boolean; + "bwImages": boolean; "requestLimits": { "MangaInfo": number; "MangaDexFeed": number;