Skip to content

Commit 7da605d

Browse files
committed
feat: add dataset details and dataset deals functionality
1 parent 22f61cb commit 7da605d

File tree

16 files changed

+748
-5
lines changed

16 files changed

+748
-5
lines changed

package-lock.json

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"graphql": "^16.10.0",
4242
"iexec": "^8.15.0",
4343
"lucide-react": "^0.487.0",
44+
"multiaddr": "^10.0.1",
4445
"prettier-plugin-tailwindcss": "^0.6.11",
4546
"react": "^19.0.0",
4647
"react-dom": "^19.0.0",

src/components/ui/table.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,20 @@ function TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {
2626
);
2727
}
2828

29-
function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
29+
function TableBody({
30+
className,
31+
zebra = true,
32+
...props
33+
}: {
34+
className?: string;
35+
zebra?: boolean;
36+
} & React.ComponentProps<'tbody'> & {}) {
3037
return (
3138
<tbody
3239
data-slot="table-body"
3340
className={cn(
34-
'[&_tr]:border-muted [&_tr]:odd:*:bg-grey-800 [&_tr:last-child]:border-0',
41+
'[&_tr]:border-muted [&_tr:last-child]:border-0',
42+
zebra && '[&_tr]:odd:*:bg-grey-800',
3543
className
3644
)}
3745
{...props}

src/graphql/gql.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ import * as types from './graphql';
1717
type Documents = {
1818
"\n query Apps($length: Int = 20, $skip: Int = 0) {\n apps(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n address: id\n owner {\n address: id\n }\n timestamp\n name\n type\n multiaddr\n checksum\n mrenclave\n transfers(orderBy: timestamp, orderDirection: desc) {\n transaction {\n txHash: id\n timestamp\n blockNumber\n }\n }\n }\n }\n": typeof types.AppsDocument,
1919
"\n query NextApps($length: Int = 20, $skip: Int = 0) {\n apps(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n address: id\n }\n }\n": typeof types.NextAppsDocument,
20+
"\n query DatasetDeals($length: Int = 20, $skip: Int = 0, $datasetAddress: ID!) {\n dataset(id: $datasetAddress) {\n address: id\n deals: usages(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n dealid: id\n timestamp\n requester {\n address: id\n }\n beneficiary {\n address: id\n }\n callback {\n address: id\n }\n app {\n address: id\n name\n }\n dataset {\n address: id\n name\n }\n workerpool {\n address: id\n description\n }\n category {\n catid: id\n workClockTimeRef\n }\n startTime\n appPrice\n datasetPrice\n workerpoolPrice\n botSize\n trust\n completedTasksCount\n claimedTasksCount\n }\n }\n }\n": typeof types.DatasetDealsDocument,
21+
"\n query Dataset($datasetAddress: ID!, $datasetAddressString: String!) {\n dataset(id: $datasetAddress) {\n address: id\n name\n owner {\n address: id\n }\n multiaddr\n checksum\n transfers(\n where: { dataset: $datasetAddressString }\n orderBy: timestamp\n orderDirection: asc\n ) {\n dataset {\n address: id\n }\n from {\n address: id\n }\n to {\n address: id\n }\n transaction {\n txHash: id\n timestamp\n blockNumber\n }\n }\n }\n }\n": typeof types.DatasetDocument,
22+
"\n query NextDatasetDeals(\n $length: Int = 20\n $skip: Int = 0\n $datasetAddress: ID!\n ) {\n dataset(id: $datasetAddress) {\n address: id\n deals: usages(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n dealid: id\n }\n }\n }\n": typeof types.NextDatasetDealsDocument,
2023
"\n query Datasets($length: Int = 20, $skip: Int = 0) {\n datasets(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n address: id\n owner {\n address: id\n }\n timestamp\n name\n multiaddr\n checksum\n transfers(orderBy: timestamp, orderDirection: desc) {\n transaction {\n txHash: id\n timestamp\n blockNumber\n }\n }\n }\n }\n": typeof types.DatasetsDocument,
2124
"\n query NextDatasets($length: Int = 20, $skip: Int = 0) {\n datasets(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n address: id\n }\n }\n": typeof types.NextDatasetsDocument,
2225
"\n query Deal($dealAddress: ID!) {\n deal(id: $dealAddress) {\n dealid: id\n timestamp\n startTime\n app {\n address: id\n name\n }\n dataset {\n address: id\n name\n }\n workerpool {\n address: id\n description\n }\n beneficiary {\n address: id\n }\n callback {\n address: id\n }\n appPrice\n datasetPrice\n workerpoolPrice\n params\n tag\n trust\n category {\n catid: id\n name\n workClockTimeRef\n description\n }\n botSize\n botFirst\n completedTasksCount\n claimedTasksCount\n requester {\n address: id\n }\n dealEvents: events(orderBy: timestamp, orderDirection: asc) {\n timestamp\n id\n type: __typename\n transaction {\n txHash: id\n }\n }\n }\n }\n": typeof types.DealDocument,
@@ -31,6 +34,9 @@ type Documents = {
3134
const documents: Documents = {
3235
"\n query Apps($length: Int = 20, $skip: Int = 0) {\n apps(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n address: id\n owner {\n address: id\n }\n timestamp\n name\n type\n multiaddr\n checksum\n mrenclave\n transfers(orderBy: timestamp, orderDirection: desc) {\n transaction {\n txHash: id\n timestamp\n blockNumber\n }\n }\n }\n }\n": types.AppsDocument,
3336
"\n query NextApps($length: Int = 20, $skip: Int = 0) {\n apps(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n address: id\n }\n }\n": types.NextAppsDocument,
37+
"\n query DatasetDeals($length: Int = 20, $skip: Int = 0, $datasetAddress: ID!) {\n dataset(id: $datasetAddress) {\n address: id\n deals: usages(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n dealid: id\n timestamp\n requester {\n address: id\n }\n beneficiary {\n address: id\n }\n callback {\n address: id\n }\n app {\n address: id\n name\n }\n dataset {\n address: id\n name\n }\n workerpool {\n address: id\n description\n }\n category {\n catid: id\n workClockTimeRef\n }\n startTime\n appPrice\n datasetPrice\n workerpoolPrice\n botSize\n trust\n completedTasksCount\n claimedTasksCount\n }\n }\n }\n": types.DatasetDealsDocument,
38+
"\n query Dataset($datasetAddress: ID!, $datasetAddressString: String!) {\n dataset(id: $datasetAddress) {\n address: id\n name\n owner {\n address: id\n }\n multiaddr\n checksum\n transfers(\n where: { dataset: $datasetAddressString }\n orderBy: timestamp\n orderDirection: asc\n ) {\n dataset {\n address: id\n }\n from {\n address: id\n }\n to {\n address: id\n }\n transaction {\n txHash: id\n timestamp\n blockNumber\n }\n }\n }\n }\n": types.DatasetDocument,
39+
"\n query NextDatasetDeals(\n $length: Int = 20\n $skip: Int = 0\n $datasetAddress: ID!\n ) {\n dataset(id: $datasetAddress) {\n address: id\n deals: usages(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n dealid: id\n }\n }\n }\n": types.NextDatasetDealsDocument,
3440
"\n query Datasets($length: Int = 20, $skip: Int = 0) {\n datasets(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n address: id\n owner {\n address: id\n }\n timestamp\n name\n multiaddr\n checksum\n transfers(orderBy: timestamp, orderDirection: desc) {\n transaction {\n txHash: id\n timestamp\n blockNumber\n }\n }\n }\n }\n": types.DatasetsDocument,
3541
"\n query NextDatasets($length: Int = 20, $skip: Int = 0) {\n datasets(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n address: id\n }\n }\n": types.NextDatasetsDocument,
3642
"\n query Deal($dealAddress: ID!) {\n deal(id: $dealAddress) {\n dealid: id\n timestamp\n startTime\n app {\n address: id\n name\n }\n dataset {\n address: id\n name\n }\n workerpool {\n address: id\n description\n }\n beneficiary {\n address: id\n }\n callback {\n address: id\n }\n appPrice\n datasetPrice\n workerpoolPrice\n params\n tag\n trust\n category {\n catid: id\n name\n workClockTimeRef\n description\n }\n botSize\n botFirst\n completedTasksCount\n claimedTasksCount\n requester {\n address: id\n }\n dealEvents: events(orderBy: timestamp, orderDirection: asc) {\n timestamp\n id\n type: __typename\n transaction {\n txHash: id\n }\n }\n }\n }\n": types.DealDocument,
@@ -51,6 +57,18 @@ export function graphql(source: "\n query Apps($length: Int = 20, $skip: Int =
5157
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
5258
*/
5359
export function graphql(source: "\n query NextApps($length: Int = 20, $skip: Int = 0) {\n apps(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n address: id\n }\n }\n"): typeof import('./graphql').NextAppsDocument;
60+
/**
61+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
62+
*/
63+
export function graphql(source: "\n query DatasetDeals($length: Int = 20, $skip: Int = 0, $datasetAddress: ID!) {\n dataset(id: $datasetAddress) {\n address: id\n deals: usages(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n dealid: id\n timestamp\n requester {\n address: id\n }\n beneficiary {\n address: id\n }\n callback {\n address: id\n }\n app {\n address: id\n name\n }\n dataset {\n address: id\n name\n }\n workerpool {\n address: id\n description\n }\n category {\n catid: id\n workClockTimeRef\n }\n startTime\n appPrice\n datasetPrice\n workerpoolPrice\n botSize\n trust\n completedTasksCount\n claimedTasksCount\n }\n }\n }\n"): typeof import('./graphql').DatasetDealsDocument;
64+
/**
65+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
66+
*/
67+
export function graphql(source: "\n query Dataset($datasetAddress: ID!, $datasetAddressString: String!) {\n dataset(id: $datasetAddress) {\n address: id\n name\n owner {\n address: id\n }\n multiaddr\n checksum\n transfers(\n where: { dataset: $datasetAddressString }\n orderBy: timestamp\n orderDirection: asc\n ) {\n dataset {\n address: id\n }\n from {\n address: id\n }\n to {\n address: id\n }\n transaction {\n txHash: id\n timestamp\n blockNumber\n }\n }\n }\n }\n"): typeof import('./graphql').DatasetDocument;
68+
/**
69+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
70+
*/
71+
export function graphql(source: "\n query NextDatasetDeals(\n $length: Int = 20\n $skip: Int = 0\n $datasetAddress: ID!\n ) {\n dataset(id: $datasetAddress) {\n address: id\n deals: usages(\n first: $length\n skip: $skip\n orderBy: timestamp\n orderDirection: desc\n ) {\n dealid: id\n }\n }\n }\n"): typeof import('./graphql').NextDatasetDealsDocument;
5472
/**
5573
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
5674
*/

0 commit comments

Comments
 (0)