OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library isolate_view_element; | 5 library isolate_view_element; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'package:observatory/models.dart' as M; | 9 import 'package:observatory/models.dart' as M; |
10 import 'package:observatory/src/elements/curly_block.dart'; | 10 import 'package:observatory/src/elements/curly_block.dart'; |
11 import 'package:observatory/src/elements/eval_box.dart'; | 11 import 'package:observatory/src/elements/eval_box.dart'; |
12 import 'package:observatory/src/elements/function_ref.dart'; | 12 import 'package:observatory/src/elements/function_ref.dart'; |
| 13 import 'package:observatory/src/elements/helpers/nav_bar.dart'; |
13 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 14 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
14 import 'package:observatory/src/elements/helpers/tag.dart'; | 15 import 'package:observatory/src/elements/helpers/tag.dart'; |
15 import 'package:observatory/src/elements/helpers/uris.dart'; | 16 import 'package:observatory/src/elements/helpers/uris.dart'; |
16 import 'package:observatory/src/elements/isolate/location.dart'; | 17 import 'package:observatory/src/elements/isolate/location.dart'; |
17 import 'package:observatory/src/elements/isolate/run_state.dart'; | 18 import 'package:observatory/src/elements/isolate/run_state.dart'; |
18 import 'package:observatory/src/elements/isolate/shared_summary.dart'; | 19 import 'package:observatory/src/elements/isolate/shared_summary.dart'; |
19 import 'package:observatory/src/elements/library_ref.dart'; | 20 import 'package:observatory/src/elements/library_ref.dart'; |
20 import 'package:observatory/src/elements/nav/bar.dart'; | |
21 import 'package:observatory/src/elements/nav/class_menu.dart'; | 21 import 'package:observatory/src/elements/nav/class_menu.dart'; |
22 import 'package:observatory/src/elements/nav/isolate_menu.dart'; | 22 import 'package:observatory/src/elements/nav/isolate_menu.dart'; |
23 import 'package:observatory/src/elements/nav/notify.dart'; | 23 import 'package:observatory/src/elements/nav/notify.dart'; |
24 import 'package:observatory/src/elements/nav/refresh.dart'; | 24 import 'package:observatory/src/elements/nav/refresh.dart'; |
25 import 'package:observatory/src/elements/nav/top_menu.dart'; | 25 import 'package:observatory/src/elements/nav/top_menu.dart'; |
26 import 'package:observatory/src/elements/nav/vm_menu.dart'; | 26 import 'package:observatory/src/elements/nav/vm_menu.dart'; |
27 import 'package:observatory/src/elements/script_inset.dart'; | 27 import 'package:observatory/src/elements/script_inset.dart'; |
28 import 'package:observatory/src/elements/source_inset.dart'; | 28 import 'package:observatory/src/elements/source_inset.dart'; |
29 import 'package:observatory/src/elements/view_footer.dart'; | 29 import 'package:observatory/src/elements/view_footer.dart'; |
30 | 30 |
31 class IsolateViewElement extends HtmlElement implements Renderable { | 31 class IsolateViewElement extends HtmlElement implements Renderable { |
32 static const tag = const Tag<IsolateViewElement>('isolate-view', | 32 static const tag = const Tag<IsolateViewElement>('isolate-view', |
33 dependencies: const [ | 33 dependencies: const [ |
34 CurlyBlockElement.tag, | 34 CurlyBlockElement.tag, |
35 EvalBoxElement.tag, | 35 EvalBoxElement.tag, |
36 FunctionRefElement.tag, | 36 FunctionRefElement.tag, |
37 IsolateLocationElement.tag, | 37 IsolateLocationElement.tag, |
38 IsolateRunStateElement.tag, | 38 IsolateRunStateElement.tag, |
39 IsolateSharedSummaryElement.tag, | 39 IsolateSharedSummaryElement.tag, |
40 LibraryRefElement.tag, | 40 LibraryRefElement.tag, |
41 NavBarElement.tag, | |
42 NavClassMenuElement.tag, | 41 NavClassMenuElement.tag, |
43 NavTopMenuElement.tag, | 42 NavTopMenuElement.tag, |
44 NavIsolateMenuElement.tag, | 43 NavIsolateMenuElement.tag, |
45 NavRefreshElement.tag, | 44 NavRefreshElement.tag, |
46 NavNotifyElement.tag, | 45 NavNotifyElement.tag, |
47 ScriptInsetElement.tag, | 46 ScriptInsetElement.tag, |
48 SourceInsetElement.tag, | 47 SourceInsetElement.tag, |
49 ViewFooterElement.tag | 48 ViewFooterElement.tag |
50 ]); | 49 ]); |
51 | 50 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 super.detached(); | 125 super.detached(); |
127 _r.disable(notify: true); | 126 _r.disable(notify: true); |
128 children = []; | 127 children = []; |
129 _subscription.cancel(); | 128 _subscription.cancel(); |
130 } | 129 } |
131 | 130 |
132 void render() { | 131 void render() { |
133 final uptime = new DateTime.now().difference(_isolate.startTime); | 132 final uptime = new DateTime.now().difference(_isolate.startTime); |
134 final libraries = _isolate.libraries.toList(); | 133 final libraries = _isolate.libraries.toList(); |
135 children = [ | 134 children = [ |
136 new NavBarElement(queue: _r.queue) | 135 navBar([ |
137 ..children = [ | 136 new NavTopMenuElement(queue: _r.queue), |
138 new NavTopMenuElement(queue: _r.queue), | 137 new NavVMMenuElement(_vm, _events, queue: _r.queue), |
139 new NavVMMenuElement(_vm, _events, queue: _r.queue), | 138 new NavIsolateMenuElement(_isolate, _events, |
140 new NavIsolateMenuElement(_isolate, _events, last: true, | 139 queue: _r.queue), |
141 queue: _r.queue), | 140 new NavRefreshElement(label: 'reload source', queue: _r.queue) |
142 new NavRefreshElement(label: 'reload source', queue: _r.queue) | 141 ..onRefresh.listen((e) async { |
143 ..onRefresh.listen((e) async { | 142 e.element.disabled = true; |
144 e.element.disabled = true; | 143 await _isolates.reloadSources(_isolate); |
145 await _isolates.reloadSources(_isolate); | 144 _r.dirty(); |
146 _r.dirty(); | 145 }), |
147 }), | 146 new NavRefreshElement(queue: _r.queue) |
148 new NavRefreshElement(queue: _r.queue) | 147 ..onRefresh.listen((e) async { |
149 ..onRefresh.listen((e) async { | 148 e.element.disabled = true; |
150 e.element.disabled = true; | 149 _isolate = await _isolates.get(_isolate); |
151 _isolate = await _isolates.get(_isolate); | 150 await _loadExtraData(); |
152 await _loadExtraData(); | 151 _r.dirty(); |
153 _r.dirty(); | 152 }), |
154 }), | 153 new NavNotifyElement(_notifications, queue: _r.queue) |
155 new NavNotifyElement(_notifications, queue: _r.queue) | 154 ]), |
156 ], | |
157 new DivElement()..classes = ['content-centered-big'] | 155 new DivElement()..classes = ['content-centered-big'] |
158 ..children = [ | 156 ..children = [ |
159 new HeadingElement.h2()..text = 'Isolate ${_isolate.name}', | 157 new HeadingElement.h2()..text = 'Isolate ${_isolate.name}', |
160 new BRElement(), | 158 new BRElement(), |
161 new DivElement()..classes = ['flex-row'] | 159 new DivElement()..classes = ['flex-row'] |
162 ..children = [ | 160 ..children = [ |
163 new DivElement()..style.flex = '1', | 161 new DivElement()..style.flex = '1', |
164 new DivElement() | 162 new DivElement() |
165 ..children = [ | 163 ..children = [ |
166 new IsolateRunStateElement(_isolate, _events, queue: _r.queue)
, | 164 new IsolateRunStateElement(_isolate, _events, queue: _r.queue)
, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 ] | 248 ] |
251 ], | 249 ], |
252 new BRElement(), | 250 new BRElement(), |
253 new DivElement()..classes = ['memberItem'] | 251 new DivElement()..classes = ['memberItem'] |
254 ..children = [ | 252 ..children = [ |
255 new DivElement()..classes = ['memberName'] | 253 new DivElement()..classes = ['memberName'] |
256 ..text = 'libraries (${libraries.length})', | 254 ..text = 'libraries (${libraries.length})', |
257 new DivElement()..classes = ['memberValue'] | 255 new DivElement()..classes = ['memberValue'] |
258 ..children = [ | 256 ..children = [ |
259 new CurlyBlockElement(queue: _r.queue) | 257 new CurlyBlockElement(queue: _r.queue) |
260 ..children = libraries.map((l) => | 258 ..content = libraries.map((l) => |
261 new DivElement() | 259 new DivElement() |
262 ..children = [ | 260 ..children = [ |
263 new LibraryRefElement(_isolate, l, | 261 new LibraryRefElement(_isolate, l, |
264 queue: _r.queue) | 262 queue: _r.queue) |
265 ] | 263 ] |
266 ).toList() | 264 ).toList() |
267 ] | 265 ] |
268 ] | 266 ] |
269 ], | 267 ], |
270 new HRElement(), | 268 new HRElement(), |
(...skipping 19 matching lines...) Expand all Loading... |
290 _function = await _functions.get(_isolate, frame.function.id); | 288 _function = await _functions.get(_isolate, frame.function.id); |
291 } | 289 } |
292 if (_isolate.rootLibrary != null) { | 290 if (_isolate.rootLibrary != null) { |
293 final rootLibrary = await _libraries.get(_isolate, | 291 final rootLibrary = await _libraries.get(_isolate, |
294 _isolate.rootLibrary.id); | 292 _isolate.rootLibrary.id); |
295 _rootScript = rootLibrary.rootScript; | 293 _rootScript = rootLibrary.rootScript; |
296 } | 294 } |
297 _r.dirty(); | 295 _r.dirty(); |
298 } | 296 } |
299 } | 297 } |
OLD | NEW |