| 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 io_view_element; | 5 library io_view_element; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'observatory_element.dart'; | 8 import 'observatory_element.dart'; |
| 9 import 'service_ref.dart'; | 9 import 'service_ref.dart'; |
| 10 import 'package:observatory/service.dart'; | 10 import 'package:observatory/service.dart'; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 class IOSocketViewElement extends ObservatoryElement { | 92 class IOSocketViewElement extends ObservatoryElement { |
| 93 @published ServiceMap socket; | 93 @published ServiceMap socket; |
| 94 | 94 |
| 95 IOSocketViewElement.created() : super.created(); | 95 IOSocketViewElement.created() : super.created(); |
| 96 | 96 |
| 97 void refresh(var done) { | 97 void refresh(var done) { |
| 98 socket.reload().whenComplete(done); | 98 socket.reload().whenComplete(done); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 @CustomTag('io-web-socket-ref') |
| 103 class IOWebSocketRefElement extends ServiceRefElement { |
| 104 IOWebSocketRefElement.created() : super.created(); |
| 105 } |
| 106 |
| 107 @CustomTag('io-web-socket-list-view') |
| 108 class IOWebSocketListViewElement extends ObservatoryElement { |
| 109 @published ServiceMap list; |
| 110 |
| 111 IOWebSocketListViewElement.created() : super.created(); |
| 112 |
| 113 void refresh(var done) { |
| 114 list.reload().whenComplete(done); |
| 115 } |
| 116 } |
| 117 |
| 118 @CustomTag('io-web-socket-view') |
| 119 class IOWebSocketViewElement extends ObservatoryElement { |
| 120 @published ServiceMap webSocket; |
| 121 |
| 122 IOWebSocketViewElement.created() : super.created(); |
| 123 |
| 124 void refresh(var done) { |
| 125 webSocket.reload().whenComplete(done); |
| 126 } |
| 127 } |
| 128 |
| 102 @CustomTag('io-random-access-file-list-view') | 129 @CustomTag('io-random-access-file-list-view') |
| 103 class IORandomAccessFileListViewElement extends ObservatoryElement { | 130 class IORandomAccessFileListViewElement extends ObservatoryElement { |
| 104 @published ServiceMap list; | 131 @published ServiceMap list; |
| 105 | 132 |
| 106 IORandomAccessFileListViewElement.created() : super.created(); | 133 IORandomAccessFileListViewElement.created() : super.created(); |
| 107 | 134 |
| 108 void refresh(var done) { | 135 void refresh(var done) { |
| 109 list.reload().whenComplete(done); | 136 list.reload().whenComplete(done); |
| 110 } | 137 } |
| 111 } | 138 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 _updateTimer = new Timer(new Duration(seconds: 1), _updateFile); | 221 _updateTimer = new Timer(new Duration(seconds: 1), _updateFile); |
| 195 } | 222 } |
| 196 | 223 |
| 197 void leftView() { | 224 void leftView() { |
| 198 super.leftView(); | 225 super.leftView(); |
| 199 if (_updateTimer != null) { | 226 if (_updateTimer != null) { |
| 200 _updateTimer.cancel(); | 227 _updateTimer.cancel(); |
| 201 _updateTimer = null; | 228 _updateTimer = null; |
| 202 } | 229 } |
| 203 } | 230 } |
| 204 } | 231 } |
| OLD | NEW |