From 3ead9a28476fcae3169ceb7c44b56e3077d23e6f Mon Sep 17 00:00:00 2001 From: shlomi-noach Date: Wed, 21 Oct 2015 15:38:13 +0200 Subject: [PATCH] web: enhanced sidebarrecovery: "*" qulifies as "catch-all" in auto-recovery filters --- build.sh | 2 +- go/inst/cluster.go | 2 + go/inst/resolve.go | 2 +- resources/public/css/orchestrator.css | 9 ++++- resources/public/js/cluster.js | 56 ++++++++++++++++++++++++--- resources/templates/cluster.tmpl | 20 ++++++++++ 6 files changed, 83 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 0a8d62ff..79e84c2e 100755 --- a/build.sh +++ b/build.sh @@ -6,7 +6,7 @@ # set -e -RELEASE_VERSION="1.4.455" +RELEASE_VERSION="1.4.458" TOPDIR=/tmp/orchestrator-release export RELEASE_VERSION TOPDIR diff --git a/go/inst/cluster.go b/go/inst/cluster.go index bedaed84..241803bd 100644 --- a/go/inst/cluster.go +++ b/go/inst/cluster.go @@ -54,6 +54,8 @@ func (this *ClusterInfo) filtersMatchCluster(filters []string) bool { if matched, _ := regexp.MatchString(aliasPattern, this.ClusterAlias); matched { return true } + } else if filter == "*" { + return true } else if matched, _ := regexp.MatchString(filter, this.ClusterName); matched && filter != "" { return true } diff --git a/go/inst/resolve.go b/go/inst/resolve.go index ecab8b7b..94fd8c55 100644 --- a/go/inst/resolve.go +++ b/go/inst/resolve.go @@ -64,7 +64,7 @@ func resolveHostname(hostname string) (string, error) { return hostname, nil } -// Attempt to resolve a hostname. This may returned a database cached hostname or otherwise +// Attempt to resolve a hostname. This may return a database cached hostname or otherwise // it may resolve the hostname via CNAME func ResolveHostname(hostname string) (string, error) { hostname = strings.TrimSpace(hostname) diff --git a/resources/public/css/orchestrator.css b/resources/public/css/orchestrator.css index 687cfd7f..70452f5f 100644 --- a/resources/public/css/orchestrator.css +++ b/resources/public/css/orchestrator.css @@ -439,10 +439,14 @@ body { cursor: pointer; } -#cluster_sidebar li span.glyphicon { +#cluster_sidebar li[data-bullet=info] span.glyphicon { font-size: 2em; } +#cluster_sidebar li a .glyphicon { + cursor: pointer; +} + #cluster_sidebar .nav li > a { padding: 0; } @@ -467,6 +471,9 @@ body { margin-bottom: 8px; } +#cluster_sidebar .text-indicate { + color: #e68545; +} .arrow_box { position: relative; diff --git a/resources/public/js/cluster.js b/resources/public/js/cluster.js index 6ea84e23..38e92a76 100644 --- a/resources/public/js/cluster.js +++ b/resources/public/js/cluster.js @@ -1066,7 +1066,7 @@ function Cluster() { function addSidebarInfoPopoverContent(content, prepend) { if (prepend === true) { - var wrappedContent = '
' + content + '
'; + var wrappedContent = '
' + content + '
'; $("#cluster_sidebar [data-bullet=info] [data-toggle=popover]").attr("data-content", wrappedContent + $("#cluster_sidebar [data-bullet=info] [data-toggle=popover]").attr("data-content")); @@ -1101,15 +1101,62 @@ function Cluster() { if (clusterInfo.HasAutomatedMasterRecovery === true) { content += ''; } else { - content += ''; + content += ''; } if (clusterInfo.HasAutomatedIntermediateMasterRecovery === true) { content += ''; } else { - content += ''; + content += ''; } addSidebarInfoPopoverContent(content, true); } + // Colorize-dc + { + var glyph = $("#cluster_sidebar [data-bullet=colorize-dc] .glyphicon"); + if ($.cookie("colorize-dc") == "true") { + glyph.addClass("text-info"); + glyph.attr("title", "Disable colors"); + } else { + glyph.addClass("text-muted"); + glyph.attr("title", "Color by data center"); + } + } + { + // Compact display + var anchor = $("#cluster_sidebar [data-bullet=compact] a"); + var glyph = $(anchor).find(".glyphicon") + if (isCompactDisplay()) { + anchor.attr("href", location.href.split("?")[0].split("#")[0] + '?compact=false') + glyph.addClass("text-info"); + glyph.attr("title", "Disable compact display"); + } else { + anchor.attr("href", location.href.split("?")[0].split("#")[0] + '?compact=true') + glyph.addClass("text-muted"); + glyph.attr("title", "Enable compact display"); + } + } + // Pool indicator + { + var glyph = $("#cluster_sidebar [data-bullet=pool-indicator] .glyphicon"); + if ($.cookie("pool-indicator") == "true") { + glyph.addClass("text-info"); + glyph.attr("title", "Disable pool indication"); + } else { + glyph.addClass("text-muted"); + glyph.attr("title", "Enable pool indication"); + } + } + // Anonymize + { + var glyph = $("#cluster_sidebar [data-bullet=anonymize] .glyphicon"); + if ($.cookie("anonymize") == "true") { + glyph.addClass("text-info"); + glyph.attr("title", "Cancel anonymize"); + } else { + glyph.addClass("text-muted"); + glyph.attr("title", "Anonymize display"); + } + } } function onAnalysisEntry(analysisEntry, instance) { @@ -1369,9 +1416,8 @@ function Cluster() { location.reload(); return } - anonymize(); - $("#dropdown-context a[data-command=anonymize]").prepend(' '); $.cookie("anonymize", "true", { path: '/', expires: 1 }); + location.reload(); }); $("body").on("click", "a[data-command=colorize-dc]", function (event) { if ($.cookie("colorize-dc") == "true") { diff --git a/resources/templates/cluster.tmpl b/resources/templates/cluster.tmpl index 125de82c..cb7784b9 100644 --- a/resources/templates/cluster.tmpl +++ b/resources/templates/cluster.tmpl @@ -14,6 +14,26 @@ +
  • +
    + +
    +
  • +
  • +
    + +
    +
  • +
  • +
    + +
    +
  • +
  • +
    + +
    +