From 9f1855a6eac3d8621241d8d73d5ca07249fc0480 Mon Sep 17 00:00:00 2001 From: cuigh Date: Mon, 16 Apr 2018 20:39:24 +0800 Subject: [PATCH] Add service link --- controller/service.go | 5 +++++ views/task/detail.jet | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/controller/service.go b/controller/service.go index b3abed8..b960413 100644 --- a/controller/service.go +++ b/controller/service.go @@ -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) diff --git a/views/task/detail.jet b/views/task/detail.jet index 8492eba..2e47d1d 100644 --- a/views/task/detail.jet +++ b/views/task/detail.jet @@ -35,8 +35,10 @@
ID
{{ .Task.ID }}
+
Service ID
+
{{ .Task.ServiceID }}
{{ if .Task.Status.ContainerStatus.ContainerID }} -
ContainerID
+
Container ID
{{ .Task.Status.ContainerStatus.ContainerID }}
{{ end }} {{ if .Task.Status.ContainerStatus.PID }}