OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analysis_server.src.status.get_handler; | 5 library analysis_server.src.status.get_handler; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 import 'dart:math'; | 10 import 'dart:math'; |
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 buffer.write(makeLink(CONTEXT_PATH, {CONTEXT_QUERY_PARAM: folder.path}, | 1710 buffer.write(makeLink(CONTEXT_PATH, {CONTEXT_QUERY_PARAM: folder.path}, |
1711 key, _hasException(folderMap[folder]))); | 1711 key, _hasException(folderMap[folder]))); |
1712 buffer.write(' <small><b>['); | 1712 buffer.write(' <small><b>['); |
1713 buffer.write(makeLink(CONTEXT_DIAGNOSTICS_PATH, | 1713 buffer.write(makeLink(CONTEXT_DIAGNOSTICS_PATH, |
1714 {CONTEXT_QUERY_PARAM: folder.path}, 'diagnostics')); | 1714 {CONTEXT_QUERY_PARAM: folder.path}, 'diagnostics')); |
1715 buffer.write(']</b></small>'); | 1715 buffer.write(']</b></small>'); |
1716 if (!folder.getChild('.packages').exists) { | 1716 if (!folder.getChild('.packages').exists) { |
1717 buffer.write(' <small>[no .packages file]</small>'); | 1717 buffer.write(' <small>[no .packages file]</small>'); |
1718 } | 1718 } |
1719 }); | 1719 }); |
1720 // TODO(brianwilkerson) Add items for the SDK contexts (currently only one
). | 1720 buffer.write('</p>'); |
| 1721 buffer.write('<p><b>SDK Contexts</b></p>'); |
| 1722 buffer.write('<p>'); |
| 1723 first = true; |
| 1724 List<String> descriptors = analysisServer.sdkManager.sdkDescriptors |
| 1725 .map((SdkDescription descriptor) => descriptor.toString()) |
| 1726 .toList(); |
| 1727 if (descriptors.isEmpty) { |
| 1728 buffer.write('none'); |
| 1729 } else { |
| 1730 descriptors.sort(); |
| 1731 for (String descriptor in descriptors) { |
| 1732 if (first) { |
| 1733 first = false; |
| 1734 } else { |
| 1735 buffer.write('<br>'); |
| 1736 } |
| 1737 // TODO(brianwilkerson) Add a link to information about the contexts. |
| 1738 buffer.write(descriptor); |
| 1739 } |
| 1740 } |
1721 buffer.write('</p>'); | 1741 buffer.write('</p>'); |
1722 | 1742 |
1723 int freq = AnalysisServer.performOperationDelayFrequency; | 1743 int freq = AnalysisServer.performOperationDelayFrequency; |
1724 String delay = freq > 0 ? '1 ms every $freq ms' : 'off'; | 1744 String delay = freq > 0 ? '1 ms every $freq ms' : 'off'; |
1725 | 1745 |
1726 buffer.write('<p><b>Performance Data</b></p>'); | 1746 buffer.write('<p><b>Performance Data</b></p>'); |
1727 buffer.write('<p>Perform operation delay: $delay</p>'); | 1747 buffer.write('<p>Perform operation delay: $delay</p>'); |
1728 buffer.write('<p>'); | 1748 buffer.write('<p>'); |
1729 buffer.write(makeLink(ANALYSIS_PERFORMANCE_PATH, {}, 'Task data')); | 1749 buffer.write(makeLink(ANALYSIS_PERFORMANCE_PATH, {}, 'Task data')); |
1730 buffer.write('</p>'); | 1750 buffer.write('</p>'); |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2534 */ | 2554 */ |
2535 static String makeLink( | 2555 static String makeLink( |
2536 String path, Map<String, String> params, String innerHtml, | 2556 String path, Map<String, String> params, String innerHtml, |
2537 [bool hasError = false]) { | 2557 [bool hasError = false]) { |
2538 Uri uri = new Uri(path: path, queryParameters: params); | 2558 Uri uri = new Uri(path: path, queryParameters: params); |
2539 String href = HTML_ESCAPE.convert(uri.toString()); | 2559 String href = HTML_ESCAPE.convert(uri.toString()); |
2540 String classAttribute = hasError ? ' class="error"' : ''; | 2560 String classAttribute = hasError ? ' class="error"' : ''; |
2541 return '<a href="$href"$classAttribute>$innerHtml</a>'; | 2561 return '<a href="$href"$classAttribute>$innerHtml</a>'; |
2542 } | 2562 } |
2543 } | 2563 } |
OLD | NEW |