Persist server configuration to config file
This commit is contained in:
@@ -4,8 +4,10 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"git.ohea.xyz/cursorius/tui/screens"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
|
||||
"git.ohea.xyz/cursorius/tui/screens"
|
||||
"git.ohea.xyz/cursorius/tui/settings"
|
||||
)
|
||||
|
||||
type model struct {
|
||||
@@ -55,31 +57,38 @@ func (m model) View() string {
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
conf, err := settings.GetConfig()
|
||||
if err != nil {
|
||||
fmt.Printf("Error: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
initialModel := model{
|
||||
screen: screens.CreateLogin(
|
||||
// TODO: load from config file
|
||||
[]screens.CursoriusServer{
|
||||
{
|
||||
Name: "local-test",
|
||||
Url: "http://127.0.0.1:45421/graphql",
|
||||
Token: "",
|
||||
},
|
||||
{
|
||||
Name: "ohea",
|
||||
Url: "https://ci.cursorius.server",
|
||||
Token: "test",
|
||||
},
|
||||
{
|
||||
Name: "nohea",
|
||||
Url: "https://ci.cursoriuspreview.server",
|
||||
Token: "test",
|
||||
},
|
||||
{
|
||||
Name: "work",
|
||||
Url: "https://ci.acme.corp",
|
||||
Token: "test",
|
||||
},
|
||||
},
|
||||
conf,
|
||||
//[]screens.CursoriusServer{
|
||||
// {
|
||||
// Name: "local-test",
|
||||
// Url: "http://127.0.0.1:45421/graphql",
|
||||
// Token: "",
|
||||
// },
|
||||
// {
|
||||
// Name: "ohea",
|
||||
// Url: "https://ci.cursorius.server",
|
||||
// Token: "test",
|
||||
// },
|
||||
// {
|
||||
// Name: "nohea",
|
||||
// Url: "https://ci.cursoriuspreview.server",
|
||||
// Token: "test",
|
||||
// },
|
||||
// {
|
||||
// Name: "work",
|
||||
// Url: "https://ci.acme.corp",
|
||||
// Token: "test",
|
||||
// },
|
||||
//},
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user