mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-06 13:27:43 +08:00
fix: Fix the issue with AI proxy certificate res error (#7983)
Some checks failed
SonarCloud Scan / SonarCloud (push) Failing after -8s
Some checks failed
SonarCloud Scan / SonarCloud (push) Failing after -8s
This commit is contained in:
parent
6c8d48c2dc
commit
1c052b7c13
4 changed files with 10 additions and 8 deletions
|
@ -36,9 +36,10 @@ type OllamaBindDomainReq struct {
|
|||
}
|
||||
|
||||
type OllamaBindDomainRes struct {
|
||||
Domain string `json:"domain"`
|
||||
SSLID uint `json:"sslID"`
|
||||
AllowIPs []string `json:"allowIPs"`
|
||||
WebsiteID uint `json:"websiteID"`
|
||||
ConnUrl string `json:"connUrl"`
|
||||
Domain string `json:"domain"`
|
||||
SSLID uint `json:"sslID"`
|
||||
AcmeAccountID uint `json:"acmeAccountID"`
|
||||
AllowIPs []string `json:"allowIPs"`
|
||||
WebsiteID uint `json:"websiteID"`
|
||||
ConnUrl string `json:"connUrl"`
|
||||
}
|
||||
|
|
|
@ -297,6 +297,8 @@ func (u *AIToolService) GetBindDomain(req dto.OllamaBindDomainReq) (*dto.OllamaB
|
|||
res.Domain = website.PrimaryDomain
|
||||
if website.WebsiteSSLID > 0 {
|
||||
res.SSLID = website.WebsiteSSLID
|
||||
ssl, _ := websiteSSLRepo.GetFirst(commonRepo.WithByID(website.WebsiteSSLID))
|
||||
res.AcmeAccountID = ssl.AcmeAccountID
|
||||
}
|
||||
res.ConnUrl = fmt.Sprintf("%s://%s", strings.ToLower(website.Protocol), website.PrimaryDomain)
|
||||
res.AllowIPs = GetAllowIps(website)
|
||||
|
|
|
@ -104,6 +104,7 @@ export namespace AI {
|
|||
export interface BindDomainRes {
|
||||
domain: string;
|
||||
sslID: number;
|
||||
acmeAccountID: number;
|
||||
allowIPs: string[];
|
||||
websiteID?: number;
|
||||
connUrl: string;
|
||||
|
|
|
@ -202,9 +202,6 @@ const listSSL = () => {
|
|||
const listAcmeAccount = () => {
|
||||
SearchAcmeAccount({ page: 1, pageSize: 100 }).then((res) => {
|
||||
acmeAccounts.value = res.data.items || [];
|
||||
if (acmeAccounts.value.length > 0) {
|
||||
req.value.acmeAccountID = acmeAccounts.value[0].id;
|
||||
}
|
||||
listSSL();
|
||||
});
|
||||
};
|
||||
|
@ -238,6 +235,7 @@ const search = async (appInstallID: number) => {
|
|||
if (res.data.sslID > 0) {
|
||||
req.value.enableSSL = true;
|
||||
req.value.sslID = res.data.sslID;
|
||||
req.value.acmeAccountID = res.data.acmeAccountID;
|
||||
listAcmeAccount();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue