Files
ps5upload/payload/include/webui_api.h
T
phantomptrandClaude Opus 5.5 c1c74dece8 console page: the pointer is the focus, the whole DualSense in one table, an input log, full screen, TV scale
The PS5 browser drives an on-screen pointer and ✕ clicks at it, so the page
now treats hover as focus: the ring and what ✕ activates are the same
element. After a key move the pointer is parked (drift under 6 px is
ignored) and a click there activates the focused control instead.

nav.ts's button table covers every DualSense button with its action, the
keys/keyCodes it may arrive as and verified:false until measured: L2/R2 page,
L3 top, R3 rail, OPTIONS help, Create refresh, touchpad full screen, PS/Mute
system. The hint bar shows ✕/○ always, the rest once verified.

POST /api/input-log appends compact, privacy-neutral event lines to a 64 KiB
ring at /data/ps5upload/webui-input.log (same-directory rewrite, bounded
body, 429 under 500 ms); the page sends only while setInputLogEnabled(true).

Full screen on the first activation (standard, then webkit-prefixed), with a
Settings switch hidden where unsupported. Type scales with the viewport
(26 px at 1540x700). Raw page budget 640 KiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RxCGb8Asp1A1AQYiv1kbgS
2026-10-17 08:25:31 -07:00

38 lines
1.9 KiB
C

/* The console web UI's JSON API (Home, Files): the webui_route_fn main.c hands to webui_start.
*
* Every route is POST with a JSON body and adapts it to a method the helper already serves
* (management through mgmt_rpc_dispatch, the data layer through ava1_data_rpc, both reached the
* way the AVA1 server reaches them), under one fixed identity: the console page owns the jobs it
* starts as "ps5upload-console-webui". The route table in webui_api.c is the allowlist: any other
* path answers 404, a known path with another method 405.
*
* POST /api/input-log {"events":["<line>",...]} is the one route that reaches no helper method: it
* appends the page's controller-input measurements to WEBUI_INPUTLOG_PATH (webui_inputlog.h),
* bodies over WEBUI_INPUTLOG_BODY_MAX answer 413, calls closer than 500 ms apart 429.
*
* Two GET routes sit outside the table: GET / serves the embedded page (webui_page.h) and
* GET /api/token answers {"token":"<hex>"}, both after the server's Host/Origin check only. */
#ifndef PS5UPLOAD_WEBUI_API_H
#define PS5UPLOAD_WEBUI_API_H
#include <stddef.h>
#include <stdint.h>
#include "webui_http.h"
#include "webui_settings.h"
/* The settings the helper started with (main.c loads WEBUI_SETTINGS_PATH before webui_start):
* /api/settings answers them and /api/settings/set changes them. Call once, before webui_start. */
void webui_api_settings_init(const webui_settings_t *s);
/* A paired PC unregistered the tile (APP_UNREGISTER of WEBUI_TILE_TITLE_ID): the same as Settings ->
* tile off. Saves tile:false to WEBUI_SETTINGS_PATH (so the next start does not register it again)
* and asks the tile thread to remove it (webui_tile_request(0): unregister, then the tile folder and
* the staged /user/app copy are deleted). Returns at once; 0, or -1 when the save failed (the
* removal is requested either way). */
int webui_api_tile_off(void);
int webui_api_route(const webui_req_t *r, const uint8_t *body, size_t body_len, int fd);
#endif