feat: show current owner names and persist user and limit order (#576)

Resolve current forwarding-rule owner names by user ID. Add administrator-managed persistent user and speed-limit ordering, backup compatibility, and conflict recovery. Repair PostgreSQL explicit-ID import sequences transactionally.

Closes #574
Closes #575
This commit is contained in:
sagit
2026-11-10 09:13:05 +08:00
committed by GitHub
parent 3209ff8a59
commit 577c189737
20 changed files with 2901 additions and 720 deletions
@@ -65,7 +65,7 @@ func (r *Repository) CreateUser(username, pwdHash string, roleID int, expTime, f
Status: status,
PasswordChangedAt: now,
}
if err := r.db.Create(&user).Error; err != nil {
if err := createFirst(r.db, "user", &user, &user.DisplayOrder); err != nil {
return 0, err
}
return user.ID, nil
@@ -940,7 +940,7 @@ func (r *Repository) CreateSpeedLimit(name string, speed int, now int64, status
UpdatedTime: sql.NullInt64{Int64: now, Valid: true},
Status: status,
}
if err := r.db.Create(&sl).Error; err != nil {
if err := createFirst(r.db, "speed_limit", &sl, &sl.DisplayOrder); err != nil {
return 0, err
}
return sl.ID, nil