feat: login page says a locked instance is suspended instead of drawing the form
Chart Release / chart (push) Successful in 20s
Server Deploy / deploy (push) Successful in 4m4s

This commit is contained in:
2026-09-11 09:05:44 +00:00
parent 2d96cb4224
commit 5ca705c88c
8 changed files with 180 additions and 16 deletions
+15
View File
@@ -35,6 +35,21 @@ func GetInstanceBySlug(slug string) (*models.Instance, error) {
return &o, nil
}
// GetInstanceBySlugIncludingLocked is GetInstanceBySlug without the lock
// filter. Only the host resolver calls it, so it can tell "no such instance"
// from "instance locked by Vantage HQ" and let the login page say which; it
// still refuses a locked instance itself.
func GetInstanceBySlugIncludingLocked(slug string) (*models.Instance, error) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
var o models.Instance
err := db.Col("instances").FindOne(ctx, bson.M{"slug": slug}).Decode(&o)
if err != nil {
return nil, err
}
return &o, nil
}
func ListInstanceIDs() ([]string, error) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()