Skip to content

Commit 936c066

Browse files
committed
Added filtering by username dstackai/dstack-cloud#291
1 parent bf926eb commit 936c066

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

frontend/src/pages/Runs/List/hooks/useFilters.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ type Args = {
99
localStorePrefix: string;
1010
};
1111

12-
type RequestParamsKeys = keyof Pick<TRunsRequestParams, 'only_active' | 'project_name'>;
12+
type RequestParamsKeys = keyof Pick<TRunsRequestParams, 'only_active' | 'project_name' | 'username'>;
1313

1414
const FilterKeys: Record<string, RequestParamsKeys> = {
1515
PROJECT_NAME: 'project_name',
16+
USER_NAME: 'username',
1617
ACTIVE: 'only_active',
1718
};
1819

@@ -87,6 +88,11 @@ export const useFilters = ({ localStorePrefix }: Args) => {
8788
propertyLabel: 'Project',
8889
groupValuesLabel: 'Project values',
8990
},
91+
{
92+
key: FilterKeys.USER_NAME,
93+
operators: ['='],
94+
propertyLabel: 'Username',
95+
},
9096
{
9197
key: FilterKeys.ACTIVE,
9298
operators: ['='],

frontend/src/types/run.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
declare type TRunsRequestParams = {
22
project_name?: IProject['project_name'];
33
repo_id?: string;
4-
user_name?: string;
4+
username?: string;
55
only_active?: boolean;
66
prev_submitted_at?: string;
77
prev_run_id?: string;

0 commit comments

Comments
 (0)