From 7788a6fd07a8b8d9897740bb5913878c3aa3ad65 Mon Sep 17 00:00:00 2001 From: Gykes Date: Mon, 19 Aug 2024 21:25:06 -0700 Subject: [PATCH 1/2] PatchComponentRedo (#5136) * PatchComponent update specifically for SettingsInterfacePanel * Fix unrelated lint issues --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com> --- internal/dlna/cds.go | 2 +- pkg/plugin/raw.go | 2 +- pkg/scraper/stashbox/stash_box.go | 2 +- .../SettingsInterfacePanel/CheckboxGroup.tsx | 89 +- .../SettingsInterfacePanel.tsx | 1653 +++++++++-------- 5 files changed, 878 insertions(+), 870 deletions(-) diff --git a/internal/dlna/cds.go b/internal/dlna/cds.go index b6a4014b1..531fc1cb5 100644 --- a/internal/dlna/cds.go +++ b/internal/dlna/cds.go @@ -192,7 +192,7 @@ func (me *contentDirectoryService) Handle(action string, argsXML []byte, r *http obj, err := me.objectFromID(browse.ObjectID) if err != nil { - return nil, upnp.Errorf(upnpav.NoSuchObjectErrorCode, err.Error()) + return nil, upnp.Errorf(upnpav.NoSuchObjectErrorCode, "cannot find object with id %q: %v", browse.ObjectID, err.Error()) } switch browse.BrowseFlag { diff --git a/pkg/plugin/raw.go b/pkg/plugin/raw.go index 6b78451ef..3ed33f37b 100644 --- a/pkg/plugin/raw.go +++ b/pkg/plugin/raw.go @@ -76,7 +76,7 @@ func (t *rawPluginTask) Start() error { if err != nil { logger.Warnf("error marshalling raw command input") } - if k, err := io.WriteString(stdin, string(inBytes)); err != nil { + if k, err := stdin.Write(inBytes); err != nil { logger.Warnf("error writing input to plugins stdin (wrote %v bytes out of %v): %v", k, len(string(inBytes)), err) } }() diff --git a/pkg/scraper/stashbox/stash_box.go b/pkg/scraper/stashbox/stash_box.go index 350bac5c4..1432eef17 100644 --- a/pkg/scraper/stashbox/stash_box.go +++ b/pkg/scraper/stashbox/stash_box.go @@ -1338,7 +1338,7 @@ func (c *Client) submitDraft(ctx context.Context, query string, input interface{ return fmt.Errorf("failed to decode data %s: %w", string(responseBytes), err) } - if respGQL.Errors != nil && len(respGQL.Errors) > 0 { + if len(respGQL.Errors) > 0 { // try to parse standard graphql error errors := &client.GqlErrorList{} if e := json.Unmarshal(responseBytes, errors); e != nil { diff --git a/ui/v2.5/src/components/Settings/SettingsInterfacePanel/CheckboxGroup.tsx b/ui/v2.5/src/components/Settings/SettingsInterfacePanel/CheckboxGroup.tsx index 6dd0d52e5..83c506182 100644 --- a/ui/v2.5/src/components/Settings/SettingsInterfacePanel/CheckboxGroup.tsx +++ b/ui/v2.5/src/components/Settings/SettingsInterfacePanel/CheckboxGroup.tsx @@ -1,5 +1,6 @@ import React from "react"; import { BooleanSetting } from "../Inputs"; +import { PatchComponent } from "src/patch"; interface IItem { id: string; @@ -13,49 +14,47 @@ interface ICheckboxGroupProps { onChange?: (ids: string[]) => void; } -export const CheckboxGroup: React.FC = ({ - groupId, - items, - checkedIds = [], - onChange, -}) => { - function generateId(itemId: string) { - return `${groupId}-${itemId}`; - } +export const CheckboxGroup: React.FC = PatchComponent( + "CheckboxGroup", + ({ groupId, items, checkedIds = [], onChange }) => { + function generateId(itemId: string) { + return `${groupId}-${itemId}`; + } - return ( - <> - {items.map(({ id, headingID }) => ( - { - if (v) { - onChange?.( - items - .map((item) => item.id) - .filter( - (itemId) => - generateId(itemId) === generateId(id) || - checkedIds.includes(itemId) - ) - ); - } else { - onChange?.( - items - .map((item) => item.id) - .filter( - (itemId) => - generateId(itemId) !== generateId(id) && - checkedIds.includes(itemId) - ) - ); - } - }} - /> - ))} - - ); -}; + return ( + <> + {items.map(({ id, headingID }) => ( + { + if (v) { + onChange?.( + items + .map((item) => item.id) + .filter( + (itemId) => + generateId(itemId) === generateId(id) || + checkedIds.includes(itemId) + ) + ); + } else { + onChange?.( + items + .map((item) => item.id) + .filter( + (itemId) => + generateId(itemId) !== generateId(id) && + checkedIds.includes(itemId) + ) + ); + } + }} + /> + ))} + + ); + } +); diff --git a/ui/v2.5/src/components/Settings/SettingsInterfacePanel/SettingsInterfacePanel.tsx b/ui/v2.5/src/components/Settings/SettingsInterfacePanel/SettingsInterfacePanel.tsx index 2533dce0d..c174847c9 100644 --- a/ui/v2.5/src/components/Settings/SettingsInterfacePanel/SettingsInterfacePanel.tsx +++ b/ui/v2.5/src/components/Settings/SettingsInterfacePanel/SettingsInterfacePanel.tsx @@ -43,6 +43,7 @@ import { defaultImageWallMargin, } from "src/utils/imageWall"; import { defaultMaxOptionsShown } from "src/core/config"; +import { PatchComponent } from "src/patch"; const allMenuItems = [ { id: "scenes", headingID: "scenes" }, @@ -55,673 +56,431 @@ const allMenuItems = [ { id: "tags", headingID: "tags" }, ]; -export const SettingsInterfacePanel: React.FC = () => { - const intl = useIntl(); +export const SettingsInterfacePanel: React.FC = PatchComponent( + "SettingsInterfacePanel", + function SettingsInterfacePanel() { + const intl = useIntl(); - const { - interface: iface, - saveInterface, - ui, - saveUI, - loading, - error, - } = useSettings(); + const { + interface: iface, + saveInterface, + ui, + saveUI, + loading, + error, + } = useSettings(); + // convert old movies menu item to groups + const massageMenuItems = useCallback((menuItems: string[]) => { + return menuItems.map((item) => { + if (item === "movies") { + return "groups"; + } + return item; + }); + }, []); - // convert old movies menu item to groups - const massageMenuItems = useCallback((menuItems: string[]) => { - return menuItems.map((item) => { - if (item === "movies") { - return "groups"; - } - return item; - }); - }, []); + const massagedMenuItems = useMemo(() => { + if (!iface.menuItems) return iface.menuItems; - const massagedMenuItems = useMemo(() => { - if (!iface.menuItems) return iface.menuItems; + return massageMenuItems(iface.menuItems); + }, [iface.menuItems, massageMenuItems]); - return massageMenuItems(iface.menuItems); - }, [iface.menuItems, massageMenuItems]); + const { + interactive, + state: interactiveState, + error: interactiveError, + serverOffset: interactiveServerOffset, + initialised: interactiveInitialised, + initialise: initialiseInteractive, + sync: interactiveSync, + } = React.useContext(InteractiveContext); - const { - interactive, - state: interactiveState, - error: interactiveError, - serverOffset: interactiveServerOffset, - initialised: interactiveInitialised, - initialise: initialiseInteractive, - sync: interactiveSync, - } = React.useContext(InteractiveContext); + const [, setInterfaceLocalForage] = useInterfaceLocalForage(); - const [, setInterfaceLocalForage] = useInterfaceLocalForage(); - - function saveLightboxSettings(v: Partial) { - // save in local forage as well for consistency - setInterfaceLocalForage((prev) => { - return { + function saveLightboxSettings(v: Partial) { + // save in local forage as well for consistency + setInterfaceLocalForage((prev) => ({ ...prev, imageLightbox: { ...prev.imageLightbox, ...v, }, - }; - }); + })); - saveInterface({ - imageLightbox: { - ...iface.imageLightbox, - ...v, - }, - }); - } - - function saveImageWallMargin(m: number) { - saveUI({ - imageWallOptions: { - ...(ui.imageWallOptions ?? defaultImageWallOptions), - margin: m, - }, - }); - } - - function saveImageWallDirection(d: ImageWallDirection) { - saveUI({ - imageWallOptions: { - ...(ui.imageWallOptions ?? defaultImageWallOptions), - direction: d, - }, - }); - } - - function saveRatingSystemType(t: RatingSystemType) { - saveUI({ - ratingSystemOptions: { - ...ui.ratingSystemOptions, - type: t, - }, - }); - } - - function saveRatingSystemStarPrecision(p: RatingStarPrecision) { - saveUI({ - ratingSystemOptions: { - ...(ui.ratingSystemOptions ?? defaultRatingSystemOptions), - starPrecision: p, - }, - }); - } - - function validateLocaleString(v: string) { - if (!v) return; - try { - JSON.parse(v); - } catch (e) { - throw new Error( - intl.formatMessage( - { id: "errors.invalid_json_string" }, - { - error: (e as SyntaxError).message, - } - ) - ); + saveInterface({ + imageLightbox: { + ...iface.imageLightbox, + ...v, + }, + }); } - } - function validateJavascriptString(v: string) { - if (!v) return; - try { - // creates a function from the string to validate it but does not execute it - // eslint-disable-next-line @typescript-eslint/no-implied-eval - new Function(v); - } catch (e) { - throw new Error( - intl.formatMessage( - { id: "errors.invalid_javascript_string" }, - { - error: (e as SyntaxError).message, - } - ) - ); + function saveImageWallMargin(m: number) { + saveUI({ + imageWallOptions: { + ...(ui.imageWallOptions ?? defaultImageWallOptions), + margin: m, + }, + }); } - } - if (error) return

{error.message}

; - if (loading) return ; + function saveImageWallDirection(d: ImageWallDirection) { + saveUI({ + imageWallOptions: { + ...(ui.imageWallOptions ?? defaultImageWallOptions), + direction: d, + }, + }); + } - // https://en.wikipedia.org/wiki/List_of_language_names - return ( - <> - - saveInterface({ language: v })} - > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + function saveRatingSystemType(t: RatingSystemType) { + saveUI({ + ratingSystemOptions: { + ...ui.ratingSystemOptions, + type: t, + }, + }); + } -
-
-
-

- {intl.formatMessage({ - id: "config.ui.menu_items.heading", - })} -

-
- {intl.formatMessage({ id: "config.ui.menu_items.description" })} -
-
-
-
- saveInterface({ menuItems: massageMenuItems(v) })} - /> -
+ function saveRatingSystemStarPrecision(p: RatingStarPrecision) { + saveUI({ + ratingSystemOptions: { + ...(ui.ratingSystemOptions ?? defaultRatingSystemOptions), + starPrecision: p, + }, + }); + } - saveUI({ abbreviateCounters: v })} - /> - - - - saveInterface({ noBrowser: v })} - /> - saveInterface({ notificationsEnabled: v })} - /> - - - - saveInterface({ wallShowTitle: v })} - /> - saveInterface({ soundOnPreview: v })} - /> - - saveInterface({ wallPlayback: v })} - > - - - - - - - - saveInterface({ showStudioAsText: v })} - /> - - - - saveUI({ enableChromecast: v })} - /> - saveUI({ disableMobileMediaAutoRotateEnabled: v })} - /> - saveInterface({ showScrubber: v })} - /> - saveUI({ alwaysStartFromBeginning: v })} - /> - saveUI({ trackActivity: v })} - /> - saveUI({ vrTag: v })} - /> - - id="ignore-interval" - headingID="config.ui.minimum_play_percent.heading" - subHeadingID="config.ui.minimum_play_percent.description" - value={ui.minimumPlayPercent ?? 0} - onChange={(v) => saveUI({ minimumPlayPercent: v })} - disabled={!ui.trackActivity} - renderField={(value, setValue) => ( - setValue(interval ?? 0)} - /> - )} - renderValue={(v) => { - return {v}%; - }} - /> - saveLightboxSettings({ slideshowDelay: v })} - /> - saveInterface({ autostartVideo: v })} - /> - saveInterface({ autostartVideoOnPlaySelected: v })} - /> - - saveInterface({ continuePlaylistDefault: v })} - /> - - - id="max-loop-duration" - headingID="config.ui.max_loop_duration.heading" - subHeadingID="config.ui.max_loop_duration.description" - value={iface.maximumLoopDuration ?? undefined} - onChange={(v) => saveInterface({ maximumLoopDuration: v })} - renderField={(value, setValue) => ( - setValue(duration ?? 0)} - /> - )} - renderValue={(v) => { - return {TextUtils.secondsToTimestamp(v ?? 0)}; - }} - /> - - saveUI({ showAbLoopControls: v })} - /> - - - saveUI({ showTagCardOnHover: v })} - /> - saveUI({ showChildTagContent: v })} - /> - - - saveUI({ showChildStudioContent: v })} - /> - - - - saveImageWallMargin(v)} - /> - - saveImageWallDirection(v as ImageWallDirection)} - > - {Array.from(imageWallDirectionIntlMap.entries()).map((v) => ( - - ))} - - - - - saveLightboxSettings({ slideshowDelay: v })} - /> - - - saveLightboxSettings({ - displayMode: v as GQL.ImageLightboxDisplayMode, - }) - } - > - {Array.from(imageLightboxDisplayModeIntlMap.entries()).map((v) => ( - - ))} - - - saveLightboxSettings({ scaleUp: v })} - /> - - saveLightboxSettings({ resetZoomOnNav: v })} - /> - - - saveLightboxSettings({ - scrollMode: v as GQL.ImageLightboxScrollMode, - }) - } - > - {Array.from(imageLightboxScrollModeIntlMap.entries()).map((v) => ( - - ))} - - - - saveLightboxSettings({ scrollAttemptsBeforeChange: v }) - } - /> - - - -
-
-
-

