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

159 lines
4.7 KiB
Go
Raw Normal View History

2022-10-28 17:04:57 +08:00
import http from '@/api';
import { ReqPage, ResPage } from '../interface';
2022-10-28 17:04:57 +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-11-02 15:19:14 +08:00
export const SearchWebSites = (req: WebSite.WebSiteSearch) => {
return http.post<ResPage<WebSite.WebSite>>(`/websites/search`, req);
};
2022-10-28 17:04:57 +08:00
export const CreateWebsite = (req: WebSite.WebSiteCreateReq) => {
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-11-30 10:34:44 +08:00
export const RecoverWebsite = (req: WebSite.WebSiteRecover) => {
return http.post(`/websites/recover`, req);
};
export const RecoverWebsiteByUpload = (req: WebSite.WebsiteRecoverByUpload) => {
return http.post(`/websites/recover/byupload`, req);
};
2022-11-29 17:39:10 +08:00
2022-11-08 17:21:13 +08:00
export const UpdateWebsite = (req: WebSite.WebSiteUpdateReq) => {
return http.post<any>(`/websites/update`, req);
};
export const GetWebsite = (id: number) => {
2022-11-16 10:31:35 +08:00
return http.get<WebSite.WebSiteDTO>(`/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-11-02 15:19:14 +08:00
export const DeleteWebsite = (req: WebSite.WebSiteDel) => {
return http.post<any>(`/websites/del`, req);
};
2022-11-02 18:18:20 +08:00
export const ListGroups = () => {
return http.get<WebSite.Group[]>(`/websites/groups`);
};
export const CreateGroup = (req: WebSite.GroupOp) => {
return http.post<any>(`/websites/groups`, req);
};
export const UpdateGroup = (req: WebSite.GroupOp) => {
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) => {
return http.get<WebSite.Domain[]>(`/websites/domains/${id}`);
};
export const DeleteDomain = (id: number) => {
return http.delete<any>(`/websites/domains/${id}`);
};
2022-11-03 18:02:07 +08:00
export const CreateDomain = (req: WebSite.DomainCreate) => {
return http.post<any>(`/websites/domains`, req);
};
2022-11-07 16:19:05 +08:00
export const GetNginxConfig = (req: WebSite.NginxConfigReq) => {
2022-12-01 00:41:50 +08:00
return http.post<WebSite.NginxScopeConfig>(`/websites/config`, req);
2022-11-07 16:19:05 +08:00
};
export const UpdateNginxConfig = (req: WebSite.NginxConfigReq) => {
return http.post<any>(`/websites/config/update`, req);
};
export const SearchDnsAccount = (req: ReqPage) => {
2022-11-16 10:31:35 +08:00
return http.post<ResPage<WebSite.DnsAccount>>(`/websites/dns/search`, req);
};
export const CreateDnsAccount = (req: WebSite.DnsAccountCreate) => {
2022-11-16 10:31:35 +08:00
return http.post<any>(`/websites/dns`, req);
};
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) => {
return http.post<ResPage<WebSite.AcmeAccount>>(`/websites/acme/search`, req);
};
export const CreateAcmeAccount = (req: WebSite.AcmeAccountCreate) => {
return http.post<WebSite.AcmeAccount>(`/websites/acme`, req);
};
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) => {
return http.post<ResPage<WebSite.SSL>>(`/websites/ssl/search`, req);
};
2022-11-20 18:32:56 +08:00
export const ListSSL = (req: WebSite.SSLReq) => {
return http.post<WebSite.SSL[]>(`/websites/ssl/search`, req);
};
2022-11-16 10:31:35 +08:00
export const CreateSSL = (req: WebSite.SSLCreate) => {
return http.post<WebSite.SSLCreate>(`/websites/ssl`, req);
};
export const DeleteSSL = (id: number) => {
return http.delete<any>(`/websites/ssl/${id}`);
};
export const GetWebsiteSSL = (websiteId: number) => {
return http.get<WebSite.SSL>(`/websites/ssl/${websiteId}`);
};
2022-11-16 10:31:35 +08:00
export const ApplySSL = (req: WebSite.SSLApply) => {
return http.post<WebSite.SSLApply>(`/websites/ssl/apply`, req);
};
export const RenewSSL = (req: WebSite.SSLRenew) => {
return http.post<any>(`/websites/ssl/renew`, req);
};
2022-11-16 10:31:35 +08:00
export const GetDnsResolve = (req: WebSite.DNSResolveReq) => {
2022-11-25 00:08:44 +08:00
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) => {
return http.get<WebSite.HTTPSConfig>(`/websites/${id}/https`);
};
export const UpdateHTTPSConfig = (req: WebSite.HTTPSReq) => {
return http.post<WebSite.HTTPSConfig>(`/websites/${req.websiteId}/https`, req);
};
2022-12-04 17:45:54 +08:00
export const PreCheck = (req: WebSite.CheckReq) => {
return http.post<WebSite.CheckRes[]>(`/websites/check`, req);
};
2022-12-06 11:42:11 +08:00
export const GetWafConfig = (req: WebSite.WafReq) => {
return http.post<WebSite.WafRes>(`/websites/waf/config`, req);
};
export const UpdateWafEnable = (req: WebSite.WafUpdate) => {
return http.post<any>(`/websites/waf/update`, req);
};