 
 (def cursor [:page :service :wizard :resources])
 
+(defn- cpu-value
+  [value]
+  (if (zero? value)
+    "unlimited"
+    value))
+
 (defn- form-cpu-reservation [value]
   (comp/form-comp
-    "CPU"
-    (comp/vtext-field
-      {:name            "cpu-reservation"
-       :key             "cpu-reservation"
-       :type            "number"
-       :min             0.000
-       :step            0.001
-       :max             1.0
-       :validations     "isValidCPUValue"
-       :validationError "Please use maximum of 1.0 (represents a whole CPU) or leave blank for default value"
-       :value           value
-       :onChange        (fn [_ v]
-                          (state/update-value [:reservation :cpu] (parse-float v) cursor))})))
+    (str "CPU  " "(" (cpu-value value) ")")
+    (comp/slider #js {:min          0
+                      :max          2
+                      :step         0.10
+                      :defaultValue 0
+                      :value        value
+                      :onChange     (fn [_ v]
+                                      (state/update-value [:reservation :cpu] (parse-float v) cursor))
+                      :sliderStyle  #js {:marginTop "14px"}})))
 
 (defn- form-memory-reservation [value]
   (comp/form-comp

       :type            "number"
       :min             4
       :validations     "isValidMemoryValue"
       :validationError "Please use minimum of 4 MB or leave blank for default value"
       :value           value
       :onChange        (fn [_ v]
                          (state/update-value [:reservation :memory] (parse-int v) cursor))})))

(defn- form-cpu-limit [value]
  (comp/form-comp
    "CPU"
    (comp/vtext-field
      {:name            "cpu-limit"
       :key             "cpu-limit"
       :type            "number"
       :min             0.000
       :step            0.001
       :max             1.0
       :validations     "isValidCPUValue"
       :validationError "Please use maximum of 1.0 (represents a whole CPU) or leave blank for default value"
       :value           value
       :onChange        (fn [_ v]
                          (state/update-value [:limit :cpu] (parse-float v) cursor))})))

(defn- form-memory-limit [value]
  (comp/form-comp

       :type            "number"
       :min             4
       :validations     "isValidMemoryValue"
       :validationError "Please use minimum of 4 MB or leave blank for unlimited"
       :value           value
       :onChange        (fn [_ v]
                          (state/update-value [:limit :memory] (parse-int v) cursor))})))
