fix26.2: полная UI-полировка peer/dashboard и завершение i18n

This commit is contained in:
2026-05-09 01:38:57 +05:00
parent c13841b61a
commit db3c88c58a
42 changed files with 421 additions and 198 deletions
-20
View File
@@ -80,23 +80,3 @@ func PagePeer(peerPageDto dto.PeerPageDto) ([]entity.Peer, int64, error) {
}
return peers, total, nil
}
func UpdatePeerTraffic(name string, download int64, upload int64) error {
if upload == 0 && download == 0 {
return nil
}
updates := map[string]interface{}{}
if download != 0 {
updates["download_bytes"] = gorm.Expr("download_bytes + ?", download)
}
if upload != 0 {
updates["upload_bytes"] = gorm.Expr("upload_bytes + ?", upload)
}
updates["update_time"] = time.Now().Format("2006-01-02 15:04:05")
if tx := sqliteDB.Model(&entity.Peer{}).Where("name = ?", name).Updates(updates); tx.Error != nil {
logrus.Errorf("%v", tx.Error)
return errors.New(constant.SysError)
}
return nil
}