Add redux actions/reducers for groups

This commit is contained in:
Ken Hibino
2022-03-24 06:55:29 -07:00
parent 33b24ca940
commit 81eed7e33d
4 changed files with 111 additions and 0 deletions

View File

@@ -58,6 +58,10 @@ export interface ListQueueStatsResponse {
stats: { [qname: string]: DailyStat[] };
}
export interface ListGroupsResponse {
groups: GroupInfo[];
}
export interface RedisInfoResponse {
address: string;
info: RedisInfo;
@@ -250,6 +254,11 @@ export interface RedisInfo {
used_memory_startup: string;
}
export interface GroupInfo {
group: string;
size: number;
}
export interface Queue {
queue: string;
paused: boolean;
@@ -376,6 +385,14 @@ export async function listQueueStats(): Promise<ListQueueStatsResponse> {
return resp.data;
}
export async function listGroups(qname: string): Promise<ListGroupsResponse> {
const resp = await axios({
method: "get",
url: `${getBaseUrl()}/queues/${qname}`,
});
return resp.data;
}
export async function getTaskInfo(
qname: string,
id: string