Skip to content

Commit

Permalink
Adding canary_tags to anyplace we show service tags
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Dec 2, 2022
1 parent 2d4611a commit ea66523
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ui/app/components/allocation-service-sidebar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
{{#each @service.tags as |tag|}}
<span class="tag is-service">{{tag}}</span>
{{/each}}
{{#each @service.canary_tags as |tag|}}
<span class="tag canary is-service">{{tag}}</span>
{{/each}}
</span>
{{/if}}
</div>
Expand Down
1 change: 1 addition & 0 deletions ui/app/models/service-fragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default class Service extends Fragment {
@attr('string') name;
@attr('string') portLabel;
@attr() tags;
@attr() canary_tags;
@attr('string') onUpdate;
@attr('string') provider;
@fragment('consul-connect') connect;
Expand Down
1 change: 1 addition & 0 deletions ui/app/models/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default class Service extends Model {
@attr('number') port;
@attr('string') serviceName;
@attr() tags;
@attr() canary_tags;

@alias('serviceName') name;

Expand Down
18 changes: 18 additions & 0 deletions ui/app/styles/components/services.scss
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,21 @@ table.health-checks {
}
}
}

$tagPadding: 0.75em;

.tag {
&.canary {
overflow: hidden;
&:before {
content: "Canary";
background-color: $blue-light;
color: $black;
line-height: 1.5em;
margin-left: -$tagPadding;
margin-right: $tagPadding;
padding: 0 $tagPadding;
align-self: normal;
}
}
}
3 changes: 3 additions & 0 deletions ui/app/templates/allocations/allocation/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@
{{#each row.model.tags as |tag|}}
<span class="tag is-service">{{tag}}</span>
{{/each}}
{{#each row.model.canary_tags as |tag|}}
<span class="tag canary is-service">{{tag}}</span>
{{/each}}
</td>
<td data-test-service-health class="is-2">
{{#if (eq row.model.provider "nomad")}}
Expand Down
5 changes: 4 additions & 1 deletion ui/app/templates/components/job-service-row.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
</td>
<td>
{{#each @service.tags as |tag|}}
<span class="tag">{{tag}}</span>
<span class="tag is-service">{{tag}}</span>
{{/each}}
{{#each @service.canary_tags as |tag|}}
<span class="tag canary is-service">{{tag}}</span>
{{/each}}
</td>
<td>
Expand Down

0 comments on commit ea66523

Please sign in to comment.