mirror of
https://github.com/acepanel/panel.git
synced 2026-02-07 10:37:14 +08:00
refactor: 接口使用蛇形命名
This commit is contained in:
@@ -13,7 +13,7 @@ export default {
|
||||
// 解封 IP
|
||||
unban: (name: string, ip: string): any => http.Post('/apps/fail2ban/unban', { name, ip }),
|
||||
// 获取白名单
|
||||
whitelist: (): any => http.Get('/apps/fail2ban/whiteList'),
|
||||
whitelist: (): any => http.Get('/apps/fail2ban/white_list'),
|
||||
// 设置白名单
|
||||
setWhitelist: (ip: string): any => http.Post('/apps/fail2ban/whiteList', { ip })
|
||||
setWhitelist: (ip: string): any => http.Post('/apps/fail2ban/white_list', { ip })
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ export default {
|
||||
// 保存配置
|
||||
saveConfig: (config: string): any => http.Post('/apps/mysql/config', { config }),
|
||||
// 清空错误日志
|
||||
clearErrorLog: (): any => http.Post('/apps/mysql/clearErrorLog'),
|
||||
clearErrorLog: (): any => http.Post('/apps/mysql/clear_error_log'),
|
||||
// 获取慢查询日志
|
||||
slowLog: (): any => http.Get('/apps/mysql/slowLog'),
|
||||
slowLog: (): any => http.Get('/apps/mysql/slow_log'),
|
||||
// 清空慢查询日志
|
||||
clearSlowLog: (): any => http.Post('/apps/mysql/clearSlowLog'),
|
||||
clearSlowLog: (): any => http.Post('/apps/mysql/clear_slow_log'),
|
||||
// 获取 root 密码
|
||||
rootPassword: (): any => http.Get('/apps/mysql/rootPassword'),
|
||||
rootPassword: (): any => http.Get('/apps/mysql/root_password'),
|
||||
// 修改 root 密码
|
||||
setRootPassword: (password: string): any => http.Post('/apps/mysql/rootPassword', { password })
|
||||
setRootPassword: (password: string): any => http.Post('/apps/mysql/root_password', { password })
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export default {
|
||||
// 保存配置
|
||||
saveConfig: (config: string): any => http.Post('/apps/nginx/config', { config }),
|
||||
// 获取错误日志
|
||||
errorLog: (): any => http.Get('/apps/nginx/errorLog'),
|
||||
errorLog: (): any => http.Get('/apps/nginx/error_log'),
|
||||
// 清空错误日志
|
||||
clearErrorLog: (): any => http.Post('/apps/nginx/clearErrorLog')
|
||||
clearErrorLog: (): any => http.Post('/apps/nginx/clear_error_log')
|
||||
}
|
||||
|
||||
@@ -2,27 +2,27 @@ import { http } from '@/utils'
|
||||
|
||||
export default {
|
||||
// 设为 CLI 版本
|
||||
setCli: (version: number): any => http.Post(`/apps/php${version}/setCli`),
|
||||
setCli: (version: number): any => http.Post(`/apps/php${version}/set_cli`),
|
||||
// 获取配置
|
||||
config: (version: number): any => http.Get(`/apps/php${version}/config`),
|
||||
// 保存配置
|
||||
saveConfig: (version: number, config: string): any =>
|
||||
http.Post(`/apps/php${version}/config`, { config }),
|
||||
// 获取FPM配置
|
||||
fpmConfig: (version: number): any => http.Get(`/apps/php${version}/fpmConfig`),
|
||||
fpmConfig: (version: number): any => http.Get(`/apps/php${version}/fpm_config`),
|
||||
// 保存FPM配置
|
||||
saveFPMConfig: (version: number, config: string): any =>
|
||||
http.Post(`/apps/php${version}/fpmConfig`, { config }),
|
||||
http.Post(`/apps/php${version}/fpm_config`, { config }),
|
||||
// 负载状态
|
||||
load: (version: number): any => http.Get(`/apps/php${version}/load`),
|
||||
// 获取错误日志
|
||||
errorLog: (version: number): any => http.Get(`/apps/php${version}/errorLog`),
|
||||
errorLog: (version: number): any => http.Get(`/apps/php${version}/error_log`),
|
||||
// 清空错误日志
|
||||
clearErrorLog: (version: number): any => http.Post(`/apps/php${version}/clearErrorLog`),
|
||||
clearErrorLog: (version: number): any => http.Post(`/apps/php${version}/clear_error_log`),
|
||||
// 获取慢日志
|
||||
slowLog: (version: number): any => http.Get(`/apps/php${version}/slowLog`),
|
||||
slowLog: (version: number): any => http.Get(`/apps/php${version}/slow_log`),
|
||||
// 清空慢日志
|
||||
clearSlowLog: (version: number): any => http.Post(`/apps/php${version}/clearSlowLog`),
|
||||
clearSlowLog: (version: number): any => http.Post(`/apps/php${version}/clear_slow_log`),
|
||||
// 拓展列表
|
||||
extensions: (version: number): any => http.Get(`/apps/php${version}/extensions`),
|
||||
// 安装拓展
|
||||
|
||||
@@ -2,11 +2,11 @@ import { http } from '@/utils'
|
||||
|
||||
export default {
|
||||
// 获取注册表配置
|
||||
registryConfig: (): any => http.Get('/apps/podman/registryConfig'),
|
||||
registryConfig: (): any => http.Get('/apps/podman/registry_config'),
|
||||
// 保存注册表配置
|
||||
saveRegistryConfig: (config: string): any => http.Post('/apps/podman/registryConfig', { config }),
|
||||
saveRegistryConfig: (config: string): any => http.Post('/apps/podman/registry_config', { config }),
|
||||
// 获取存储配置
|
||||
storageConfig: (): any => http.Get('/apps/podman/storageConfig'),
|
||||
storageConfig: (): any => http.Get('/apps/podman/storage_config'),
|
||||
// 保存存储配置
|
||||
saveStorageConfig: (config: string): any => http.Post('/apps/podman/storageConfig', { config })
|
||||
saveStorageConfig: (config: string): any => http.Post('/apps/podman/storage_config', { config })
|
||||
}
|
||||
|
||||
@@ -8,11 +8,11 @@ export default {
|
||||
// 保存配置
|
||||
saveConfig: (config: string): any => http.Post('/apps/postgresql/config', { config }),
|
||||
// 获取用户配置
|
||||
userConfig: (): any => http.Get('/apps/postgresql/userConfig'),
|
||||
userConfig: (): any => http.Get('/apps/postgresql/user_config'),
|
||||
// 保存配置
|
||||
saveUserConfig: (config: string): any => http.Post('/apps/postgresql/userConfig', { config }),
|
||||
saveUserConfig: (config: string): any => http.Post('/apps/postgresql/user_config', { config }),
|
||||
// 获取日志
|
||||
log: (): any => http.Get('/apps/postgresql/log'),
|
||||
// 清空错误日志
|
||||
clearLog: (): any => http.Post('/apps/postgresql/clearLog')
|
||||
clearLog: (): any => http.Post('/apps/postgresql/clear_log')
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ export default {
|
||||
// 获取错误日志
|
||||
log: (): any => http.Get('/apps/supervisor/log'),
|
||||
// 清空错误日志
|
||||
clearLog: (): any => http.Post('/apps/supervisor/clearLog'),
|
||||
clearLog: (): any => http.Post('/apps/supervisor/clear_log'),
|
||||
// 获取配置
|
||||
config: (): any => http.Get('/apps/supervisor/config'),
|
||||
// 保存配置
|
||||
@@ -25,7 +25,7 @@ export default {
|
||||
processLog: (process: string): any => http.Get(`/apps/supervisor/processes/${process}/log`),
|
||||
// 清空进程日志
|
||||
clearProcessLog: (process: string): any =>
|
||||
http.Post(`/apps/supervisor/processes/${process}/clearLog`),
|
||||
http.Post(`/apps/supervisor/processes/${process}/clear_log`),
|
||||
// 进程配置
|
||||
processConfig: (process: string): any => http.Get(`/apps/supervisor/processes/${process}`),
|
||||
// 保存进程配置
|
||||
|
||||
@@ -16,7 +16,7 @@ export default {
|
||||
// 设置时间
|
||||
updateTime: (time: string): any => http.Post('/apps/toolbox/time', { time }),
|
||||
// 同步时间
|
||||
syncTime: (): any => http.Post('/apps/toolbox/syncTime'),
|
||||
syncTime: (): any => http.Post('/apps/toolbox/sync_time'),
|
||||
// 主机名
|
||||
hostname: (): any => http.Get('/apps/toolbox/hostname'),
|
||||
// Hosts
|
||||
@@ -27,5 +27,5 @@ export default {
|
||||
updateHosts: (hosts: string): any => http.Post('/apps/toolbox/hosts', { hosts }),
|
||||
// 设置 Root 密码
|
||||
updateRootPassword: (password: string): any =>
|
||||
http.Post('/apps/toolbox/rootPassword', { password })
|
||||
http.Post('/apps/toolbox/root_password', { password })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user