- {intl.formatMessage({ - id: "config.ui.detail.enable_background_image.heading", - })} -

-
- {intl.formatMessage({ - id: "config.ui.detail.enable_background_image.description", - })} -
-
-
-
- saveUI({ enableMovieBackgroundImage: v })} - /> - saveUI({ enablePerformerBackgroundImage: v })} - /> - saveUI({ enableStudioBackgroundImage: v })} - /> - saveUI({ enableTagBackgroundImage: v })} - /> -
- saveUI({ showAllDetails: v })} - /> - saveUI({ compactExpandedDetails: v })} - /> - - - -
-
-
-

- {intl.formatMessage({ - id: "config.ui.editing.disable_dropdown_create.heading", - })} -

-
- {intl.formatMessage({ - id: "config.ui.editing.disable_dropdown_create.description", - })} -
-
-
-
- - saveInterface({ - disableDropdownCreate: { - ...iface.disableDropdownCreate, - performer: v, - }, - }) + function validateLocaleString(v: string) { + if (!v) return; + try { + JSON.parse(v); + } catch (e) { + throw new Error( + intl.formatMessage( + { id: "errors.invalid_json_string" }, + { + error: (e as SyntaxError).message, } - /> - - saveInterface({ - disableDropdownCreate: { - ...iface.disableDropdownCreate, - studio: v, - }, - }) + ) + ); + } + } + + function validateJavascriptString(v: string) { + if (!v) return; + try { + // creates a function from the string to validate it but does not execute it + // eslint-disable-next-line @typescript-eslint/no-implied-eval + new Function(v); + } catch (e) { + throw new Error( + intl.formatMessage( + { id: "errors.invalid_javascript_string" }, + { + error: (e as SyntaxError).message, } - /> - - saveInterface({ - disableDropdownCreate: { - ...iface.disableDropdownCreate, - tag: v, - }, - }) - } - /> - - saveInterface({ - disableDropdownCreate: { - ...iface.disableDropdownCreate, - movie: v, - }, - }) - } - /> -
- saveUI({ maxOptionsShown: v })} - /> - saveRatingSystemType(v as RatingSystemType)} - > - {Array.from(ratingSystemIntlMap.entries()).map((v) => ( - - ))} - - {(ui.ratingSystemOptions?.type ?? defaultRatingSystemType) === - RatingSystemType.Stars && ( + ) + ); + } + } + + if (error) return

