Development panel¶
The panel shows the traffic between events, the traces of the framework and the statistics. It is the window that a developer keeps open next to the application.
Source code: src/yui_dev.js,
src/yui_frontend_view.js
build_dev_panel()¶
Builds the panel: a bar of controls, a log and the statistics. It follows the theme that is active.
Returns an object with two keys.
| Key | Description |
|---|---|
$el | The element of the panel. |
dispose | Stops the trace of the traffic. Call it from the close of the modal that holds the panel. |
setup_dev(self, show)¶
Opens or closes the window of the developer, which holds the same panel inside a
C_YUI_WINDOW with a title bar, a button of maximize and a button of close.
It keeps the state of the window in the local storage, so a reload of the page finds it again.
dev_window_was_open()¶
Tells if the window of the developer was open in the last visit. The host reads it at start up, and opens the window again, so the traffic and the traces that the developer turned on keep their collection.
apply_dev_traces()¶
Writes every trace of the developer that the local storage holds to the running yuno: the traffic, the state machine, the creation, the start and the stop, the subscriptions and the i18n.
It does not depend on the window. Call it one time at the start of the application, so a reload keeps what the developer turned on.
info_traffic(title, msg, direction, size)¶
Adds one message between events to the log of the traffic. The buffer has a limit, so a change of the view or of the filter draws again from the memory.
direction | Meaning |
|---|---|
1 | It goes out. |
2 | It comes in. |
3 | An error. |
With no logger in place the function writes to the console.
setup_frontend_view(self)¶
Opens the tree of the gobjs of the application, in a window that is not modal.
It gives the window back, or null when the window exists already.
The tree is a pure child of the window, so every path that takes the window down takes the tree with it.