Skip to content

Commit

Permalink
update testify dep and css classes for zone colors
Browse files Browse the repository at this point in the history
  • Loading branch information
zoemccormick committed May 22, 2024
1 parent 9f4cba4 commit 051b99f
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 12 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ require (
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/stretchr/testify v1.7.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
golang.org/x/sys v0.10.0 // indirect
)

Expand Down
13 changes: 10 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@ github.com/nsqio/go-nsq v1.1.0/go.mod h1:vKq36oyeVXgsS5Q8YEO7WghqidAVXQlcFxzQbQT
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
12 changes: 12 additions & 0 deletions nsqadmin/static/build/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@
display: inline;
}

.bg-zone-local {
background-color: #ddffdd;
}

.bg-region-local {
background-color: #fefec2;
}

.bg-global {
background-color: white;
}

.popup {
position: relative;
display: inline-block;
Expand Down
2 changes: 1 addition & 1 deletion nsqadmin/static/build/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion nsqadmin/static/build/main.js.map

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions nsqadmin/static/css/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@
display: inline;
}

.bg-zone-local {
background-color: rgb(221,255,221);
}

.bg-region-local {
background-color: rgb(254,254,194);
}

.bg-global {
background-color: white;
}

.popup {
position: relative;
display: inline-block;
Expand Down
10 changes: 5 additions & 5 deletions nsqadmin/static/js/views/channel.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@
<td>
<div class="popup" data-id="popup-{{node}}">
<div class="progress" style="width: 120px; height: 20px; border-right: .01em solid #777; border-left: .01em solid #777; border-top: .01em solid #777; border-bottom: .01em solid #777">
<div class="progress-bar progress-bar-success" style="background-color:rgb(221,255,221); width: {{floatToPercent zone_local_percentage}}%">
<div class="progress-bar progress-bar-success bg-zone-local" style="width: {{floatToPercent zone_local_percentage}}%">
<span class="sr-only">{{floatToPercent zone_local_percentage}}%</span>
</div>
<div class="progress-bar progress-bar-warning progress-bar-striped" style="background-color:rgb(254,254,194); width: {{floatToPercent region_local_percentage}}%">
<div class="progress-bar progress-bar-warning progress-bar-striped bg-region-local" style="width: {{floatToPercent region_local_percentage}}%">
<span class="sr-only">{{floatToPercent region_local_percentage}}%</span>
</div>
<div class="progress-bar progress-bar-danger" style="background-color: white; width: {{floatToPercent global_percentage}}%">
<div class="progress-bar progress-bar-danger bg-global" style="width: {{floatToPercent global_percentage}}%">
<span class="sr-only">{{floatToPercent global_percentage}}%</span>
</div>
</div>
<span class="popuptext" id="popup-{{node}}"><span style="background-color:rgb(221,255,221); color:#4b4b4b">{{floatToDecimalPercent zone_local_percentage}}%</span> | <span style="background-color:rgb(254,254,194); color:#4b4b4b">{{floatToDecimalPercent region_local_percentage}}%</span> | <span style="color:#4b4b4b">{{floatToDecimalPercent global_percentage}}%</span></span>
<span class="popuptext" id="popup-{{node}}"><span class="bg-zone-local" style="color:#4b4b4b">{{floatToDecimalPercent zone_local_percentage}}%</span> | <span class="bg-region-local" style="color:#4b4b4b">{{floatToDecimalPercent region_local_percentage}}%</span> | <span style="color:#4b4b4b">{{floatToDecimalPercent global_percentage}}%</span></span>
</div>
</td>
{{/if}}
Expand Down Expand Up @@ -208,7 +208,7 @@
<th>Connected</th>
</tr>
{{#each clients}}
<tr style={{#if (and node_topology_zone (eq topology_zone node_topology_zone))}}"background-color:rgb(221,255,221)"{{/if}}{{#if (and node_topology_region (eq topology_region node_topology_region))}}"background-color:rgb(254,254,194)"{{/if}}>
<tr class={{#if (and node_topology_zone (eq topology_zone node_topology_zone))}}"bg-zone-local"{{/if}}{{#if (and node_topology_region (eq topology_region node_topology_region))}}"bg-region-local"{{/if}}>
<td title="{{remote_address}}">{{hostname_port}}{{#if show_client_id}} ({{client_id}}){{/if}}</td>
<td>{{#if user_agent.length}}<small>{{user_agent}}</small>{{/if}}</td>
<td>
Expand Down

0 comments on commit 051b99f

Please sign in to comment.