Skip to content

Commit 5fd7e9b

Browse files
committed
feat(FR-2904): expose all DeploymentFilter fields, ordering, and table columns in deployment list
1 parent f2d410d commit 5fd7e9b

23 files changed

Lines changed: 204 additions & 2 deletions

react/src/components/DeploymentList.tsx

Lines changed: 113 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
BAITable,
2626
filterOutEmpty,
2727
filterOutNullAndUndefined,
28+
isValidUUID,
2829
toLocalId,
2930
useBAILogger,
3031
type BAIColumnType,
@@ -53,9 +54,9 @@ const COLUMN_KEY_TO_FIELD: Record<string, string> = {
5354
name: 'NAME',
5455
createdAt: 'CREATED_AT',
5556
domainName: 'DOMAIN',
56-
projectName: 'PROJECT',
57+
projectId: 'PROJECT',
5758
resourceGroup: 'RESOURCE_GROUP',
58-
tag: 'TAG',
59+
tags: 'TAG',
5960
};
6061

6162
/** All valid order strings accepted by BAITable for deployments. */
@@ -64,6 +65,14 @@ export const availableDeploymentOrderValues = [
6465
'-name',
6566
'createdAt',
6667
'-createdAt',
68+
'domainName',
69+
'-domainName',
70+
'projectId',
71+
'-projectId',
72+
'resourceGroup',
73+
'-resourceGroup',
74+
'tags',
75+
'-tags',
6776
] as const;
6877