{error.message}

; + if (loading) return ; + + // https://en.wikipedia.org/wiki/List_of_language_names + + return ( + <> + - saveRatingSystemStarPrecision(v as RatingStarPrecision) - } + id="language" + headingID="config.ui.language.heading" + value={iface.language ?? undefined} + onChange={(v) => saveInterface({ language: v })} > - {Array.from(ratingStarPrecisionIntlMap.entries()).map((v) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+

+ {intl.formatMessage({ + id: "config.ui.menu_items.heading", + })} +

+
+ {intl.formatMessage({ + id: "config.ui.menu_items.description", + })} +
+
+
+
+ + saveInterface({ menuItems: massageMenuItems(v) }) + } + /> +
+ + saveUI({ abbreviateCounters: v })} + /> + + + + saveInterface({ noBrowser: v })} + /> + saveInterface({ notificationsEnabled: v })} + /> + + + + saveInterface({ wallShowTitle: v })} + /> + saveInterface({ soundOnPreview: v })} + /> + + saveInterface({ wallPlayback: v })} + > + + + + + + + + saveInterface({ showStudioAsText: v })} + /> + + + + saveUI({ enableChromecast: v })} + /> + saveUI({ disableMobileMediaAutoRotateEnabled: v })} + /> + saveInterface({ showScrubber: v })} + /> + saveUI({ alwaysStartFromBeginning: v })} + /> + saveUI({ trackActivity: v })} + /> + saveUI({ vrTag: v })} + /> + + id="ignore-interval" + headingID="config.ui.minimum_play_percent.heading" + subHeadingID="config.ui.minimum_play_percent.description" + value={ui.minimumPlayPercent ?? 0} + onChange={(v) => saveUI({ minimumPlayPercent: v })} + disabled={!ui.trackActivity} + renderField={(value, setValue) => ( + setValue(interval ?? 0)} + /> + )} + renderValue={(v) => { + return {v}%; + }} + /> + saveLightboxSettings({ slideshowDelay: v })} + /> + saveInterface({ autostartVideo: v })} + /> + saveInterface({ autostartVideoOnPlaySelected: v })} + /> + + saveInterface({ continuePlaylistDefault: v })} + /> + + + id="max-loop-duration" + headingID="config.ui.max_loop_duration.heading" + subHeadingID="config.ui.max_loop_duration.description" + value={iface.maximumLoopDuration ?? undefined} + onChange={(v) => saveInterface({ maximumLoopDuration: v })} + renderField={(value, setValue) => ( + setValue(duration ?? 0)} + /> + )} + renderValue={(v) => { + return {TextUtils.secondsToTimestamp(v ?? 0)}; + }} + /> + + saveUI({ showAbLoopControls: v })} + /> + + + saveUI({ showTagCardOnHover: v })} + /> + saveUI({ showChildTagContent: v })} + /> + + + saveUI({ showChildStudioContent: v })} + /> + + + + saveImageWallMargin(v)} + /> + + saveImageWallDirection(v as ImageWallDirection)} + > + {Array.from(imageWallDirectionIntlMap.entries()).map((v) => ( ))} - )} - + - - saveInterface({ cssEnabled: v })} - /> + + saveLightboxSettings({ slideshowDelay: v })} + /> - - id="custom-css" - headingID="config.ui.custom_css.heading" - subHeadingID="config.ui.custom_css.description" - value={iface.css ?? undefined} - onChange={(v) => saveInterface({ css: v })} - renderField={(value, setValue) => ( - ) => - setValue(e.currentTarget.value) - } - rows={16} - className="text-input code" + + saveLightboxSettings({ + displayMode: v as GQL.ImageLightboxDisplayMode, + }) + } + > + {Array.from(imageLightboxDisplayModeIntlMap.entries()).map((v) => ( + + ))} + + + saveLightboxSettings({ scaleUp: v })} + /> + + saveLightboxSettings({ resetZoomOnNav: v })} + /> + + + saveLightboxSettings({ + scrollMode: v as GQL.ImageLightboxScrollMode, + }) + } + > + {Array.from(imageLightboxScrollModeIntlMap.entries()).map((v) => ( + + ))} + + + + saveLightboxSettings({ scrollAttemptsBeforeChange: v }) + } + /> + + + +
+
+
+

+ {intl.formatMessage({ + id: "config.ui.detail.enable_background_image.heading", + })} +

+
+ {intl.formatMessage({ + id: "config.ui.detail.enable_background_image.description", + })} +
+
+
+
+ saveUI({ enableMovieBackgroundImage: v })} /> - )} - renderValue={() => { - return <>; - }} - /> - - - saveInterface({ javascriptEnabled: v })} - /> + saveUI({ enablePerformerBackgroundImage: v })} + /> + saveUI({ enableStudioBackgroundImage: v })} + /> + saveUI({ enableTagBackgroundImage: v })} + /> +
+ saveUI({ showAllDetails: v })} + /> + saveUI({ compactExpandedDetails: v })} + /> + - - id="custom-javascript" - headingID="config.ui.custom_javascript.heading" - subHeadingID="config.ui.custom_javascript.description" - value={iface.javascript ?? undefined} - onChange={(v) => saveInterface({ javascript: v })} - validateChange={validateJavascriptString} - renderField={(value, setValue, err) => ( - <> + +
+
+
+

+ {intl.formatMessage({ + id: "config.ui.editing.disable_dropdown_create.heading", + })} +

+
+ {intl.formatMessage({ + id: "config.ui.editing.disable_dropdown_create.description", + })} +
+
+
+
+ + saveInterface({ + disableDropdownCreate: { + ...iface.disableDropdownCreate, + performer: v, + }, + }) + } + /> + + saveInterface({ + disableDropdownCreate: { + ...iface.disableDropdownCreate, + studio: v, + }, + }) + } + /> + + saveInterface({ + disableDropdownCreate: { + ...iface.disableDropdownCreate, + tag: v, + }, + }) + } + /> + + saveInterface({ + disableDropdownCreate: { + ...iface.disableDropdownCreate, + movie: v, + }, + }) + } + /> +
+ saveUI({ maxOptionsShown: v })} + /> + saveRatingSystemType(v as RatingSystemType)} + > + {Array.from(ratingSystemIntlMap.entries()).map((v) => ( + + ))} + + {(ui.ratingSystemOptions?.type ?? defaultRatingSystemType) === + RatingSystemType.Stars && ( + + saveRatingSystemStarPrecision(v as RatingStarPrecision) + } + > + {Array.from(ratingStarPrecisionIntlMap.entries()).map((v) => ( + + ))} + + )} + + + + saveInterface({ cssEnabled: v })} + /> + + + id="custom-css" + headingID="config.ui.custom_css.heading" + subHeadingID="config.ui.custom_css.description" + value={iface.css ?? undefined} + onChange={(v) => saveInterface({ css: v })} + renderField={(value, setValue) => ( { } rows={16} className="text-input code" - isInvalid={!!err} /> - - {err} - - - )} - renderValue={() => { - return <>; - }} - /> - - - saveInterface({ customLocalesEnabled: v })} - /> + )} + renderValue={() => { + return <>; + }} + /> + + + saveInterface({ javascriptEnabled: v })} + /> - - id="custom-locales" - headingID="config.ui.custom_locales.heading" - subHeadingID="config.ui.custom_locales.description" - value={iface.customLocales ?? undefined} - onChange={(v) => saveInterface({ customLocales: v })} - validateChange={validateLocaleString} - renderField={(value, setValue, err) => ( + + id="custom-javascript" + headingID="config.ui.custom_javascript.heading" + subHeadingID="config.ui.custom_javascript.description" + value={iface.javascript ?? undefined} + onChange={(v) => saveInterface({ javascript: v })} + validateChange={validateJavascriptString} + renderField={(value, setValue, err) => ( + <> + ) => + setValue(e.currentTarget.value) + } + rows={16} + className="text-input code" + isInvalid={!!err} + /> + + {err} + + + )} + renderValue={() => { + return <>; + }} + /> + + + saveInterface({ customLocalesEnabled: v })} + /> + + + id="custom-locales" + headingID="config.ui.custom_locales.heading" + subHeadingID="config.ui.custom_locales.description" + value={iface.customLocales ?? undefined} + onChange={(v) => saveInterface({ customLocales: v })} + validateChange={validateLocaleString} + renderField={(value, setValue, err) => ( + <> + ) => + setValue(e.currentTarget.value) + } + rows={16} + className="text-input code" + isInvalid={!!err} + /> + + {err} + + + )} + renderValue={() => { + return <>; + }} + /> + + + + saveInterface({ handyKey: v })} + /> + {interactive.handyKey && ( <> - ) => - setValue(e.currentTarget.value) - } - rows={16} - className="text-input code" - isInvalid={!!err} - /> - - {err} - +
+
+

