1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-03-04 04:54:16 +08:00

161 lines
4.8 KiB
Go
Raw Normal View History

2022-10-28 17:04:57 +08:00
import http from '@/api';
import { ReqPage, ResPage } from '../interface';
2022-12-13 17:20:13 +08:00
import { Website } from '../interface/Website';
2022-11-19 17:16:02 +08:00
import { File } from '../interface/file';
2022-10-28 17:04:57 +08:00
2022-12-13 17:20:13 +08:00
export const SearchWebsites = (req: Website.WebSiteSearch) => {
return http.post<ResPage<Website.Website>>(`/websites/search`, req);
2022-11-02 15:19:14 +08:00
};
2022-12-13 17:20:13 +08:00
export const CreateWebsite = (req: Website.WebSiteCreateReq) => {
2022-10-28 17:04:57 +08:00
return http.post<any>(`/websites`, req);
};
2022-11-02 15:19:14 +08:00
2022-11-29 17:39:10 +08:00
export const BackupWebsite = (id: number) => {
return http.post(`/websites/backup/${id}`);
};
2022-12-13 17:20:13 +08:00
export const RecoverWebsite = (req: Website.WebSiteRecover) => {
2022-11-30 10:34:44 +08:00
return http.post(`/websites/recover`, req);
};
2022-12-13 17:20:13 +08:00
export const RecoverWebsiteByUpload = (req: Website.WebsiteRecoverByUpload) => {
return http.post(`/websites/recover/byupload`, req);
};
2022-11-29 17:39:10 +08:00
2022-12-13 17:20:13 +08:00
export const UpdateWebsite = (req: Website.WebSiteUpdateReq) => {
2022-11-08 17:21:13 +08:00
return http.post<any>(`/websites/update`, req);
};
export const GetWebsite = (id: number) => {
2022-12-13 17:20:13 +08:00
return http.get<Website.Website>(`/websites/${id}`);
2022-11-08 17:21:13 +08:00
};
export const GetWebsiteOptions = () => {
return http.get<Array<string>>(`/websites/options`);
};
2022-11-19 17:16:02 +08:00
export const GetWebsiteNginx = (id: number) => {
return http.get<File.File>(`/websites/${id}/nginx`);
};
2022-12-13 17:20:13 +08:00
export const DeleteWebsite = (req: Website.WebSiteDel) => {
2022-11-02 15:19:14 +08:00
return http.post<any>(`/websites/del`, req);
};
2022-11-02 18:18:20 +08:00
export const ListGroups = () => {
2022-12-13 17:20:13 +08:00
return http.get<Website.Group[]>(`/websites/groups`);
2022-11-02 18:18:20 +08:00
};
2022-12-13 17:20:13 +08:00
export const CreateGroup = (req: Website.GroupOp) => {
2022-11-02 18:18:20 +08:00
return http.post<any>(`/websites/groups`, req);
};
2022-12-13 17:20:13 +08:00
export const UpdateGroup = (req: Website.GroupOp) => {
2022-11-02 18:18:20 +08:00
return http.put<any>(`/websites/groups`, req);
};
export const DeleteGroup = (id: number) => {
return http.delete<any>(`/websites/groups/${id}`);
};
2022-11-03 17:06:48 +08:00
export const ListDomains = (id: number) => {
2022-12-13 17:20:13 +08:00
return http.get<Website.Domain[]>(`/websites/domains/${id}`);
2022-11-03 17:06:48 +08:00
};
2022-12-13 17:20:13 +08:00
export const DeleteDomain = (req: Website.DomainDelete) => {
return http.post<any>(`/websites/domains/del/`, req);
2022-11-03 17:06:48 +08:00
};
2022-11-03 18:02:07 +08:00
2022-12-13 17:20:13 +08:00
export const CreateDomain = (req: Website.DomainCreate) => {
2022-11-03 18:02:07 +08:00
return http.post<any>(`/websites/domains`, req);
};
2022-11-07 16:19:05 +08:00
2022-12-13 17:20:13 +08:00
export const GetNginxConfig = (req: Website.NginxConfigReq) => {
return http.post<Website.NginxScopeConfig>(`/websites/config`, req);
2022-11-07 16:19:05 +08:00
};
2022-12-13 17:20:13 +08:00
export const UpdateNginxConfig = (req: Website.NginxConfigReq) => {
2022-11-07 16:19:05 +08:00
return http.post<any>(`/websites/config/update`, req);
};
export const SearchDnsAccount = (req: ReqPage) => {
2022-12-13 17:20:13 +08:00
return http.post<ResPage<Website.DnsAccount>>(`/websites/dns/search`, req);
};
2022-12-13 17:20:13 +08:00
export const CreateDnsAccount = (req: Website.DnsAccountCreate) => {
2022-11-16 10:31:35 +08:00
return http.post<any>(`/websites/dns`, req);
};
2022-12-13 17:20:13 +08:00
export const UpdateDnsAccount = (req: Website.DnsAccountUpdate) => {
return http.post<any>(`/websites/dns/update`, req);
};
export const DeleteDnsAccount = (id: number) => {
return http.delete<any>(`/websites/dns/${id}`);
};
2022-11-11 17:41:39 +08:00
export const SearchAcmeAccount = (req: ReqPage) => {
2022-12-13 17:20:13 +08:00
return http.post<ResPage<Website.AcmeAccount>>(`/websites/acme/search`, req);
2022-11-11 17:41:39 +08:00
};
2022-12-13 17:20:13 +08:00
export const CreateAcmeAccount = (req: Website.AcmeAccountCreate) => {
return http.post<Website.AcmeAccount>(`/websites/acme`, req);
2022-11-11 17:41:39 +08:00
};
export const DeleteAcmeAccount = (id: number) => {
return http.delete<any>(`/websites/acme/${id}`);
};
2022-11-16 10:31:35 +08:00
export const SearchSSL = (req: ReqPage) => {
2022-12-13 17:20:13 +08:00
return http.post<ResPage<Website.SSL>>(`/websites/ssl/search`, req);
2022-11-16 10:31:35 +08:00
};
2022-12-13 17:20:13 +08:00
export const ListSSL = (req: Website.SSLReq) => {
return http.post<Website.SSL[]>(`/websites/ssl/search`, req);
2022-11-20 18:32:56 +08:00
};
2022-12-13 17:20:13 +08:00
export const CreateSSL = (req: Website.SSLCreate) => {
return http.post<Website.SSLCreate>(`/websites/ssl`, req);
2022-11-16 10:31:35 +08:00
};
export const DeleteSSL = (id: number) => {
return http.delete<any>(`/websites/ssl/${id}`);
};
export const GetWebsiteSSL = (websiteId: number) => {
2022-12-13 17:20:13 +08:00
return http.get<Website.SSL>(`/websites/ssl/${websiteId}`);
};
2022-12-13 17:20:13 +08:00
export const ApplySSL = (req: Website.SSLApply) => {
return http.post<Website.SSLApply>(`/websites/ssl/apply`, req);
2022-11-16 10:31:35 +08:00
};
2022-12-13 17:20:13 +08:00
export const RenewSSL = (req: Website.SSLRenew) => {
return http.post<any>(`/websites/ssl/renew`, req);
};
2022-12-13 17:20:13 +08:00
export const GetDnsResolve = (req: Website.DNSResolveReq) => {
return http.post<Website.DNSResolve[]>(`/websites/ssl/resolve`, req);
2022-11-16 10:31:35 +08:00
};
2022-11-20 18:32:56 +08:00
export const GetHTTPSConfig = (id: number) => {
2022-12-13 17:20:13 +08:00
return http.get<Website.HTTPSConfig>(`/websites/${id}/https`);
2022-11-20 18:32:56 +08:00
};
2022-12-13 17:20:13 +08:00
export const UpdateHTTPSConfig = (req: Website.HTTPSReq) => {
return http.post<Website.HTTPSConfig>(`/websites/${req.websiteId}/https`, req);
2022-11-20 18:32:56 +08:00
};
2022-12-04 17:45:54 +08:00
2022-12-13 17:20:13 +08:00
export const PreCheck = (req: Website.CheckReq) => {
return http.post<Website.CheckRes[]>(`/websites/check`, req);
2022-12-04 17:45:54 +08:00
};
2022-12-06 11:42:11 +08:00
2022-12-13 17:20:13 +08:00
export const GetWafConfig = (req: Website.WafReq) => {
return http.post<Website.WafRes>(`/websites/waf/config`, req);
2022-12-06 11:42:11 +08:00
};
2022-12-13 17:20:13 +08:00
export const UpdateWafEnable = (req: Website.WafUpdate) => {
2022-12-06 11:42:11 +08:00
return http.post<any>(`/websites/waf/update`, req);
};