-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
186 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import { request } from '@/utils' | ||
import { http } from '@/utils' | ||
|
||
export default { | ||
// 获取备份列表 | ||
list: (type: string, page: number, limit: number): any => | ||
request.get(`/backup/${type}`, { params: { page, limit } }), | ||
http.Get(`/backup/${type}`, { params: { page, limit } }), | ||
// 创建备份 | ||
create: (type: string, target: string, path: string): any => | ||
request.post(`/backup/${type}`, { target, path }), | ||
http.Post(`/backup/${type}`, { target, path }), | ||
// 上传备份 | ||
upload: (type: string, formData: FormData): any => { | ||
return request.post(`/backup/${type}/upload`, formData, { | ||
return http.Post(`/backup/${type}/upload`, formData, { | ||
headers: { 'Content-Type': 'multipart/form-data' } | ||
}) | ||
}, | ||
// 删除备份 | ||
delete: (type: string, file: string): any => | ||
request.delete(`/backup/${type}/delete`, { data: { file } }), | ||
http.Delete(`/backup/${type}/delete`, { data: { file } }), | ||
// 恢复备份 | ||
restore: (type: string, file: string, target: string): any => | ||
request.post(`/backup/${type}/restore`, { file, target }) | ||
http.Post(`/backup/${type}/restore`, { file, target }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,25 @@ | ||
import { http, request } from '@/utils' | ||
|
||
import type { RequestConfig } from '~/types/axios' | ||
import { http } from '@/utils' | ||
|
||
export default { | ||
// 面板信息 | ||
panel: (): Promise<Response> => fetch('/api/dashboard/panel'), | ||
// 面板菜单 | ||
menu: (): any => request.get('/dashboard/menu'), | ||
panel: (): any => http.Get('/dashboard/panel'), | ||
// 首页应用 | ||
homeApps: (): any => request.get('/dashboard/homeApps'), | ||
homeApps: (): any => http.Get('/dashboard/homeApps'), | ||
// 实时信息 | ||
current: (nets: string[], disks: string[]): any => | ||
request.post('/dashboard/current', { nets, disks }, { noNeedTip: true } as RequestConfig), | ||
http.Post('/dashboard/current', { nets, disks }, { meta: { noAlert: true } }), | ||
// 系统信息 | ||
systemInfo: (): any => request.get('/dashboard/systemInfo'), | ||
systemInfo: (): any => http.Get('/dashboard/systemInfo'), | ||
// 统计信息 | ||
countInfo: (): any => request.get('/dashboard/countInfo'), | ||
countInfo: (): any => http.Get('/dashboard/countInfo'), | ||
// 已安装的数据库和PHP | ||
installedDbAndPhp: (): any => request.get('/dashboard/installedDbAndPhp'), | ||
installedDbAndPhp: (): any => http.Get('/dashboard/installedDbAndPhp'), | ||
// 检查更新 | ||
checkUpdate: (): any => request.get('/dashboard/checkUpdate'), | ||
checkUpdate: (): any => http.Get('/dashboard/checkUpdate'), | ||
// 更新日志 | ||
updateInfo: (): any => request.get('/dashboard/updateInfo'), | ||
updateInfo: (): any => http.Get('/dashboard/updateInfo'), | ||
// 更新面板 | ||
update: (): any => request.post('/dashboard/update', null), | ||
update: (): any => http.Post('/dashboard/update'), | ||
// 重启面板 | ||
restart: (): any => request.post('/dashboard/restart') | ||
restart: (): any => http.Post('/dashboard/restart') | ||
} | ||
|
||
export const panel = () => http.Get('/dashboard/panel') | ||
export const current = (nets: string[], disks: string[]) => | ||
http.Post('/dashboard/current', { nets, disks }, { meta: { noAlert: true } }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import { request } from '@/utils' | ||
import { http } from '@/utils' | ||
|
||
export default { | ||
// 开关 | ||
setting: (): any => request.get('/monitor/setting'), | ||
setting: (): any => http.Get('/monitor/setting'), | ||
// 保存天数 | ||
updateSetting: (enabled: boolean, days: number): any => | ||
request.post('/monitor/setting', { enabled, days }), | ||
http.Post('/monitor/setting', { enabled, days }), | ||
// 清空监控记录 | ||
clear: (): any => request.post('/monitor/clear'), | ||
clear: (): any => http.Post('/monitor/clear'), | ||
// 监控记录 | ||
list: (start: number, end: number): any => | ||
request.get('/monitor/list', { params: { start, end } }) | ||
list: (start: number, end: number): any => http.Get('/monitor/list', { params: { start, end } }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.