Paperchain is a blockchain-based distributed application for taking contemporaneous notes that are cryptographically verifiable.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
879 B

package main
import (
"gitlab.com/tslocum/cview"
_ "paperchain.cc/paperchain/utils"
)
func createUi() {
app := cview.NewApplication()
box := cview.NewTextView()
box.SetBorder(true)
box.SetTitle("Hello, world!")
box.SetText("Lorem ipsum dolor sit amet")
app.SetRoot(box, true)
if err := app.Run(); err != nil {
panic(err)
}
}
func loginUi() {
app := cview.NewApplication()
form := cview.NewForm()
form.SetBorder(true)
form.SetTitle("Paperchain Login")
form.SetTitleAlign(cview.AlignLeft)
form.AddInputField("username", "", 20, nil, func(s string) {})
form.AddPasswordField("Password", "", 20, '*', func(s string) {
// h := utils.GenHashedPw(s)
// utils.Login.password = h
})
form.AddButton("login", nil)
form.AddButton("exit", func() { app.Stop() })
app.SetRoot(form, true)
app.SetFocus(form)
if err := app.Run(); err != nil {
panic(err)
}
}