fix: Fix offline alert issue (#9608)

This commit is contained in:
2025-07-22 18:39:26 +08:00 committed by GitHub
parent 90e76e3a0f
commit 657e55cde3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 2 deletions

View file

@ -20,6 +20,7 @@ type IAlertRepo interface {
WithByCreateAt(date *date.Date) DBOption
WithByLicenseId(licenseId string) DBOption
WithByRecordId(recordId uint) DBOption
WithByMethod(method string) DBOption
Create(alert *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 {
return func(g *gorm.DB) *gorm.DB {
return g.Where("DATE(created_at) = DATE(?)", createAt)

View file

@ -69,5 +69,5 @@ export const SyncAlertAll = () => {
};
export const SyncOfflineAlert = () => {
return http.post<any>(`/xpack/core/alert/offline/sync`);
return http.post<any>(`/core/xpack/alert/offline/sync`);
};

View file

@ -125,7 +125,7 @@ const buttons = [
syncAlert(row);
},
disabled: (row: Alert.AlertLog) => {
return row.status != 'PushSuccess' && row.status != 'SyncError';
return row.method != 'sms' && row.status != 'PushSuccess' && row.status != 'SyncError';
},
},
];