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 vm_view_element; | 5 library vm_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/helpers/nav_bar.dart'; |
10 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 11 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
11 import 'package:observatory/src/elements/helpers/tag.dart'; | 12 import 'package:observatory/src/elements/helpers/tag.dart'; |
12 import 'package:observatory/src/elements/helpers/uris.dart'; | 13 import 'package:observatory/src/elements/helpers/uris.dart'; |
13 import 'package:observatory/src/elements/isolate/summary.dart'; | 14 import 'package:observatory/src/elements/isolate/summary.dart'; |
14 import 'package:observatory/src/elements/nav/bar.dart'; | |
15 import 'package:observatory/src/elements/nav/notify.dart'; | 15 import 'package:observatory/src/elements/nav/notify.dart'; |
16 import 'package:observatory/src/elements/nav/refresh.dart'; | 16 import 'package:observatory/src/elements/nav/refresh.dart'; |
17 import 'package:observatory/src/elements/nav/top_menu.dart'; | 17 import 'package:observatory/src/elements/nav/top_menu.dart'; |
18 import 'package:observatory/src/elements/nav/vm_menu.dart'; | 18 import 'package:observatory/src/elements/nav/vm_menu.dart'; |
19 import 'package:observatory/src/elements/view_footer.dart'; | 19 import 'package:observatory/src/elements/view_footer.dart'; |
20 | 20 |
21 class VMViewElement extends HtmlElement implements Renderable { | 21 class VMViewElement extends HtmlElement implements Renderable { |
22 static const tag = const Tag<VMViewElement>('vm-view', | 22 static const tag = const Tag<VMViewElement>('vm-view', |
23 dependencies: const [ | 23 dependencies: const [ |
24 IsolateSummaryElement.tag, | 24 IsolateSummaryElement.tag, |
25 NavBarElement.tag, | |
26 NavTopMenuElement.tag, | 25 NavTopMenuElement.tag, |
27 NavVMMenuElement.tag, | 26 NavVMMenuElement.tag, |
28 NavRefreshElement.tag, | 27 NavRefreshElement.tag, |
29 NavNotifyElement.tag, | 28 NavNotifyElement.tag, |
30 ViewFooterElement.tag | 29 ViewFooterElement.tag |
31 ]); | 30 ]); |
32 | 31 |
33 RenderingScheduler<VMViewElement> _r; | 32 RenderingScheduler<VMViewElement> _r; |
34 | 33 |
35 Stream<RenderedEvent<VMViewElement>> get onRendered => _r.onRendered; | 34 Stream<RenderedEvent<VMViewElement>> get onRendered => _r.onRendered; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 children = []; | 84 children = []; |
86 _vmSubscription.cancel(); | 85 _vmSubscription.cancel(); |
87 _startSubscription.cancel(); | 86 _startSubscription.cancel(); |
88 _exitSubscription.cancel(); | 87 _exitSubscription.cancel(); |
89 } | 88 } |
90 | 89 |
91 void render() { | 90 void render() { |
92 final uptime = new DateTime.now().difference(_vm.startTime); | 91 final uptime = new DateTime.now().difference(_vm.startTime); |
93 final isolates = _vm.isolates.toList(); | 92 final isolates = _vm.isolates.toList(); |
94 children = [ | 93 children = [ |
95 new NavBarElement(queue: _r.queue) | 94 navBar([ |
96 ..children = [ | 95 new NavTopMenuElement(queue: _r.queue), |
97 new NavTopMenuElement(queue: _r.queue), | 96 new NavVMMenuElement(_vm, _events, queue: _r.queue), |
98 new NavVMMenuElement(_vm, _events, last: true, queue: _r.queue), | 97 new NavRefreshElement(queue: _r.queue) |
99 new NavRefreshElement(queue: _r.queue) | 98 ..onRefresh.listen((e) async { |
100 ..onRefresh.listen((e) async { | 99 e.element.disabled = true; |
101 e.element.disabled = true; | 100 _r.dirty(); |
102 _r.dirty(); | 101 }), |
103 }), | 102 new NavNotifyElement(_notifications, queue: _r.queue) |
104 new NavNotifyElement(_notifications, queue: _r.queue) | 103 ]), |
105 ], | |
106 new DivElement()..classes = ['content-centered-big'] | 104 new DivElement()..classes = ['content-centered-big'] |
107 ..children = [ | 105 ..children = [ |
108 new HeadingElement.h1()..text = 'VM', | 106 new HeadingElement.h1()..text = 'VM', |
109 new HRElement(), | 107 new HRElement(), |
110 new DivElement()..classes = ['memberList'] | 108 new DivElement()..classes = ['memberList'] |
111 ..children = [ | 109 ..children = [ |
112 new DivElement()..classes = ['memberItem'] | 110 new DivElement()..classes = ['memberItem'] |
113 ..children = [ | 111 ..children = [ |
114 new DivElement()..classes = ['memberName'] | 112 new DivElement()..classes = ['memberName'] |
115 ..text = 'name', | 113 ..text = 'name', |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 new IsolateSummaryElement(i, _isolates, _events, _scripts, | 181 new IsolateSummaryElement(i, _isolates, _events, _scripts, |
184 queue: _r.queue) | 182 queue: _r.queue) |
185 ], | 183 ], |
186 new HRElement() | 184 new HRElement() |
187 ]).toList(), | 185 ]).toList(), |
188 new ViewFooterElement(queue: _r.queue) | 186 new ViewFooterElement(queue: _r.queue) |
189 ] | 187 ] |
190 ]; | 188 ]; |
191 } | 189 } |
192 } | 190 } |
OLD | NEW |