Skip to content

Commit

Permalink
web: enhanced sidebarrecovery: "*" qulifies as "catch-all" in
Browse files Browse the repository at this point in the history
auto-recovery filters
  • Loading branch information
shlomi-noach committed Oct 21, 2015
1 parent 9509d76 commit 3ead9a2
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
set -e

RELEASE_VERSION="1.4.455"
RELEASE_VERSION="1.4.458"
TOPDIR=/tmp/orchestrator-release
export RELEASE_VERSION TOPDIR

Expand Down
2 changes: 2 additions & 0 deletions go/inst/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion go/inst/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 8 additions & 1 deletion resources/public/css/orchestrator.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -467,6 +471,9 @@ body {
margin-bottom: 8px;
}

#cluster_sidebar .text-indicate {
color: #e68545;
}

.arrow_box {
position: relative;
Expand Down
56 changes: 51 additions & 5 deletions resources/public/js/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ function Cluster() {

function addSidebarInfoPopoverContent(content, prepend) {
if (prepend === true) {
var wrappedContent = '<div>' + content + '</div>';
var wrappedContent = '<div>' + content + '<div style="clear: both;"></div></div>';
$("#cluster_sidebar [data-bullet=info] [data-toggle=popover]").attr("data-content",
wrappedContent + $("#cluster_sidebar [data-bullet=info] [data-toggle=popover]").attr("data-content"));

Expand Down Expand Up @@ -1101,15 +1101,62 @@ function Cluster() {
if (clusterInfo.HasAutomatedMasterRecovery === true) {
content += '<span class="glyphicon glyphicon-heart text-info" title="Automated master recovery for this cluster ENABLED"></span>';
} else {
content += '<span class="glyphicon glyphicon-heart text-muted" title="Automated master recovery for this cluster DISABLED"></span>';
content += '<span class="glyphicon glyphicon-heart text-muted pull-right" title="Automated master recovery for this cluster DISABLED"></span>';
}
if (clusterInfo.HasAutomatedIntermediateMasterRecovery === true) {
content += '<span class="glyphicon glyphicon-heart-empty text-info" title="Automated intermediate master recovery for this cluster ENABLED"></span>';
} else {
content += '<span class="glyphicon glyphicon-heart-empty text-muted" title="Automated intermediate master recovery for this cluster DISABLED"></span>';
content += '<span class="glyphicon glyphicon-heart-empty text-muted pull-right" title="Automated intermediate master recovery for this cluster DISABLED"></span>';
}
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) {
Expand Down Expand Up @@ -1369,9 +1416,8 @@ function Cluster() {
location.reload();
return
}
anonymize();
$("#dropdown-context a[data-command=anonymize]").prepend('<span class="glyphicon glyphicon-ok small"></span> ');
$.cookie("anonymize", "true", { path: '/', expires: 1 });
location.reload();
});
$("body").on("click", "a[data-command=colorize-dc]", function (event) {
if ($.cookie("colorize-dc") == "true") {
Expand Down
20 changes: 20 additions & 0 deletions resources/templates/cluster.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@
<span class="glyphicon glyphicon-info-sign"></span>
</div>
</li>
<li data-bullet="colorize-dc">
<div>
<a data-command="colorize-dc"><span class="glyphicon glyphicon-adjust"></span></a>
</div>
</li>
<li data-bullet="compact">
<div>
<a href=""><span class="glyphicon glyphicon-compressed"></span></a>
</div>
</li>
<li data-bullet="pool-indicator">
<div>
<a data-command="pool-indicator"><span class="glyphicon glyphicon-tint"></span></a>
</div>
</li>
<li data-bullet="anonymize">
<div>
<a data-command="anonymize"><span class="glyphicon glyphicon-user"></span></a>
</div>
</li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 3ead9a2

Please sign in to comment.