mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
feat: add start-tui command for interactive mode
This commit is contained in:
@@ -336,16 +336,18 @@ logs-sonr: init-env
|
||||
bin/process-compose process logs sonr --port $(PC_PORT_NUM) --follow
|
||||
|
||||
###############################################################################
|
||||
### help ###
|
||||
### Network Start/Stop ###
|
||||
###############################################################################
|
||||
|
||||
.PHONY: deploy start stop restart status
|
||||
.PHONY: deploy start start-tui stop restart status
|
||||
|
||||
start: build-hway init-env
|
||||
bin/process-compose up --port $(PC_PORT_NUM) --log-file $(PC_LOG_FILE) --detached -f deploy/process-compose.yaml
|
||||
|
||||
stop: init-env
|
||||
start-tui: build-hway init-env
|
||||
bin/process-compose up --port $(PC_PORT_NUM) --log-file $(PC_LOG_FILE) -f deploy/process-compose.yaml
|
||||
|
||||
stop: init-env
|
||||
bin/process-compose down --port $(PC_PORT_NUM)
|
||||
|
||||
restart: stop clean start
|
||||
|
||||
@@ -92,6 +92,7 @@ require (
|
||||
github.com/strangelove-ventures/tokenfactory v0.50.0
|
||||
github.com/stretchr/testify v1.10.0
|
||||
golang.org/x/crypto v0.30.0
|
||||
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9
|
||||
google.golang.org/grpc v1.67.1
|
||||
google.golang.org/protobuf v1.35.2
|
||||
@@ -352,7 +353,6 @@ require (
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
|
||||
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d // indirect
|
||||
golang.org/x/mod v0.22.0 // indirect
|
||||
golang.org/x/net v0.32.0 // indirect
|
||||
golang.org/x/oauth2 v0.23.0 // indirect
|
||||
|
||||
@@ -8,14 +8,11 @@ import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/onsonr/sonr/crypto/mpc"
|
||||
"github.com/onsonr/sonr/pkg/common/response"
|
||||
"golang.org/x/exp/rand"
|
||||
)
|
||||
|
||||
func HandleCreateProfile(c echo.Context) error {
|
||||
dat := CreateProfileData{
|
||||
FirstNumber: 1,
|
||||
LastNumber: 2,
|
||||
}
|
||||
return response.TemplEcho(c, ProfileFormView(dat))
|
||||
return response.TemplEcho(c, ProfileFormView(randomCreateProfileData()))
|
||||
}
|
||||
|
||||
func HandlePasskeyStart(c echo.Context) error {
|
||||
@@ -50,3 +47,10 @@ func HandlePasskeyFinish(c echo.Context) error {
|
||||
}
|
||||
return response.TemplEcho(c, LoadingVaultView())
|
||||
}
|
||||
|
||||
func randomCreateProfileData() CreateProfileData {
|
||||
return CreateProfileData{
|
||||
FirstNumber: rand.Intn(5) + 1,
|
||||
LastNumber: rand.Intn(4) + 1,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package ui
|
||||
|
||||
// Styles for form controls
|
||||
templ LabelOnLeft() {
|
||||
<style>
|
||||
.label-on-left {
|
||||
--label-width: 3.75rem;
|
||||
--gap-width: 1rem;
|
||||
}
|
||||
|
||||
.label-on-left + .label-on-left {
|
||||
margin-top: var(--sl-spacing-medium);
|
||||
}
|
||||
|
||||
.label-on-left::part(form-control) {
|
||||
display: grid;
|
||||
grid: auto / var(--label-width) 1fr;
|
||||
gap: var(--sl-spacing-3x-small) var(--gap-width);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.label-on-left::part(form-control-label) {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.label-on-left::part(form-control-help-text) {
|
||||
grid-column-start: 2;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.793
|
||||
package ui
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import templruntime "github.com/a-h/templ/runtime"
|
||||
|
||||
// Styles for form controls
|
||||
func LabelOnLeft() templ.Component {
|
||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||
return templ_7745c5c3_CtxErr
|
||||
}
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
defer func() {
|
||||
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err == nil {
|
||||
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||||
}
|
||||
}()
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var1 == nil {
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<style>\n .label-on-left {\n --label-width: 3.75rem;\n --gap-width: 1rem;\n }\n\n .label-on-left + .label-on-left {\n margin-top: var(--sl-spacing-medium);\n }\n\n .label-on-left::part(form-control) {\n display: grid;\n grid: auto / var(--label-width) 1fr;\n gap: var(--sl-spacing-3x-small) var(--gap-width);\n align-items: center;\n }\n\n .label-on-left::part(form-control-label) {\n text-align: right;\n }\n\n .label-on-left::part(form-control-help-text) {\n grid-column-start: 2;\n }\n </style>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
var _ = templruntime.GeneratedTemplate
|
||||
Reference in New Issue
Block a user