Display balance in ETH + stop scheduler threads on exit

This commit is contained in:
kagel 2016-09-20 23:43:20 +03:00
parent 561d852a38
commit 6d8ad78bfd
4 changed files with 13 additions and 6 deletions

View File

@ -61,6 +61,7 @@
:immutant {:war {:name "ROOT" :immutant {:war {:name "ROOT"
:destination "/opt/wildfly/standalone/deployments" :destination "/opt/wildfly/standalone/deployments"
:context-path "/"}} :context-path "/"}}
:ring {:destroy commiteth.scheduler/stop}
;:npm {:dependencies ["primer-css" "latest"]} ;:npm {:dependencies ["primer-css" "latest"]}

View File

@ -9,7 +9,8 @@
[commiteth.db.repositories :as repositories] [commiteth.db.repositories :as repositories]
[commiteth.db.bounties :as bounties] [commiteth.db.bounties :as bounties]
[commiteth.github.core :as github] [commiteth.github.core :as github]
[clojure.tools.logging :as log])) [clojure.tools.logging :as log]
[commiteth.eth.core :as eth]))
(defn access-error [_ _] (defn access-error [_ _]
(unauthorized {:error "unauthorized"})) (unauthorized {:error "unauthorized"}))
@ -59,7 +60,8 @@
(GET "/issues" [] (GET "/issues" []
:auth-rules authenticated? :auth-rules authenticated?
:current-user user :current-user user
(ok (bounties/list-owner-bounties (:id user)))) (ok (map #(conj % {:balance-eth (eth/hex->eth (:balance %) 6)})
(bounties/list-owner-bounties (:id user)))))
(POST "/repository/toggle" {:keys [params]} (POST "/repository/toggle" {:keys [params]}
:auth-rules authenticated? :auth-rules authenticated?
:current-user user :current-user user

View File

@ -67,3 +67,7 @@
:stop (do :stop (do
(log/info "Stopping scheduler pool") (log/info "Stopping scheduler pool")
(stop-and-reset-pool! pool))) (stop-and-reset-pool! pool)))
(defn stop []
(log/info "Stopping scheduler pool")
(stop-and-reset-pool! pool))

View File

@ -32,7 +32,7 @@
issue-number :issue_number issue-number :issue_number
owner :owner_name owner :owner_name
repo :repo_name repo :repo_name
balance :balance}] balance :balance-eth}]
^{:key issue-id} ^{:key issue-id}
[:li.issue [:li.issue
[:div.d-table.table-fixed.width-full [:div.d-table.table-fixed.width-full
@ -48,10 +48,10 @@
[:path [:path
{:d {:d
"M7 10h2v2H7v-2zm2-6H7v5h2V4zm1.5 1.5l-1 1L12 9l4-4.5-1-1L12 7l-1.5-1.5zM8 13.7A5.71 5.71 0 0 1 2.3 8c0-3.14 2.56-5.7 5.7-5.7 1.83 0 3.45.88 4.5 2.2l.92-.92A6.947 6.947 0 0 0 8 1C4.14 1 1 4.14 1 8s3.14 7 7 7 7-3.14 7-7l-1.52 1.52c-.66 2.41-2.86 4.19-5.48 4.19v-.01z"}]]]] "M7 10h2v2H7v-2zm2-6H7v5h2V4zm1.5 1.5l-1 1L12 9l4-4.5-1-1L12 7l-1.5-1.5zM8 13.7A5.71 5.71 0 0 1 2.3 8c0-3.14 2.56-5.7 5.7-5.7 1.83 0 3.45.88 4.5 2.2l.92-.92A6.947 6.947 0 0 0 8 1C4.14 1 1 4.14 1 8s3.14 7 7 7 7-3.14 7-7l-1.52 1.52c-.66 2.41-2.86 4.19-5.48 4.19v-.01z"}]]]]
[:button.btn.btn-danger.float-right [:button.btn.btn-sm.btn-danger.float-right
{:type "submit" {:type "submit"
:style {:margin-top "4px" :style {:margin-top "7px"
:margin-right "4px"} :margin-right "7px"}
:on-click #(println %)} :on-click #(println %)}
(str "Sign and send " balance " ETH")] (str "Sign and send " balance " ETH")]
[:div.float-left.col-9.p-3.lh-condensed [:div.float-left.col-9.p-3.lh-condensed