From 03afeb347075381bcb7fd6036295c9fa4a90d2dc Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Sun, 3 Mar 2024 12:15:23 -0500 Subject: Updated multiple Python modules (now in libs and custom_libs directories) and React libraries --- frontend/src/components/forms/ColorToolForm.tsx | 4 ++-- frontend/src/components/forms/FrameRateForm.tsx | 6 +++--- frontend/src/components/forms/ItemEditForm.tsx | 6 +++--- frontend/src/components/forms/MovieUploadForm.tsx | 14 +++++++------- frontend/src/components/forms/ProfileEditForm.tsx | 22 +++++++++++----------- frontend/src/components/forms/SeriesUploadForm.tsx | 20 ++++++++++---------- frontend/src/components/forms/SyncSubtitleForm.tsx | 8 ++++---- frontend/src/components/forms/TimeOffsetForm.tsx | 4 ++-- frontend/src/components/forms/TranslationForm.tsx | 6 +++--- 9 files changed, 45 insertions(+), 45 deletions(-) (limited to 'frontend/src/components/forms') diff --git a/frontend/src/components/forms/ColorToolForm.tsx b/frontend/src/components/forms/ColorToolForm.tsx index af4d2b6e5..a37819bee 100644 --- a/frontend/src/components/forms/ColorToolForm.tsx +++ b/frontend/src/components/forms/ColorToolForm.tsx @@ -96,7 +96,7 @@ const ColorToolForm: FunctionComponent = ({ selections, onSubmit }) => { validate: { color: FormUtils.validation( (value) => colorOptions.find((op) => op.value === value) !== undefined, - "Must select a color" + "Must select a color", ), }, }); @@ -110,7 +110,7 @@ const ColorToolForm: FunctionComponent = ({ selections, onSubmit }) => { task.create(s.path, TaskName, mutateAsync, { action, form: s, - }) + }), ); onSubmit?.(); diff --git a/frontend/src/components/forms/FrameRateForm.tsx b/frontend/src/components/forms/FrameRateForm.tsx index c8694ae37..7e7eca24c 100644 --- a/frontend/src/components/forms/FrameRateForm.tsx +++ b/frontend/src/components/forms/FrameRateForm.tsx @@ -29,11 +29,11 @@ const FrameRateForm: FunctionComponent = ({ selections, onSubmit }) => { validate: { from: FormUtils.validation( (value) => value > 0, - "The From value must be larger than 0" + "The From value must be larger than 0", ), to: FormUtils.validation( (value) => value > 0, - "The To value must be larger than 0" + "The To value must be larger than 0", ), }, }); @@ -47,7 +47,7 @@ const FrameRateForm: FunctionComponent = ({ selections, onSubmit }) => { task.create(s.path, TaskName, mutateAsync, { action, form: s, - }) + }), ); onSubmit?.(); diff --git a/frontend/src/components/forms/ItemEditForm.tsx b/frontend/src/components/forms/ItemEditForm.tsx index 31d00bfec..a51d63f54 100644 --- a/frontend/src/components/forms/ItemEditForm.tsx +++ b/frontend/src/components/forms/ItemEditForm.tsx @@ -27,12 +27,12 @@ const ItemEditForm: FunctionComponent = ({ const profileOptions = useSelectorOptions( data ?? [], (v) => v.name ?? "Unknown", - (v) => v.profileId.toString() ?? "-1" + (v) => v.profileId.toString() ?? "-1", ); const profile = useMemo( () => data?.find((v) => v.profileId === item?.profileId) ?? null, - [data, item?.profileId] + [data, item?.profileId], ); const form = useForm({ @@ -44,7 +44,7 @@ const ItemEditForm: FunctionComponent = ({ const options = useSelectorOptions( item?.audio_language ?? [], (v) => v.name, - (v) => v.code2 + (v) => v.code2, ); const isOverlayVisible = isLoading || isFetching || item === null; diff --git a/frontend/src/components/forms/MovieUploadForm.tsx b/frontend/src/components/forms/MovieUploadForm.tsx index 46b592081..fbcb0b04f 100644 --- a/frontend/src/components/forms/MovieUploadForm.tsx +++ b/frontend/src/components/forms/MovieUploadForm.tsx @@ -47,7 +47,7 @@ type SubtitleValidateResult = { const validator = ( movie: Item.Movie, - file: SubtitleFile + file: SubtitleFile, ): SubtitleValidateResult => { if (file.language === null) { return { @@ -57,7 +57,7 @@ const validator = ( } else { const { subtitles } = movie; const existing = subtitles.find( - (v) => v.code2 === file.language?.code2 && isString(v.path) + (v) => v.code2 === file.language?.code2 && isString(v.path), ); if (existing !== undefined) { return { @@ -91,12 +91,12 @@ const MovieUploadForm: FunctionComponent = ({ const languageOptions = useSelectorOptions( languages, (v) => v.name, - (v) => v.code2 + (v) => v.code2, ); const defaultLanguage = useMemo( () => (languages.length > 0 ? languages[0] : null), - [languages] + [languages], ); const form = useForm({ @@ -120,7 +120,7 @@ const MovieUploadForm: FunctionComponent = ({ (v) => v.language === null || v.validateResult === undefined || - v.validateResult.state === "error" + v.validateResult.state === "error", ) === undefined ); }, "Some files cannot be uploaded, please check"), @@ -254,7 +254,7 @@ const MovieUploadForm: FunctionComponent = ({ }, }, ], - [action, languageOptions] + [action, languageOptions], ); const { upload } = useMovieSubtitleModification(); @@ -294,7 +294,7 @@ export const MovieUploadModal = withModal( { title: "Upload Subtitles", size: "xl", - } + }, ); export default MovieUploadForm; diff --git a/frontend/src/components/forms/ProfileEditForm.tsx b/frontend/src/components/forms/ProfileEditForm.tsx index d31a0e338..874f5b8a6 100644 --- a/frontend/src/components/forms/ProfileEditForm.tsx +++ b/frontend/src/components/forms/ProfileEditForm.tsx @@ -69,11 +69,11 @@ const ProfileEditForm: FunctionComponent = ({ validate: { name: FormUtils.validation( (value) => value.length > 0, - "Must have a name" + "Must have a name", ), items: FormUtils.validation( (value) => value.length > 0, - "Must contain at lease 1 language" + "Must contain at lease 1 language", ), }, }); @@ -83,7 +83,7 @@ const ProfileEditForm: FunctionComponent = ({ const itemCutoffOptions = useSelectorOptions( form.values.items, (v) => v.language, - (v) => String(v.id) + (v) => String(v.id), ); const cutoffOptions = useMemo( @@ -91,24 +91,24 @@ const ProfileEditForm: FunctionComponent = ({ ...itemCutoffOptions, options: [...itemCutoffOptions.options, ...defaultCutoffOptions], }), - [itemCutoffOptions] + [itemCutoffOptions], ); const selectedCutoff = useMemo( () => cutoffOptions.options.find((v) => v.value.id === form.values.cutoff) ?.value ?? null, - [cutoffOptions, form.values.cutoff] + [cutoffOptions, form.values.cutoff], ); const mustContainOptions = useSelectorOptions( form.values.mustContain, - (v) => v + (v) => v, ); const mustNotContainOptions = useSelectorOptions( form.values.mustNotContain, - (v) => v + (v) => v, ); const action = useArrayAction((fn) => { @@ -120,7 +120,7 @@ const ProfileEditForm: FunctionComponent = ({ 1 + form.values.items.reduce( (val, item) => Math.max(item.id, val), - 0 + 0, ); if (languages.length > 0) { @@ -154,7 +154,7 @@ const ProfileEditForm: FunctionComponent = ({ () => languageOptions.options.find((l) => l.value.code2 === code) ?.value ?? null, - [code] + [code], ); const { classes } = useTableStyles(); @@ -238,7 +238,7 @@ const ProfileEditForm: FunctionComponent = ({ }, }, ], - [action, languageOptions] + [action, languageOptions], ); return ( @@ -332,5 +332,5 @@ export const ProfileEditModal = withModal( { title: "Edit Languages Profile", size: "xl", - } + }, ); diff --git a/frontend/src/components/forms/SeriesUploadForm.tsx b/frontend/src/components/forms/SeriesUploadForm.tsx index 3c8b036a4..784baf8a5 100644 --- a/frontend/src/components/forms/SeriesUploadForm.tsx +++ b/frontend/src/components/forms/SeriesUploadForm.tsx @@ -64,7 +64,7 @@ const validator = (file: SubtitleFile): SubtitleValidateResult => { } else { const { subtitles } = file.episode; const existing = subtitles.find( - (v) => v.code2 === file.language?.code2 && isString(v.path) + (v) => v.code2 === file.language?.code2 && isString(v.path), ); if (existing !== undefined) { return { @@ -95,7 +95,7 @@ const SeriesUploadForm: FunctionComponent = ({ const episodeOptions = useSelectorOptions( episodes.data ?? [], (v) => `(${v.season}x${v.episode}) ${v.title}`, - (v) => v.sonarrEpisodeId.toString() + (v) => v.sonarrEpisodeId.toString(), ); const profile = useLanguageProfileBy(series.profileId); @@ -103,12 +103,12 @@ const SeriesUploadForm: FunctionComponent = ({ const languageOptions = useSelectorOptions( languages, (v) => v.name, - (v) => v.code2 + (v) => v.code2, ); const defaultLanguage = useMemo( () => (languages.length > 0 ? languages[0] : null), - [languages] + [languages], ); const form = useForm({ @@ -134,9 +134,9 @@ const SeriesUploadForm: FunctionComponent = ({ v.language === null || v.episode === null || v.validateResult === undefined || - v.validateResult.state === "error" + v.validateResult.state === "error", ) === undefined, - "Some files cannot be uploaded, please check" + "Some files cannot be uploaded, please check", ), }, }); @@ -162,7 +162,7 @@ const SeriesUploadForm: FunctionComponent = ({ if (info) { item.episode = episodes.data?.find( - (v) => v.season === info.season && v.episode === info.episode + (v) => v.season === info.season && v.episode === info.episode, ) ?? item.episode; } return item; @@ -320,7 +320,7 @@ const SeriesUploadForm: FunctionComponent = ({ }, }, ], - [action, episodeOptions, languageOptions] + [action, episodeOptions, languageOptions], ); const { upload } = useEpisodeSubtitleModification(); @@ -335,7 +335,7 @@ const SeriesUploadForm: FunctionComponent = ({ if (language === null || episode === null) { throw new Error( - "Invalid language or episode. This shouldn't happen, please report this bug." + "Invalid language or episode. This shouldn't happen, please report this bug.", ); } @@ -370,7 +370,7 @@ const SeriesUploadForm: FunctionComponent = ({ export const SeriesUploadModal = withModal( SeriesUploadForm, "upload-series-subtitles", - { title: "Upload Subtitles", size: "xl" } + { title: "Upload Subtitles", size: "xl" }, ); export default SeriesUploadForm; diff --git a/frontend/src/components/forms/SyncSubtitleForm.tsx b/frontend/src/components/forms/SyncSubtitleForm.tsx index 349058f63..b5136fc85 100644 --- a/frontend/src/components/forms/SyncSubtitleForm.tsx +++ b/frontend/src/components/forms/SyncSubtitleForm.tsx @@ -21,18 +21,18 @@ const TaskName = "Syncing Subtitle"; function useReferencedSubtitles( mediaType: "episode" | "movie", mediaId: number, - subtitlesPath: string + subtitlesPath: string, ) { // We cannot call hooks conditionally, we rely on useQuery "enabled" option to do only the required API call const episodeData = useRefTracksByEpisodeId( subtitlesPath, mediaId, - mediaType === "episode" + mediaType === "episode", ); const movieData = useRefTracksByMovieId( subtitlesPath, mediaId, - mediaType === "movie" + mediaType === "movie", ); const mediaData = mediaType === "episode" ? episodeData : movieData; @@ -108,7 +108,7 @@ const SyncSubtitleForm: FunctionComponent = ({ const subtitles: SelectorOption[] = useReferencedSubtitles( mediaType, mediaId, - subtitlesPath + subtitlesPath, ); const form = useForm({ diff --git a/frontend/src/components/forms/TimeOffsetForm.tsx b/frontend/src/components/forms/TimeOffsetForm.tsx index 6d213b359..2792d64d8 100644 --- a/frontend/src/components/forms/TimeOffsetForm.tsx +++ b/frontend/src/components/forms/TimeOffsetForm.tsx @@ -37,7 +37,7 @@ const TimeOffsetForm: FunctionComponent = ({ selections, onSubmit }) => { sec: FormUtils.validation((v) => v >= 0, "Second must be larger than 0"), ms: FormUtils.validation( (v) => v >= 0, - "Millisecond must be larger than 0" + "Millisecond must be larger than 0", ), }, }); @@ -62,7 +62,7 @@ const TimeOffsetForm: FunctionComponent = ({ selections, onSubmit }) => { task.create(s.path, TaskName, mutateAsync, { action, form: s, - }) + }), ); onSubmit?.(); diff --git a/frontend/src/components/forms/TranslationForm.tsx b/frontend/src/components/forms/TranslationForm.tsx index 260d9b198..976b2f72f 100644 --- a/frontend/src/components/forms/TranslationForm.tsx +++ b/frontend/src/components/forms/TranslationForm.tsx @@ -146,13 +146,13 @@ const TranslationForm: FunctionComponent = ({ const available = useMemo( () => languages.filter((v) => v.code2 in translations), - [languages] + [languages], ); const options = useSelectorOptions( available, (v) => v.name, - (v) => v.code2 + (v) => v.code2, ); return ( @@ -166,7 +166,7 @@ const TranslationForm: FunctionComponent = ({ ...s, language: language.code2, }, - }) + }), ); onSubmit?.(); -- cgit v1.2.3 From 814b1af79f03a31946ccecc95b5b399a85fd712a Mon Sep 17 00:00:00 2001 From: JayZed Date: Tue, 12 Mar 2024 23:03:08 -0400 Subject: Fixed and improved UI while correcting text --- bazarr/radarr/rootfolder.py | 4 +- bazarr/sonarr/rootfolder.py | 4 +- .../subliminal_patch/providers/whisperai.py | 2 +- frontend/src/components/forms/ItemEditForm.tsx | 2 +- .../src/components/modals/ManualSearchModal.tsx | 5 +- frontend/src/pages/Episodes/table.tsx | 4 +- frontend/src/pages/History/Movies/index.tsx | 6 +- frontend/src/pages/History/Series/index.tsx | 6 +- frontend/src/pages/Series/index.tsx | 8 -- frontend/src/pages/Settings/Languages/index.tsx | 8 +- frontend/src/pages/Settings/Subtitles/options.ts | 5 +- frontend/src/pages/System/Announcements/table.tsx | 2 +- frontend/src/pages/System/Backups/table.tsx | 98 +++++++++++----------- frontend/src/pages/System/Status/index.tsx | 30 +++++-- frontend/src/pages/System/Tasks/table.tsx | 3 +- 15 files changed, 105 insertions(+), 82 deletions(-) (limited to 'frontend/src/components/forms') diff --git a/bazarr/radarr/rootfolder.py b/bazarr/radarr/rootfolder.py index 477c32845..e0dabc55f 100644 --- a/bazarr/radarr/rootfolder.py +++ b/bazarr/radarr/rootfolder.py @@ -75,8 +75,8 @@ def check_radarr_rootfolder(): if not os.path.isdir(path_mappings.path_replace_movie(root_path)): database.execute( update(TableMoviesRootfolder) - .values(accessible=0, error='This Radarr root directory does not seems to be accessible by Please ' - 'check path mapping.') + .values(accessible=0, error='This Radarr root directory does not seem to be accessible by Bazarr. ' + 'Please check path mapping or if directory/drive is online.') .where(TableMoviesRootfolder.id == item.id)) elif not os.access(path_mappings.path_replace_movie(root_path), os.W_OK): database.execute( diff --git a/bazarr/sonarr/rootfolder.py b/bazarr/sonarr/rootfolder.py index aa4c8f88d..75afda9b7 100644 --- a/bazarr/sonarr/rootfolder.py +++ b/bazarr/sonarr/rootfolder.py @@ -75,8 +75,8 @@ def check_sonarr_rootfolder(): if not os.path.isdir(path_mappings.path_replace(root_path)): database.execute( update(TableShowsRootfolder) - .values(accessible=0, error='This Sonarr root directory does not seems to be accessible by Bazarr. ' - 'Please check path mapping.') + .values(accessible=0, error='This Sonarr root directory does not seem to be accessible by Bazarr. ' + 'Please check path mapping or if directory/drive is online.') .where(TableShowsRootfolder.id == item.id)) elif not os.access(path_mappings.path_replace(root_path), os.W_OK): database.execute( diff --git a/custom_libs/subliminal_patch/providers/whisperai.py b/custom_libs/subliminal_patch/providers/whisperai.py index 1d47057e6..dfd733da3 100644 --- a/custom_libs/subliminal_patch/providers/whisperai.py +++ b/custom_libs/subliminal_patch/providers/whisperai.py @@ -227,7 +227,7 @@ class WhisperAIProvider(Provider): if not ffmpeg_path: raise ConfigurationError("ffmpeg path must be provided") - self.endpoint = endpoint + self.endpoint = endpoint.rstrip("/") self.response = int(response) self.timeout = int(timeout) self.session = None diff --git a/frontend/src/components/forms/ItemEditForm.tsx b/frontend/src/components/forms/ItemEditForm.tsx index a51d63f54..9f3856d54 100644 --- a/frontend/src/components/forms/ItemEditForm.tsx +++ b/frontend/src/components/forms/ItemEditForm.tsx @@ -77,7 +77,7 @@ const ItemEditForm: FunctionComponent = ({ {...profileOptions} {...form.getInputProps("profile")} clearable - label="Languages Profiles" + label="Languages Profile" > diff --git a/frontend/src/components/modals/ManualSearchModal.tsx b/frontend/src/components/modals/ManualSearchModal.tsx index 0dc0f1347..24799130d 100644 --- a/frontend/src/components/modals/ManualSearchModal.tsx +++ b/frontend/src/components/modals/ManualSearchModal.tsx @@ -64,6 +64,7 @@ function ManualSearchView(props: Props) { }, }, { + Header: "Language", accessor: "language", Cell: ({ row: { original }, value }) => { const lang: Language.Info = { @@ -137,7 +138,7 @@ function ManualSearchView(props: Props) { }, }, { - Header: "Upload", + Header: "Uploader", accessor: "uploader", Cell: ({ value }) => { const { classes } = useTableStyles(); @@ -145,6 +146,7 @@ function ManualSearchView(props: Props) { }, }, { + Header: "Match", accessor: "matches", Cell: (row) => { const { matches, dont_matches: dont } = row.row.original; @@ -158,6 +160,7 @@ function ManualSearchView(props: Props) { }, }, { + Header: "Get", accessor: "subtitle", Cell: ({ row }) => { const result = row.original; diff --git a/frontend/src/pages/Episodes/table.tsx b/frontend/src/pages/Episodes/table.tsx index 8cf02672e..5a310c359 100644 --- a/frontend/src/pages/Episodes/table.tsx +++ b/frontend/src/pages/Episodes/table.tsx @@ -221,10 +221,10 @@ const Table: FunctionComponent = ({ useEffect(() => { if (instance.current) { if (initial) { + // start with all rows collapsed + instance.current.toggleAllRowsExpanded(false); // expand the last/current season on initial display instance.current.toggleRowExpanded([`season:${maxSeason}`], true); - // make sure season 0 is collapsed - instance.current.toggleRowExpanded([`season:0`], false); } else { if (expand !== undefined) { instance.current.toggleAllRowsExpanded(expand); diff --git a/frontend/src/pages/History/Movies/index.tsx b/frontend/src/pages/History/Movies/index.tsx index f82863cfc..ee4e98df0 100644 --- a/frontend/src/pages/History/Movies/index.tsx +++ b/frontend/src/pages/History/Movies/index.tsx @@ -58,6 +58,7 @@ const MoviesHistoryView: FunctionComponent = () => { accessor: "score", }, { + Header: "Match", accessor: "matches", Cell: (row) => { const { matches, dont_matches: dont } = row.row.original; @@ -90,6 +91,7 @@ const MoviesHistoryView: FunctionComponent = () => { }, }, { + Header: "Info", accessor: "description", Cell: ({ value }) => { return ( @@ -100,11 +102,12 @@ const MoviesHistoryView: FunctionComponent = () => { }, }, { + Header: "Upgrade", accessor: "upgradable", Cell: (row) => { if (row.value) { return ( - + ); @@ -114,6 +117,7 @@ const MoviesHistoryView: FunctionComponent = () => { }, }, { + Header: "Blacklist", accessor: "blacklisted", Cell: ({ row, value }) => { const add = useMovieAddBlacklist(); diff --git a/frontend/src/pages/History/Series/index.tsx b/frontend/src/pages/History/Series/index.tsx index ceea28299..d6b1469bf 100644 --- a/frontend/src/pages/History/Series/index.tsx +++ b/frontend/src/pages/History/Series/index.tsx @@ -74,6 +74,7 @@ const SeriesHistoryView: FunctionComponent = () => { accessor: "score", }, { + Header: "Match", accessor: "matches", Cell: (row) => { const { matches, dont_matches: dont } = row.row.original; @@ -106,6 +107,7 @@ const SeriesHistoryView: FunctionComponent = () => { }, }, { + Header: "Info", accessor: "description", Cell: ({ row, value }) => { return ( @@ -116,11 +118,12 @@ const SeriesHistoryView: FunctionComponent = () => { }, }, { + Header: "Upgrade", accessor: "upgradable", Cell: (row) => { if (row.value) { return ( - + ); @@ -130,6 +133,7 @@ const SeriesHistoryView: FunctionComponent = () => { }, }, { + Header: "Blacklist", accessor: "blacklisted", Cell: ({ row, value }) => { const { diff --git a/frontend/src/pages/Series/index.tsx b/frontend/src/pages/Series/index.tsx index 139ad3a46..66921347c 100644 --- a/frontend/src/pages/Series/index.tsx +++ b/frontend/src/pages/Series/index.tsx @@ -1,6 +1,5 @@ import { useSeriesModification, useSeriesPagination } from "@/apis/hooks"; import { Action } from "@/components"; -import { AudioList } from "@/components/bazarr"; import LanguageProfileName from "@/components/bazarr/LanguageProfile"; import { ItemEditModal } from "@/components/forms/ItemEditForm"; import { useModals } from "@/modules/modals"; @@ -44,13 +43,6 @@ const SeriesView: FunctionComponent = () => { ); }, }, - { - Header: "Audio", - accessor: "audio_language", - Cell: ({ value }) => { - return ; - }, - }, { Header: "Languages Profile", accessor: "profileId", diff --git a/frontend/src/pages/Settings/Languages/index.tsx b/frontend/src/pages/Settings/Languages/index.tsx index 762174133..61733c992 100644 --- a/frontend/src/pages/Settings/Languages/index.tsx +++ b/frontend/src/pages/Settings/Languages/index.tsx @@ -102,7 +102,7 @@ const SettingsLanguagesView: FunctionComponent = () => { { return { label: v.name, value: v.code2 }; @@ -112,7 +112,7 @@ const SettingsLanguagesView: FunctionComponent = () => { }} > -
+
@@ -121,7 +121,7 @@ const SettingsLanguagesView: FunctionComponent = () => { settingKey="settings-general-serie_default_enabled" > - Apply only to Series added to Bazarr after enabling this option. + Will apply only to Series added to Bazarr after enabling this option. @@ -137,7 +137,7 @@ const SettingsLanguagesView: FunctionComponent = () => { settingKey="settings-general-movie_default_enabled" > - Apply only to Movies added to Bazarr after enabling this option. + Will apply only to Movies added to Bazarr after enabling this option. diff --git a/frontend/src/pages/Settings/Subtitles/options.ts b/frontend/src/pages/Settings/Subtitles/options.ts index d38133133..75fc4b027 100644 --- a/frontend/src/pages/Settings/Subtitles/options.ts +++ b/frontend/src/pages/Settings/Subtitles/options.ts @@ -33,12 +33,13 @@ export const folderOptions: SelectorOption[] = [ export const embeddedSubtitlesParserOption: SelectorOption[] = [ { - label: "ffprobe (faster)", + label: + "ffprobe (faster than mediainfo. Part of Bazarr installation already)", value: "ffprobe", }, { label: - "mediainfo (slower but may give better results. Must be already installed)", + "mediainfo (slower but may give better results. User must install the mediainfo executable first)", value: "mediainfo", }, ]; diff --git a/frontend/src/pages/System/Announcements/table.tsx b/frontend/src/pages/System/Announcements/table.tsx index 2d9037b20..74a160190 100644 --- a/frontend/src/pages/System/Announcements/table.tsx +++ b/frontend/src/pages/System/Announcements/table.tsx @@ -33,7 +33,7 @@ const Table: FunctionComponent = ({ announcements }) => { }, }, { - Header: "More info", + Header: "More Info", accessor: "link", Cell: ({ value }) => { if (value) { diff --git a/frontend/src/pages/System/Backups/table.tsx b/frontend/src/pages/System/Backups/table.tsx index d0570da40..4f9eeae44 100644 --- a/frontend/src/pages/System/Backups/table.tsx +++ b/frontend/src/pages/System/Backups/table.tsx @@ -3,9 +3,8 @@ import { Action, PageTable } from "@/components"; import { useModals } from "@/modules/modals"; import { useTableStyles } from "@/styles"; import { Environment } from "@/utilities"; -import { faClock, faHistory, faTrash } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { Anchor, Group, Text } from "@mantine/core"; +import { faHistory, faTrash } from "@fortawesome/free-solid-svg-icons"; +import { Anchor, Text } from "@mantine/core"; import { FunctionComponent, useMemo } from "react"; import { Column } from "react-table"; @@ -16,10 +15,6 @@ interface Props { const Table: FunctionComponent = ({ backups }) => { const columns: Column[] = useMemo[]>( () => [ - { - accessor: "type", - Cell: , - }, { Header: "Name", accessor: "filename", @@ -50,52 +45,61 @@ const Table: FunctionComponent = ({ backups }) => { }, }, { - id: "actions", + id: "restore", + Header: "Restore", accessor: "filename", Cell: ({ value }) => { const modals = useModals(); const restore = useRestoreBackups(); + return ( + + modals.openConfirmModal({ + title: "Restore Backup", + children: ( + + Are you sure you want to restore the backup ({value})? + Bazarr will automatically restart and reload the UI during + the restore process. + + ), + labels: { confirm: "Restore", cancel: "Cancel" }, + confirmProps: { color: "red" }, + onConfirm: () => restore.mutate(value), + }) + } + icon={faHistory} + > + ); + }, + }, + { + id: "delet4", + Header: "Delete", + accessor: "filename", + Cell: ({ value }) => { + const modals = useModals(); const remove = useDeleteBackups(); return ( - - - modals.openConfirmModal({ - title: "Restore Backup", - children: ( - - Are you sure you want to restore the backup ({value})? - Bazarr will automatically restart and reload the UI - during the restore process. - - ), - labels: { confirm: "Restore", cancel: "Cancel" }, - confirmProps: { color: "red" }, - onConfirm: () => restore.mutate(value), - }) - } - icon={faHistory} - > - - modals.openConfirmModal({ - title: "Delete Backup", - children: ( - - Are you sure you want to delete the backup ({value})? - - ), - labels: { confirm: "Delete", cancel: "Cancel" }, - confirmProps: { color: "red" }, - onConfirm: () => remove.mutate(value), - }) - } - icon={faTrash} - > - + + modals.openConfirmModal({ + title: "Delete Backup", + children: ( + + Are you sure you want to delete the backup ({value})? + + ), + labels: { confirm: "Delete", cancel: "Cancel" }, + confirmProps: { color: "red" }, + onConfirm: () => remove.mutate(value), + }) + } + icon={faTrash} + > ); }, }, diff --git a/frontend/src/pages/System/Status/index.tsx b/frontend/src/pages/System/Status/index.tsx index ebb5d03d8..80757c4c7 100644 --- a/frontend/src/pages/System/Status/index.tsx +++ b/frontend/src/pages/System/Status/index.tsx @@ -10,7 +10,15 @@ import { } from "@fortawesome/free-brands-svg-icons"; import { faCode, faPaperPlane } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { Anchor, Container, Divider, Grid, Stack, Text } from "@mantine/core"; +import { + Anchor, + Container, + Divider, + Grid, + Space, + Stack, + Text, +} from "@mantine/core"; import { useDocumentTitle } from "@mantine/hooks"; import moment from "moment"; import { @@ -30,12 +38,14 @@ interface InfoProps { function Row(props: InfoProps): JSX.Element { const { title, children } = props; return ( - - - {title} + + + + {title} + - - {children} + + {children} ); @@ -68,9 +78,13 @@ const InfoContainer: FunctionComponent< > = ({ title, children }) => { return ( -

{title}

- + {children} +
); }; diff --git a/frontend/src/pages/System/Tasks/table.tsx b/frontend/src/pages/System/Tasks/table.tsx index 38ea5b5e0..ea45af49d 100644 --- a/frontend/src/pages/System/Tasks/table.tsx +++ b/frontend/src/pages/System/Tasks/table.tsx @@ -35,6 +35,7 @@ const Table: FunctionComponent = ({ tasks }) => { accessor: "next_run_in", }, { + Header: "Run", accessor: "job_running", Cell: ({ row, value }) => { const { job_id: jobId } = row.original; @@ -42,7 +43,7 @@ const Table: FunctionComponent = ({ tasks }) => { return (