mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-08 02:36:01 +08:00
fix: Fix offline alert issue (#9608)
This commit is contained in:
parent
90e76e3a0f
commit
657e55cde3
3 changed files with 9 additions and 2 deletions
|
|
@ -20,6 +20,7 @@ type IAlertRepo interface {
|
||||||
WithByCreateAt(date *date.Date) DBOption
|
WithByCreateAt(date *date.Date) DBOption
|
||||||
WithByLicenseId(licenseId string) DBOption
|
WithByLicenseId(licenseId string) DBOption
|
||||||
WithByRecordId(recordId uint) DBOption
|
WithByRecordId(recordId uint) DBOption
|
||||||
|
WithByMethod(method string) DBOption
|
||||||
|
|
||||||
Create(alert *model.Alert) error
|
Create(alert *model.Alert) error
|
||||||
Get(opts ...DBOption) (model.Alert, error)
|
Get(opts ...DBOption) (model.Alert, error)
|
||||||
|
|
@ -100,6 +101,12 @@ func (a *AlertRepo) WithByRecordId(recordId uint) DBOption {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *AlertRepo) WithByMethod(method string) DBOption {
|
||||||
|
return func(g *gorm.DB) *gorm.DB {
|
||||||
|
return g.Where("method = ?", method)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (a *AlertRepo) WithByCreateAt(createAt *date.Date) DBOption {
|
func (a *AlertRepo) WithByCreateAt(createAt *date.Date) DBOption {
|
||||||
return func(g *gorm.DB) *gorm.DB {
|
return func(g *gorm.DB) *gorm.DB {
|
||||||
return g.Where("DATE(created_at) = DATE(?)", createAt)
|
return g.Where("DATE(created_at) = DATE(?)", createAt)
|
||||||
|
|
|
||||||
|
|
@ -69,5 +69,5 @@ export const SyncAlertAll = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SyncOfflineAlert = () => {
|
export const SyncOfflineAlert = () => {
|
||||||
return http.post<any>(`/xpack/core/alert/offline/sync`);
|
return http.post<any>(`/core/xpack/alert/offline/sync`);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ const buttons = [
|
||||||
syncAlert(row);
|
syncAlert(row);
|
||||||
},
|
},
|
||||||
disabled: (row: Alert.AlertLog) => {
|
disabled: (row: Alert.AlertLog) => {
|
||||||
return row.status != 'PushSuccess' && row.status != 'SyncError';
|
return row.method != 'sms' && row.status != 'PushSuccess' && row.status != 'SyncError';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue