Skip to content

Commit

Permalink
Print tags in dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
svaroqui committed Dec 11, 2017
1 parent 339fa7d commit 5f0d722
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
8 changes: 8 additions & 0 deletions cluster/cluster_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,11 @@ func (cluster *Cluster) GetTopology() string {
}
return cluster.conf.Topology
}

func (cluster *Cluster) GetDatabaseTags() []string {
return strings.Split(cluster.conf.ProvTags, ",")
}

func (cluster *Cluster) GetProxyTags() []string {
return strings.Split(cluster.conf.ProvProxTags, ",")
}
27 changes: 21 additions & 6 deletions dashboard/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ <h1>

<div layout="column" layout-gt-xs="row">
<div flex-gt-xs="30" class="col-lg-33">
<md-card>
<md-card>
<md-card-content><p class="sectionheader">ACTIONS</p></md-card-content>

<table class="table">
Expand All @@ -231,16 +231,31 @@ <h1>
<button ng-if="master.State !='Failed'" type="button" class="btn btn-primary" ng-click="switch(false)">Switchover</button>
<button ng-if="master.State =='Failed'" type="button" class="btn btn-danger" ng-click="switch(true)">Failover</button>
<button type="button" class="btn btn-primary" ng-click="resetfail()">Reset Failover Counter</button>
<BR><BR>
<button ng-if="settings.heartbeat=='true'" type="button" class="btn btn-primary" ng-click="setactive()">Force Active Status</button>
<button ng-if="settings.test=='true'" type="button" class="btn btn-primary" ng-click="bootstrap()">Bootstrap</button>
<button ng-if="settings.enterprise=='true'" type="button" class="btn btn-primary" ng-click="unprovision()">Unprovision</button>
<button ng-if="settings.enterprise=='true'" type="button" class="btn btn-primary" ng-click="unprovision()">Rolling Upgrade</button><BR><BR>
</td>
</tr>
</table>
</md-card>
<BR>
<md-card>
<md-card-content><p class="sectionheader">PRO</p></md-card-content>

<table class="table">
<tr>
<td>
<button ng-if="settings.test=='true'" type="button" class="btn btn-primary" ng-click="bootstrap()">Bootstrap</button>
<button ng-if="settings.enterprise=='true'" type="button" class="btn btn-primary" ng-click="unprovision()">Unprovision</button>
<button ng-if="settings.enterprise=='true'" type="button" class="btn btn-primary" ng-click="rolling()">Rolling Upgrade</button><BR><BR>
</td>
</tr>
<tr>
<td>
<div ng-repeat="tag in settings.databasetags"> <span class="label label-success">{{ tag }}<span></div>
</td>
</tr>
</table>
</md-card>
<BR>

<md-card ng-if="settings.test=='true'">
<table class="table">
<tr>
Expand Down
2 changes: 2 additions & 0 deletions httpserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ func handlerSettings(w http.ResponseWriter, r *http.Request) {
}
s.Topology = currentCluster.GetTopology()
s.Version = fmt.Sprintf("%s %s %s %s", FullVersion, Build, GoOS, GoArch)
s.DBTags = currentCluster.GetDatabaseTags()
s.ProxyTags = currentCluster.GetProxyTags()
e := json.NewEncoder(w)
e.SetIndent("", "\t")
err := e.Encode(s)
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ type Settings struct {
RegTests []string `json:"regtests"`
Topology string `json:"topology"`
Version string `json:"version"`
DBTags []string `json:"databasetags"`
ProxyTags []string `json:"proxytags"`
}
type heartbeat struct {
UUID string `json:"uuid"`
Expand Down

0 comments on commit 5f0d722

Please sign in to comment.