Persist server configuration to config file
This commit is contained in:
@@ -11,16 +11,11 @@ import (
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
|
||||
"git.ohea.xyz/cursorius/tui/settings"
|
||||
"git.ohea.xyz/cursorius/tui/widget"
|
||||
)
|
||||
|
||||
type CursoriusServer struct {
|
||||
Name string
|
||||
Url string
|
||||
Token string
|
||||
}
|
||||
|
||||
func (s CursoriusServer) Login() tea.Msg {
|
||||
func ServerLogin(s settings.CursoriusServer) tea.Msg {
|
||||
dashboard, err := createDashboard(s)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -156,7 +151,7 @@ func (d dashboardItemDelegate) Render(w io.Writer, m list.Model, index int, list
|
||||
fmt.Fprint(w, fn(str))
|
||||
}
|
||||
|
||||
func createDashboard(s CursoriusServer) (Dashboard, error) {
|
||||
func createDashboard(s settings.CursoriusServer) (Dashboard, error) {
|
||||
|
||||
client := graphql.NewClient(s.Url, http.DefaultClient)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user