Dernier intrant
Valeur : {html_escape(current_input.get('value', ''))}
+ {f'Valeur de référence : {html_escape(current_input.get("reference_value", ""))}
' if 'reference_value' in current_input else ''}
Capturé le : {html_escape(current_input.get('captured_at', ''))}
Origine : {html_escape(current_input.get('origin', ''))}
@@ -668,6 +713,18 @@ def page_set_item(domain: str, item_key: str, value: str = Form(...), origin: st
return RedirectResponse(url=f"/life-noc/item/{domain}/{item_key}", status_code=303)
+@app.post("/life-noc/item/{domain}/{item_key}/counter")
+def page_set_counter(domain: str, item_key: str, current_value: str = Form(...), reference_value: str = Form(...), origin: str = Form(default="manual")) -> RedirectResponse:
+ try:
+ set_counter_pair(domain, item_key, current_value=current_value, reference_value=reference_value, origin=origin)
+ except KeyError:
+ raise HTTPException(status_code=404, detail="item introuvable")
+ except ValueError as exc:
+ raise HTTPException(status_code=400, detail=str(exc))
+
+ return RedirectResponse(url=f"/life-noc/item/{domain}/{item_key}", status_code=303)
+
+
@app.post("/life-noc/item/{domain}/{item_key}/complete")
def page_complete_item(domain: str, item_key: str, origin: str = Form(default="manual")) -> RedirectResponse:
try: