     (array-map
       :id service-id
       :version (get-in service [:Version :Index])
-      :createdAt (get service :CreatedAt)
-      :updatedAt (get service :UpdatedAt)
+      :createdAt (date (get service :CreatedAt))
+      :updatedAt (date (get service :UpdatedAt))
       :image image-name
       :imageDigest image-digest
       :serviceName service-name
       :mode service-mode
       :replicas replicas
-      :replicasState (->service-replicas-state replicas replicas-running service-mode)
       :state (->service-state replicas replicas-running service-mode)
+      :status {:info   (->service-replicas-state replicas replicas-running service-mode)
+               :update (some? (get-in service [:UpdateStatus :State]))}
       :ports (->service-ports service)
       :volumes (->service-volumes service)
       :variables (->service-variables service)
-      :tasks service-tasks)))
+      :tasks (->tasks service-tasks nodes service-name service-mode))))
 
 (defn ->services
   [services tasks nodes]

                 :value (second variable)})))
       (into [])))

(defn ->service-replicas-state
  [replicas replicas-running service-mode]
  (if (= service-mode "replicated")
    (str replicas-running " / " replicas)
    (str replicas-running " / " replicas-running)))

(defn ->service-state
  [replicas replicas-running service-mode]
  (case service-mode
    "replicated" (if (zero? replicas-running)
                   "not running"
                   (if (= replicas-running replicas)
                     "running"
                     "partly running"))
    "global" (if (zero? replicas-running)
               "not running"
               "running")))


(ns swarmpit.docker.mapper.inbound
  "Map docker domain to swarmpit domain"
  (:import (java.text SimpleDateFormat))
  (:require [clojure.string :as str]))

(def date-format (SimpleDateFormat. "yyyy-MM-dd'T'HH:mm:ss"))

(defn date
  [date]
  (str (.parse date-format date)))

(defn ->node
  [node]