+ {intl.formatMessage({ + id: "config.ui.handy_connection.status.heading", + })} +

+ +
+ + {interactiveError && : {interactiveError}} +
+
+
+ {!interactiveInitialised && ( + + )} +
+
+
+
+

+ {intl.formatMessage({ + id: "config.ui.handy_connection.server_offset.heading", + })} +

+ +
+ {interactiveServerOffset.toFixed()}ms +
+
+
+ {interactiveInitialised && ( + + )} +
+
)} - renderValue={() => { - return <>; - }} - /> -
- - saveInterface({ handyKey: v })} - /> - {interactive.handyKey && ( - <> -
-
-

- {intl.formatMessage({ - id: "config.ui.handy_connection.status.heading", - })} -

+ saveInterface({ funscriptOffset: v })} + /> -
- - {interactiveError && : {interactiveError}} -
-
-
- {!interactiveInitialised && ( - - )} -
-
-
-
-

- {intl.formatMessage({ - id: "config.ui.handy_connection.server_offset.heading", - })} -

- -
- {interactiveServerOffset.toFixed()}ms -
-
-
- {interactiveInitialised && ( - - )} -
-
- - )} - - saveInterface({ funscriptOffset: v })} - /> - - saveInterface({ useStashHostedFunscript: v })} - /> -
- - ); -}; + saveInterface({ useStashHostedFunscript: v })} + /> + + + ); + } +); From 427c18be7de58d4d63edc69669b75bc08436f1d0 Mon Sep 17 00:00:00 2001 From: Gykes Date: Tue, 20 Aug 2024 16:22:59 -0700 Subject: [PATCH 2/2] QOL Move Refresh Scrapers to Top (#5142) QOL change to move the "Refresh Scrapers" button within the "Scrape with..." dropdown to the top. --- ui/v2.5/src/components/Shared/ScraperMenu.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ui/v2.5/src/components/Shared/ScraperMenu.tsx b/ui/v2.5/src/components/Shared/ScraperMenu.tsx index 2152854b0..f73103e57 100644 --- a/ui/v2.5/src/components/Shared/ScraperMenu.tsx +++ b/ui/v2.5/src/components/Shared/ScraperMenu.tsx @@ -54,6 +54,15 @@ export const ScraperMenu: React.FC<{ {toggle} + onReloadScrapers()}> + + + + + + + + {(stashBoxes?.length ?? 0) + scrapers.length > minFilteredScrapers && ( )} + {filteredStashboxes.map((s, index) => ( ))} - onReloadScrapers()}> - - - - - - - );