// api/admin-sessions.prg — Format admin sessions list (with device names) // ctx: rows (JSON), total FUNCTION Main() LOCAL aRows := hb_jsonDecode(ctx_get("rows", "[]")) LOCAL nTotal := Val(ctx_get("total", "0")) IF ! HB_ISARRAY(aRows) ; aRows := {} ; ENDIF AP_JSONRESPONSE({ "total" => nTotal, "sessions" => aRows }) RETURN NIL