| OLD | NEW |
| 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Fletch 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 import 'json.dart'; | 5 import 'json.dart'; |
| 6 | 6 |
| 7 class Resource { | 7 class Resource { |
| 8 String host; | 8 String host; |
| 9 String path; | 9 String path; |
| 10 Resource(this.host, this.path); | 10 Resource(this.host, this.path); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 JsonData _status; | 54 JsonData _status; |
| 55 JsonData _changes; | 55 JsonData _changes; |
| 56 | 56 |
| 57 Console(this.title, | 57 Console(this.title, |
| 58 Resource api, | 58 Resource api, |
| 59 Resource status) { | 59 Resource status) { |
| 60 _status = new JsonData(status.sub("/current?format=json")); | 60 _status = new JsonData(status.sub("/current?format=json")); |
| 61 _status.updateData(); | 61 _status.updateData(); |
| 62 _changes = new JsonData(api.sub("/json/changes")); | 62 _changes = new JsonData(api.sub("/json/changes")); |
| 63 _changes.updateData(); |
| 63 } | 64 } |
| 64 | 65 |
| 65 String get status { | 66 String get status { |
| 66 _status.ensureData(); | 67 _status.ensureData(); |
| 67 if (_status.data is Map && _status.data.containsKey("message")) { | 68 if (_status.data is Map && _status.data.containsKey("message")) { |
| 68 return _status.data['message']; | 69 return _status.data['message']; |
| 69 } | 70 } |
| 70 return "unknown status"; | 71 return "unknown status"; |
| 71 } | 72 } |
| 72 } | 73 } |
| OLD | NEW |