@yuneta/gobj-ui 7.27.26 → 7.27.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -27
- package/dist/gobj-ui.cjs.js +3379 -2697
- package/dist/gobj-ui.es.js +3379 -2697
- package/package.json +1 -1
- package/src/c_yui_gclass.css +104 -22
- package/src/c_yui_gclass.js +413 -94
- package/src/c_yui_gobj_tree_js.js +457 -143
- package/src/gclass_traces.wiring.test.js +235 -0
- package/src/gobj_tree_model.js +51 -10
- package/src/gobj_tree_model.test.js +14 -3
- package/src/gobj_tree_remote.wiring.test.js +84 -7
- package/src/yui_gclass_view.js +11 -0
|
@@ -16,24 +16,40 @@
|
|
|
16
16
|
* out EV_TRACE_INFO_WANTED {gclass} a card was opened
|
|
17
17
|
* in EV_TRACE_INFO {gclass, gclass_levels, global_levels,
|
|
18
18
|
* gclass_on, global_on, error}
|
|
19
|
-
* out EV_SET_TRACE_LEVEL {scope: "gobj"|"gclass",
|
|
20
|
-
* gclass, levels: [...], set}
|
|
19
|
+
* out EV_SET_TRACE_LEVEL {scope: "gobj"|"gclass"|"global",
|
|
20
|
+
* gobj, gclass, levels: [...], set}
|
|
21
21
|
* out EV_GCLASS_WANTED {gclass} the gclass button
|
|
22
22
|
* in EV_GCLASS_DESCRIPTION {gclass, description}
|
|
23
23
|
*
|
|
24
24
|
* The host loads the FIRST tree on its own (it opened the
|
|
25
25
|
* view); the view asks again only when Refresh is pressed.
|
|
26
26
|
* After a trace is set the host loads the tree and the
|
|
27
|
-
* trace info again:
|
|
27
|
+
* trace info of `gclass` again: what the reader is on stays
|
|
28
|
+
* open.
|
|
28
29
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
30
|
+
* TRACES, in "remote": three scopes, each where it belongs.
|
|
31
|
+
* The kernel's levels (`machine`, `create_delete`...; the
|
|
32
|
+
* table gobj.c calls "global") are valid in all three, a
|
|
33
|
+
* gclass' own levels in the first two:
|
|
34
|
+
*
|
|
35
|
+
* this gobj the popover of its card: one box per
|
|
36
|
+
* level (`set-gobj-trace`). A level its
|
|
37
|
+
* gclass or the yuno holds is on and
|
|
38
|
+
* locked, saying which.
|
|
39
|
+
* every gobj of the gclass viewer the card's GClass
|
|
40
|
+
* the gclass button opens: its `trace levels` zone
|
|
41
|
+
* (`set-gclass-trace`). The viewer is this
|
|
42
|
+
* view's child and publishes
|
|
43
|
+
* EV_SET_GCLASS_TRACE {gclass, levels, set},
|
|
44
|
+
* which goes out as EV_SET_TRACE_LEVEL.
|
|
45
|
+
* the whole yuno the toolbar's `traces of the yuno`, in
|
|
46
|
+
* the popover (`set-global-trace`). Its
|
|
47
|
+
* levels are read with EV_TRACE_INFO_WANTED
|
|
48
|
+
* of the ROOT's gclass, whose answer
|
|
49
|
+
* carries them like every other one.
|
|
50
|
+
*
|
|
51
|
+
* A gclass or yuno level is saved by the yuno and survives a
|
|
52
|
+
* restart; a gobj level lasts until the yuno ends.
|
|
37
53
|
*
|
|
38
54
|
* The output events are published ONLY in "remote", so a host
|
|
39
55
|
* of a local tree (the Frontend view) declares none of them.
|
|
@@ -86,6 +102,7 @@ import {
|
|
|
86
102
|
node_status_symbol,
|
|
87
103
|
node_can_pause,
|
|
88
104
|
trace_rows,
|
|
105
|
+
global_trace_rows,
|
|
89
106
|
own_trace_levels,
|
|
90
107
|
} from "./gobj_tree_model.js";
|
|
91
108
|
import {text_node} from "./yui_text.js";
|
|
@@ -451,6 +468,8 @@ let PRIVATE_DATA = {
|
|
|
451
468
|
remote_root: null, // the descriptor of the backend tree, as last loaded
|
|
452
469
|
trace_info: {}, // gclass -> {gclass_levels, global_levels, gclass_on, global_on, error}
|
|
453
470
|
trace_pending: false, // a trace was set: the block is locked until the host answers
|
|
471
|
+
popover_mode: "", // what the popover shows: "node" (a card) | "yuno" (the yuno's traces)
|
|
472
|
+
viewer_stale: "", // a gclass whose open viewer must be asked again after a yuno set
|
|
454
473
|
view_refused: false, // the saved camera showed no card: the opening's framing replaces it
|
|
455
474
|
};
|
|
456
475
|
|
|
@@ -1243,6 +1262,28 @@ function make_toolbar(gobj)
|
|
|
1243
1262
|
}]
|
|
1244
1263
|
);
|
|
1245
1264
|
priv.$layout_select = $wrap.querySelector("select");
|
|
1265
|
+
|
|
1266
|
+
/* The yuno's own scope of traces (`set-global-trace`) is the
|
|
1267
|
+
* yuno's, not any one gobj's: it opens from here, not from a card.
|
|
1268
|
+
* Its label goes on mobile -- the row is full there. */
|
|
1269
|
+
if(is_remote(gobj)) {
|
|
1270
|
+
right_items.push(createElement2(['button', {
|
|
1271
|
+
type: 'button',
|
|
1272
|
+
class: 'GOBJ_TREE_YUNO_TRACES_BUTTON button',
|
|
1273
|
+
style: {height: toolbar_wide, "margin-left": "0.5em"},
|
|
1274
|
+
title: t("traces of the yuno"), 'data-i18n-title': "traces of the yuno",
|
|
1275
|
+
'aria-label': t("traces of the yuno"), 'data-i18n-aria-label': "traces of the yuno",
|
|
1276
|
+
}, [
|
|
1277
|
+
['span', {class: 'icon'}, [['i', {class: 'yi-list-check'}]]],
|
|
1278
|
+
['span', {class: 'is-hidden-mobile', i18n: "traces of the yuno"},
|
|
1279
|
+
t("traces of the yuno")]
|
|
1280
|
+
], {
|
|
1281
|
+
click: (evt) => {
|
|
1282
|
+
evt.stopPropagation();
|
|
1283
|
+
gobj_send_event(gobj, "EV_OPEN_YUNO_TRACES", {}, gobj);
|
|
1284
|
+
}
|
|
1285
|
+
}]));
|
|
1286
|
+
}
|
|
1246
1287
|
right_items.push($wrap);
|
|
1247
1288
|
|
|
1248
1289
|
const $toolbar = yui_toolbar({}, [
|
|
@@ -2146,40 +2187,116 @@ function is_remote(gobj)
|
|
|
2146
2187
|
}
|
|
2147
2188
|
|
|
2148
2189
|
/************************************************************
|
|
2149
|
-
*
|
|
2190
|
+
* Paint again whatever the popover is showing: a card, or
|
|
2191
|
+
* the yuno's traces.
|
|
2192
|
+
************************************************************/
|
|
2193
|
+
function render_current_popover(gobj)
|
|
2194
|
+
{
|
|
2195
|
+
let priv = gobj.priv;
|
|
2196
|
+
if(!priv.$popover || priv.$popover.style.display !== "block") {
|
|
2197
|
+
return;
|
|
2198
|
+
}
|
|
2199
|
+
if(priv.popover_mode === "yuno") {
|
|
2200
|
+
priv.$popover_body.textContent = "";
|
|
2201
|
+
priv.$popover_body.appendChild(build_yuno_traces_block(gobj));
|
|
2202
|
+
} else if(priv.popover_node) {
|
|
2203
|
+
render_popover_body(gobj, priv.popover_node);
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
/************************************************************
|
|
2208
|
+
* The TRACES block of a backend gobj's popover: what THIS
|
|
2209
|
+
* gobj traces (`set-gobj-trace`), one row per level -- the
|
|
2210
|
+
* gclass' own, then the kernel's (trace_rows() in the model).
|
|
2211
|
+
*
|
|
2212
|
+
* ONE scope here, the gobj's. The other two live where they
|
|
2213
|
+
* belong: every gobj of the gclass in the gclass viewer (its
|
|
2214
|
+
* `trace levels` zone), the whole yuno behind the toolbar's
|
|
2215
|
+
* `traces of the yuno`. A level one of them holds is shown on
|
|
2216
|
+
* and LOCKED here, saying which one, because unticking the
|
|
2217
|
+
* gobj's own bit would not stop it.
|
|
2150
2218
|
*
|
|
2151
|
-
*
|
|
2152
|
-
*
|
|
2153
|
-
*
|
|
2154
|
-
*
|
|
2155
|
-
* block stays locked until the host has loaded what the
|
|
2156
|
-
* backend says now -- the box shows the backend's state, not
|
|
2157
|
-
* the click.
|
|
2219
|
+
* A box is an action: its change goes to the FSM, which
|
|
2220
|
+
* publishes it to the host, and the block stays locked until
|
|
2221
|
+
* the host has loaded what the backend says now -- the box
|
|
2222
|
+
* shows the backend's state, not the click.
|
|
2158
2223
|
************************************************************/
|
|
2159
2224
|
const TRACES_NOTE_STYLE = 'color:var(--bulma-text-weak, #6B7280); margin:4px 0;';
|
|
2160
2225
|
const TRACES_CELL_STYLE = 'padding:1px 4px; text-align:center;';
|
|
2226
|
+
const TRACES_ORIGIN_STYLE = 'margin-left:6px; color:var(--bulma-text-weak, #6B7280);';
|
|
2227
|
+
const TRACES_BUTTON_STYLE = 'padding:0 8px; height:22px; font-size:11px; white-space:nowrap;';
|
|
2228
|
+
|
|
2229
|
+
/* What the block says while the levels are not in, or could not be
|
|
2230
|
+
* read. Null when they are. */
|
|
2231
|
+
function traces_state_note(info)
|
|
2232
|
+
{
|
|
2233
|
+
if(!info) {
|
|
2234
|
+
return ['div', {class: 'GOBJ_TREE_TRACES_NOTE', i18n: 'loading',
|
|
2235
|
+
style: TRACES_NOTE_STYLE}, t('loading')];
|
|
2236
|
+
}
|
|
2237
|
+
if(info.error) {
|
|
2238
|
+
return ['div', {class: 'GOBJ_TREE_TRACES_ERROR',
|
|
2239
|
+
style: 'color:var(--bulma-danger, #dc2626); margin:4px 0;'},
|
|
2240
|
+
text_node(info.error)];
|
|
2241
|
+
}
|
|
2242
|
+
return null;
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
/* The level cell: its name, the backend's own text for it as the
|
|
2246
|
+
* tooltip (data, not a key), and where an inherited level comes
|
|
2247
|
+
* from. */
|
|
2248
|
+
function trace_level_cell(level, description, $origin)
|
|
2249
|
+
{
|
|
2250
|
+
let $level = createElement2(['td', {class: 'GOBJ_TREE_TRACES_LEVEL',
|
|
2251
|
+
style: 'padding:1px 4px; word-break:break-all;'}, []]);
|
|
2252
|
+
$level.appendChild(text_node(level));
|
|
2253
|
+
if($origin) {
|
|
2254
|
+
$level.appendChild($origin);
|
|
2255
|
+
}
|
|
2256
|
+
$level.setAttribute('title', description);
|
|
2257
|
+
return $level;
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
function trace_group_row(span, $label)
|
|
2261
|
+
{
|
|
2262
|
+
return ['tr', {class: 'GOBJ_TREE_TRACES_GROUP'}, [
|
|
2263
|
+
['td', {colspan: span, style: 'padding:4px 4px 1px 4px; font-weight:600; ' +
|
|
2264
|
+
'color:var(--bulma-text-weak, #6B7280);'}, [$label]]
|
|
2265
|
+
]];
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
/* `names` are the button's i18n, title and aria-label, written by the
|
|
2269
|
+
* caller with its literal key; `$label` its text. */
|
|
2270
|
+
function traces_remove_button(gobj, scope, names, $label, disabled)
|
|
2271
|
+
{
|
|
2272
|
+
let $b = createElement2(['button', Object.assign({
|
|
2273
|
+
type: 'button',
|
|
2274
|
+
class: `GOBJ_TREE_TRACES_CLEAR_${scope.toUpperCase()} button is-small`,
|
|
2275
|
+
style: TRACES_BUTTON_STYLE,
|
|
2276
|
+
}, names), [$label], {
|
|
2277
|
+
click: (evt) => {
|
|
2278
|
+
evt.stopPropagation();
|
|
2279
|
+
gobj_send_event(gobj, "EV_TRACES_CLEARED", {scope: scope}, gobj);
|
|
2280
|
+
}
|
|
2281
|
+
}]);
|
|
2282
|
+
$b.disabled = !!disabled;
|
|
2283
|
+
return createElement2(['div', {class: 'GOBJ_TREE_TRACES_TOOLS',
|
|
2284
|
+
style: 'display:flex; flex-wrap:wrap; gap:4px; margin-top:4px;'},
|
|
2285
|
+
[$b]]);
|
|
2286
|
+
}
|
|
2161
2287
|
|
|
2162
2288
|
function build_traces_block(gobj, d)
|
|
2163
2289
|
{
|
|
2164
2290
|
let priv = gobj.priv;
|
|
2165
2291
|
let info = priv.trace_info[d.gclass] || null;
|
|
2166
2292
|
|
|
2167
|
-
let kids = [
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
if(!info) {
|
|
2175
|
-
kids.push(['div', {class: 'GOBJ_TREE_TRACES_NOTE', i18n: 'loading',
|
|
2176
|
-
style: TRACES_NOTE_STYLE}, t('loading')]);
|
|
2177
|
-
return createElement2(['div', {class: 'GOBJ_TREE_TRACES'}, kids]);
|
|
2178
|
-
}
|
|
2179
|
-
if(info.error) {
|
|
2180
|
-
kids.push(['div', {class: 'GOBJ_TREE_TRACES_ERROR',
|
|
2181
|
-
style: 'color:var(--bulma-danger, #dc2626); margin:4px 0;'},
|
|
2182
|
-
text_node(info.error)]);
|
|
2293
|
+
let kids = [['div', {class: 'GOBJ_TREE_TRACES_HEAD', i18n: 'traces of this gobj',
|
|
2294
|
+
style: 'font-weight:700; margin:8px 0 2px 0; padding-top:6px; ' +
|
|
2295
|
+
'border-top:1px solid var(--bulma-border-weak, #E5E7EB);'},
|
|
2296
|
+
t('traces of this gobj')]];
|
|
2297
|
+
let state = traces_state_note(info);
|
|
2298
|
+
if(state) {
|
|
2299
|
+
kids.push(state);
|
|
2183
2300
|
return createElement2(['div', {class: 'GOBJ_TREE_TRACES'}, kids]);
|
|
2184
2301
|
}
|
|
2185
2302
|
|
|
@@ -2191,41 +2308,27 @@ function build_traces_block(gobj, d)
|
|
|
2191
2308
|
for(let r of rows) {
|
|
2192
2309
|
if(r.group !== group) {
|
|
2193
2310
|
group = r.group;
|
|
2194
|
-
|
|
2311
|
+
trs.push(trace_group_row(2, (group === "gclass")?
|
|
2195
2312
|
text_node(d.gclass):
|
|
2196
|
-
createElement2(['span', {i18n: '
|
|
2197
|
-
trs.push(['tr', {class: 'GOBJ_TREE_TRACES_GROUP'}, [
|
|
2198
|
-
['td', {colspan: 3, style: 'padding:4px 4px 1px 4px; font-weight:600; ' +
|
|
2199
|
-
'color:var(--bulma-text-weak, #6B7280);'}, [$label]]
|
|
2200
|
-
]]);
|
|
2313
|
+
createElement2(['span', {i18n: 'kernel levels'}, t('kernel levels')])));
|
|
2201
2314
|
}
|
|
2202
|
-
let origin = null;
|
|
2315
|
+
let $origin = null;
|
|
2203
2316
|
if(r.origin === "global") {
|
|
2204
|
-
origin = ['span', {
|
|
2205
|
-
|
|
2206
|
-
t('
|
|
2317
|
+
$origin = createElement2(['span', {
|
|
2318
|
+
class: 'GOBJ_TREE_TRACES_ORIGIN', i18n: 'yuno', style: TRACES_ORIGIN_STYLE,
|
|
2319
|
+
title: t('on for the whole yuno'), 'data-i18n-title': 'on for the whole yuno',
|
|
2320
|
+
}, t('yuno')]);
|
|
2207
2321
|
} else if(r.origin === "gclass") {
|
|
2208
|
-
origin = ['span', {
|
|
2209
|
-
|
|
2210
|
-
t('gclass')
|
|
2211
|
-
|
|
2212
|
-
let $level = createElement2(['td', {class: 'GOBJ_TREE_TRACES_LEVEL',
|
|
2213
|
-
style: 'padding:1px 4px; word-break:break-all;'}, []]);
|
|
2214
|
-
$level.appendChild(text_node(r.level));
|
|
2215
|
-
if(origin) {
|
|
2216
|
-
$level.appendChild(createElement2(origin));
|
|
2322
|
+
$origin = createElement2(['span', {
|
|
2323
|
+
class: 'GOBJ_TREE_TRACES_ORIGIN', style: TRACES_ORIGIN_STYLE,
|
|
2324
|
+
title: t('on for all of the gclass'), 'data-i18n-title': 'on for all of the gclass',
|
|
2325
|
+
}, [text_node(d.gclass)]]);
|
|
2217
2326
|
}
|
|
2218
|
-
/* What the level does is the backend's text: data, not a key. */
|
|
2219
|
-
$level.setAttribute('title', r.description);
|
|
2220
|
-
|
|
2221
2327
|
trs.push(['tr', {class: 'GOBJ_TREE_TRACES_ROW'}, [
|
|
2222
|
-
|
|
2328
|
+
trace_level_cell(r.level, r.description, $origin),
|
|
2223
2329
|
['td', {style: TRACES_CELL_STYLE}, [
|
|
2224
2330
|
trace_checkbox(gobj, "gobj", r.level, r.gobj_on, pending || r.gobj_locked)
|
|
2225
2331
|
]],
|
|
2226
|
-
['td', {style: TRACES_CELL_STYLE}, [
|
|
2227
|
-
trace_checkbox(gobj, "gclass", r.level, r.gclass_on, pending || r.gclass_locked)
|
|
2228
|
-
]],
|
|
2229
2332
|
]]);
|
|
2230
2333
|
}
|
|
2231
2334
|
|
|
@@ -2235,7 +2338,6 @@ function build_traces_block(gobj, d)
|
|
|
2235
2338
|
['tr', {}, [
|
|
2236
2339
|
['th', {i18n: 'level', style: 'padding:1px 4px; text-align:left;'}, t('level')],
|
|
2237
2340
|
['th', {i18n: 'this gobj', style: TRACES_CELL_STYLE}, t('this gobj')],
|
|
2238
|
-
['th', {i18n: 'all of the gclass', style: TRACES_CELL_STYLE}, t('all of the gclass')],
|
|
2239
2341
|
]]
|
|
2240
2342
|
]],
|
|
2241
2343
|
['tbody', {}, trs]
|
|
@@ -2246,61 +2348,93 @@ function build_traces_block(gobj, d)
|
|
|
2246
2348
|
style: TRACES_NOTE_STYLE},
|
|
2247
2349
|
t('gclass traces survive a restart, gobj traces end with the yuno')]);
|
|
2248
2350
|
|
|
2249
|
-
|
|
2250
|
-
let none_gclass = pending || own_trace_levels(rows, "gclass").length === 0;
|
|
2251
|
-
let btn_style = 'padding:0 8px; height:22px; font-size:11px; white-space:nowrap;';
|
|
2252
|
-
let clear = (scope) => {
|
|
2253
|
-
return {
|
|
2254
|
-
click: (evt) => {
|
|
2255
|
-
evt.stopPropagation();
|
|
2256
|
-
gobj_send_event(gobj, "EV_TRACES_CLEARED", {scope: scope}, gobj);
|
|
2257
|
-
}
|
|
2258
|
-
};
|
|
2259
|
-
};
|
|
2260
|
-
let $clear_gobj = createElement2(['button', {
|
|
2261
|
-
type: 'button', class: 'GOBJ_TREE_TRACES_CLEAR_GOBJ button is-small', style: btn_style,
|
|
2262
|
-
i18n: 'remove the traces of this gobj',
|
|
2351
|
+
kids.push(traces_remove_button(gobj, "gobj", {
|
|
2263
2352
|
title: t('remove the traces of this gobj'),
|
|
2264
2353
|
'data-i18n-title': 'remove the traces of this gobj',
|
|
2265
2354
|
'aria-label': t('remove the traces of this gobj'),
|
|
2266
2355
|
'data-i18n-aria-label': 'remove the traces of this gobj',
|
|
2267
|
-
},
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
i18n: 'remove the traces of the gclass',
|
|
2271
|
-
title: t('remove the traces of the gclass'),
|
|
2272
|
-
'data-i18n-title': 'remove the traces of the gclass',
|
|
2273
|
-
'aria-label': t('remove the traces of the gclass'),
|
|
2274
|
-
'data-i18n-aria-label': 'remove the traces of the gclass',
|
|
2275
|
-
}, t('remove the traces of the gclass'), clear("gclass")]);
|
|
2276
|
-
$clear_gobj.disabled = none_gobj;
|
|
2277
|
-
$clear_gclass.disabled = none_gclass;
|
|
2278
|
-
kids.push(['div', {class: 'GOBJ_TREE_TRACES_TOOLS',
|
|
2279
|
-
style: 'display:flex; flex-wrap:wrap; gap:4px; margin-top:4px;'},
|
|
2280
|
-
[$clear_gobj, $clear_gclass]]);
|
|
2356
|
+
}, createElement2(['span', {i18n: 'remove the traces of this gobj'},
|
|
2357
|
+
t('remove the traces of this gobj')]),
|
|
2358
|
+
pending || own_trace_levels(rows, "gobj").length === 0));
|
|
2281
2359
|
|
|
2282
2360
|
return createElement2(['div', {class: 'GOBJ_TREE_TRACES'}, kids]);
|
|
2283
2361
|
}
|
|
2284
2362
|
|
|
2285
|
-
|
|
2363
|
+
/************************************************************
|
|
2364
|
+
* The yuno's traces (`set-global-trace`): the kernel's levels,
|
|
2365
|
+
* and whether every gobj of the yuno traces each one. Drawn in
|
|
2366
|
+
* the popover, opened from the toolbar, and read from the
|
|
2367
|
+
* answer for the ROOT's gclass -- the yuno itself, whose
|
|
2368
|
+
* answer carries the yuno's levels like every other one.
|
|
2369
|
+
************************************************************/
|
|
2370
|
+
function build_yuno_traces_block(gobj)
|
|
2371
|
+
{
|
|
2372
|
+
let priv = gobj.priv;
|
|
2373
|
+
let root = priv.remote_root;
|
|
2374
|
+
let info = (root && priv.trace_info[root.gclass]) || null;
|
|
2375
|
+
|
|
2376
|
+
let kids = [];
|
|
2377
|
+
let state = traces_state_note(info);
|
|
2378
|
+
if(state) {
|
|
2379
|
+
kids.push(state);
|
|
2380
|
+
return createElement2(['div', {class: 'GOBJ_TREE_YUNO_TRACES'}, kids]);
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
let rows = global_trace_rows(info);
|
|
2384
|
+
let pending = !!priv.trace_pending;
|
|
2385
|
+
|
|
2386
|
+
let trs = rows.map((r) => ['tr', {class: 'GOBJ_TREE_TRACES_ROW'}, [
|
|
2387
|
+
trace_level_cell(r.level, r.description, null),
|
|
2388
|
+
['td', {style: TRACES_CELL_STYLE}, [
|
|
2389
|
+
trace_checkbox(gobj, "global", r.level, r.global_on, pending)
|
|
2390
|
+
]],
|
|
2391
|
+
]]);
|
|
2392
|
+
|
|
2393
|
+
kids.push(['table', {class: 'GOBJ_TREE_TRACES_TABLE',
|
|
2394
|
+
style: 'width:100%; border-collapse:collapse;'}, [
|
|
2395
|
+
['thead', {}, [
|
|
2396
|
+
['tr', {}, [
|
|
2397
|
+
['th', {i18n: 'kernel levels', style: 'padding:1px 4px; text-align:left;'},
|
|
2398
|
+
t('kernel levels')],
|
|
2399
|
+
['th', {i18n: 'the whole yuno', style: TRACES_CELL_STYLE}, t('the whole yuno')],
|
|
2400
|
+
]]
|
|
2401
|
+
]],
|
|
2402
|
+
['tbody', {}, trs]
|
|
2403
|
+
]]);
|
|
2404
|
+
|
|
2405
|
+
kids.push(['div', {class: 'GOBJ_TREE_TRACES_NOTE',
|
|
2406
|
+
i18n: "the yuno's traces survive a restart",
|
|
2407
|
+
style: TRACES_NOTE_STYLE},
|
|
2408
|
+
t("the yuno's traces survive a restart")]);
|
|
2409
|
+
|
|
2410
|
+
kids.push(traces_remove_button(gobj, "global", {
|
|
2411
|
+
title: t('remove the traces of the yuno'),
|
|
2412
|
+
'data-i18n-title': 'remove the traces of the yuno',
|
|
2413
|
+
'aria-label': t('remove the traces of the yuno'),
|
|
2414
|
+
'data-i18n-aria-label': 'remove the traces of the yuno',
|
|
2415
|
+
}, createElement2(['span', {i18n: 'remove the traces of the yuno'},
|
|
2416
|
+
t('remove the traces of the yuno')]),
|
|
2417
|
+
pending || own_trace_levels(rows, "global").length === 0));
|
|
2418
|
+
|
|
2419
|
+
return createElement2(['div', {class: 'GOBJ_TREE_YUNO_TRACES'}, kids]);
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
/* One box of a block. `checked` and `disabled` are set as
|
|
2286
2423
|
* PROPERTIES: createElement2 writes attributes, and an attribute
|
|
2287
2424
|
* `checked="false"` is a checked box. */
|
|
2425
|
+
const TRACE_BOX = {
|
|
2426
|
+
gobj: {cls: 'GOBJ_TREE_TRACE_GOBJ', key: 'this gobj'},
|
|
2427
|
+
global: {cls: 'GOBJ_TREE_TRACE_GLOBAL', key: 'the whole yuno'},
|
|
2428
|
+
};
|
|
2429
|
+
|
|
2288
2430
|
function trace_checkbox(gobj, scope, level, on, locked)
|
|
2289
2431
|
{
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
}]);
|
|
2297
|
-
} else {
|
|
2298
|
-
$cb = createElement2(['input', {
|
|
2299
|
-
type: 'checkbox', class: 'GOBJ_TREE_TRACE_GCLASS',
|
|
2300
|
-
title: t('all of the gclass'), 'data-i18n-title': 'all of the gclass',
|
|
2301
|
-
'aria-label': t('all of the gclass'), 'data-i18n-aria-label': 'all of the gclass',
|
|
2302
|
-
}]);
|
|
2303
|
-
}
|
|
2432
|
+
const box = TRACE_BOX[scope];
|
|
2433
|
+
let $cb = createElement2(['input', {
|
|
2434
|
+
type: 'checkbox', class: box.cls,
|
|
2435
|
+
title: t(box.key), 'data-i18n-title': box.key,
|
|
2436
|
+
'aria-label': t(box.key), 'data-i18n-aria-label': box.key,
|
|
2437
|
+
}]);
|
|
2304
2438
|
$cb.setAttribute('data-level', level);
|
|
2305
2439
|
$cb.checked = !!on;
|
|
2306
2440
|
$cb.disabled = !!locked;
|
|
@@ -2321,13 +2455,22 @@ function reload_keeping_popover(gobj, opts)
|
|
|
2321
2455
|
{
|
|
2322
2456
|
let priv = gobj.priv;
|
|
2323
2457
|
let $popover = priv.$popover;
|
|
2324
|
-
let
|
|
2458
|
+
let shown = !!($popover && $popover.style.display === "block");
|
|
2459
|
+
let keep = (shown && priv.popover_mode === "node" && priv.popover_node)?
|
|
2325
2460
|
priv.popover_node.full_name: null;
|
|
2461
|
+
let keep_yuno = shown && priv.popover_mode === "yuno";
|
|
2326
2462
|
let left = $popover? $popover.style.left: "";
|
|
2327
2463
|
let top = $popover? $popover.style.top: "";
|
|
2328
2464
|
|
|
2329
2465
|
refresh_tree(gobj, opts); /* hides the popover */
|
|
2330
2466
|
|
|
2467
|
+
if(keep_yuno) {
|
|
2468
|
+
open_popover_frame(gobj, "yuno", t("traces of the yuno"));
|
|
2469
|
+
$popover.style.left = left;
|
|
2470
|
+
$popover.style.top = top;
|
|
2471
|
+
render_current_popover(gobj);
|
|
2472
|
+
return;
|
|
2473
|
+
}
|
|
2331
2474
|
if(!keep || !priv.node_by_id) {
|
|
2332
2475
|
return;
|
|
2333
2476
|
}
|
|
@@ -2335,13 +2478,11 @@ function reload_keeping_popover(gobj, opts)
|
|
|
2335
2478
|
let d = priv.node_by_id[id];
|
|
2336
2479
|
if(d.full_name === keep) {
|
|
2337
2480
|
priv.popover_node = d;
|
|
2338
|
-
|
|
2339
|
-
(d.gclass + (d.name ? "^" + d.name : ""));
|
|
2340
|
-
priv.$popover_title.title = priv.$popover_title.textContent;
|
|
2481
|
+
open_popover_frame(gobj, "node", d.short_name ||
|
|
2482
|
+
(d.gclass + (d.name ? "^" + d.name : "")));
|
|
2341
2483
|
render_popover_body(gobj, d);
|
|
2342
2484
|
$popover.style.left = left;
|
|
2343
2485
|
$popover.style.top = top;
|
|
2344
|
-
$popover.style.display = "block";
|
|
2345
2486
|
return;
|
|
2346
2487
|
}
|
|
2347
2488
|
}
|
|
@@ -2363,10 +2504,8 @@ function show_popover(gobj, node_data, client_x, client_y)
|
|
|
2363
2504
|
}
|
|
2364
2505
|
|
|
2365
2506
|
priv.popover_node = node_data;
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
(node_data.gclass + (node_data.name ? "^" + node_data.name : ""));
|
|
2369
|
-
$title.title = $title.textContent;
|
|
2507
|
+
open_popover_frame(gobj, "node", node_data.short_name ||
|
|
2508
|
+
(node_data.gclass + (node_data.name ? "^" + node_data.name : "")));
|
|
2370
2509
|
|
|
2371
2510
|
render_popover_body(gobj, node_data);
|
|
2372
2511
|
|
|
@@ -2418,6 +2557,51 @@ function hide_popover(gobj)
|
|
|
2418
2557
|
priv.$popover_title.textContent = "";
|
|
2419
2558
|
}
|
|
2420
2559
|
priv.popover_node = null;
|
|
2560
|
+
priv.popover_mode = "";
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
/************************************************************
|
|
2564
|
+
* The popover's frame for what it is about to show: its
|
|
2565
|
+
* title, and the gclass button only for a card -- the yuno's
|
|
2566
|
+
* traces are no gclass of their own.
|
|
2567
|
+
************************************************************/
|
|
2568
|
+
function open_popover_frame(gobj, mode, title)
|
|
2569
|
+
{
|
|
2570
|
+
let priv = gobj.priv;
|
|
2571
|
+
priv.popover_mode = mode;
|
|
2572
|
+
priv.$popover_title.textContent = title;
|
|
2573
|
+
priv.$popover_title.title = title;
|
|
2574
|
+
if(priv.$popover_gclass) {
|
|
2575
|
+
priv.$popover_gclass.classList.toggle("is-hidden", mode !== "node");
|
|
2576
|
+
}
|
|
2577
|
+
priv.$popover.style.display = "block";
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
/************************************************************
|
|
2581
|
+
* The yuno's traces, in the popover, under the toolbar
|
|
2582
|
+
* button that opened them.
|
|
2583
|
+
************************************************************/
|
|
2584
|
+
function show_yuno_traces(gobj)
|
|
2585
|
+
{
|
|
2586
|
+
let priv = gobj.priv;
|
|
2587
|
+
let $popover = priv.$popover;
|
|
2588
|
+
let $container = gobj_read_attr(gobj, "$container");
|
|
2589
|
+
if(!$popover || !$container) {
|
|
2590
|
+
return;
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
priv.popover_node = null;
|
|
2594
|
+
open_popover_frame(gobj, "yuno", t("traces of the yuno"));
|
|
2595
|
+
render_current_popover(gobj);
|
|
2596
|
+
|
|
2597
|
+
let rect = $container.getBoundingClientRect();
|
|
2598
|
+
let $btn = $container.querySelector(".GOBJ_TREE_YUNO_TRACES_BUTTON");
|
|
2599
|
+
let b = $btn? $btn.getBoundingClientRect(): null;
|
|
2600
|
+
let pop = $popover.getBoundingClientRect();
|
|
2601
|
+
let left = b? (b.right - rect.left - pop.width): (rect.width - pop.width - 8);
|
|
2602
|
+
let top = b? (b.bottom - rect.top + 6): 8;
|
|
2603
|
+
$popover.style.left = Math.max(4, left) + "px";
|
|
2604
|
+
$popover.style.top = Math.max(4, top) + "px";
|
|
2421
2605
|
}
|
|
2422
2606
|
|
|
2423
2607
|
/************************************************************
|
|
@@ -3347,7 +3531,7 @@ function ac_open_gclass(gobj, event, kw, src)
|
|
|
3347
3531
|
return 0;
|
|
3348
3532
|
}
|
|
3349
3533
|
|
|
3350
|
-
open_gclass_window(gobj, node_data.gclass, null, node_data
|
|
3534
|
+
open_gclass_window(gobj, node_data.gclass, null, node_data);
|
|
3351
3535
|
|
|
3352
3536
|
return 0;
|
|
3353
3537
|
}
|
|
@@ -3364,12 +3548,13 @@ function ac_gclass_description(gobj, event, kw, src)
|
|
|
3364
3548
|
}
|
|
3365
3549
|
let d = priv.popover_node;
|
|
3366
3550
|
open_gclass_window(gobj, kw.gclass, kw.description,
|
|
3367
|
-
(d && d.gclass === kw.gclass)?
|
|
3551
|
+
(d && d.gclass === kw.gclass)? d: null);
|
|
3368
3552
|
return 0;
|
|
3369
3553
|
}
|
|
3370
3554
|
|
|
3371
|
-
/* One window at a time: a second gclass replaces the first.
|
|
3372
|
-
|
|
3555
|
+
/* One window at a time: a second gclass replaces the first. `d` is
|
|
3556
|
+
* the card the reader came from, or null. */
|
|
3557
|
+
function open_gclass_window(gobj, gclass, description, d)
|
|
3373
3558
|
{
|
|
3374
3559
|
let priv = gobj.priv;
|
|
3375
3560
|
|
|
@@ -3383,7 +3568,10 @@ function open_gclass_window(gobj, gclass, description, state)
|
|
|
3383
3568
|
* CLASS and cannot carry it, and the tree is the only party
|
|
3384
3569
|
* that knows -- so the machine lights the column the reader
|
|
3385
3570
|
* is actually standing in. */
|
|
3386
|
-
current_state: state,
|
|
3571
|
+
current_state: (d && d.state) || "",
|
|
3572
|
+
/* ...and which instance that is: a gclass has several, and a
|
|
3573
|
+
* state with no name beside it belongs to none of them. */
|
|
3574
|
+
instance_name: (d && d.name) || "",
|
|
3387
3575
|
on_close: () => {
|
|
3388
3576
|
if(gobj_is_destroying(gobj)) {
|
|
3389
3577
|
return;
|
|
@@ -3394,6 +3582,12 @@ function open_gclass_window(gobj, gclass, description, state)
|
|
|
3394
3582
|
if(description) {
|
|
3395
3583
|
opts.description = description;
|
|
3396
3584
|
}
|
|
3585
|
+
/* A backend gclass' traces can be set for every gobj of it, from
|
|
3586
|
+
* the viewer: it is handed what the host read, and tells this
|
|
3587
|
+
* view what to set (EV_SET_GCLASS_TRACE). */
|
|
3588
|
+
if(is_remote(gobj)) {
|
|
3589
|
+
opts.traces = viewer_traces(gobj, gclass);
|
|
3590
|
+
}
|
|
3397
3591
|
priv.gclass_view = open_gclass_view(gobj, /* i18n: data */ gclass, opts);
|
|
3398
3592
|
}
|
|
3399
3593
|
|
|
@@ -3457,32 +3651,98 @@ function ac_trace_info(gobj, event, kw, src)
|
|
|
3457
3651
|
priv.trace_pending = false;
|
|
3458
3652
|
|
|
3459
3653
|
let d = priv.popover_node;
|
|
3460
|
-
|
|
3461
|
-
|
|
3654
|
+
let root = priv.remote_root;
|
|
3655
|
+
if((priv.popover_mode === "node" && d && d.gclass === kw.gclass) ||
|
|
3656
|
+
(priv.popover_mode === "yuno" && root && root.gclass === kw.gclass)) {
|
|
3657
|
+
render_current_popover(gobj);
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
let viewer = gclass_viewer_gobj(gobj);
|
|
3661
|
+
if(viewer) {
|
|
3662
|
+
let shown = gobj_read_str_attr(viewer, "gclass_name");
|
|
3663
|
+
if(shown === kw.gclass) {
|
|
3664
|
+
gobj_send_event(viewer, "EV_SET_TRACES", viewer_traces(gobj, shown), gobj);
|
|
3665
|
+
} else if(priv.viewer_stale === shown) {
|
|
3666
|
+
/* A set of the YUNO's scope: what the viewer shows as held by
|
|
3667
|
+
* the yuno moved too, and the host refreshed only the root's
|
|
3668
|
+
* gclass. */
|
|
3669
|
+
gobj_publish_event(gobj, "EV_TRACE_INFO_WANTED", {gclass: shown});
|
|
3670
|
+
}
|
|
3462
3671
|
}
|
|
3672
|
+
priv.viewer_stale = "";
|
|
3463
3673
|
return 0;
|
|
3464
3674
|
}
|
|
3465
3675
|
|
|
3676
|
+
/************************************************************
|
|
3677
|
+
* The gclass viewer this view opened, while it is open.
|
|
3678
|
+
************************************************************/
|
|
3679
|
+
function gclass_viewer_gobj(gobj)
|
|
3680
|
+
{
|
|
3681
|
+
let h = gobj.priv.gclass_view;
|
|
3682
|
+
return (h && h.json_gobj && !gobj_is_destroying(h.json_gobj))? h.json_gobj: null;
|
|
3683
|
+
}
|
|
3684
|
+
|
|
3685
|
+
/************************************************************
|
|
3686
|
+
* What the gclass viewer needs to draw the traces of `gclass`
|
|
3687
|
+
* for every gobj of it: the levels the host read, and whether a
|
|
3688
|
+
* set is still in flight. Plain json: it rides in a kw.
|
|
3689
|
+
************************************************************/
|
|
3690
|
+
function viewer_traces(gobj, gclass)
|
|
3691
|
+
{
|
|
3692
|
+
let priv = gobj.priv;
|
|
3693
|
+
return {
|
|
3694
|
+
info: priv.trace_info[gclass] || null,
|
|
3695
|
+
pending: !!priv.trace_pending,
|
|
3696
|
+
};
|
|
3697
|
+
}
|
|
3698
|
+
|
|
3466
3699
|
/************************************************************
|
|
3467
3700
|
* A box of the TRACES block was ticked or cleared.
|
|
3468
3701
|
************************************************************/
|
|
3469
3702
|
function ac_trace_toggled(gobj, event, kw, src)
|
|
3470
3703
|
{
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
if(!is_remote(gobj) || !d) {
|
|
3474
|
-
log_error(`${gobj_short_name(gobj)}: a trace set with no backend card open`);
|
|
3704
|
+
if(!kw.level) {
|
|
3705
|
+
log_error(`${gobj_short_name(gobj)}: a trace set of no level, scope '${kw.scope}'`);
|
|
3475
3706
|
return -1;
|
|
3476
3707
|
}
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
return -1;
|
|
3708
|
+
let target = trace_target(gobj, kw.scope);
|
|
3709
|
+
if(!target) {
|
|
3710
|
+
return -1; // Error already logged
|
|
3481
3711
|
}
|
|
3482
|
-
set_trace_levels(gobj,
|
|
3712
|
+
set_trace_levels(gobj, target, kw.scope, [kw.level], !!kw.set);
|
|
3483
3713
|
return 0;
|
|
3484
3714
|
}
|
|
3485
3715
|
|
|
3716
|
+
/************************************************************
|
|
3717
|
+
* What a set of `scope` acts on: the card the popover is on
|
|
3718
|
+
* (gobj), or the yuno itself, the root (global). Null, and
|
|
3719
|
+
* logged, when the popover is not showing it.
|
|
3720
|
+
************************************************************/
|
|
3721
|
+
function trace_target(gobj, scope)
|
|
3722
|
+
{
|
|
3723
|
+
let priv = gobj.priv;
|
|
3724
|
+
if(!is_remote(gobj)) {
|
|
3725
|
+
log_error(`${gobj_short_name(gobj)}: a trace set on a tree that is not remote`);
|
|
3726
|
+
return null;
|
|
3727
|
+
}
|
|
3728
|
+
if(scope === "gobj") {
|
|
3729
|
+
if(priv.popover_mode !== "node" || !priv.popover_node) {
|
|
3730
|
+
log_error(`${gobj_short_name(gobj)}: a gobj trace set with no backend card open`);
|
|
3731
|
+
return null;
|
|
3732
|
+
}
|
|
3733
|
+
return priv.popover_node;
|
|
3734
|
+
}
|
|
3735
|
+
if(scope === "global") {
|
|
3736
|
+
if(priv.popover_mode !== "yuno" || !priv.remote_root) {
|
|
3737
|
+
log_error(`${gobj_short_name(gobj)}: a yuno trace set with the yuno's traces closed`);
|
|
3738
|
+
return null;
|
|
3739
|
+
}
|
|
3740
|
+
return priv.remote_root;
|
|
3741
|
+
}
|
|
3742
|
+
log_error(`${gobj_short_name(gobj)}: a trace set of no scope the popover has: '${scope}'`);
|
|
3743
|
+
return null;
|
|
3744
|
+
}
|
|
3745
|
+
|
|
3486
3746
|
/************************************************************
|
|
3487
3747
|
* "Remove the traces" of the gobj or of its gclass: every
|
|
3488
3748
|
* level that scope holds on its own.
|
|
@@ -3490,39 +3750,88 @@ function ac_trace_toggled(gobj, event, kw, src)
|
|
|
3490
3750
|
function ac_traces_cleared(gobj, event, kw, src)
|
|
3491
3751
|
{
|
|
3492
3752
|
let priv = gobj.priv;
|
|
3493
|
-
let
|
|
3494
|
-
if(!
|
|
3495
|
-
|
|
3496
|
-
return -1;
|
|
3753
|
+
let target = trace_target(gobj, kw.scope);
|
|
3754
|
+
if(!target) {
|
|
3755
|
+
return -1; // Error already logged
|
|
3497
3756
|
}
|
|
3498
|
-
let
|
|
3757
|
+
let info = priv.trace_info[target.gclass];
|
|
3758
|
+
let rows = (kw.scope === "global")? global_trace_rows(info): trace_rows(target, info);
|
|
3499
3759
|
let levels = own_trace_levels(rows, kw.scope);
|
|
3500
3760
|
if(!levels.length) {
|
|
3501
3761
|
/* The button is off when there is nothing: reaching here is
|
|
3502
3762
|
* a button that did not follow the block. */
|
|
3503
|
-
log_error(`${gobj_short_name(gobj)}: no ${kw.scope} trace of ${
|
|
3763
|
+
log_error(`${gobj_short_name(gobj)}: no ${kw.scope} trace of ${target.full_name} to remove`);
|
|
3764
|
+
return -1;
|
|
3765
|
+
}
|
|
3766
|
+
set_trace_levels(gobj, target, kw.scope, levels, false);
|
|
3767
|
+
return 0;
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
/************************************************************
|
|
3771
|
+
* The gclass viewer asked for a set of every gobj of its
|
|
3772
|
+
* gclass ({gclass, levels, set}).
|
|
3773
|
+
************************************************************/
|
|
3774
|
+
function ac_set_gclass_trace(gobj, event, kw, src)
|
|
3775
|
+
{
|
|
3776
|
+
let levels = (kw && Array.isArray(kw.levels))? kw.levels: [];
|
|
3777
|
+
if(!is_remote(gobj) || !kw.gclass || !levels.length) {
|
|
3778
|
+
log_error(`${gobj_short_name(gobj)}: a gclass trace set of no gclass or level, ` +
|
|
3779
|
+
`or on a tree that is not remote: '${kw && kw.gclass}'`);
|
|
3504
3780
|
return -1;
|
|
3505
3781
|
}
|
|
3506
|
-
set_trace_levels(gobj,
|
|
3782
|
+
set_trace_levels(gobj, {full_name: "", gclass: kw.gclass}, "gclass", levels, !!kw.set);
|
|
3507
3783
|
return 0;
|
|
3508
3784
|
}
|
|
3509
3785
|
|
|
3510
|
-
/* Lock
|
|
3511
|
-
* repainted from what the backend says next, never from here.
|
|
3512
|
-
|
|
3786
|
+
/* Lock every block and hand the change to the host. The blocks are
|
|
3787
|
+
* repainted from what the backend says next, never from here.
|
|
3788
|
+
*
|
|
3789
|
+
* `target.gclass` is the gclass whose levels the host reads again
|
|
3790
|
+
* afterwards: the card's, the viewer's, or the root's for a set of
|
|
3791
|
+
* the yuno's scope -- which also moves what an open viewer of
|
|
3792
|
+
* ANOTHER gclass shows as held by the yuno, so that one is asked
|
|
3793
|
+
* for again when the answer is in (ac_trace_info). */
|
|
3794
|
+
function set_trace_levels(gobj, target, scope, levels, set)
|
|
3513
3795
|
{
|
|
3514
3796
|
let priv = gobj.priv;
|
|
3515
3797
|
priv.trace_pending = true;
|
|
3516
|
-
|
|
3798
|
+
render_current_popover(gobj);
|
|
3799
|
+
|
|
3800
|
+
let viewer = gclass_viewer_gobj(gobj);
|
|
3801
|
+
if(viewer) {
|
|
3802
|
+
let shown = gobj_read_str_attr(viewer, "gclass_name");
|
|
3803
|
+
if(scope === "global" && shown !== target.gclass) {
|
|
3804
|
+
priv.viewer_stale = shown;
|
|
3805
|
+
}
|
|
3806
|
+
gobj_send_event(viewer, "EV_SET_TRACES", viewer_traces(gobj, shown), gobj);
|
|
3807
|
+
}
|
|
3808
|
+
|
|
3517
3809
|
gobj_publish_event(gobj, "EV_SET_TRACE_LEVEL", {
|
|
3518
3810
|
scope: scope,
|
|
3519
|
-
gobj:
|
|
3520
|
-
gclass:
|
|
3811
|
+
gobj: target.full_name || "",
|
|
3812
|
+
gclass: target.gclass,
|
|
3521
3813
|
levels: levels,
|
|
3522
3814
|
set: set,
|
|
3523
3815
|
});
|
|
3524
3816
|
}
|
|
3525
3817
|
|
|
3818
|
+
/************************************************************
|
|
3819
|
+
* The toolbar's "traces of the yuno": the popover shows the
|
|
3820
|
+
* yuno's scope, read from the answer for the root's gclass.
|
|
3821
|
+
************************************************************/
|
|
3822
|
+
function ac_open_yuno_traces(gobj, event, kw, src)
|
|
3823
|
+
{
|
|
3824
|
+
let priv = gobj.priv;
|
|
3825
|
+
let root = priv.remote_root;
|
|
3826
|
+
if(!is_remote(gobj) || !root) {
|
|
3827
|
+
log_error(`${gobj_short_name(gobj)}: the yuno's traces asked with no backend tree loaded`);
|
|
3828
|
+
return -1;
|
|
3829
|
+
}
|
|
3830
|
+
show_yuno_traces(gobj);
|
|
3831
|
+
gobj_publish_event(gobj, "EV_TRACE_INFO_WANTED", {gclass: root.gclass});
|
|
3832
|
+
return 0;
|
|
3833
|
+
}
|
|
3834
|
+
|
|
3526
3835
|
/************************************************************
|
|
3527
3836
|
* The app switched language.
|
|
3528
3837
|
*
|
|
@@ -3603,6 +3912,8 @@ function create_gclass(gclass_name)
|
|
|
3603
3912
|
["EV_TRACE_TOGGLED", ac_trace_toggled, null],
|
|
3604
3913
|
["EV_TRACES_CLEARED", ac_traces_cleared, null],
|
|
3605
3914
|
["EV_GCLASS_DESCRIPTION", ac_gclass_description, null],
|
|
3915
|
+
["EV_OPEN_YUNO_TRACES", ac_open_yuno_traces, null],
|
|
3916
|
+
["EV_SET_GCLASS_TRACE", ac_set_gclass_trace, null],
|
|
3606
3917
|
]]
|
|
3607
3918
|
];
|
|
3608
3919
|
|
|
@@ -3635,6 +3946,9 @@ function create_gclass(gclass_name)
|
|
|
3635
3946
|
["EV_TRACE_TOGGLED", 0],
|
|
3636
3947
|
["EV_TRACES_CLEARED", 0],
|
|
3637
3948
|
["EV_GCLASS_DESCRIPTION", 0],
|
|
3949
|
+
["EV_OPEN_YUNO_TRACES", 0],
|
|
3950
|
+
/* From the gclass viewer this view opens (its child). */
|
|
3951
|
+
["EV_SET_GCLASS_TRACE", 0],
|
|
3638
3952
|
/* Published only when `source` is "remote" (see the header). */
|
|
3639
3953
|
["EV_TREE_WANTED", event_flag_t.EVF_OUTPUT_EVENT],
|
|
3640
3954
|
["EV_TRACE_INFO_WANTED", event_flag_t.EVF_OUTPUT_EVENT],
|