prometheus/web/ui/templates/_base.html
Julius Volz 3470ee1fbf
Make React UI the default, keep old UI under /classic (#8142)
The React app's assets are now served under /assets, while all old
custom web assets (including the ones for console templates) are now
served from /classic/static.

I tested different combinations of --web.external-url and
--web.route-prefix with proxies in front, and I couldn't find a problem
yet with the routing. Console templates also still work.

While migrating old endpoints to /classic, I noticed that /version was
being treated like a lot of the old UI pages, with readiness check
handler in front of it, etc. I kept it in /version and removed that
readiness wrapper, since it doesn't seem to be needed for that endpoint.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2020-11-03 14:51:48 +01:00

73 lines
4.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex,nofollow">
<title>{{ pageTitle }}</title>
<link rel="shortcut icon" href="{{ pathPrefix }}/classic/static/img/favicon.ico?v={{ buildVersion }}">
<script src="{{ pathPrefix }}/classic/static/vendor/js/jquery-3.5.1.min.js?v={{ buildVersion }}"></script>
<script src="{{ pathPrefix }}/classic/static/vendor/js/popper.min.js?v={{ buildVersion }}"></script>
<script src="{{ pathPrefix }}/classic/static/vendor/bootstrap-4.5.2/js/bootstrap.min.js?v={{ buildVersion }}"></script>
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/classic/static/vendor/bootstrap-4.5.2/css/bootstrap.min.css?v={{ buildVersion }}">
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/classic/static/css/prometheus.css?v={{ buildVersion }}">
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/classic/static/vendor/bootstrap4-glyphicons/css/bootstrap-glyphicons.min.css?v={{ buildVersion }}">
<script>
var PATH_PREFIX = "{{ pathPrefix }}";
var BUILD_VERSION = "{{ buildVersion }}";
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
{{template "head" .}}
</head>
<body>
<nav class="navbar fixed-top navbar-expand-sm navbar-dark bg-dark">
<div class="container-fluid">
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#nav-content" aria-expanded="false" aria-controls="nav-content" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
<!--span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span-->
</button>
<a class="navbar-brand" href="{{ pathPrefix }}/">Prometheus</a>
<div id="nav-content" class="navbar-collapse collapse">
<ul class="navbar-nav">
{{$consoles := consolesPath}}
{{if $consoles}}
<li class="nav-item"><a class="nav-link" href="{{$consoles}}">Consoles</a></li>
{{ end }}
<li class="nav-item"><a class="nav-link" href="{{ pathPrefix }}/classic/alerts">Alerts</a></li>
<li class="nav-item"><a class="nav-link" href="{{ pathPrefix }}/classic/graph">Graph</a></li>
<li class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Status <span class="caret"></span></a>
<div class="dropdown-menu">
<a class="dropdown-item" href="{{ pathPrefix }}/classic/status">Runtime &amp; Build Information</a>
<a class="dropdown-item" href="{{ pathPrefix }}/classic/flags">Command-Line Flags</a>
<a class="dropdown-item" href="{{ pathPrefix }}/classic/config">Configuration</a>
<a class="dropdown-item" href="{{ pathPrefix }}/classic/rules">Rules</a>
<a class="dropdown-item" href="{{ pathPrefix }}/classic/targets">Targets</a>
<a class="dropdown-item" href="{{ pathPrefix }}/classic/service-discovery">Service Discovery</a>
</div>
</li>
<li class= "nav-item">
<a class ="nav-link" href="https://prometheus.io/docs/prometheus/latest/getting_started/" target="_blank">Help</a>
</li>
<li class="nav-item"><a class="nav-link" href="{{ pathPrefix }}/graph">New UI</a></li>
</ul>
</div>
</div>
</nav>
{{template "content" .}}
</body>
</html>