mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-06 17:50:20 +00:00
fix(web): 修复代码格式和文件清理问题
清理无用文件和资源,调整代码格式统一双引号,修复部分组件路径引用问题 删除大量无用图片资源和组件文件,统一代码风格使用双引号,修复国际化文件路径引用,调整部分组件逻辑,优化项目结构
This commit is contained in:
@@ -1,85 +1,54 @@
|
||||
import request from '@/utils/http';
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = '/monitor/cache';
|
||||
const API_PATH = "/monitor/cache";
|
||||
|
||||
const CacheAPI = {
|
||||
/**
|
||||
* 获取缓存信息
|
||||
* @returns 缓存信息
|
||||
*/
|
||||
getCacheInfo() {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/info`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取所有缓存名称
|
||||
* @returns 所有缓存名称
|
||||
*/
|
||||
getCacheNames() {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/get/names`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取指定缓存名称下的所有键
|
||||
* @param cacheName 缓存名称
|
||||
* @returns 所有键
|
||||
*/
|
||||
getCacheKeys(cacheName: string) {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/get/keys/${cacheName}`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取指定缓存名称下的指定键的值
|
||||
* @param cacheName 缓存名称
|
||||
* @param cacheKey 键
|
||||
* @returns 值
|
||||
*/
|
||||
getCacheValue(cacheName: string, cacheKey: string) {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/get/value/${cacheName}/${cacheKey}`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除指定缓存名称
|
||||
* @param cacheName 缓存名称
|
||||
*/
|
||||
deleteCacheName(cacheName: string) {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/delete/name/${cacheName}`,
|
||||
method: 'delete',
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除指定缓存名称下的指定键
|
||||
* @param cacheName 缓存名称
|
||||
* @param cacheKey 键
|
||||
*/
|
||||
deleteCacheKey(cacheKey: string) {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/delete/key/${cacheKey}`,
|
||||
method: 'delete',
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除所有缓存
|
||||
*/
|
||||
deleteCacheAll() {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/delete/all`,
|
||||
method: 'delete',
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,39 +1,31 @@
|
||||
import request from '@/utils/http';
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = '/monitor/online';
|
||||
const API_PATH = "/monitor/online";
|
||||
|
||||
const OnlineAPI = {
|
||||
/**
|
||||
* 查询所有在线用户列表
|
||||
* @returns 所有在线用户列表
|
||||
*/
|
||||
// 查询在线用户列表
|
||||
listOnline(query: OnlineUserPageQuery) {
|
||||
return request<PageResult<OnlineUserTable[]>>({
|
||||
return request<ApiResponse<PageResult<OnlineUserTable[]>>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 强退用户
|
||||
* @param body 用户会话ID列表
|
||||
*/
|
||||
// 强退用户
|
||||
deleteOnline(body: string) {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 强退所有在线用户
|
||||
*/
|
||||
// 强退用户
|
||||
clearOnline() {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/clear`,
|
||||
method: 'delete',
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import request from '@/utils/http';
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = '/monitor/resource';
|
||||
const API_PATH = "/monitor/resource";
|
||||
|
||||
export const ResourceAPI = {
|
||||
/**
|
||||
@@ -8,9 +8,9 @@ export const ResourceAPI = {
|
||||
* @param query 查询参数
|
||||
*/
|
||||
listResource(query: ResourcePageQuery) {
|
||||
return request<PageResult<ResourceItem[]>>({
|
||||
return request<ApiResponse<PageResult<ResourceItem[]>>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
@@ -22,9 +22,9 @@ export const ResourceAPI = {
|
||||
uploadFile(formData: FormData) {
|
||||
return request<ApiResponse<ResourceUploadSchema>>({
|
||||
url: `${API_PATH}/upload`,
|
||||
method: 'post',
|
||||
method: "post",
|
||||
data: formData,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
});
|
||||
},
|
||||
|
||||
@@ -33,11 +33,11 @@ export const ResourceAPI = {
|
||||
* @param path 文件路径
|
||||
*/
|
||||
downloadFile(path: string) {
|
||||
return request<ApiResponse<Blob>>({
|
||||
return request<Blob>({
|
||||
url: `${API_PATH}/download`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
params: { path },
|
||||
responseType: 'blob',
|
||||
responseType: "blob",
|
||||
});
|
||||
},
|
||||
|
||||
@@ -46,9 +46,9 @@ export const ResourceAPI = {
|
||||
* @param body 文件路径数组
|
||||
*/
|
||||
deleteResource(body: string[]) {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
@@ -58,9 +58,9 @@ export const ResourceAPI = {
|
||||
* @param body 移动参数
|
||||
*/
|
||||
moveResource(body: ResourceMoveQuery) {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/move`,
|
||||
method: 'post',
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
@@ -70,9 +70,9 @@ export const ResourceAPI = {
|
||||
* @param body 复制参数
|
||||
*/
|
||||
copyResource(body: ResourceCopyQuery) {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/copy`,
|
||||
method: 'post',
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
@@ -82,9 +82,9 @@ export const ResourceAPI = {
|
||||
* @param body 重命名参数
|
||||
*/
|
||||
renameResource(body: ResourceRenameQuery) {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/rename`,
|
||||
method: 'post',
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
@@ -94,9 +94,9 @@ export const ResourceAPI = {
|
||||
* @param body 创建目录参数
|
||||
*/
|
||||
createDirectory(body: ResourceCreateDirQuery) {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/create-dir`,
|
||||
method: 'post',
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
@@ -106,11 +106,11 @@ export const ResourceAPI = {
|
||||
* @param body 导出条件
|
||||
*/
|
||||
exportResource(body: ResourcePageQuery) {
|
||||
return request<ApiResponse<Blob>>({
|
||||
return request<Blob>({
|
||||
url: `${API_PATH}/export`,
|
||||
method: 'post',
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: 'blob',
|
||||
responseType: "blob",
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
import request from '@/utils/http';
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = '/monitor/server';
|
||||
const API_PATH = "/monitor/server";
|
||||
|
||||
const ServerAPI = {
|
||||
/**
|
||||
* 获取当前服务信息
|
||||
* @returns 服务信息
|
||||
*/
|
||||
// 获取服务信息
|
||||
getServer() {
|
||||
return request({
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/info`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user