mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
feat: add notifications for renew certs #192
This commit is contained in:
parent
ddb6cee153
commit
994b9087ae
45 changed files with 1971 additions and 594 deletions
|
@ -34,6 +34,7 @@ func GenerateAllModel() []any {
|
|||
Site{},
|
||||
DnsCredential{},
|
||||
Environment{},
|
||||
Notification{},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,12 +100,8 @@ func OrderAndPaginate(c *gin.Context) func(db *gorm.DB) *gorm.DB {
|
|||
return func(db *gorm.DB) *gorm.DB {
|
||||
sort := c.DefaultQuery("order", "desc")
|
||||
|
||||
sortBy := DefaultQuery(c, "sort_by", "")
|
||||
|
||||
if sortBy != "" {
|
||||
order := fmt.Sprintf("`%s` %s", DefaultQuery(c, "sort_by", "id"), sort)
|
||||
db = db.Order(order)
|
||||
}
|
||||
order := fmt.Sprintf("`%s` %s", DefaultQuery(c, "sort_by", "id"), sort)
|
||||
db = db.Order(order)
|
||||
|
||||
page := cast.ToInt(c.Query("page"))
|
||||
if page == 0 {
|
||||
|
|
17
model/notification.go
Normal file
17
model/notification.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package model
|
||||
|
||||
type NotificationType int
|
||||
|
||||
const (
|
||||
NotificationError NotificationType = iota
|
||||
NotificationWarning
|
||||
NotificationInfo
|
||||
NotificationSuccess
|
||||
)
|
||||
|
||||
type Notification struct {
|
||||
Model
|
||||
Type NotificationType `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Details string `json:"details"`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue