Skip to content

Commit

Permalink
Add errorString "Tracker error" column
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeseandcereal authored and qu1ck committed Aug 9, 2024
1 parent effbb88 commit e111530
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/tables/torrenttable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ const AllFields: readonly TableField[] = [
columnId: "trackerStatus",
accessorFn: (t) => t.cachedTrackerStatus,
},
{
name: "errorString",
label: "Error",
component: ErrorField,
columnId: "error",
accessorFn: (t) => t.cachedError,
},
{ name: "doneDate", label: "Completed on", component: DateField },
{ name: "activityDate", label: "Last active", component: DateDiffField },
{ name: "downloadDir", label: "Path", component: StringField },
Expand Down Expand Up @@ -273,6 +280,10 @@ function TrackerStatusField(props: TableFieldProps) {
return <div>{props.torrent.cachedTrackerStatus}</div>;
}

function ErrorField(props: TableFieldProps) {
return <div>{props.torrent.cachedError}</div>;
}

function PriorityField(props: TableFieldProps) {
const priority = props.torrent[props.fieldName];
return <Badge radius="md" variant="filled" bg={PriorityColors.get(priority)}>{PriorityStrings.get(priority)}</Badge>;
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ const DefaultColumnVisibility: Partial<Record<TableName, VisibilityState>> = {
"file-count": false,
pieceCount: false,
metadataPercentComplete: false,
error: false,
},
peers: {
flagStr: false,
Expand Down

0 comments on commit e111530

Please sign in to comment.