6978
export type DeploymentOrderValue =
@@ -159,16 +168,20 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
159168
edges {
160169
node {
161170
id
171+
createdUserId
162172
metadata {
163173
name
164174
status
165175
createdAt
176+
updatedAt
166177
domainName
167178
projectId
179+
resourceGroupName
168180
...DeploymentTagChips_metadata
169181
}
170182
networkAccess {
171183
endpointUrl
184+
openToPublic
172185
}
173186
replicaState {
174187
desiredReplicaCount
@@ -207,6 +220,11 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
207220
const supportsExtendedFilter =
208221
baiClient?.supports('model-deployment-extended-filter') ?? false;
209222

223+
const uuidRule = {
224+
message: t('general.InvalidUUID'),
225+
validate: (value: string) => isValidUUID(value.toLowerCase()),
226+
};
227+
210228
const baseFilterProperties = [
211229
{
212230
key: 'name',
@@ -223,6 +241,11 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
223241
propertyLabel: t('deployment.filter.EndpointUrl'),
224242
type: 'string' as const,
225243
},
244+
{
245+
key: 'openToPublic',
246+
propertyLabel: t('deployment.filter.OpenToPublic'),
247+
type: 'boolean' as const,
248+
},
226249
];
227250

228251
const extendedAdminFilterProperties =
@@ -238,13 +261,34 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
238261
propertyLabel: t('deployment.filter.ResourceGroup'),
239262
type: 'string' as const,
240263
},
264+
{
265+
key: 'projectId',
266+
propertyLabel: t('deployment.filter.ProjectId'),
267+
type: 'uuid' as const,
268+
fixedOperator: 'equals' as const,
269+
rule: uuidRule,
270+
},
271+
{
272+
key: 'createdUserId',
273+
propertyLabel: t('deployment.filter.CreatedUserId'),
274+
type: 'uuid' as const,
275+
fixedOperator: 'equals' as const,
276+
rule: uuidRule,
277+
},
241278
{
242279
key: 'createdAt',
243280
propertyLabel: t('deployment.filter.CreatedAt'),
244281
type: 'datetime' as const,
245282
operators: ['after' as const, 'before' as const],
246283
defaultOperator: 'after' as const,
247284
},
285+
{
286+
key: 'destroyedAt',
287+
propertyLabel: t('deployment.filter.DestroyedAt'),
288+
type: 'datetime' as const,
289+
operators: ['after' as const, 'before' as const],
290+
defaultOperator: 'after' as const,
291+
},
248292
]
249293
: [];
250294

@@ -388,6 +432,7 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
388432
key: 'tags',
389433
title: t('deployment.Tags'),
390434
defaultHidden: true,
435+
sorter: true,
391436
render: (_text, row) => (
392437
<DeploymentTagChips
393438
metadataFrgmt={row.metadata}
@@ -406,10 +451,49 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
406451
return createdAt ? dayjs(createdAt).format('ll LT') : '-';
407452
},
408453
},
454+
{
455+
key: 'updatedAt',
456+
title: t('deployment.UpdatedAt'),
457+
defaultHidden: true,
458+
render: (_text, row) => {
459+
const updatedAt = row.metadata?.updatedAt;
460+
return updatedAt ? dayjs(updatedAt).format('ll LT') : '-';
461+
},
462+
},
463+
{
464+
key: 'openToPublic',
465+
title: t('deployment.OpenToPublic'),
466+
defaultHidden: true,
467+
render: (_text, row) => {
468+
const isPublic = row.networkAccess?.openToPublic;
469+
return isPublic == null ? (
470+
<Typography.Text type="secondary">-</Typography.Text>
471+
) : (
472+
<Typography.Text>
473+
{isPublic ? t('deployment.Public') : t('deployment.Private')}
474+
</Typography.Text>
475+
);
476+
},
477+
},
478+
{
479+
key: 'resourceGroup',
480+
title: t('deployment.ResourceGroup'),
481+
defaultHidden: true,
482+
sorter: true,
483+
render: (_text, row) => {
484+
const resourceGroup = row.metadata?.resourceGroupName;
485+
return resourceGroup ? (
486+
<Typography.Text>{resourceGroup}</Typography.Text>
487+
) : (
488+
<Typography.Text type="secondary">-</Typography.Text>
489+
);
490+
},
491+
},
409492
isAdminMode && {
410493
key: 'domainName',
411494
title: t('deployment.Domain'),
412495
defaultHidden: true,
496+
sorter: true,
413497
render: (_text, row) => {
414498
const domain = row.metadata?.domainName;
415499
return domain ? (
@@ -419,6 +503,33 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
419503
);
420504
},
421505
},
506+
isAdminMode && {
507+
key: 'projectId',
508+
title: t('deployment.ProjectId'),
509+
defaultHidden: true,
510+
sorter: true,
511+
render: (_text, row) => {
512+
const projectId = row.metadata?.projectId;
513+
return projectId ? (
514+
<BAIId globalId={projectId} copyable />
515+
) : (
516+
<Typography.Text type="secondary">-</Typography.Text>
517+
);
518+
},
519+
},
520+
isAdminMode && {
521+
key: 'createdUserId',
522+
title: t('deployment.CreatedBy'),
523+
defaultHidden: true,
524+
render: (_text, row) => {
525+
const userId = row.createdUserId;
526+
return userId ? (
527+
<BAIId globalId={userId} copyable />
528+
) : (
529+
<Typography.Text type="secondary">-</Typography.Text>
530+
);
531+
},
532+
},
422533
isAdminMode && {
423534
key: 'owner',
424535
title: t('deployment.Owner'),

react/src/pages/DeploymentListPage.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import DeploymentSettingModal from '../components/DeploymentSettingModal';
1919
import { useWebUINavigate } from '../hooks';
2020
import { useBAIPaginationOptionStateOnSearchParam } from '../hooks/reactPaginationQueryOptions';
2121
import { useBAISettingUserState } from '../hooks/useBAISetting';
22+
import { useCurrentProjectValue } from '../hooks/useCurrentProject';
2223
import { useToggle } from 'ahooks';
2324
import { Button, Skeleton } from 'antd';
2425
import {
@@ -72,6 +73,8 @@ const DeploymentListPageContent: React.FC = () => {
7273

7374
const [fetchKey, updateFetchKey] = useFetchKey();
7475

76+
const currentProject = useCurrentProjectValue();
77+
7578
const sort = tableOrderToSort(queryParams.order);
7679
const orderBy: DeploymentOrderBy[] | undefined = sort
7780
? [
@@ -86,10 +89,14 @@ const DeploymentListPageContent: React.FC = () => {
8689
queryParams.statusCategory === 'finished'
8790
? { status: { in: finishedStatuses } }
8891
: { status: { notIn: finishedStatuses } };
92+
const projectFilter: DeploymentFilter = currentProject.id
93+
? { projectId: { equals: currentProject.id } }
94+
: {};
8995
const queryVariables = {
9096
filter: {
9197
...((queryParams.filter ?? {}) as DeploymentFilter),
9298
...statusCategoryFilter,
99+
...projectFilter,
93100
},
94101
orderBy,
95102
limit: baiPaginationOption.limit,

resources/i18n/de.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,7 @@
996996
"Private": "Privat",
997997
"PrivateDeploymentAlertTitle": "Private Bereitstellung — verwenden Sie ein Zugriffstoken, um auf den Endpunkt zuzugreifen.",
998998
"Project": "Projekt",
999+
"ProjectId": "Projekt-ID",
9991000
"Public": "Öffentlich",
10001001
"QuickDeploy": "Bereitstellen",
10011002
"QuickDeployDetailed": "Konfigurieren und bereitstellen...",
@@ -1048,10 +1049,13 @@
10481049
},
10491050
"filter": {
10501051
"CreatedAt": "Erstellt am",
1052+
"CreatedUserId": "Ersteller-ID",
1053+
"DestroyedAt": "Gelöscht am",
10511054
"DomainName": "Domäne",
10521055
"EndpointUrl": "Endpunkt-URL",
10531056
"Name": "Name",
10541057
"OpenToPublic": "Öffentlich",
1058+
"ProjectId": "Projekt-ID",
10551059
"ResourceGroup": "Ressourcengruppe",
10561060
"Status": "Status",
10571061
"Tags": "Tags"

resources/i18n/el.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,7 @@
996996
"Private": "Ιδιωτικό",
997997
"PrivateDeploymentAlertTitle": "Ιδιωτική ανάπτυξη — χρησιμοποιήστε ένα διακριτικό πρόσβασης για να αποκτήσετε πρόσβαση στο τελικό σημείο.",
998998
"Project": "Έργο",
999+
"ProjectId": "ID έργου",
9991000
"Public": "Δημόσιο",
10001001
"QuickDeploy": "Ανάπτυξη",
10011002
"QuickDeployDetailed": "Διαμόρφωση και ανάπτυξη...",
@@ -1048,10 +1049,13 @@
10481049
},
10491050
"filter": {
10501051
"CreatedAt": "Δημιουργήθηκε",
1052+
"CreatedUserId": "ID δημιουργού",
1053+
"DestroyedAt": "Καταστράφηκε στις",
10511054
"DomainName": "Τομέας",
10521055
"EndpointUrl": "URL τελικού σημείου",
10531056
"Name": "Όνομα",
10541057
"OpenToPublic": "Δημόσιο",
1058+
"ProjectId": "ID έργου",
10551059
"ResourceGroup": "Ομάδα πόρων",
10561060
"Status": "Κατάσταση",
10571061
"Tags": "Ετικέτες"

resources/i18n/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,7 @@
10151015
"Private": "Private",
10161016
"PrivateDeploymentAlertTitle": "Private deployment — use an access token to access the endpoint.",
10171017
"Project": "Project",
1018+
"ProjectId": "Project ID",
10181019
"Public": "Public",
10191020
"QuickDeploy": "Deploy",
10201021
"QuickDeployDetailed": "Configure and deploy",
@@ -1067,10 +1068,13 @@
10671068
},
10681069
"filter": {
10691070
"CreatedAt": "Created At",
1071+
"CreatedUserId": "Creator ID",
1072+
"DestroyedAt": "Destroyed At",
10701073
"DomainName": "Domain",
10711074
"EndpointUrl": "Endpoint URL",
10721075
"Name": "Name",
10731076
"OpenToPublic": "Public",
1077+
"ProjectId": "Project ID",
10741078
"ResourceGroup": "Resource Group",
10751079
"Status": "Status",
10761080
"Tags": "Tags"

resources/i18n/es.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,7 @@
996996
"Private": "Privado",
997997
"PrivateDeploymentAlertTitle": "Despliegue privado — use un token de acceso para acceder al endpoint.",
998998
"Project": "Proyecto",
999+
"ProjectId": "ID del proyecto",
9991000
"Public": "Público",
10001001
"QuickDeploy": "Desplegar",
10011002
"QuickDeployDetailed": "Configurar y desplegar...",
@@ -1048,10 +1049,13 @@
10481049
},
10491050
"filter": {
10501051
"CreatedAt": "Creado el",
1052+
"CreatedUserId": "ID del creador",
1053+
"DestroyedAt": "Eliminado el",
10511054
"DomainName": "Dominio",
10521055
"EndpointUrl": "URL del endpoint",
10531056
"Name": "Nombre",
10541057
"OpenToPublic": "Público",
1058+
"ProjectId": "ID del proyecto",
10551059
"ResourceGroup": "Grupo de recursos",
10561060
"Status": "Estado",
10571061
"Tags": "Etiquetas"

resources/i18n/fi.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,7 @@
996996
"Private": "Yksityinen",
997997
"PrivateDeploymentAlertTitle": "Yksityinen käyttöönotto — käytä käyttöoikeustunnusta päätepisteen käyttämiseen.",
998998
"Project": "Projekti",
999+
"ProjectId": "Projektin tunnus",
9991000
"Public": "Julkinen",
10001001
"QuickDeploy": "Ota käyttöön",
10011002
"QuickDeployDetailed": "Määritä ja ota käyttöön...",
@@ -1048,10 +1049,13 @@
10481049
},
10491050
"filter": {
10501051
"CreatedAt": "Luotu",
1052+
"CreatedUserId": "Luojan tunnus",
1053+
"DestroyedAt": "Tuhottu",
10511054
"DomainName": "Verkkotunnus",
10521055
"EndpointUrl": "Päätepisteen URL",
10531056
"Name": "Nimi",
10541057
"OpenToPublic": "Julkinen",
1058+
"ProjectId": "Projektin tunnus",
10551059
"ResourceGroup": "Resurssiryhmä",
10561060
"Status": "Tila",
10571061
"Tags": "Tunnisteet"

resources/i18n/fr.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,7 @@
996996
"Private": "Privé",
997997
"PrivateDeploymentAlertTitle": "Déploiement privé — utilisez un jeton d'accès pour accéder au point de terminaison.",
998998
"Project": "Projet",
999+
"ProjectId": "ID du projet",
9991000
"Public": "Public",
10001001
"QuickDeploy": "Déployer",
10011002
"QuickDeployDetailed": "Configurer et déployer...",
@@ -1048,10 +1049,13 @@
10481049
},
10491050
"filter": {
10501051
"CreatedAt": "Créé le",
1052+
"CreatedUserId": "ID du créateur",
1053+
"DestroyedAt": "Supprimé le",
10511054
"DomainName": "Domaine",
10521055
"EndpointUrl": "URL du point de terminaison",
10531056
"Name": "Nom",
10541057
"OpenToPublic": "Public",
1058+
"ProjectId": "ID du projet",
10551059
"ResourceGroup": "Groupe de ressources",
10561060
"Status": "Statut",
10571061
"Tags": "Étiquettes"

resources/i18n/id.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,7 @@
996996
"Private": "Privat",
997997
"PrivateDeploymentAlertTitle": "Penerapan privat — gunakan token akses untuk mengakses endpoint.",
998998
"Project": "Proyek",
999+
"ProjectId": "ID proyek",
9991000
"Public": "Publik",
10001001
"QuickDeploy": "Terapkan",
10011002
"QuickDeployDetailed": "Konfigurasi dan terapkan...",
@@ -1048,10 +1049,13 @@
10481049
},
10491050
"filter": {
10501051
"CreatedAt": "Dibuat Pada",
1052+
"CreatedUserId": "ID Pembuat",
1053+
"DestroyedAt": "Dihancurkan Pada",
10511054
"DomainName": "Domain",
10521055
"EndpointUrl": "URL Titik Akhir",
10531056
"Name": "Nama",
10541057
"OpenToPublic": "Publik",
1058+
"ProjectId": "ID proyek",
10551059
"ResourceGroup": "Grup Sumber Daya",
10561060
"Status": "Status",
10571061
"Tags": "Tag"

0 commit comments

Comments
 (0)