mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-28 23:27:10 +00:00
发布v2.0.0分支
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
export function getCacheInfo(query) {
|
||||
return request({
|
||||
url: "/api/v1/monitor/cache/info",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
export function getCacheNames() {
|
||||
return request({
|
||||
url: "/api/v1/monitor/cache/get/names",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
export function getCacheKeys(cacheName) {
|
||||
return request({
|
||||
url: `/api/v1/monitor/cache/get/keys/${cacheName}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
export function getCacheValue(cacheName, cacheKey) {
|
||||
return request({
|
||||
url: `/api/v1/monitor/cache/get/value/${cacheName}/${cacheKey}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteCacheName(cacheName) {
|
||||
return request({
|
||||
url: `/api/v1/monitor/cache/delete/name/${cacheName}`,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteCacheKey(cacheKey) {
|
||||
return request({
|
||||
url: `/api/v1/monitor/cache/delete/key/${cacheKey}`,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteCacheAll() {
|
||||
return request({
|
||||
url: "/api/v1/monitor/cache/delete/all",
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const CacheAPI = {
|
||||
getCacheInfo() {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/cache/info`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
getCacheNames() {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/cache/get/names`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
getCacheKeys(cacheName: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/cache/get/keys/${cacheName}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
getCacheValue(cacheName: string, cacheKey: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/cache/get/value/${cacheName}/${cacheKey}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
deleteCacheName(cacheName: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/cache/delete/name/${cacheName}`,
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
|
||||
deleteCacheKey(cacheKey: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/cache/delete/key/${cacheKey}`,
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
|
||||
deleteCacheAll() {
|
||||
return request<ApiResponse>({
|
||||
url: "/monitor/cache/delete/all",
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default CacheAPI;
|
||||
|
||||
export interface CacheForm {
|
||||
cache_name: string;
|
||||
cache_key: string;
|
||||
cache_value: string;
|
||||
}
|
||||
|
||||
export interface CacheInfo {
|
||||
cache_key: string;
|
||||
cache_name: string;
|
||||
cache_value: string;
|
||||
remark: string;
|
||||
}
|
||||
|
||||
export interface CommandStats {
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface RedisInfo {
|
||||
redis_version: string;
|
||||
redis_mode: string;
|
||||
tcp_port: number;
|
||||
connected_clients: number;
|
||||
uptime_in_days: number;
|
||||
used_memory_human: string;
|
||||
used_cpu_user_children: string;
|
||||
maxmemory_human: string;
|
||||
aof_enabled: string;
|
||||
rdb_last_bgsave_status: string;
|
||||
instantaneous_input_kbps: number;
|
||||
instantaneous_output_kbps: number;
|
||||
}
|
||||
|
||||
export interface CacheMonitor {
|
||||
command_stats: CommandStats[];
|
||||
db_size: number;
|
||||
info: RedisInfo;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询在线用户列表
|
||||
export function getOnlineList(query) {
|
||||
return request({
|
||||
url: '/api/v1/monitor/online/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 强退用户
|
||||
export function deleteOnline(body) {
|
||||
return request({
|
||||
url: "/api/v1/monitor/online/delete",
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const OnlineAPI = {
|
||||
// 查询在线用户列表
|
||||
getOnlineList(query: OnlineUserPageQuery) {
|
||||
return request<ApiResponse<PageResult<OnlineUserTable[]>>>({
|
||||
url: `/monitor/online/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
// 强退用户
|
||||
deleteOnline(body: any) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/online/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default OnlineAPI;
|
||||
|
||||
export interface OnlineUserPageQuery extends PageQuery {
|
||||
ipaddr?: string;
|
||||
name?: string;
|
||||
login_location?: string;
|
||||
}
|
||||
|
||||
export interface OnlineUserTable {
|
||||
session_id: string;
|
||||
user_id: number;
|
||||
name: string;
|
||||
user_name: string;
|
||||
ipaddr: string;
|
||||
login_location: string;
|
||||
os: string;
|
||||
browser: string;
|
||||
login_time: string;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 获取服务信息
|
||||
export function getServer() {
|
||||
return request({
|
||||
url: '/api/v1/monitor/server/info',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const ServerAPI = {
|
||||
// 获取服务信息
|
||||
getServer() {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/server/info`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default ServerAPI;
|
||||
|
||||
export interface Cpu {
|
||||
cpu_num: number;
|
||||
used: number;
|
||||
sys: number;
|
||||
free: number;
|
||||
}
|
||||
|
||||
export interface Memory {
|
||||
total: string;
|
||||
used: string;
|
||||
free: string;
|
||||
usage: number;
|
||||
}
|
||||
|
||||
export interface System {
|
||||
computer_name: string;
|
||||
os_name: string;
|
||||
computer_ip: string;
|
||||
os_arch: string;
|
||||
user_dir: string;
|
||||
}
|
||||
|
||||
export interface Python {
|
||||
name: string;
|
||||
version: string;
|
||||
start_time: string;
|
||||
run_time: string;
|
||||
home: string;
|
||||
memory_total: string;
|
||||
memory_used: string;
|
||||
memory_free: string;
|
||||
memory_usage: number;
|
||||
}
|
||||
|
||||
export interface SysFile {
|
||||
dirName: string;
|
||||
sysTypeName: string;
|
||||
typeName: string;
|
||||
total: string;
|
||||
free: string;
|
||||
used: string;
|
||||
usage: number;
|
||||
}
|
||||
|
||||
export interface ServerInfo {
|
||||
cpu: Cpu;
|
||||
mem: Memory;
|
||||
sys: System;
|
||||
py: Python;
|
||||
disks: SysFile[];
|
||||
}
|
||||
Reference in New Issue
Block a user