-
Notifications
You must be signed in to change notification settings - Fork 293
Expand file tree
/
Copy pathMcpDeploymentsTableColumns.ts
More file actions
48 lines (46 loc) · 1.14 KB
/
McpDeploymentsTableColumns.ts
File metadata and controls
48 lines (46 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { SortableData } from 'mod-arch-shared';
import { McpDeployment, McpDeploymentPhase } from '~/app/mcpDeploymentTypes';
import { getServerDisplayName } from './utils';
const phaseOrder: Record<McpDeploymentPhase, number> = {
[McpDeploymentPhase.RUNNING]: 0,
[McpDeploymentPhase.PENDING]: 1,
[McpDeploymentPhase.FAILED]: 2,
};
export const mcpDeploymentColumns: SortableData<McpDeployment>[] = [
{
field: 'server',
label: 'Server',
sortable: (a, b) => getServerDisplayName(a).localeCompare(getServerDisplayName(b)),
width: 20,
},
{
field: 'name',
label: 'Name',
sortable: (a, b) => a.name.localeCompare(b.name),
width: 20,
},
{
field: 'created',
label: 'Created',
sortable: (a, b) =>
new Date(a.creationTimestamp).getTime() - new Date(b.creationTimestamp).getTime(),
width: 20,
},
{
field: 'status',
label: 'Status',
sortable: (a, b) => (phaseOrder[a.phase] ?? 3) - (phaseOrder[b.phase] ?? 3),
width: 15,
},
{
field: 'service',
label: 'Service',
sortable: false,
width: 10,
},
{
field: 'kebab',
label: '',
sortable: false,
},
];