Add task executor bar chart, add system version string (#11155)

### What problem does this PR solve?

- Add task executor bar chart
- Add read version string

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Jimmy Ben Klieve
2025-11-11 15:20:37 +08:00
committed by GitHub
parent 26cf5131c9
commit 7dd9758056
16 changed files with 315 additions and 78 deletions

View File

@ -101,8 +101,6 @@ request.interceptors.response.use(
);
const {
getSystemVersion: _getSystemVersion,
adminLogin,
adminLogout,
adminListUsers,
@ -136,6 +134,8 @@ const {
adminUpdateWhitelistEntry,
adminDeleteWhitelistEntry,
adminImportWhitelist,
adminGetSystemVersion,
} = api;
type ResponseData<D = NonNullable<unknown>> = {
@ -260,4 +260,4 @@ export const importWhitelistFromExcel = (file: File) => {
};
export const getSystemVersion = () =>
request.get<ResponseData<string>>(_getSystemVersion);
request.get<ResponseData<{ version: string }>>(adminGetSystemVersion);

View File

@ -66,6 +66,21 @@ declare module AdminService {
title: string;
};
export type TaskExectorHeartbeatItem = {
name: string;
boot_at: string;
now: string;
ip_address: string;
current: Record<string, object>;
done: number;
failed: number;
lag: number;
pending: number;
pid: number;
};
export type TaskExecutorInfo = Record<string, TaskExectorHeartbeatItem[]>;
export type ListServicesItem = {
extra: Record<string, unknown>;
host: string;
@ -76,11 +91,17 @@ declare module AdminService {
status: 'alive' | 'timeout' | 'fail';
};
export type ServiceDetail = {
service_name: string;
status: 'alive' | 'timeout';
message: string | Record<string, any> | Record<string, any>[];
};
export type ServiceDetail =
| {
service_name: string;
status: 'alive' | 'timeout';
message: string | Record<string, any> | Record<string, any>[];
}
| {
service_name: 'task_executor';
status: 'alive' | 'timeout';
message: AdminService.TaskExecutorInfo;
};
export type PermissionData = {
enable: boolean;