mirror of
https://github.com/cuigh/swirl
synced 2025-01-30 22:37:21 +00:00
Show update status
This commit is contained in:
parent
918fd82ea5
commit
b6bc988c76
@ -126,6 +126,7 @@ network.description: Networks are user-defined networks that containers can be a
|
||||
service.title: Service
|
||||
service.description: Services are the definitions of tasks to run on a swarm.
|
||||
service.edit.warning: "NOTE: This service belong to '%s' stack, usually you should modify original compose instead of updating it directly."
|
||||
service.field.update-status: "Update status"
|
||||
|
||||
# service template pages
|
||||
service.template.title: Service Template
|
||||
|
@ -126,6 +126,7 @@ network.description: 能够连接到容器的 Docker 预置和用户自定义的
|
||||
service.title: 服务
|
||||
service.description: 服务是在 Swarm 集群中运行的任务定义。
|
||||
service.edit.warning: "注意: 这个服务属于编排 %s,通常你应该修改原始的编排而不是直接修改此服务信息,否则后续重新部署编排时这些修改将会丢失。"
|
||||
service.field.update-status: "更新状态"
|
||||
|
||||
# service template pages
|
||||
service.template.title: 服务模板
|
||||
|
2
main.go
2
main.go
@ -25,7 +25,7 @@ func main() {
|
||||
misc.BindOptions()
|
||||
|
||||
app.Name = "Swirl"
|
||||
app.Version = "0.6.5"
|
||||
app.Version = "0.6.6"
|
||||
app.Desc = "A web management UI for Docker, focused on swarm cluster"
|
||||
app.Action = func(ctx *app.Context) {
|
||||
misc.LoadOptions()
|
||||
|
@ -93,13 +93,14 @@ type StackListInfo struct {
|
||||
}
|
||||
|
||||
type ServiceListInfo struct {
|
||||
Name string
|
||||
Image string
|
||||
Mode string
|
||||
Actives uint64
|
||||
Replicas uint64
|
||||
UpdatedAt time.Time
|
||||
Rollback bool
|
||||
Name string
|
||||
Image string
|
||||
Mode string
|
||||
Actives uint64
|
||||
Replicas uint64
|
||||
Rollback bool
|
||||
UpdatedAt time.Time
|
||||
UpdateStatus string
|
||||
}
|
||||
|
||||
func NewServiceListInfo(service swarm.Service, actives uint64) *ServiceListInfo {
|
||||
@ -110,6 +111,9 @@ func NewServiceListInfo(service swarm.Service, actives uint64) *ServiceListInfo
|
||||
UpdatedAt: service.UpdatedAt.Local(),
|
||||
Rollback: service.PreviousSpec != nil,
|
||||
}
|
||||
if service.UpdateStatus != nil {
|
||||
info.UpdateStatus = string(service.UpdateStatus.State)
|
||||
}
|
||||
if service.Spec.Mode.Replicated != nil && service.Spec.Mode.Replicated.Replicas != nil {
|
||||
info.Mode = "replicated"
|
||||
info.Replicas = *service.Spec.Mode.Replicated.Replicas
|
||||
|
@ -72,6 +72,10 @@
|
||||
<dd>{{ time(.Service.CreatedAt) }}</dd>
|
||||
<dt class="has-text-left">{{ i18n("field.updated-at") }}</dt>
|
||||
<dd>{{ time(.Service.UpdatedAt) }}</dd>
|
||||
{{ if .Service.UpdateStatus }}
|
||||
<dt class="has-text-left">{{ i18n("service.field.update-status") }}</dt>
|
||||
<dd>{{ .Service.UpdateStatus.State }}({{ .Service.UpdateStatus.Message }})</dd>
|
||||
{{ end }}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -58,7 +58,7 @@
|
||||
<span class="tag is-{{.Actives == 0 ? "danger" : (.Actives < .Replicas ? "warning" : "success")}}">{{.Actives}}/{{.Replicas}}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{time(.UpdatedAt)}}</td>
|
||||
<td>{{time(.UpdatedAt)}}{{ if .UpdateStatus }}<span class="icon {{ if .UpdateStatus == "completed" }}has-text-success{{ else if .UpdateStatus == "updating" }}has-text-warning{{ else }}has-text-danger{{ end }} tooltip" data-tooltip="{{.UpdateStatus}}"><i class="fa fa-circle"></i></span>{{ end }}</td>
|
||||
<td>
|
||||
<a href="{{.Name}}/edit" class="button is-small is-dark is-outlined tooltip is-tooltip-bottom" data-tooltip="{{ i18n("button.edit") }}">
|
||||
<span class="icon"><i class="fa fa-edit"></i></span>
|
||||
|
Loading…
Reference in New Issue
Block a user