[Workbench] Retrieve all log content directly from API instead of pre-rendering in Rails
Currently "get arvados#log entries and format them in a PRE element" is implemented in both Ruby and JS.
Reasons to remove the Ruby version:
1. In #9679 the two implementations started to go out of sync: the JS code knows how to format "container state change" logs, but the Ruby code skips them. The result is that "state change" logs only show up if they arrive while Workbench is listening for them on websocket. Refreshing the "log" page makes them disappear.
2. Doing API requests directly from the browser (instead of using the Workbench Rails server as a proxy) is expected to reduce real & perceived latency from the user's perspective.
The "terminal window" div should have a data attribute indicating the configured number of log records to fetch. When the div is displayed, client-side JS should make an API request to retrieve logs. They should be prepended to the div by sending an event to
To avoid missing or duplicating any logs, use the page display time ("now") as a "created_at>=X" filter when subscribing to Websocket events to append, and use the same time as a "created_at<X" filter when retrieving previous logs to prepend. This should produce the correct results regardless of processing/response order, so "subscribe" and "retrieve previous" can be done concurrently.