Maintenance: ListBlockErrors est un GET (verifie dans l'OpenAPI v2 de Garage), le mock refuse le POST
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8de5262c12
commit
17b98b6cf3
2 files changed
+5
-1
No files matched your search
@@ -315,6 +315,10 @@ func handle(token string) http.HandlerFunc {
|
||||
map[string]any{"id": 3, "name": "object sync", "state": map[string]any{"throttled": map[string]any{"durationSecs": 5}}, "errors": 1, "consecutiveErrors": 1, "lastError": map[string]any{"message": "timeout", "secsAgo": 90}},
|
||||
}}, "error": map[string]any{}})
|
||||
case "ListBlockErrors":
|
||||
if r.Method != http.MethodGet { // comme le vrai Garage : GET uniquement
|
||||
gerr(w, 400, "Unknown API endpoint: "+r.Method+" /v2/"+op)
|
||||
return
|
||||
}
|
||||
j(w, 200, map[string]any{"success": map[string]any{nodeID: []any{}}, "error": map[string]any{}})
|
||||
case "LaunchRepairOperation", "CreateMetadataSnapshot", "RetryBlockResync":
|
||||
j(w, 200, map[string]any{"success": map[string]any{nodeID: nil}, "error": map[string]any{}})
|
||||
|
||||
@@ -58,7 +58,7 @@ export function Maintenance() {
|
||||
const [repair, setRepair] = useState("tables");
|
||||
const [result, setResult] = useState("");
|
||||
const workers = useLoad(() => garage.post<MultiResponse<Worker[]>>("ListWorkers", { node: "*" }, { busyOnly, errorOnly: false }), [busyOnly]);
|
||||
const blocks = useLoad(() => garage.post<MultiResponse<BlockError[]>>("ListBlockErrors", { node: "*" }));
|
||||
const blocks = useLoad(() => garage.get<MultiResponse<BlockError[]>>("ListBlockErrors", { node: "*" }));
|
||||
const w = flat(workers.data);
|
||||
const wlist = w.items.flat();
|
||||
const b = flat(blocks.data);
|
||||
|
||||
Reference in new issue
Block a user