feat: RBAC controlling

This commit is contained in:
2026-03-10 17:59:44 +08:00
parent f803a447b5
commit b9c0f3025c
11 changed files with 716 additions and 380 deletions

View File

@@ -26,6 +26,13 @@ export type Stats = {
todayEnergyWh: number;
};
export type UserStats = {
totalIdTags: number;
totalBalance: number;
activeTransactions: number;
totalTransactions: number;
};
export type ConnectorSummary = {
id: string;
connectorId: number;
@@ -128,7 +135,7 @@ export type PaginatedTransactions = {
export const api = {
stats: {
get: () => apiFetch<Stats>("/api/stats"),
get: () => apiFetch<Stats | UserStats>("/api/stats"),
},
chargePoints: {
list: () => apiFetch<ChargePoint[]>("/api/charge-points"),
@@ -178,6 +185,7 @@ export const api = {
idTags: {
list: () => apiFetch<IdTag[]>("/api/id-tags"),
get: (idTag: string) => apiFetch<IdTag>(`/api/id-tags/${idTag}`),
claim: () => apiFetch<IdTag>("/api/id-tags/claim", { method: "POST" }),
create: (data: {
idTag: string;
status?: string;