fix(quota): 配额表单整体替换,留空即不限、0 即不给、负数和越界拒收,超配额的服务器仍可调小

This commit is contained in:
Lemon-miaow committed 2026-09-27 02:26:03 +08:00
1 parent ee4065b986
commit 7aa5034c1a
17 files changed
+346 -109

No files matched your search

+2
View File
@@ -1146,6 +1146,8 @@ export function humanizeError(e: unknown): string {
return t("no_migration");
case "not_confirmed":
return t("not_confirmed");
case "invalid_quota":
return t("invalid_quota");
case "already_confirmed":
return t("already_confirmed");
case "invalid_target":
+14 -3
View File
@@ -1263,7 +1263,10 @@ export interface paths {
};
/** Get a user's quotas (admin only). */
get: operations["getQuotas"];
/** Set a user's quotas (admin only). */
/**
* Set a user's quotas (admin only).
* @description Replaces all four caps at once. An absent or null field is unlimited; 0 grants none of that resource, so every claim that needs it is refused. An empty body lifts every cap. A cap below what the user already owns refuses new claims and leaves the servers they have alone.
*/
put: operations["setQuotas"];
post?: never;
delete?: never;
@@ -2620,7 +2623,7 @@ export interface components {
verified_at: string;
}[];
};
/** @description A user's quotas row (internal/api/repo.go QuotaView). Null fields mean unlimited. */
/** @description A user's quotas row (internal/api/repo.go QuotaView). An absent or null field is unlimited; 0 grants none of that resource. */
QuotaView: {
user_id: string;
max_servers?: number | null;
@@ -6119,7 +6122,15 @@ export interface operations {
"application/json": components["schemas"]["QuotaView"];
};
};
400: components["responses"]["BadRequest"];
/** @description invalid_quota, a cap outside 0..2147483647; or a body that is not JSON or carries a fraction. */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
/** @description Unknown user. */