Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>Voider - VOID Management Console</title>
</head>
<body>
<div id="root"></div>
Expand Down
19 changes: 19 additions & 0 deletions client/src/api/authority.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
ShoulderPattern,
AllocationRequest,
AllocationResponse,
AllocationUpdateRequest,
PaginatedAllocations,
AuthorityStatistics,
} from './types';
Expand Down Expand Up @@ -66,6 +67,24 @@ export async function getAllocation(shoulder: string): Promise<AllocationRespons
return response.json();
}

export async function updateAllocation(
id: number,
request: AllocationUpdateRequest
): Promise<AllocationResponse> {
const response = await fetch(`${getBaseUrl()}/api/authority/allocations/${id}`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(request),
});
if (!response.ok) {
const error = await response.json().catch(() => ({ detail: response.statusText }));
throw new Error(error.detail || 'Failed to update allocation');
}
return response.json();
}

export async function getAuthorityStatistics(): Promise<AuthorityStatistics> {
const response = await fetch(`${getBaseUrl()}/api/authority/statistics`);
if (!response.ok) {
Expand Down
10 changes: 10 additions & 0 deletions client/src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface AllocationRequest {
contact_email: string;
purpose: string;
pattern_id: number;
external: boolean;
}

export interface AllocationResponse {
Expand All @@ -30,6 +31,7 @@ export interface AllocationResponse {
contact_name: string;
contact_email: string;
purpose: string;
external: boolean;
requested_at: string;
}

Expand All @@ -41,9 +43,16 @@ export interface AllocationSummary {
cycle_length: number;
contact_name: string;
contact_email: string;
purpose: string;
external: boolean;
has_minter: boolean;
requested_at: string;
}

export interface AllocationUpdateRequest {
external: boolean;
}

export interface PaginatedAllocations {
items: AllocationSummary[];
total: number;
Expand Down Expand Up @@ -169,5 +178,6 @@ export interface MinterStatistics {
total_minted: number;
total_remaining: number;
utilization_percent: number;
minted_today: number;
minters_by_priority: MinterResponse[];
}
2 changes: 1 addition & 1 deletion client/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface NavItem {
const navItems: NavItem[] = [
{ text: 'Dashboard', icon: <DashboardIcon />, path: '/' },
{ text: 'Request Block', icon: <AddBoxIcon />, path: '/request' },
{ text: 'Allocations', icon: <AssignmentIcon />, path: '/allocations' },
{ text: 'Block Allocations', icon: <AssignmentIcon />, path: '/allocations' },
{ text: 'Mint IDs', icon: <PrintIcon />, path: '/mint' },
{ text: 'Statistics', icon: <BarChartIcon />, path: '/statistics' },
];
Expand Down
2 changes: 1 addition & 1 deletion client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ a:hover {
body {
margin: 0;
display: flex;
place-items: center;
place-items: start;
min-width: 320px;
min-height: 100vh;
}
Expand Down
Loading