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:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 import 'dart:convert'; | 9 import 'dart:convert'; |
10 import 'dart:io'; | 10 import 'dart:io'; |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 | 1062 |
1063 _writeResponse(request, (StringBuffer buffer) { | 1063 _writeResponse(request, (StringBuffer buffer) { |
1064 _writePage( | 1064 _writePage( |
1065 buffer, 'Analysis Server - Context', ['Context: $contextFilter'], | 1065 buffer, 'Analysis Server - Context', ['Context: $contextFilter'], |
1066 (StringBuffer buffer) { | 1066 (StringBuffer buffer) { |
1067 buffer.write('<h3>Most Recently Perfomed Tasks</h3>'); | 1067 buffer.write('<h3>Most Recently Perfomed Tasks</h3>'); |
1068 AnalysisTask.LAST_TASKS.forEach((String description) { | 1068 AnalysisTask.LAST_TASKS.forEach((String description) { |
1069 buffer.write('<p>$description</p>'); | 1069 buffer.write('<p>$description</p>'); |
1070 }); | 1070 }); |
1071 | 1071 |
| 1072 String _describe(WorkItem item) { |
| 1073 if (item == null) { |
| 1074 return 'None'; |
| 1075 } |
| 1076 return '${item.descriptor?.name} computing ${item.spawningResult?.name
} for ${item.target?.toString()}'; |
| 1077 } |
| 1078 |
1072 buffer.write('<h3>Work Items</h3>'); | 1079 buffer.write('<h3>Work Items</h3>'); |
1073 buffer.write( | 1080 buffer.write( |
1074 '<p><b>Current: ${driver.currentWorkOrder?.current?.descriptor?.name
}</b></p>'); | 1081 '<p><b>Current:</b> ${_describe(driver.currentWorkOrder?.current)}</
p>'); |
1075 buffer.write('<br>'); | |
1076 if (workItems != null) { | 1082 if (workItems != null) { |
1077 buffer.writeAll(workItems | 1083 buffer.writeAll(workItems.reversed |
1078 .map((item) => '<p>${item.descriptor?.name}</p>') | 1084 .map((item) => '<p>${_describe(item)}</p>') |
1079 ?.toList()); | 1085 ?.toList()); |
1080 } | 1086 } |
1081 | 1087 |
1082 _writeFiles(buffer, 'Priority Files', priorityNames); | 1088 _writeFiles(buffer, 'Priority Files', priorityNames); |
1083 _writeFiles(buffer, 'Explicitly Analyzed Files', explicitNames); | 1089 _writeFiles(buffer, 'Explicitly Analyzed Files', explicitNames); |
1084 _writeFiles(buffer, 'Implicitly Analyzed Files', implicitNames); | 1090 _writeFiles(buffer, 'Implicitly Analyzed Files', implicitNames); |
1085 | 1091 |
1086 buffer.write('<h3>Exceptions</h3>'); | 1092 buffer.write('<h3>Exceptions</h3>'); |
1087 if (exceptions.isEmpty) { | 1093 if (exceptions.isEmpty) { |
1088 buffer.write('<p>None</p>'); | 1094 buffer.write('<p>None</p>'); |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1963 */ | 1969 */ |
1964 static String makeLink( | 1970 static String makeLink( |
1965 String path, Map<String, String> params, String innerHtml, | 1971 String path, Map<String, String> params, String innerHtml, |
1966 [bool hasError = false]) { | 1972 [bool hasError = false]) { |
1967 Uri uri = new Uri(path: path, queryParameters: params); | 1973 Uri uri = new Uri(path: path, queryParameters: params); |
1968 String href = HTML_ESCAPE.convert(uri.toString()); | 1974 String href = HTML_ESCAPE.convert(uri.toString()); |
1969 String classAttribute = hasError ? ' class="error"' : ''; | 1975 String classAttribute = hasError ? ' class="error"' : ''; |
1970 return '<a href="$href"$classAttribute>$innerHtml</a>'; | 1976 return '<a href="$href"$classAttribute>$innerHtml</a>'; |
1971 } | 1977 } |
1972 } | 1978 } |
OLD | NEW |