diff --git a/agent/app/dto/request/website_ssl.go b/agent/app/dto/request/website_ssl.go index 6f9b53b25..f83f8e207 100644 --- a/agent/app/dto/request/website_ssl.go +++ b/agent/app/dto/request/website_ssl.go @@ -5,6 +5,7 @@ import "github.com/1Panel-dev/1Panel/agent/app/dto" type WebsiteSSLSearch struct { dto.PageInfo AcmeAccountID string `json:"acmeAccountID"` + Domain string `json:"domain"` } type WebsiteSSLCreate struct { diff --git a/agent/app/repo/website_ssl.go b/agent/app/repo/website_ssl.go index 8d98fef58..fbb4e3ebd 100644 --- a/agent/app/repo/website_ssl.go +++ b/agent/app/repo/website_ssl.go @@ -16,6 +16,7 @@ type ISSLRepo interface { WithByAcmeAccountId(acmeAccountId uint) DBOption WithByDnsAccountId(dnsAccountId uint) DBOption WithByCAID(caID uint) DBOption + WithByDomain(domain string) DBOption Page(page, size int, opts ...DBOption) (int64, []model.WebsiteSSL, error) GetFirst(opts ...DBOption) (*model.WebsiteSSL, error) List(opts ...DBOption) ([]model.WebsiteSSL, error) @@ -51,6 +52,11 @@ func (w WebsiteSSLRepo) WithByCAID(caID uint) DBOption { return db.Where("ca_id = ?", caID) } } +func (w WebsiteSSLRepo) WithByDomain(domain string) DBOption { + return func(db *gorm.DB) *gorm.DB { + return db.Where("primary_domain Like ? or domains Like ?", "%"+domain+"%", "%"+domain+"%") + } +} func (w WebsiteSSLRepo) Page(page, size int, opts ...DBOption) (int64, []model.WebsiteSSL, error) { var sslList []model.WebsiteSSL diff --git a/agent/app/service/app.go b/agent/app/service/app.go index b43da0607..07b3c249f 100644 --- a/agent/app/service/app.go +++ b/agent/app/service/app.go @@ -935,7 +935,7 @@ func (a AppService) SyncAppListFromRemote(taskID string) (err error) { t.Log(i18n.GetMsgByKey("AppStoreIsSyncing")) return nil } - t.Log(i18n.GetMsgByKey("AppStoreIsLastVersion")) + t.Log(i18n.GetMsgByKey("AppStoreIsUpToDate")) return nil } list := &dto.AppList{} diff --git a/agent/app/service/website_ssl.go b/agent/app/service/website_ssl.go index 05726f60c..11f9e3cc8 100644 --- a/agent/app/service/website_ssl.go +++ b/agent/app/service/website_ssl.go @@ -56,8 +56,13 @@ func NewIWebsiteSSLService() IWebsiteSSLService { func (w WebsiteSSLService) Page(search request.WebsiteSSLSearch) (int64, []response.WebsiteSSLDTO, error) { var ( result []response.WebsiteSSLDTO + opts []repo.DBOption ) - total, sslList, err := websiteSSLRepo.Page(search.Page, search.PageSize, repo.WithOrderBy("created_at desc")) + opts = append(opts, repo.WithOrderBy("created_at desc")) + if search.Domain != "" { + opts = append(opts, websiteSSLRepo.WithByDomain(search.Domain)) + } + total, sslList, err := websiteSSLRepo.Page(search.Page, search.PageSize, opts...) if err != nil { return 0, nil, err } diff --git a/agent/i18n/lang/zh.yaml b/agent/i18n/lang/zh.yaml index c969dd91c..46ba56905 100644 --- a/agent/i18n/lang/zh.yaml +++ b/agent/i18n/lang/zh.yaml @@ -82,7 +82,6 @@ PullImageStart: "开始拉取镜像 {{ .name }}" PullImageSuccess: "镜像拉取成功" UpgradeAppStart: "开始升级应用 {{ .name }}" UpgradeAppSuccess: "应用 {{ .name }} 升级成功" -AppStoreIsLastVersion: "应用商店已经是最新版本" AppStoreSyncSuccess: "应用商店同步成功" SyncAppDetail: "同步应用配置" AppVersionNotMatch: "{{ .name }} 应用需要更高的 1Panel 版本,跳过同步" diff --git a/frontend/src/views/website/ssl/index.vue b/frontend/src/views/website/ssl/index.vue index f03f54476..024c61885 100644 --- a/frontend/src/views/website/ssl/index.vue +++ b/frontend/src/views/website/ssl/index.vue @@ -23,7 +23,15 @@ - +