Skip to content

Commit

Permalink
misc style changes; bump 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Feb 5, 2018
1 parent ba6f100 commit fe1c797
Show file tree
Hide file tree
Showing 13 changed files with 500 additions and 275 deletions.
640 changes: 403 additions & 237 deletions app/calcit.edn

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[mvc-works/keycode "0.1.3"]
[mvc-works/shell-page "0.1.6"]
[cumulo/recollect "0.4.3"]
[respo "0.8.14"]
[respo "0.8.15"]
[respo/ui "0.3.2"]
[respo/message "0.2.3"]]
:builds {:browser {:output-dir "target/"
Expand Down
6 changes: 3 additions & 3 deletions app/src/app/comp/commander.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
{}
(input
{:value (:cwd state),
:style (merge ui/input {:width 240, :font-family ui/font-code}),
:placeholder "Current working directy",
:style (merge ui/input {:width 160, :font-family ui/font-code}),
:placeholder "cwd",
:on-input (mutation-> (assoc state :cwd (:value %e)))})
(=< 8 nil)
(input
{:value (:command state),
:style (merge ui/input {:width 240, :font-family ui/font-code}),
:style (merge ui/input {:width 160, :font-family ui/font-code}),
:placeholder "Command",
:on-input (mutation-> (assoc state :command (:value %e)))})
(=< 8 nil)
Expand Down
22 changes: 15 additions & 7 deletions app/src/app/comp/container.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(:require [hsl.core :refer [hsl]]
[respo-ui.core :as ui]
[respo-ui.colors :as colors]
[respo.macros :refer [defcomp <> div cursor-> span button]]
[respo.macros :refer [defcomp <> div cursor-> action-> span button pre]]
[respo.comp.inspect :refer [comp-inspect]]
[respo.comp.space :refer [=<]]
[app.comp.header :refer [comp-header]]
Expand All @@ -17,7 +17,19 @@
[app.comp.history :refer [comp-history]]
[app.comp.process-detail :refer [comp-process-detail]]))

(def style-alert {:font-family "Josefin Sans", :font-weight 100, :font-size 40})
(defcomp
comp-offline
()
(div
{:style (merge ui/global ui/fullscreen ui/center)}
(span
{:style {:font-family ui/font-fancy, :font-weight 100, :font-size 40, :cursor :pointer},
:title "Click to reconnect!",
:on-click (action-> :effect/connect nil)}
(<> "No connection!"))
(<>
"This is a placeholder page for Termina, install and run the command line to try again:")
(pre {:inner-text "npm i -g termina", :style {:font-family ui/font-code}})))

(def style-debugger {:bottom 0, :left 0, :max-width "100%"})

Expand All @@ -26,11 +38,7 @@
(states store)
(let [state (:data states), session (:session store)]
(if (nil? store)
(div
{:style (merge ui/global ui/fullscreen ui/center)}
(span
{:style {:cursor :pointer}, :on-click (fn [e d! m!] (d! :effect/connect nil))}
(<> "No connection!" style-alert)))
(comp-offline)
(div
{:style (merge ui/global ui/fullscreen ui/column)}
(comp-header (:logged-in? store) (:router store))
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/comp/home.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
(div
{:style {:padding 8, :overflow :auto}}
(div
{:style (merge ui/row {:align-items :center})}
{:style (merge ui/row-parted {:align-items :center})}
(list->
{:style ui/row}
(->> (:workflows router-data)
Expand Down
17 changes: 9 additions & 8 deletions app/src/app/comp/login.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
[respo.comp.space :refer [=<]]
[respo.comp.inspect :refer [comp-inspect]]
[respo-ui.core :as ui]
[app.schema :as schema]))
[app.schema :as schema]
[app.style :as style]))

(def initial-state {:username "", :password ""})

Expand All @@ -20,33 +21,33 @@
(states)
(let [state (or (:data states) initial-state)]
(div
{}
{:style (merge ui/flex ui/center)}
(div
{:style {}}
(div
{}
(input
{:placeholder "Username",
:value (:username state),
:style ui/input,
:style style/input,
:on-input (on-input state :username)}))
(=< nil 8)
(div
{}
(input
{:placeholder "Password",
:value (:password state),
:style ui/input,
:style style/input,
:on-input (on-input state :password)})))
(=< nil 8)
(div
{:style ui/flex}
{:style {}}
(button
{:inner-text "Sign up",
:style (merge ui/button {:outline :none, :border :none}),
:style (merge style/button),
:on-click (on-submit (:username state) (:password state) true)})
(=< 8 nil)
(button
{:inner-text "Sign in",
:style (merge ui/button {:outline :none, :border :none}),
{:inner-text "Log in",
:style (merge style/button),
:on-click (on-submit (:username state) (:password state) false)})))))
6 changes: 3 additions & 3 deletions app/src/app/comp/process.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
(<>
(:data chunk)
{:color (case (:type chunk)
:stderr (hsl 60 80 60)
:error (hsl 0 80 60)
(hsl 0 0 0))})))))))
:stderr (hsl 60 80 36)
:error (hsl 0 80 50)
(hsl 60 0 0))})))))))
2 changes: 1 addition & 1 deletion app/src/app/comp/profile.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
comp-profile
(user)
(div
{:style ui/flex}
{:style (merge ui/flex {:padding "8px 16px"})}
(<> span (str "Hello! " (:name user)) nil)
(=< 8 nil)
(a {:style style-trigger, :on-click on-log-out} (<> span "Log out" nil))))
28 changes: 17 additions & 11 deletions app/src/app/comp/workflow.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,15 @@
(fn [[k command]]
[k
(div
{}
(<> (:code command) {:background-color (hsl 0 0 90), :padding "0 8px"})
(=< 8 {:font-family ui/font-code})
(<> (:path command))
{:style {:font-family ui/font-code}}
(<> (:path command) {:display :inline-block, :min-width 200})
(=< 8 nil)
(<>
(:code command)
{:background-color (hsl 0 0 95),
:padding "0 8px",
:display :inline-block,
:min-width 320})
(span
{:style style/link,
:inner-text "edit",
Expand Down Expand Up @@ -161,22 +166,23 @@
(div
{:style (merge ui/row {:padding 16})}
(div
{:style {:width 240}}
(div {:style ui/row} (<> "Workflows"))
{:style {:width 200}}
(div {:style ui/row} (<> "Workflows" {:font-family ui/font-fancy}))
(list->
{}
(->> workflows
(map-val
(fn [workflow]
(div
{:style {:cursor :pointer,
:margin "4px 0",
:padding "0 8px",
:margin-bottom 8,
:min-width 40,
:min-height 20,
:background-color (if (= (:focused-id state) (:id workflow))
:border-bottom (str "1px solid " (hsl 0 0 90)),
:border-color (if (= (:id workflow) (:focused-id state))
(hsl 0 0 80)
(hsl 0 0 90))},
(hsl 0 0 94))},
:on-click (mutation-> (assoc state :focused-id (:id workflow)))}
(<> (:name workflow)))))))
(div
Expand All @@ -185,7 +191,7 @@
{:style style/button,
:on-click (fn [e d! m!] (m! (assoc state :edit-workflow? true :base-workflow nil)))}
(<> "add"))))
(=< 16 nil)
(=< 32 nil)
(div
{:style ui/flex}
(let [focused-id (:focused-id state)]
Expand All @@ -196,7 +202,7 @@
%cursor
(assoc state :edit-workflow? true :base-workflow workflow)))]
(cursor-> :detail comp-workflow-detail states workflow on-edit!))
(div {} (<> "nothing")))))
(div {} (<> "Nothing" {:font-family ui/font-fancy})))))
(if (:edit-workflow? state)
(let [on-close! (fn [m!] (m! %cursor (assoc state :edit-workflow? false)))]
(comp-dialog
Expand Down
4 changes: 3 additions & 1 deletion app/src/app/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
(ns app.style (:require [respo-ui.core :as ui]))

(def button
(merge ui/button {:padding "0 8px", :min-width 40, :line-height "20px", :height "20px"}))
(merge ui/button {:padding "0 8px", :min-width 40, :line-height "24px", :height "24px"}))

(def input (merge ui/input {:width 320}))

(def link (merge ui/clickable-text))
38 changes: 38 additions & 0 deletions server/calcit.edn

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "termina",
"version": "0.1.0",
"version": "0.1.1",
"description": "Start process from a Webpage",
"main": "index.js",
"bin": {
Expand Down
6 changes: 5 additions & 1 deletion server/src/server/manager.cljs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

(ns server.manager (:require [verbosely.core :refer [log!]] ["child_process" :as cp]))
(ns server.manager
(:require [verbosely.core :refer [log!]]
[clojure.string :as string]
["child_process" :as cp]))

(defonce *registry (atom {}))

Expand All @@ -8,6 +11,7 @@
cwd (:cwd op-data)
proc (.exec cp command (clj->js {:cwd cwd}))
pid proc.pid]
(println "Run" (if (string/blank? cwd) "./" cwd) (pr-str command))
(swap! *registry assoc pid proc)
(dispatch! :process/create {:pid pid, :command command, :cwd cwd})
(.on proc "exit" (fn [event] (dispatch! :process/finish pid)))
Expand Down

0 comments on commit fe1c797

Please sign in to comment.