Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: pkg/analysis_server/lib/src/status/pages.dart

Issue 2918533002: Updates to the diagnostics page. (Closed)
Patch Set: use integer division Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/status/diagnostics.dart ('k') | pkg/analysis_server/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/status/pages.dart
diff --git a/pkg/analysis_server/lib/src/status/pages.dart b/pkg/analysis_server/lib/src/status/pages.dart
index dae51025d2f37c817a73124a0f090bb1db6cd2d7..096032f23923cc01369775e114f2099cbc5ba982 100644
--- a/pkg/analysis_server/lib/src/status/pages.dart
+++ b/pkg/analysis_server/lib/src/status/pages.dart
@@ -5,6 +5,8 @@
import 'dart:convert';
import 'dart:io';
+import 'package:intl/intl.dart';
+
/// Contains a collection of Pages.
abstract class Site {
final String title;
@@ -107,8 +109,8 @@ abstract class Page {
buf.writeln('<h4>${raw ? text : escape(text)}</h4>');
}
- void ul<T>(Iterable<T> items, void gen(T item)) {
- buf.writeln('<ul>');
+ void ul<T>(Iterable<T> items, void gen(T item), {String classes}) {
+ buf.writeln('<ul${classes == null ? '' : ' class=$classes'}>');
for (T item in items) {
buf.write('<li>');
gen(item);
@@ -156,14 +158,10 @@ abstract class Page {
String escape(String text) => text == null ? '' : HTML_ESCAPE.convert(text);
-String printInteger(int value) {
- return value.toString();
-}
+final NumberFormat numberFormat = new NumberFormat.decimalPattern();
-String printMilliseconds(num value) {
- return '${value.toStringAsFixed(1)} ms';
-}
+String printInteger(int value) => numberFormat.format(value);
-String printPercentage(num value) {
- return '${(value * 100).toStringAsFixed(1)}%';
-}
+String printMilliseconds(num value) => '${numberFormat.format(value)} ms';
+
+String printPercentage(num value) => '${(value * 100).toStringAsFixed(1)}%';
« no previous file with comments | « pkg/analysis_server/lib/src/status/diagnostics.dart ('k') | pkg/analysis_server/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698