From 96b51634861b8b2dca09404b55a49c274157dd3f Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 20 Oct 2024 00:30:28 +0200 Subject: [PATCH] Add delete and startnow buttons to Monitoring Entries nowrap tags in searchresults --- Website/modules/MonitorJobsList.tsx | 27 ++++++++++----- Website/modules/interfaces/IManga.tsx | 10 +++--- Website/styles/MangaSearchResult.css | 50 ++++++++++++++++++++++----- 3 files changed, 66 insertions(+), 21 deletions(-) diff --git a/Website/modules/MonitorJobsList.tsx b/Website/modules/MonitorJobsList.tsx index 1fc4bca..1536330 100644 --- a/Website/modules/MonitorJobsList.tsx +++ b/Website/modules/MonitorJobsList.tsx @@ -5,6 +5,8 @@ import IJob from "./interfaces/IJob"; import IManga, {CoverCard} from "./interfaces/IManga"; import {Manga} from './Manga'; import '../styles/MangaCoverCard.css' +import Icon from '@mdi/react'; +import { mdiTrashCanOutline, mdiPlayBoxOutline } from '@mdi/js'; export default function MonitorJobsList({onStartSearch, onJobsChanged} : {onStartSearch() : void, onJobsChanged: EventHandler}) { const [MonitoringJobs, setMonitoringJobs] = useState([]); @@ -28,11 +30,6 @@ export default function MonitorJobsList({onStartSearch, onJobsChanged} : {onStar UpdateMonitoringJobsList(); }, []); - const DeleteJob : MouseEventHandler = (e) => { - const jobId = e.currentTarget.id; - Job.DeleteJob(jobId).then(() => onJobsChanged(jobId)); - } - function UpdateMonitoringJobsList(){ console.debug("Updating MonitoringJobsList"); Job.GetMonitoringJobs() @@ -56,6 +53,18 @@ export default function MonitorJobsList({onStartSearch, onJobsChanged} : {onStar ); } + const DeleteJob : MouseEventHandler = (e) => { + const jobId = e.currentTarget.id.slice(e.currentTarget.id.indexOf("-")+1); + console.info(`Pressed ${e.currentTarget.id} => ${jobId}`); + Job.DeleteJob(jobId).then(() => onJobsChanged(jobId)); + } + + const StartJob : MouseEventHandler = (e) => { + const jobId = e.currentTarget.id.slice(e.currentTarget.id.indexOf("-")+1); + console.info(`Pressed ${e.currentTarget.id} => ${jobId}`); + Job.StartJob(jobId); + } + return (
{StartSearchMangaEntry()} @@ -63,10 +72,12 @@ export default function MonitorJobsList({onStartSearch, onJobsChanged} : {onStar const job = MonitoringJobs.find(job => job.mangaInternalId == manga.internalId); if (job === undefined || job == null) return
Error. Could not find matching job for {manga.internalId}
- return
+ return
{CoverCard(manga)} - {job.id} - +
+ + +
; })}
) diff --git a/Website/modules/interfaces/IManga.tsx b/Website/modules/interfaces/IManga.tsx index 64c6aa7..a5aedb1 100644 --- a/Website/modules/interfaces/IManga.tsx +++ b/Website/modules/interfaces/IManga.tsx @@ -59,11 +59,11 @@ export function SearchResult(manga: IManga, jobsChanged: EventHandler) : Re

{manga.mangaConnector.name}

{manga.sortName}

-
    - {manga.authors.map(author =>
  • {author}
  • )} - {manga.tags.map(tag =>
  • {tag}
  • )} -
- +
+ {manga.authors.map(author =>

{author}

)} + {manga.tags.map(tag =>

{tag}

)} +
+