2022-11-23 16:19:05 +08:00
|
|
|
import http from '@/api';
|
|
|
|
import { File } from '../interface/file';
|
2022-11-24 10:28:39 +08:00
|
|
|
import { Nginx } from '../interface/nginx';
|
2022-11-23 16:19:05 +08:00
|
|
|
|
|
|
|
export const GetNginx = () => {
|
2023-02-22 17:13:08 +08:00
|
|
|
return http.get<File.File>(`/openresty`);
|
2022-11-23 16:19:05 +08:00
|
|
|
};
|
2022-11-24 10:28:39 +08:00
|
|
|
|
|
|
|
export const GetNginxConfigByScope = (req: Nginx.NginxScopeReq) => {
|
2023-02-22 17:13:08 +08:00
|
|
|
return http.post<Nginx.NginxParam[]>(`/openresty/scope`, req);
|
2022-11-24 10:28:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
export const UpdateNginxConfigByScope = (req: Nginx.NginxConfigReq) => {
|
2023-02-22 17:13:08 +08:00
|
|
|
return http.post<any>(`/openresty/update`, req);
|
2022-11-24 10:28:39 +08:00
|
|
|
};
|
2022-11-24 16:06:18 +08:00
|
|
|
|
|
|
|
export const GetNginxStatus = () => {
|
2023-02-22 17:13:08 +08:00
|
|
|
return http.get<Nginx.NginxStatus>(`/openresty/status`);
|
2022-11-24 16:06:18 +08:00
|
|
|
};
|
2022-12-09 17:16:07 +08:00
|
|
|
|
|
|
|
export const UpdateNginxConfigFile = (req: Nginx.NginxFileUpdate) => {
|
2023-02-22 17:13:08 +08:00
|
|
|
return http.post<any>(`/openresty/file`, req);
|
2022-12-09 17:16:07 +08:00
|
|
|
};
|