Skip to content

Commit

Permalink
Merge pull request #936 from MaxFedotov/search-by-cluster-alias
Browse files Browse the repository at this point in the history
support searching by cluster alias
  • Loading branch information
Shlomi Noach committed Aug 6, 2019
2 parents 5dbb911 + 0e5a187 commit 3ab7969
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion go/inst/instance_dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -1349,10 +1349,11 @@ func SearchInstances(searchString string) ([](*Instance), error) {
or instr(version, ?) > 0
or instr(version_comment, ?) > 0
or instr(concat(hostname, ':', port), ?) > 0
or instr(suggested_cluster_alias, ?) > 0
or concat(server_id, '') = ?
or concat(port, '') = ?
`
args := sqlutils.Args(searchString, searchString, searchString, searchString, searchString, searchString, searchString)
args := sqlutils.Args(searchString, searchString, searchString, searchString, searchString, searchString, searchString, searchString)
return readInstancesByCondition(condition, args, `replication_depth asc, num_slave_hosts desc, cluster_name, hostname, port`)
}

Expand Down
6 changes: 5 additions & 1 deletion resources/public/js/orchestrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,11 @@ function renderInstanceElement(popoverElement, instance, renderType) {
contentHtml += '<p><strong>Master</strong></p>';
}
if (renderType == "search") {
contentHtml += '<p>' + 'Cluster: <a href="' + appUrl('/web/cluster/' + instance.ClusterName) + '">' + instance.ClusterName + '</a>' + '</p>';
if (instance.SuggestedClusterAlias) {
contentHtml += '<p>' + 'Cluster: <a href="' + appUrl('/web/cluster/alias/' + instance.SuggestedClusterAlias) + '">' + instance.SuggestedClusterAlias + '</a>' + '</p>';
} else {
contentHtml += '<p>' + 'Cluster: <a href="' + appUrl('/web/cluster/' + instance.ClusterName) + '">' + instance.ClusterName + '</a>' + '</p>';
}
}
if (renderType == "problems") {
contentHtml += '<p>' + 'Problem: <strong title="' + instance.problemDescription + '">' + instance.problem.replace(/_/g, ' ') + '</strong>' + '</p>';
Expand Down

0 comments on commit 3ab7969

Please sign in to comment.