diff --git a/backend/app/api/v1/file.go b/backend/app/api/v1/file.go index dac795cd3..db617d121 100644 --- a/backend/app/api/v1/file.go +++ b/backend/app/api/v1/file.go @@ -449,7 +449,7 @@ func (b *BaseApi) Download(c *gin.Context) { // @Summary Download file with path // @Description 下载指定文件 // @Accept json -// @Param request body request.FilePath true "request" +// @Param request body dto.FilePath true "request" // @Success 200 // @Security ApiKeyAuth // @Router /files/download/bypath [post] diff --git a/backend/app/api/v1/website_ssl.go b/backend/app/api/v1/website_ssl.go index dde6e9a9b..ca8f4e4b8 100644 --- a/backend/app/api/v1/website_ssl.go +++ b/backend/app/api/v1/website_ssl.go @@ -176,3 +176,25 @@ func (b *BaseApi) GetWebsiteSSLById(c *gin.Context) { } helper.SuccessWithData(c, websiteSSL) } + +// @Tags Website SSL +// @Summary Update ssl +// @Description 更新 ssl +// @Accept json +// @Param request body request.WebsiteSSLUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/ssl/update [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"website_ssls","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"更新证书设置 [domain]","formatEN":"Update ssl config [domain]"} +func (b *BaseApi) UpdateWebsiteSSL(c *gin.Context) { + var req request.WebsiteSSLUpdate + if err := c.ShouldBindJSON(&req); err != nil { + helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) + return + } + if err := websiteSSLService.Update(req); err != nil { + helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) + return + } + helper.SuccessWithData(c, nil) +} diff --git a/backend/app/dto/request/website_ssl.go b/backend/app/dto/request/website_ssl.go index f4d125104..b385006ca 100644 --- a/backend/app/dto/request/website_ssl.go +++ b/backend/app/dto/request/website_ssl.go @@ -44,3 +44,8 @@ type WebsiteDnsAccountUpdate struct { type WebsiteResourceReq struct { ID uint `json:"id" validate:"required"` } + +type WebsiteSSLUpdate struct { + ID uint `json:"id" validate:"required"` + AutoRenew bool `json:"autoRenew" validate:"required"` +} diff --git a/backend/app/service/website_ssl.go b/backend/app/service/website_ssl.go index 576d5c5d9..f8acef662 100644 --- a/backend/app/service/website_ssl.go +++ b/backend/app/service/website_ssl.go @@ -27,6 +27,7 @@ type IWebsiteSSLService interface { GetDNSResolve(req request.WebsiteDNSReq) ([]response.WebsiteDNSRes, error) GetWebsiteSSL(websiteId uint) (response.WebsiteSSLDTO, error) Delete(id uint) error + Update(update request.WebsiteSSLUpdate) error } func NewIWebsiteSSLService() IWebsiteSSLService { @@ -132,6 +133,7 @@ func (w WebsiteSSLService) Create(create request.WebsiteSSLCreate) (request.Webs websiteSSL.StartDate = cert.NotBefore websiteSSL.Type = cert.Issuer.CommonName websiteSSL.Organization = cert.Issuer.Organization[0] + websiteSSL.AutoRenew = create.AutoRenew if err := websiteSSLRepo.Create(context.TODO(), &websiteSSL); err != nil { return res, err @@ -258,3 +260,12 @@ func (w WebsiteSSLService) Delete(id uint) error { } return websiteSSLRepo.DeleteBy(commonRepo.WithByID(id)) } + +func (w WebsiteSSLService) Update(update request.WebsiteSSLUpdate) error { + websiteSSL, err := websiteSSLRepo.GetFirst(commonRepo.WithByID(update.ID)) + if err != nil { + return err + } + websiteSSL.AutoRenew = update.AutoRenew + return websiteSSLRepo.Save(websiteSSL) +} diff --git a/backend/router/ro_website_ssl.go b/backend/router/ro_website_ssl.go index a70701212..82e8a21ed 100644 --- a/backend/router/ro_website_ssl.go +++ b/backend/router/ro_website_ssl.go @@ -22,5 +22,6 @@ func (a *WebsiteSSLRouter) InitWebsiteSSLRouter(Router *gin.RouterGroup) { groupRouter.POST("/del", baseApi.DeleteWebsiteSSL) groupRouter.GET("/website/:websiteId", baseApi.GetWebsiteSSLByWebsiteId) groupRouter.GET("/:id", baseApi.GetWebsiteSSLById) + groupRouter.POST("/update", baseApi.UpdateWebsiteSSL) } } diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go index 6386b5a7a..8629d7668 100644 --- a/cmd/server/docs/docs.go +++ b/cmd/server/docs/docs.go @@ -1,17 +1,10 @@ -// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// Package docs GENERATED BY SWAG; DO NOT EDIT // This file was generated by swaggo/swag package docs -import ( - "bytes" - "encoding/json" - "strings" - "text/template" +import "github.com/swaggo/swag" - "github.com/swaggo/swag" -) - -var doc = `{ +const docTemplate = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { @@ -76,7 +69,7 @@ var doc = `{ "summary": "Get app list update", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -415,7 +408,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -517,7 +510,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -559,7 +552,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -603,7 +596,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -622,7 +615,7 @@ var doc = `{ "summary": "Sync app installed", "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -662,7 +655,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -715,7 +708,7 @@ var doc = `{ "summary": "Sync app list", "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -753,7 +746,7 @@ var doc = `{ "summary": "Check System isDemo", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -781,7 +774,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -831,7 +824,7 @@ var doc = `{ "summary": "User logout", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -876,7 +869,7 @@ var doc = `{ "summary": "Check is First login", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -909,7 +902,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -952,7 +945,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -994,7 +987,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1073,7 +1066,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1165,7 +1158,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1205,7 +1198,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1245,7 +1238,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1382,7 +1375,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1535,7 +1528,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1577,7 +1570,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1660,7 +1653,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1748,7 +1741,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1790,7 +1783,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1871,7 +1864,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1941,7 +1934,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1986,7 +1979,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2079,7 +2072,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -2115,7 +2108,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2295,7 +2288,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2337,7 +2330,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2427,7 +2420,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2478,7 +2471,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2520,7 +2513,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2638,7 +2631,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2681,7 +2674,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2732,7 +2725,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2783,7 +2776,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2906,7 +2899,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2958,7 +2951,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3091,7 +3084,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3155,7 +3148,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3206,7 +3199,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3257,7 +3250,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3297,7 +3290,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3384,7 +3377,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3530,7 +3523,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3570,7 +3563,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3610,7 +3603,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3672,7 +3665,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3836,7 +3829,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3876,7 +3869,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3918,7 +3911,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3960,7 +3953,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3997,7 +3990,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4039,7 +4032,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4126,7 +4119,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4168,7 +4161,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4210,7 +4203,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4246,13 +4239,13 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/request.FilePath" + "$ref": "#/definitions/dto.FilePath" } } ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4339,7 +4332,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4382,7 +4375,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4425,7 +4418,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4468,7 +4461,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4546,7 +4539,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4619,7 +4612,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4697,7 +4690,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4741,7 +4734,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4838,7 +4831,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4881,7 +4874,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4968,7 +4961,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5010,7 +5003,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5061,7 +5054,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5104,7 +5097,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5199,7 +5192,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5312,7 +5305,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -5381,7 +5374,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5572,7 +5565,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5670,7 +5663,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5721,7 +5714,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5763,7 +5756,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5807,7 +5800,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5858,7 +5851,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5909,7 +5902,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5952,7 +5945,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -5985,7 +5978,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6030,7 +6023,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6167,7 +6160,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6231,7 +6224,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6293,7 +6286,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6319,7 +6312,7 @@ var doc = `{ "summary": "Clean monitor datas", "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6359,7 +6352,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6399,7 +6392,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6449,7 +6442,7 @@ var doc = `{ "summary": "Load system available status", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -6482,7 +6475,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6525,7 +6518,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6576,7 +6569,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6628,7 +6621,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6671,7 +6664,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6722,7 +6715,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6838,7 +6831,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6901,7 +6894,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6943,7 +6936,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7184,7 +7177,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7343,7 +7336,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7394,7 +7387,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7446,7 +7439,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7497,7 +7490,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7539,7 +7532,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7626,7 +7619,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7747,7 +7740,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7818,7 +7811,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7860,7 +7853,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7911,7 +7904,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8030,7 +8023,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8081,7 +8074,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8234,7 +8227,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -8267,7 +8260,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8318,7 +8311,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8405,11 +8398,62 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } }, + "/websites/ssl/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新 ssl", + "consumes": [ + "application/json" + ], + "tags": [ + "Website SSL" + ], + "summary": "Update ssl", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.WebsiteSSLUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "website_ssls", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "primary_domain", + "output_value": "domain" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "Update ssl config [domain]", + "formatZH": "更新证书设置 [domain]", + "paramKeys": [] + } + } + }, "/websites/ssl/website/:websiteId": { "get": { "security": [ @@ -8436,7 +8480,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -8469,7 +8513,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8547,7 +8591,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -10112,6 +10156,21 @@ var doc = `{ } } }, + "dto.NginxKey": { + "type": "string", + "enum": [ + "index", + "limit-conn", + "ssl", + "http-per" + ], + "x-enum-varnames": [ + "Index", + "LimitConn", + "SSL", + "HttpPer" + ] + }, "dto.OperateByID": { "type": "object", "required": [ @@ -11441,17 +11500,6 @@ var doc = `{ } } }, - "request.FilePath": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "type": "string" - } - } - }, "request.FilePathCheck": { "type": "object", "required": [ @@ -11542,7 +11590,7 @@ var doc = `{ }, "params": {}, "scope": { - "type": "string" + "$ref": "#/definitions/dto.NginxKey" }, "websiteId": { "type": "integer" @@ -11556,7 +11604,7 @@ var doc = `{ ], "properties": { "scope": { - "type": "string" + "$ref": "#/definitions/dto.NginxKey" }, "websiteId": { "type": "integer" @@ -11987,6 +12035,21 @@ var doc = `{ } } }, + "request.WebsiteSSLUpdate": { + "type": "object", + "required": [ + "autoRenew", + "id" + ], + "properties": { + "autoRenew": { + "type": "boolean" + }, + "id": { + "type": "integer" + } + } + }, "request.WebsiteSearch": { "type": "object", "required": [ @@ -12498,56 +12561,18 @@ var doc = `{ } }` -type swaggerInfo struct { - Version string - Host string - BasePath string - Schemes []string - Title string - Description string -} - // SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = swaggerInfo{ - Version: "1.0", - Host: "localhost", - BasePath: "/api/v1", - Schemes: []string{}, - Title: "1Panel", - Description: "开源Linux面板", -} - -type s struct{} - -func (s *s) ReadDoc() string { - sInfo := SwaggerInfo - sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) - - t, err := template.New("swagger_info").Funcs(template.FuncMap{ - "marshal": func(v interface{}) string { - a, _ := json.Marshal(v) - return string(a) - }, - "escape": func(v interface{}) string { - // escape tabs - str := strings.Replace(v.(string), "\t", "\\t", -1) - // replace " with \", and if that results in \\", replace that with \\\" - str = strings.Replace(str, "\"", "\\\"", -1) - return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1) - }, - }).Parse(doc) - if err != nil { - return doc - } - - var tpl bytes.Buffer - if err := t.Execute(&tpl, sInfo); err != nil { - return doc - } - - return tpl.String() +var SwaggerInfo = &swag.Spec{ + Version: "1.0", + Host: "localhost", + BasePath: "/api/v1", + Schemes: []string{}, + Title: "1Panel", + Description: "开源Linux面板", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, } func init() { - swag.Register("swagger", &s{}) + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) } diff --git a/cmd/server/docs/swagger.json b/cmd/server/docs/swagger.json index 1f933d905..9856175d6 100644 --- a/cmd/server/docs/swagger.json +++ b/cmd/server/docs/swagger.json @@ -62,7 +62,7 @@ "summary": "Get app list update", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -401,7 +401,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -503,7 +503,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -545,7 +545,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -589,7 +589,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -608,7 +608,7 @@ "summary": "Sync app installed", "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -648,7 +648,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -701,7 +701,7 @@ "summary": "Sync app list", "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -739,7 +739,7 @@ "summary": "Check System isDemo", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -767,7 +767,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -817,7 +817,7 @@ "summary": "User logout", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -862,7 +862,7 @@ "summary": "Check is First login", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -895,7 +895,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -938,7 +938,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -980,7 +980,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1059,7 +1059,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1151,7 +1151,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1191,7 +1191,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1231,7 +1231,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1368,7 +1368,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1521,7 +1521,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1563,7 +1563,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1646,7 +1646,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1734,7 +1734,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1776,7 +1776,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1857,7 +1857,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1927,7 +1927,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1972,7 +1972,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2065,7 +2065,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -2101,7 +2101,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2281,7 +2281,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2323,7 +2323,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2413,7 +2413,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2464,7 +2464,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2506,7 +2506,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2624,7 +2624,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2667,7 +2667,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2718,7 +2718,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2769,7 +2769,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2892,7 +2892,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2944,7 +2944,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3077,7 +3077,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3141,7 +3141,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3192,7 +3192,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3243,7 +3243,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3283,7 +3283,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3370,7 +3370,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3516,7 +3516,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3556,7 +3556,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3596,7 +3596,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3658,7 +3658,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3822,7 +3822,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3862,7 +3862,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3904,7 +3904,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3946,7 +3946,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3983,7 +3983,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4025,7 +4025,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4112,7 +4112,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4154,7 +4154,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4196,7 +4196,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4232,13 +4232,13 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/request.FilePath" + "$ref": "#/definitions/dto.FilePath" } } ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4325,7 +4325,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4368,7 +4368,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4411,7 +4411,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4454,7 +4454,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4532,7 +4532,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4605,7 +4605,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4683,7 +4683,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4727,7 +4727,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4824,7 +4824,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4867,7 +4867,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4954,7 +4954,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4996,7 +4996,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5047,7 +5047,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5090,7 +5090,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5185,7 +5185,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5298,7 +5298,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -5367,7 +5367,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5558,7 +5558,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5656,7 +5656,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5707,7 +5707,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5749,7 +5749,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5793,7 +5793,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5844,7 +5844,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5895,7 +5895,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5938,7 +5938,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -5971,7 +5971,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6016,7 +6016,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6153,7 +6153,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6217,7 +6217,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6279,7 +6279,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6305,7 +6305,7 @@ "summary": "Clean monitor datas", "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6345,7 +6345,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6385,7 +6385,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6435,7 +6435,7 @@ "summary": "Load system available status", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -6468,7 +6468,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6511,7 +6511,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6562,7 +6562,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6614,7 +6614,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6657,7 +6657,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6708,7 +6708,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6824,7 +6824,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6887,7 +6887,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6929,7 +6929,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7170,7 +7170,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7329,7 +7329,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7380,7 +7380,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7432,7 +7432,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7483,7 +7483,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7525,7 +7525,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7612,7 +7612,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7733,7 +7733,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7804,7 +7804,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7846,7 +7846,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7897,7 +7897,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8016,7 +8016,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8067,7 +8067,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8220,7 +8220,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -8253,7 +8253,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8304,7 +8304,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8391,11 +8391,62 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } }, + "/websites/ssl/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新 ssl", + "consumes": [ + "application/json" + ], + "tags": [ + "Website SSL" + ], + "summary": "Update ssl", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.WebsiteSSLUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "website_ssls", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "primary_domain", + "output_value": "domain" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "Update ssl config [domain]", + "formatZH": "更新证书设置 [domain]", + "paramKeys": [] + } + } + }, "/websites/ssl/website/:websiteId": { "get": { "security": [ @@ -8422,7 +8473,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -8455,7 +8506,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8533,7 +8584,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -10098,6 +10149,21 @@ } } }, + "dto.NginxKey": { + "type": "string", + "enum": [ + "index", + "limit-conn", + "ssl", + "http-per" + ], + "x-enum-varnames": [ + "Index", + "LimitConn", + "SSL", + "HttpPer" + ] + }, "dto.OperateByID": { "type": "object", "required": [ @@ -11427,17 +11493,6 @@ } } }, - "request.FilePath": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "type": "string" - } - } - }, "request.FilePathCheck": { "type": "object", "required": [ @@ -11528,7 +11583,7 @@ }, "params": {}, "scope": { - "type": "string" + "$ref": "#/definitions/dto.NginxKey" }, "websiteId": { "type": "integer" @@ -11542,7 +11597,7 @@ ], "properties": { "scope": { - "type": "string" + "$ref": "#/definitions/dto.NginxKey" }, "websiteId": { "type": "integer" @@ -11973,6 +12028,21 @@ } } }, + "request.WebsiteSSLUpdate": { + "type": "object", + "required": [ + "autoRenew", + "id" + ], + "properties": { + "autoRenew": { + "type": "boolean" + }, + "id": { + "type": "integer" + } + } + }, "request.WebsiteSearch": { "type": "object", "required": [ diff --git a/cmd/server/docs/swagger.yaml b/cmd/server/docs/swagger.yaml index c09325529..571488aac 100644 --- a/cmd/server/docs/swagger.yaml +++ b/cmd/server/docs/swagger.yaml @@ -1032,6 +1032,18 @@ definitions: subnet: type: string type: object + dto.NginxKey: + enum: + - index + - limit-conn + - ssl + - http-per + type: string + x-enum-varnames: + - Index + - LimitConn + - SSL + - HttpPer dto.OperateByID: properties: id: @@ -1912,13 +1924,6 @@ definitions: showHidden: type: boolean type: object - request.FilePath: - properties: - path: - type: string - required: - - path - type: object request.FilePathCheck: properties: path: @@ -1978,7 +1983,7 @@ definitions: type: string params: {} scope: - type: string + $ref: '#/definitions/dto.NginxKey' websiteId: type: integer required: @@ -1987,7 +1992,7 @@ definitions: request.NginxScopeReq: properties: scope: - type: string + $ref: '#/definitions/dto.NginxKey' websiteId: type: integer required: @@ -2277,6 +2282,16 @@ definitions: - page - pageSize type: object + request.WebsiteSSLUpdate: + properties: + autoRenew: + type: boolean + id: + type: integer + required: + - autoRenew + - id + type: object request.WebsiteSearch: properties: name: @@ -2650,7 +2665,7 @@ paths: description: 获取应用更新版本 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Get app list update @@ -2862,7 +2877,7 @@ paths: $ref: '#/definitions/request.AppInstalledOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Operate installed app @@ -2929,7 +2944,7 @@ paths: $ref: '#/definitions/request.AppInstalledUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change app params @@ -2956,7 +2971,7 @@ paths: $ref: '#/definitions/request.PortUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change app port @@ -2985,7 +3000,7 @@ paths: $ref: '#/definitions/request.AppInstalledSearch' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: List app installed @@ -2996,7 +3011,7 @@ paths: description: 同步已安装应用列表 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Sync app installed @@ -3022,7 +3037,7 @@ paths: $ref: '#/definitions/request.AppSearch' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: List apps @@ -3054,7 +3069,7 @@ paths: description: 同步应用列表 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Sync app list @@ -3082,7 +3097,7 @@ paths: description: 判断是否为demo环境 responses: "200": - description: "" + description: OK summary: Check System isDemo tags: - Auth @@ -3100,7 +3115,7 @@ paths: $ref: '#/definitions/dto.InitUser' responses: "200": - description: "" + description: OK summary: Init user tags: - Auth @@ -3129,7 +3144,7 @@ paths: description: 用户登出 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: User logout @@ -3160,7 +3175,7 @@ paths: description: 判断是否为首次登录 responses: "200": - description: "" + description: OK summary: Check is First login tags: - Auth @@ -3178,7 +3193,7 @@ paths: $ref: '#/definitions/dto.ContainerCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create container @@ -3206,7 +3221,7 @@ paths: $ref: '#/definitions/dto.ComposeCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create compose @@ -3233,7 +3248,7 @@ paths: $ref: '#/definitions/dto.ComposeOperation' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Operate compose @@ -3283,7 +3298,7 @@ paths: $ref: '#/definitions/dto.ComposeUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update compose @@ -3340,7 +3355,7 @@ paths: $ref: '#/definitions/dto.DaemonJsonConf' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update docker daemon.json @@ -3366,7 +3381,7 @@ paths: $ref: '#/definitions/dto.DaemonJsonUpdateByFile' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update docker daemon.json by upload file @@ -3392,7 +3407,7 @@ paths: $ref: '#/definitions/dto.DockerOperation' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Operate docker @@ -3478,7 +3493,7 @@ paths: $ref: '#/definitions/dto.ImageLoad' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Load image @@ -3578,7 +3593,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete image @@ -3605,7 +3620,7 @@ paths: $ref: '#/definitions/dto.ImageSave' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Save image @@ -3658,7 +3673,7 @@ paths: $ref: '#/definitions/dto.ImageTag' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Tag image @@ -3714,7 +3729,7 @@ paths: $ref: '#/definitions/dto.NetworkCreat' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create network @@ -3741,7 +3756,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete network @@ -3792,7 +3807,7 @@ paths: $ref: '#/definitions/dto.ContainerOperation' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Operate Container @@ -3837,7 +3852,7 @@ paths: - application/json responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create image repo @@ -3866,7 +3881,7 @@ paths: - application/json responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete image repo @@ -3925,7 +3940,7 @@ paths: - application/json responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Load repo status @@ -3947,7 +3962,7 @@ paths: - application/json responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update image repo @@ -4059,7 +4074,7 @@ paths: $ref: '#/definitions/dto.ComposeTemplateCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create compose template @@ -4086,7 +4101,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete compose template @@ -4143,7 +4158,7 @@ paths: $ref: '#/definitions/dto.ComposeTemplateUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update compose template @@ -4176,7 +4191,7 @@ paths: $ref: '#/definitions/dto.VolumeCreat' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create volume @@ -4203,7 +4218,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete volume @@ -4277,7 +4292,7 @@ paths: $ref: '#/definitions/dto.CronjobCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create cronjob @@ -4305,7 +4320,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete cronjob @@ -4338,7 +4353,7 @@ paths: $ref: '#/definitions/dto.CronjobDownload' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Download cronjob records @@ -4371,7 +4386,7 @@ paths: $ref: '#/definitions/dto.OperateByID' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Handle cronjob once @@ -4448,7 +4463,7 @@ paths: $ref: '#/definitions/dto.CronjobUpdateStatus' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update cronjob status @@ -4482,7 +4497,7 @@ paths: $ref: '#/definitions/dto.CronjobUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update cronjob @@ -4567,7 +4582,7 @@ paths: $ref: '#/definitions/dto.MysqlDBCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create mysql database @@ -4607,7 +4622,7 @@ paths: $ref: '#/definitions/dto.ChangeDBInfo' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change mysql access @@ -4640,7 +4655,7 @@ paths: $ref: '#/definitions/dto.ChangeDBInfo' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change mysql password @@ -4673,7 +4688,7 @@ paths: $ref: '#/definitions/dto.MysqlConfUpdateByFile' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update mysql conf by upload file @@ -4699,7 +4714,7 @@ paths: $ref: '#/definitions/dto.MysqlDBDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete mysql database @@ -4754,7 +4769,7 @@ paths: $ref: '#/definitions/dto.UpdateDescription' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update mysql database description @@ -4845,7 +4860,7 @@ paths: $ref: '#/definitions/dto.RedisConfUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update redis conf @@ -4871,7 +4886,7 @@ paths: $ref: '#/definitions/dto.RedisConfUpdateByFile' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update redis conf by file @@ -4897,7 +4912,7 @@ paths: $ref: '#/definitions/dto.ChangeDBInfo' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change redis password @@ -4936,7 +4951,7 @@ paths: $ref: '#/definitions/dto.RedisConfPersistenceUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update redis persistence conf @@ -5036,7 +5051,7 @@ paths: $ref: '#/definitions/dto.MysqlVariablesUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update mysql variables @@ -5062,7 +5077,7 @@ paths: $ref: '#/definitions/request.FileCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create file @@ -5089,7 +5104,7 @@ paths: $ref: '#/definitions/request.FileBatchDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Batch delete file @@ -5116,7 +5131,7 @@ paths: $ref: '#/definitions/request.FilePathCheck' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Check file exist @@ -5140,7 +5155,7 @@ paths: type: file responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: ChunkUpload file @@ -5167,7 +5182,7 @@ paths: $ref: '#/definitions/request.FileCompress' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Compress file @@ -5223,7 +5238,7 @@ paths: $ref: '#/definitions/request.FileDeCompress' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Decompress file @@ -5250,7 +5265,7 @@ paths: $ref: '#/definitions/request.FileDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete file @@ -5277,7 +5292,7 @@ paths: $ref: '#/definitions/request.FileDownload' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Download file @@ -5301,10 +5316,10 @@ paths: name: request required: true schema: - $ref: '#/definitions/request.FilePath' + $ref: '#/definitions/dto.FilePath' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Download file with path @@ -5360,7 +5375,7 @@ paths: $ref: '#/definitions/request.FileCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change file mode @@ -5388,7 +5403,7 @@ paths: $ref: '#/definitions/request.FileMove' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Move file @@ -5416,7 +5431,7 @@ paths: $ref: '#/definitions/request.FileRename' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change file name @@ -5444,7 +5459,7 @@ paths: $ref: '#/definitions/request.FileEdit' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update file content @@ -5493,7 +5508,7 @@ paths: $ref: '#/definitions/request.DirSizeReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Load file size @@ -5539,7 +5554,7 @@ paths: type: file responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Upload file @@ -5588,7 +5603,7 @@ paths: $ref: '#/definitions/request.FileWget' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Wget file @@ -5617,7 +5632,7 @@ paths: $ref: '#/definitions/dto.HostOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create host @@ -5678,7 +5693,7 @@ paths: $ref: '#/definitions/dto.CommandOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create command @@ -5706,7 +5721,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete command @@ -5761,7 +5776,7 @@ paths: $ref: '#/definitions/dto.CommandOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update command @@ -5788,7 +5803,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete host @@ -5821,7 +5836,7 @@ paths: $ref: '#/definitions/dto.GroupCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create group @@ -5849,7 +5864,7 @@ paths: $ref: '#/definitions/dto.OperateByID' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete group @@ -5910,7 +5925,7 @@ paths: $ref: '#/definitions/dto.GroupUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update group @@ -5981,7 +5996,7 @@ paths: $ref: '#/definitions/dto.HostConnTest' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Test host conn by info @@ -6023,7 +6038,7 @@ paths: $ref: '#/definitions/dto.ChangeHostGroup' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update host group @@ -6143,7 +6158,7 @@ paths: $ref: '#/definitions/request.NginxConfigFileUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update OpenResty conf by upload file @@ -6204,7 +6219,7 @@ paths: $ref: '#/definitions/request.NginxConfigUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update OpenResty conf @@ -6237,7 +6252,7 @@ paths: $ref: '#/definitions/dto.BackupOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create backup account @@ -6264,7 +6279,7 @@ paths: $ref: '#/definitions/dto.CommonBackup' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Backup system data @@ -6293,7 +6308,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete backup account @@ -6326,7 +6341,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete backup record @@ -6359,7 +6374,7 @@ paths: $ref: '#/definitions/dto.DownloadRecord' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Download backup record @@ -6387,7 +6402,7 @@ paths: $ref: '#/definitions/dto.RecordSearch' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Page backup records @@ -6407,7 +6422,7 @@ paths: $ref: '#/definitions/dto.CommonRecover' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Recover system data @@ -6437,7 +6452,7 @@ paths: $ref: '#/definitions/dto.CommonRecover' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Recover system data by upload @@ -6523,7 +6538,7 @@ paths: $ref: '#/definitions/dto.BackupOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update backup account @@ -6563,7 +6578,7 @@ paths: $ref: '#/definitions/dto.PasswordUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Reset system password expired @@ -6602,7 +6617,7 @@ paths: $ref: '#/definitions/dto.MfaCredential' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Bind mfa @@ -6619,7 +6634,7 @@ paths: description: 清空监控数据 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Clean monitor datas @@ -6645,7 +6660,7 @@ paths: $ref: '#/definitions/dto.PasswordUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update system password @@ -6671,7 +6686,7 @@ paths: $ref: '#/definitions/dto.PortUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update system port @@ -6702,7 +6717,7 @@ paths: description: 获取系统可用状态 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Load system available status @@ -6722,7 +6737,7 @@ paths: $ref: '#/definitions/dto.SnapshotCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create system snapshot @@ -6750,7 +6765,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete system backup @@ -6783,7 +6798,7 @@ paths: $ref: '#/definitions/dto.UpdateDescription' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update snapshot description @@ -6817,7 +6832,7 @@ paths: $ref: '#/definitions/dto.SnapshotImport' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Import system snapshot @@ -6845,7 +6860,7 @@ paths: $ref: '#/definitions/dto.SnapshotRecover' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Recover system backup @@ -6878,7 +6893,7 @@ paths: $ref: '#/definitions/dto.SnapshotRecover' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Rollback system backup @@ -6952,7 +6967,7 @@ paths: $ref: '#/definitions/dto.SettingUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update system setting @@ -6992,7 +7007,7 @@ paths: $ref: '#/definitions/dto.Upgrade' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Upgrade @@ -7019,7 +7034,7 @@ paths: $ref: '#/definitions/request.WebsiteCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create website @@ -7172,7 +7187,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete website acme account @@ -7271,7 +7286,7 @@ paths: $ref: '#/definitions/request.NginxConfigUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update nginx conf @@ -7304,7 +7319,7 @@ paths: $ref: '#/definitions/request.WebsiteDefaultUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change default server @@ -7338,7 +7353,7 @@ paths: $ref: '#/definitions/request.WebsiteDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete website @@ -7371,7 +7386,7 @@ paths: $ref: '#/definitions/request.WebsiteDnsAccountCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create website dns account @@ -7398,7 +7413,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete website dns account @@ -7453,7 +7468,7 @@ paths: $ref: '#/definitions/request.WebsiteDnsAccountUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update website dns account @@ -7530,7 +7545,7 @@ paths: $ref: '#/definitions/request.WebsiteDomainDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete website domain @@ -7575,7 +7590,7 @@ paths: $ref: '#/definitions/request.WebsiteGroupCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create website group @@ -7602,7 +7617,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete website group @@ -7635,7 +7650,7 @@ paths: $ref: '#/definitions/request.WebsiteGroupUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update website group @@ -7711,7 +7726,7 @@ paths: $ref: '#/definitions/request.WebsiteNginxUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update website nginx conf @@ -7744,7 +7759,7 @@ paths: $ref: '#/definitions/request.WebsiteOp' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Operate website @@ -7841,7 +7856,7 @@ paths: type: integer responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Search website ssl by id @@ -7861,7 +7876,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete website ssl @@ -7894,7 +7909,7 @@ paths: $ref: '#/definitions/request.WebsiteSSLRenew' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Reset website ssl @@ -7949,12 +7964,45 @@ paths: $ref: '#/definitions/request.WebsiteSSLSearch' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Page website ssl tags: - Website SSL + /websites/ssl/update: + post: + consumes: + - application/json + description: 更新 ssl + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/request.WebsiteSSLUpdate' + responses: + "200": + description: OK + security: + - ApiKeyAuth: [] + summary: Update ssl + tags: + - Website SSL + x-panel-log: + BeforeFuntions: + - db: website_ssls + input_colume: id + input_value: id + isList: false + output_colume: primary_domain + output_value: domain + bodyKeys: + - id + formatEN: Update ssl config [domain] + formatZH: 更新证书设置 [domain] + paramKeys: [] /websites/ssl/website/:websiteId: get: consumes: @@ -7968,7 +8016,7 @@ paths: type: integer responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Search website ssl by website id @@ -7988,7 +8036,7 @@ paths: $ref: '#/definitions/request.WebsiteUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update website @@ -8037,7 +8085,7 @@ paths: $ref: '#/definitions/request.WebsiteWafUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update website waf conf diff --git a/frontend/src/api/interface/website.ts b/frontend/src/api/interface/website.ts index 8d4ffe5df..0d7e1e6b9 100644 --- a/frontend/src/api/interface/website.ts +++ b/frontend/src/api/interface/website.ts @@ -160,6 +160,7 @@ export namespace Website { startDate: string; provider: string; websites?: Website.Website[]; + autoRenew: boolean; } export interface SSLCreate { @@ -179,6 +180,11 @@ export namespace Website { SSLId: number; } + export interface SSLUpdate { + id: number; + autoRenew: boolean; + } + export interface AcmeAccount extends CommonModel { email: string; url: string; diff --git a/frontend/src/api/modules/website.ts b/frontend/src/api/modules/website.ts index ac79ed12e..c3431b17d 100644 --- a/frontend/src/api/modules/website.ts +++ b/frontend/src/api/modules/website.ts @@ -139,6 +139,10 @@ export const RenewSSL = (req: Website.SSLRenew) => { return http.post(`/websites/ssl/renew`, req); }; +export const UpdateSSL = (req: Website.SSLUpdate) => { + return http.post(`/websites/ssl/update`, req); +}; + export const GetDnsResolve = (req: Website.DNSResolveReq) => { return http.post(`/websites/ssl/resolve`, req); }; diff --git a/frontend/src/views/website/ssl/index.vue b/frontend/src/views/website/ssl/index.vue index f5a892f56..e77ef65db 100644 --- a/frontend/src/views/website/ssl/index.vue +++ b/frontend/src/views/website/ssl/index.vue @@ -50,6 +50,15 @@ show-overflow-tooltip prop="type" > + + + { }); }; +const updateConfig = (row: Website.SSL) => { + loading.value = true; + UpdateSSL({ id: row.id, autoRenew: row.autoRenew }) + .then(() => { + MsgSuccess(i18n.global.t('commons.msg.updateSuccess')); + }) + .finally(() => { + loading.value = false; + }); +}; + const openAcmeAccount = () => { acmeAccountRef.value.acceptParams(); };