| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:html'; | 5 import 'dart:html'; |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import 'package:observatory/models.dart' as M; | 7 import 'package:observatory/models.dart' as M; |
| 8 import 'package:observatory/utils.dart'; | 8 import 'package:observatory/utils.dart'; |
| 9 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 9 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
| 10 import 'package:observatory/src/elements/helpers/tag.dart'; | 10 import 'package:observatory/src/elements/helpers/tag.dart'; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 | 44 |
| 45 @override | 45 @override |
| 46 void detached() { | 46 void detached() { |
| 47 super.detached(); | 47 super.detached(); |
| 48 children = []; | 48 children = []; |
| 49 _r.disable(notify: true); | 49 _r.disable(notify: true); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void render() { | 52 void render() { |
| 53 children = []; | |
| 54 if (_isolate.error != null) { | |
| 55 children = [ | |
| 56 new PreElement()..classes = const ["errorBox"] | |
| 57 ..text = _isolate.error.message | |
| 58 ]; | |
| 59 } | |
| 60 final newHeapUsed = Utils.formatSize(_isolate.newSpace.used); | 53 final newHeapUsed = Utils.formatSize(_isolate.newSpace.used); |
| 61 final newHeapCapacity = Utils.formatSize(_isolate.newSpace.capacity); | 54 final newHeapCapacity = Utils.formatSize(_isolate.newSpace.capacity); |
| 62 final oldHeapUsed = Utils.formatSize(_isolate.oldSpace.used); | 55 final oldHeapUsed = Utils.formatSize(_isolate.oldSpace.used); |
| 63 final oldHeapCapacity = Utils.formatSize(_isolate.oldSpace.capacity); | 56 final oldHeapCapacity = Utils.formatSize(_isolate.oldSpace.capacity); |
| 64 children.addAll([ | 57 final content = [ |
| 65 new DivElement()..classes = ['menu'] | 58 new DivElement()..classes = ['menu'] |
| 66 ..children = [ | 59 ..children = [ |
| 67 new DivElement()..classes = const ['memberList'] | 60 new DivElement()..classes = const ['memberList'] |
| 68 ..children = [ | 61 ..children = [ |
| 69 new DivElement()..classes = const ['memberItem'] | 62 new DivElement()..classes = const ['memberItem'] |
| 70 ..children = [ | 63 ..children = [ |
| 71 new DivElement()..classes = const ['memberName'] | 64 new DivElement()..classes = const ['memberName'] |
| 72 ..text = 'new heap', | 65 ..text = 'new heap', |
| 73 new DivElement()..classes = const ['memberValue'] | 66 new DivElement()..classes = const ['memberValue'] |
| 74 ..text = '$newHeapUsed of $newHeapCapacity', | 67 ..text = '$newHeapUsed of $newHeapCapacity', |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 ..text = 'ports' | 136 ..text = 'ports' |
| 144 ], | 137 ], |
| 145 new DivElement() | 138 new DivElement() |
| 146 ..children = [ | 139 ..children = [ |
| 147 new SpanElement()..text = 'see ', | 140 new SpanElement()..text = 'see ', |
| 148 new AnchorElement(href: Uris.logging(_isolate)) | 141 new AnchorElement(href: Uris.logging(_isolate)) |
| 149 ..text = 'logging' | 142 ..text = 'logging' |
| 150 ] | 143 ] |
| 151 ], | 144 ], |
| 152 new IsolateCounterChartElement(_isolate.counters, queue: _r.queue) | 145 new IsolateCounterChartElement(_isolate.counters, queue: _r.queue) |
| 153 ]); | 146 ]; |
| 147 if (_isolate.error != null) { |
| 148 children = [ |
| 149 new PreElement()..classes = const ['errorBox'] |
| 150 ..text = _isolate.error.message, |
| 151 new DivElement()..classes = const ['summary'] |
| 152 ..children = content |
| 153 ]; |
| 154 } else { |
| 155 children = [ |
| 156 new DivElement()..classes = const ['summary'] |
| 157 ..children = content |
| 158 ]; |
| 159 } |
| 154 } | 160 } |
| 155 } | 161 } |
| OLD | NEW |