Skip to content

Commit 2a94994

Browse files
committed
feat: add label display on release UI
1 parent fadb7c5 commit 2a94994

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

cmd/go-cat/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func main() {
2828
infraFlags := []cli.Flag{
2929
&cli.StringFlag{Name: "name", Usage: "Name of the service or endpoint"},
3030
&cli.StringFlag{Name: "type", Usage: "Type of infrastructure on which the service is deployed to"},
31+
&cli.StringFlag{Name: "labels", Usage: "Additional key:value pairs, separated by comma"},
3132
&cli.StringFlag{Name: "commit-sha", Usage: "Deployed Commit SHA"},
3233
&cli.StringFlag{Name: "cloud", Usage: "Name of the cloud, example: gcp, aws"},
3334
&cli.StringFlag{Name: "cloud-project-id", Usage: "A unique identifier of the project / environment in which the service is deployed"},

parser/markdown.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func InfrastructureMetaToString(infraMeta *infrastructure.MetadataGroup) (string
101101
labels += fmt.Sprintf("`%s:%s`, <br>", k, infra.Labels[k])
102102
}
103103
}
104-
t.SetContent(i, 2, fmt.Sprintf("`sha:%s`%s", infra.CommitSha, something))
104+
t.SetContent(i, 2, fmt.Sprintf("`sha:%s`%s", infra.CommitSha, labels))
105105
t.SetContent(i, 3, infra.DeployedOn.Format("2006-01-02 15:04:05 -0700 MST"))
106106

107107
// get logging and monitoring links, and only show them if we support monitoring

ui/go-cat-ui/src/App.svelte

+15-4
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ import InfraType from './InfraType.svelte';
6969
}, 700)
7070
7171
}
72-
73-
74-
7572
</script>
7673

7774
<svelte:head>
@@ -102,7 +99,7 @@ import InfraType from './InfraType.svelte';
10299
<thead>
103100
<tr>
104101
<th><abbr title="Deployment Name">Name</abbr></th>
105-
<th>Deployment Links</th>
102+
<th>Links</th>
106103
<th>Tags</th>
107104
</tr>
108105

@@ -195,6 +192,7 @@ import InfraType from './InfraType.svelte';
195192
</div>
196193
</div>
197194

195+
198196
{#if d.infra_type }
199197
<InfraType infra={d} />
200198
<CloudNativeMonitoring infra={d} />
@@ -204,6 +202,19 @@ import InfraType from './InfraType.svelte';
204202
{#if d.monitoring_links}
205203
<Monitoring infra={d} />
206204
{/if}
205+
206+
207+
{#each Object.entries(d.labels) as [k, v]}
208+
209+
<div class="control">
210+
<div class="tags has-addons">
211+
<span class="tag is-dark">{k}</span>
212+
<span class="tag is-primary">{v}</span>
213+
</div>
214+
</div>
215+
{/each}
216+
217+
207218
</div>
208219

209220
</td>

0 commit comments

Comments
 (0)