perf: add loading message

Loading can take a few seconds, so add a basic note that something is
coming.

For golang/go#48803.

Change-Id: Ic24483f5729395cfde87ba751c851950abe48281
Reviewed-on: https://go-review.googlesource.com/c/build/+/413419
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
diff --git a/perf/app/dashboard/index.html b/perf/app/dashboard/index.html
index c11f614..0dee6b7 100644
--- a/perf/app/dashboard/index.html
+++ b/perf/app/dashboard/index.html
@@ -43,12 +43,21 @@
 <script>
 </script>
 
-<div id="dashboard"></div>
+<div id="dashboard">
+	<h2 class="Dashboard-title" id="loading">Loading...</h2>
+</div>
 
 <script>
+function removeLoadingMessage() {
+	let loading = document.getElementById("loading");
+	loading.parentNode.removeChild(loading);
+}
+
 function addContent(benchmarks) {
 	let dashboard = document.getElementById("dashboard");
 
+	removeLoadingMessage();
+
 	let prevName = "";
 	let grid = null;
 	for (const b in benchmarks) {
@@ -79,6 +88,8 @@
 function failure(name) {
 	let dashboard = document.getElementById("dashboard");
 
+	removeLoadingMessage();
+
 	let title = document.createElement("h2");
 	title.classList.add("Dashboard-title");
 	title.innerHTML = "Benchmark \"" + name + "\" not found.";