mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-07 02:33:39 +02:00
Implement authentication
This commit is contained in:
parent
9f5ff05101
commit
d782b49b94
7 changed files with 70 additions and 8 deletions
|
|
@ -1,8 +1,28 @@
|
|||
(ns airsonic-ui.views
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[airsonic-ui.subs :as subs]
|
||||
))
|
||||
[airsonic-ui.config :as config]
|
||||
[airsonic-ui.subs :as subs]))
|
||||
|
||||
(defn login-form []
|
||||
[:form {:method "get"
|
||||
:action config/server
|
||||
:on-click #(js/alert "bang bang! TODO: implement login via form")}
|
||||
[:div
|
||||
[:span "User"]
|
||||
[:input {:type "text" :name "user"}]]
|
||||
[:div
|
||||
[:span "Password"]
|
||||
[:input {:type "password" :name "pass"}]]
|
||||
[:div
|
||||
[:input {:type "submit" :value "submit"}]]])
|
||||
|
||||
(defn app [user]
|
||||
[:div
|
||||
[:h2 (str "Currently logged in as " user)]])
|
||||
|
||||
(defn main-panel []
|
||||
(let [name (re-frame/subscribe [::subs/name])]
|
||||
[:div "Hello from " @name]))
|
||||
[:div
|
||||
[:h1 "Airsonic"]
|
||||
(if-let [login @(re-frame/subscribe [::subs/login])]
|
||||
[app (:u login)]
|
||||
[login-form])])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue