From ae485c2bfd789d64c717ee7ec1795a210f913ada Mon Sep 17 00:00:00 2001 From: Nikolay <nik@victoriametrics.com> Date: Thu, 1 Jul 2021 11:48:07 +0300 Subject: [PATCH] fixes /targets button style (#1423) * fixes /targets button style https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1422 * updates boostrap version --- lib/promscrape/targets_response.qtpl | 6 +++--- lib/promscrape/targets_response.qtpl.go | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/promscrape/targets_response.qtpl b/lib/promscrape/targets_response.qtpl index 2a24d0b396..3efdef22be 100644 --- a/lib/promscrape/targets_response.qtpl +++ b/lib/promscrape/targets_response.qtpl @@ -38,17 +38,17 @@ job={%q= jobName %} (0/0 up) <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous"> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> <title>Scrape targets</title> </head> <body class="m-3"> <h1>Scrape targets</h1> <div> - <button type="button" class="btn {% if !onlyUnhealthy %}btn-primary{% else %}btn-secondary{% endif %}" + <button type="button" class="btn{% space %} {% if !onlyUnhealthy %}btn-primary{% else %}btn-secondary{% endif %}" {% if onlyUnhealthy %}onclick="location.href='{%s redirectPath %}'"{% endif %}> All </button> - <button type="button" class="btn {% if onlyUnhealthy %}btn-primary{% else %}btn-secondary{% endif %}" + <button type="button" class="btn{% space %}{% if onlyUnhealthy %}btn-primary{% else %}btn-secondary{% endif %}" {% if !onlyUnhealthy %}onclick="location.href='{%s= redirectPath %}?show_only_unhealthy=true'"{% endif %}> Unhealthy </button> diff --git a/lib/promscrape/targets_response.qtpl.go b/lib/promscrape/targets_response.qtpl.go index 844a021300..95a281bc61 100644 --- a/lib/promscrape/targets_response.qtpl.go +++ b/lib/promscrape/targets_response.qtpl.go @@ -169,7 +169,9 @@ func TargetsResponsePlain(jts []jobTargetsStatuses, emptyJobs []string, showOrig //line lib/promscrape/targets_response.qtpl:35 func StreamTargetsResponseHTML(qw422016 *qt422016.Writer, jts []jobTargetsStatuses, emptyJobs []string, redirectPath string, onlyUnhealthy bool) { //line lib/promscrape/targets_response.qtpl:35 - qw422016.N().S(`<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous"><title>Scrape targets</title></head><body class="m-3"><h1>Scrape targets</h1><div><button type="button" class="btn`) + qw422016.N().S(`<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"><title>Scrape targets</title></head><body class="m-3"><h1>Scrape targets</h1><div><button type="button" class="btn`) +//line lib/promscrape/targets_response.qtpl:47 + qw422016.N().S(` `) //line lib/promscrape/targets_response.qtpl:47 if !onlyUnhealthy { //line lib/promscrape/targets_response.qtpl:47 @@ -194,6 +196,8 @@ func StreamTargetsResponseHTML(qw422016 *qt422016.Writer, jts []jobTargetsStatus } //line lib/promscrape/targets_response.qtpl:48 qw422016.N().S(`>All</button><button type="button" class="btn`) +//line lib/promscrape/targets_response.qtpl:51 + qw422016.N().S(` `) //line lib/promscrape/targets_response.qtpl:51 if onlyUnhealthy { //line lib/promscrape/targets_response.qtpl:51