2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-06 15:58:52 +08:00

refactor: 接口使用蛇形命名

This commit is contained in:
2025-05-02 19:28:52 +08:00
parent c0be351b95
commit fe6e9efd09
26 changed files with 123 additions and 123 deletions

View File

@@ -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 })
}

View File

@@ -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 })
}

View File

@@ -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')
}

View File

@@ -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`),
// 安装拓展

View File

@@ -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 })
}

View File

@@ -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')
}

View File

@@ -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}`),
// 保存进程配置

View File

@@ -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 })
}

View File

@@ -11,9 +11,9 @@ export default {
// 更新应用
update: (slug: string): any => http.Post('/app/update', { slug }),
// 设置首页显示
updateShow: (slug: string, show: boolean): any => http.Post('/app/updateShow', { slug, show }),
updateShow: (slug: string, show: boolean): any => http.Post('/app/update_show', { slug, show }),
// 应用是否已安装
isInstalled: (slug: string): any => http.Get('/app/isInstalled', { params: { slug } }),
isInstalled: (slug: string): any => http.Get('/app/is_installed', { params: { slug } }),
// 更新缓存
updateCache: (): any => http.Get('/app/updateCache')
updateCache: (): any => http.Get('/app/update_cache')
}

View File

@@ -2,9 +2,9 @@ import { http } from '@/utils'
export default {
// CA 供应商列表
caProviders: (): any => http.Get('/cert/caProviders'),
caProviders: (): any => http.Get('/cert/ca_providers'),
// DNS 供应商列表
dnsProviders: (): any => http.Get('/cert/dnsProviders'),
dnsProviders: (): any => http.Get('/cert/dns_providers'),
// 证书算法列表
algorithms: (): any => http.Get('/cert/algorithms'),
// ACME 账号列表
@@ -41,15 +41,15 @@ export default {
// 证书删除
certDelete: (id: number): any => http.Delete(`/cert/cert/${id}`),
// 证书自动签发
obtainAuto: (id: number): any => http.Post(`/cert/cert/${id}/obtainAuto`, { id }),
obtainAuto: (id: number): any => http.Post(`/cert/cert/${id}/obtain_auto`, { id }),
// 证书手动签发
obtainManual: (id: number): any => http.Post(`/cert/cert/${id}/obtainManual`, { id }),
obtainManual: (id: number): any => http.Post(`/cert/cert/${id}/obtain_manual`, { id }),
// 证书自签名签发
obtainSelfSigned: (id: number): any => http.Post(`/cert/cert/${id}/obtainSelfSigned`, { id }),
obtainSelfSigned: (id: number): any => http.Post(`/cert/cert/${id}/obtain_self_signed`, { id }),
// 续签
renew: (id: number): any => http.Post(`/cert/cert/${id}/renew`, { id }),
// 获取 DNS 记录
manualDNS: (id: number): any => http.Post(`/cert/cert/${id}/manualDNS`, { id }),
manualDNS: (id: number): any => http.Post(`/cert/cert/${id}/manual_dns`, { id }),
// 部署
deploy: (id: number, website_id: number): any =>
http.Post(`/cert/cert/${id}/deploy`, { id, website_id })

View File

@@ -4,20 +4,20 @@ export default {
// 面板信息
panel: (): any => http.Get('/dashboard/panel'),
// 首页应用
homeApps: (): any => http.Get('/dashboard/homeApps'),
homeApps: (): any => http.Get('/dashboard/home_apps'),
// 实时信息
current: (nets: string[], disks: string[]): any =>
http.Post('/dashboard/current', { nets, disks }, { meta: { noAlert: true } }),
// 系统信息
systemInfo: (): any => http.Get('/dashboard/systemInfo'),
systemInfo: (): any => http.Get('/dashboard/system_info'),
// 统计信息
countInfo: (): any => http.Get('/dashboard/countInfo'),
countInfo: (): any => http.Get('/dashboard/count_info'),
// 已安装的数据库和PHP
installedDbAndPhp: (): any => http.Get('/dashboard/installedDbAndPhp'),
installedDbAndPhp: (): any => http.Get('/dashboard/installed_db_and_php'),
// 检查更新
checkUpdate: (): any => http.Get('/dashboard/checkUpdate'),
checkUpdate: (): any => http.Get('/dashboard/check_update'),
// 更新日志
updateInfo: (): any => http.Get('/dashboard/updateInfo'),
updateInfo: (): any => http.Get('/dashboard/update_info'),
// 更新面板
update: (): any => http.Post('/dashboard/update'),
// 重启面板

View File

@@ -12,30 +12,30 @@ export default {
http.Post(`/database/comment`, { server_id, name, comment }),
// 获取数据库服务器列表
serverList: (page: number, limit: number) =>
http.Get('/databaseServer', { params: { page, limit } }),
http.Get('/database_server', { params: { page, limit } }),
// 创建数据库服务器
serverCreate: (data: any) => http.Post('/databaseServer', data),
serverCreate: (data: any) => http.Post('/database_server', data),
// 获取数据库服务器
serverGet: (id: number) => http.Get(`/databaseServer/${id}`),
serverGet: (id: number) => http.Get(`/database_server/${id}`),
// 更新数据库服务器
serverUpdate: (id: number, data: any) => http.Put(`/databaseServer/${id}`, data),
serverUpdate: (id: number, data: any) => http.Put(`/database_server/${id}`, data),
// 删除数据库服务器
serverDelete: (id: number) => http.Delete(`/databaseServer/${id}`),
serverDelete: (id: number) => http.Delete(`/database_server/${id}`),
// 同步数据库
serverSync: (id: number) => http.Post(`/databaseServer/${id}/sync`),
serverSync: (id: number) => http.Post(`/database_server/${id}/sync`),
// 更新服务器备注
serverRemark: (id: number, remark: string) =>
http.Put(`/databaseServer/${id}/remark`, { remark }),
http.Put(`/database_server/${id}/remark`, { remark }),
// 获取数据库用户列表
userList: (page: number, limit: number) => http.Get('/databaseUser', { params: { page, limit } }),
userList: (page: number, limit: number) => http.Get('/database_user', { params: { page, limit } }),
// 创建数据库用户
userCreate: (data: any) => http.Post('/databaseUser', data),
userCreate: (data: any) => http.Post('/database_user', data),
// 获取数据库用户
userGet: (id: number) => http.Get(`/databaseUser/${id}`),
userGet: (id: number) => http.Get(`/database_user/${id}`),
// 更新数据库用户
userUpdate: (id: number, data: any) => http.Put(`/databaseUser/${id}`, data),
userUpdate: (id: number, data: any) => http.Put(`/database_user/${id}`, data),
// 删除数据库用户
userDelete: (id: number) => http.Delete(`/databaseUser/${id}`),
userDelete: (id: number) => http.Delete(`/database_user/${id}`),
// 更新用户备注
userRemark: (id: number, remark: string) => http.Put(`/databaseUser/${id}/remark`, { remark })
userRemark: (id: number, remark: string) => http.Put(`/database_user/${id}/remark`, { remark })
}

View File

@@ -19,7 +19,7 @@ export default {
copy: (paths: any[]): any => http.Post('/file/copy', paths),
// 远程下载
remoteDownload: (path: string, url: string): any =>
http.Post('/file/remoteDownload', { path, url }),
http.Post('/file/remote_download', { path, url }),
// 获取文件信息
info: (path: string): any => http.Get('/file/info', { params: { path } }),
// 修改文件权限
@@ -29,7 +29,7 @@ export default {
compress: (dir: string, paths: string[], file: string): any =>
http.Post('/file/compress', { dir, paths, file }),
// 解压文件
unCompress: (file: string, path: string): any => http.Post('/file/unCompress', { file, path }),
unCompress: (file: string, path: string): any => http.Post('/file/un_compress', { file, path }),
// 搜索文件
search: (path: string, keyword: string, sub: boolean, page: number, limit: number): any =>
http.Get('/file/search', { params: { path, keyword, sub, page, limit } }),

View File

@@ -14,11 +14,11 @@ export default {
deleteRule: (rule: any): any => http.Delete('/firewall/rule', rule),
// 获取防火墙IP规则
ipRules: (page: number, limit: number): any =>
http.Get('/firewall/ipRule', { params: { page, limit } }),
http.Get('/firewall/ip_rule', { params: { page, limit } }),
// 创建防火墙IP规则
createIpRule: (rule: any): any => http.Post('/firewall/ipRule', rule),
createIpRule: (rule: any): any => http.Post('/firewall/ip_rule', rule),
// 删除防火墙IP规则
deleteIpRule: (rule: any): any => http.Delete('/firewall/ipRule', rule),
deleteIpRule: (rule: any): any => http.Delete('/firewall/ip_rule', rule),
// 获取防火墙转发规则
forwards: (page: number, limit: number): any =>
http.Get('/firewall/forward', { params: { page, limit } }),

View File

@@ -4,7 +4,7 @@ export default {
// 服务状态
status: (service: string): any => http.Get('/systemctl/status', { params: { service } }),
// 是否启用服务
isEnabled: (service: string): any => http.Get('/systemctl/isEnabled', { params: { service } }),
isEnabled: (service: string): any => http.Get('/systemctl/is_enabled', { params: { service } }),
// 启用服务
enable: (service: string): any => http.Post('/systemctl/enable', { service }),
// 禁用服务

View File

@@ -13,7 +13,7 @@ export default {
// 登出
logout: () => http.Post('/user/logout'),
// 是否登录
isLogin: () => http.Get('/user/isLogin'),
isLogin: () => http.Get('/user/is_login'),
// 获取用户信息
info: () => http.Get('/user/info')
}

View File

@@ -11,10 +11,10 @@ export default {
// 伪静态
rewrites: (): any => http.Get(`/website/rewrites`),
// 获取默认配置
defaultConfig: (): any => http.Get('/website/defaultConfig'),
defaultConfig: (): any => http.Get('/website/default_config'),
// 保存默认配置
saveDefaultConfig: (index: string, stop: string): any =>
http.Post('/website/defaultConfig', { index, stop }),
http.Post('/website/default_config', { index, stop }),
// 网站配置
config: (id: number): any => http.Get('/website/' + id),
// 保存网站配置
@@ -23,11 +23,11 @@ export default {
clearLog: (id: number): any => http.Delete('/website/' + id + '/log'),
// 更新备注
updateRemark: (id: number, remark: string): any =>
http.Post(`/website/${id}` + '/updateRemark', { remark }),
http.Post(`/website/${id}` + '/update_remark', { remark }),
// 重置配置
resetConfig: (id: number): any => http.Post(`/website/${id}/resetConfig`),
resetConfig: (id: number): any => http.Post(`/website/${id}/reset_config`),
// 修改状态
status: (id: number, status: boolean): any => http.Post(`/website/${id}/status`, { status }),
// 签发证书
obtainCert: (id: number): any => http.Post(`/website/${id}/obtainCert`)
obtainCert: (id: number): any => http.Post(`/website/${id}/obtain_cert`)
}