Add service link

This commit is contained in:
cuigh 2018-04-16 20:39:24 +08:00
parent 8c380fa23a
commit 9f1855a6ea
2 changed files with 8 additions and 1 deletions

View File

@ -76,6 +76,11 @@ func serviceDetail(ctx web.Context) error {
return err
}
// redirect if name is service id
if name != service.Spec.Name {
return ctx.Redirect("/service/" + service.Spec.Name + "/detail")
}
info := model.NewServiceDetailInfo(service)
for _, vip := range service.Endpoint.VirtualIPs {
n, e := docker.NetworkInspect(vip.NetworkID)

View File

@ -35,8 +35,10 @@
<dl class="is-horizontal is-marginless">
<dt class="has-text-left">ID</dt>
<dd>{{ .Task.ID }}</dd>
<dt class="has-text-left">Service ID</dt>
<dd><a href="/service/{{ .Task.ServiceID }}/detail">{{ .Task.ServiceID }}</a></dd>
{{ if .Task.Status.ContainerStatus.ContainerID }}
<dt class="has-text-left">ContainerID</dt>
<dt class="has-text-left">Container ID</dt>
<dd><a href="/container/{{ .Task.Status.ContainerStatus.ContainerID }}/detail">{{ .Task.Status.ContainerStatus.ContainerID }}</a></dd>
{{ end }}
{{ if .Task.Status.ContainerStatus.PID }}