Usenet streaming with a WebDAV server and a SABnzbd-compatible API
C#
Added health-check-queue table to /health route.
nzbdav-devef32962ad70b
diff --git a/frontend/app/routes/health/components/health-table/health-table.module.css b/frontend/app/routes/health/components/health-table/health-table.module.cssnew file mode 100644index 00000000..8d6d0637--- /dev/null+++ b/frontend/app/routes/health/components/health-table/health-table.module.css@@ -0,0 +1,205 @@+.container {+ width: 100%;+ background: hsl(192, 90%, 6%);+ border-radius: 10px;+ padding: var(--container-padding);+ padding-bottom: 0;+ border: 1px solid rgba(255, 255, 255, 0.05);+ --container-padding: 24px;+}++.header {+ display: flex;+ justify-content: space-between;+ align-items: center;+ margin-bottom: 24px;+ flex-wrap: wrap;+ gap: 16px;+}++.title {+ color: hsl(180, 30%, 70%);+ margin: 0;+ font-size: 1.5em;+ font-weight: 600;+}++.count {+ color: hsl(180, 7%, 55%);+ font-size: 0.9em;+ font-weight: 500;+ background: hsl(196.8, 25%, 14.51%);+ padding: 6px 12px;+ border-radius: 16px;+ border: 1px solid rgba(255, 255, 255, 0.05);+}++.tableContainer {+ min-height: 200px;+ margin-left: calc(-1 * var(--container-padding));+ margin-right: calc(-1 * var(--container-padding));+}++.table {+ margin: 0;+ color: hsl(180, 7%, 70%);++ /* table headers */+ thead th {+ background-color: hsl(192, 100%, 11%) !important;+ color: hsl(180, 7%, 85%) !important;+ border: none;+ padding: 16px 12px;+ font-weight: 600;+ font-size: 0.9em;+ text-transform: uppercase;+ letter-spacing: 0.5px;+ white-space: nowrap;+ text-align: center;+ width: 100px;++ &:first-child {+ text-align: left;+ padding-left: var(--container-padding);+ width: 50%;+ }+ }++ /* table body */+ tbody td {+ border: none;+ background-color: unset;+ border-bottom: 1px solid rgba(255, 255, 255, 0.05);+ padding: 16px 12px;+ vertical-align: middle;+ max-width: 200px;++ &:first-child {+ padding-left: var(--container-padding);+ }+ }+}++.table tbody tr:last-child td {+ border-bottom: none;+}++.nameContainer {+ display: flex;+ flex-direction: column;+ gap: 4px;+}++.name {+ font-weight: 500;+ color: hsl(180, 7%, 85%);+ font-size: 0.95em;+ line-height: 1.3;+ word-break: break-all;+}++.path {+ font-size: 0.8em;+ color: hsl(180, 7%, 55%);+ font-style: italic;+ word-break: break-all;+ line-height: 1.3;+}++.dateCell {+ font-size: 0.85em;+ color: hsl(180, 7%, 60%);+ text-align: center;+}++.emptyState {+ text-align: center;+ padding: 60px 20px;+ color: hsl(180, 7%, 55%);+}++.emptyIcon {+ font-size: 3em;+ margin-bottom: 16px;+ opacity: 0.6;+}++.emptyTitle {+ font-size: 1.2em;+ font-weight: 600;+ color: hsl(180, 7%, 70%);+ margin-bottom: 8px;+}++.emptyDescription {+ font-size: 0.9em;+ line-height: 1.5;+ max-width: 400px;+ margin: 0 auto;+}++.dateDetailsTable {+ margin-top: 12px;+ background: hsl(196.8, 25%, 14.51%);+ border-radius: 8px;+ padding: 12px;+ border: 1px solid rgba(255, 255, 255, 0.05);+}++.dateDetailsRow {+ display: flex;+ justify-content: space-between;+ align-items: center;+ padding: 8px 0;+ border-bottom: 1px solid rgba(255, 255, 255, 0.05);+}++.dateDetailsRow:last-child {+ border-bottom: none;+ padding-bottom: 0;+}++.dateDetailsRow:first-child {+ padding-top: 0;+}++.dateDetailsLabel {+ font-size: 0.85em;+ font-weight: 500;+ color: hsl(180, 7%, 70%);+ text-transform: uppercase;+ letter-spacing: 0.5px;+ min-width: 80px;+}++.dateDetailsValue {+ font-size: 0.9em;+ color: hsl(180, 7%, 85%);+ text-align: right;+ word-break: break-word;+ flex: 1;+ margin-left: 12px;+}++.mobile {+ display: none;+}++/* mobile */+@media not (min-width: 900px) {+ .desktop {+ display: none;+ }++ .mobile {+ display: block;+ }++ .table thead tr th:first-child {+ width: unset;+ }++ .table td:first-child {+ padding: var(--container-padding) var(--container-padding);+ }+}\ No newline at end of filediff --git a/frontend/app/routes/health/components/health-table/health-table.tsx b/frontend/app/routes/health/components/health-table/health-table.tsxnew file mode 100644index 00000000..110948cf--- /dev/null+++ b/frontend/app/routes/health/components/health-table/health-table.tsx@@ -0,0 +1,102 @@+import { Table } from "react-bootstrap";+import type { HealthCheckQueueItem } from "~/clients/backend-client.server";+import styles from "./health-table.module.css";+import { Truncate } from "~/routes/queue/components/truncate/truncate";++export type HealthTableProps = {+ healthCheckItems: HealthCheckQueueItem[],+}++export function HealthTable({ healthCheckItems }: HealthTableProps) {++ return (+ <div className={styles.container}>+ <div className={styles.header}>+ <h3 className={styles.title}>Health Check Queue</h3>+ <div className={styles.count}>+ Only {healthCheckItems.length} shown+ </div>+ </div>++ {healthCheckItems.length === 0 ? (+ <div className={styles.emptyState}>+ <div className={styles.emptyIcon}>π©Ίππͺ</div>+ <div className={styles.emptyTitle}>No Items To Health-Check</div>+ <div className={styles.emptyDescription}>+ Once you begin processing nzbs, the mounted usenet files will be queued for continuous health monitoring+ </div>+ </div>+ ) : (+ <div className={styles.tableContainer}>+ <Table className={styles.table} responsive>+ <thead className={styles.desktop}>+ <tr>+ <th>Name</th>+ <th className={styles.desktop}>Release Date</th>+ <th className={styles.desktop}>Last Check</th>+ <th className={styles.desktop}>Next Check</th>+ </tr>+ </thead>+ <tbody>+ {healthCheckItems.map(item => (+ <tr key={item.id} className={styles.tableRow}>+ <td className={styles.nameCell}>+ <div className={styles.nameContainer}>+ <div className={styles.name}><Truncate>{item.name}</Truncate></div>+ <div className={styles.path}><Truncate>{item.path}</Truncate></div>+ <div className={styles.mobile}>+ <DateDetailsTable item={item} />+ </div>+ </div>+ </td>+ <td className={`${styles.dateCell} ${styles.desktop}`}>+ {formatDate(item.releaseDate, 'Unknown')}+ </td>+ <td className={`${styles.dateCell} ${styles.desktop}`}>+ {formatDate(item.lastHealthCheck, 'Never π¨')}+ </td>+ <td className={`${styles.dateCell} ${styles.desktop}`}>+ {formatDate(item.nextHealthCheck, 'ASAP π')}+ </td>+ </tr>+ ))}+ </tbody>+ </Table>+ </div>+ )}+ </div>+ );+}++function DateDetailsTable({ item }: { item: HealthCheckQueueItem }) {+ return (+ <div className={styles.dateDetailsTable}>+ <div className={styles.dateDetailsRow}>+ <div className={styles.dateDetailsLabel}>Release Date</div>+ <div className={styles.dateDetailsValue}>+ {formatDate(item.releaseDate, 'Unknown')}+ </div>+ </div>+ <div className={styles.dateDetailsRow}>+ <div className={styles.dateDetailsLabel}>Last Health Check</div>+ <div className={styles.dateDetailsValue}>+ {formatDate(item.lastHealthCheck, 'Never')}+ </div>+ </div>+ <div className={styles.dateDetailsRow}>+ <div className={styles.dateDetailsLabel}>Next Health Check</div>+ <div className={styles.dateDetailsValue}>+ {formatDate(item.nextHealthCheck, 'ASAP')}+ </div>+ </div>+ </div>+ );+}++function formatDate(dateString: string | null, fallback: string) {+ try {+ return dateString ? new Date(dateString).toLocaleDateString() : fallback;+ } catch {+ return fallback;+ }+};\ No newline at end of filediff --git a/frontend/app/routes/health/route.module.css b/frontend/app/routes/health/route.module.cssindex 98645bc3..1858b712 100644--- a/frontend/app/routes/health/route.module.css+++ b/frontend/app/routes/health/route.module.css@@ -1,13 +1,13 @@.container {min-width: 100%;min-height: 100%;- padding: 30px 35px 20px 35px;+ padding: 35px 30px;color: #93a1a1;font-size: 14px;}.section {- margin-bottom: 40px;+ margin-bottom: 35px;}.section:last-child {diff --git a/frontend/app/routes/health/route.tsx b/frontend/app/routes/health/route.tsxindex e877837a..aac47f79 100644--- a/frontend/app/routes/health/route.tsx+++ b/frontend/app/routes/health/route.tsx@@ -1,6 +1,7 @@import type { Route } from "./+types/route";import styles from "./route.module.css"import { backendClient } from "~/clients/backend-client.server";+import { HealthTable } from "./components/health-table/health-table";import { HealthStats } from "./components/health-stats/health-stats";export async function loader() {@@ -24,6 +25,9 @@ export default function Health({ loaderData }: Route.ComponentProps) {<div className={styles.section}><HealthStats stats={historyStats} /></div>+ <div className={styles.section}>+ <HealthTable healthCheckItems={queueItems} />+ </div></div>);}\ No newline at end of file