mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
chore: migrate to hub/v2 and bubbletea/v2
This commit is contained in:
@@ -3,7 +3,7 @@ package context
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/charmbracelet/huh"
|
||||
"charm.land/huh/v2"
|
||||
"github.com/psviderski/uncloud/internal/cli"
|
||||
"github.com/psviderski/uncloud/internal/cli/config"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"maps"
|
||||
"slices"
|
||||
|
||||
"github.com/charmbracelet/huh"
|
||||
"charm.land/huh/v2"
|
||||
"github.com/psviderski/uncloud/internal/cli"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/charmbracelet/huh/spinner"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"charm.land/huh/v2/spinner"
|
||||
"charm.land/lipgloss/v2"
|
||||
"github.com/docker/compose/v2/pkg/progress"
|
||||
"github.com/psviderski/uncloud/cmd/uncloud/caddy"
|
||||
"github.com/psviderski/uncloud/internal/cli"
|
||||
@@ -154,8 +154,12 @@ func add(ctx context.Context, uncli *cli.CLI, remoteMachine *cli.RemoteMachine,
|
||||
err = spinner.New().
|
||||
Title(" Waiting for the machine to join the cluster...").
|
||||
Type(spinner.MiniDot).
|
||||
Style(lipgloss.NewStyle().Foreground(lipgloss.Color("3"))).
|
||||
TitleStyle(lipgloss.NewStyle()).
|
||||
WithTheme(spinner.ThemeFunc(func(isDark bool) *spinner.Styles {
|
||||
return &spinner.Styles{
|
||||
Spinner: lipgloss.NewStyle().Foreground(lipgloss.Yellow),
|
||||
Title: lipgloss.NewStyle(),
|
||||
}
|
||||
})).
|
||||
ActionWithErr(func(ctx context.Context) error {
|
||||
return machineClient.WaitClusterReady(ctx, 5*time.Minute)
|
||||
}).
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/charmbracelet/huh/spinner"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"charm.land/huh/v2/spinner"
|
||||
"charm.land/lipgloss/v2"
|
||||
"github.com/docker/compose/v2/pkg/progress"
|
||||
"github.com/psviderski/uncloud/cmd/uncloud/caddy"
|
||||
"github.com/psviderski/uncloud/cmd/uncloud/dns"
|
||||
@@ -202,8 +202,12 @@ func initCluster(ctx context.Context, uncli *cli.CLI, remoteMachine *cli.RemoteM
|
||||
err = spinner.New().
|
||||
Title(" Waiting for the cluster to be ready...").
|
||||
Type(spinner.MiniDot).
|
||||
Style(lipgloss.NewStyle().Foreground(lipgloss.Color("3"))).
|
||||
TitleStyle(lipgloss.NewStyle()).
|
||||
WithTheme(spinner.ThemeFunc(func(isDark bool) *spinner.Styles {
|
||||
return &spinner.Styles{
|
||||
Spinner: lipgloss.NewStyle().Foreground(lipgloss.Yellow),
|
||||
Title: lipgloss.NewStyle(),
|
||||
}
|
||||
})).
|
||||
ActionWithErr(func(ctx context.Context) error {
|
||||
return client.WaitClusterReady(ctx, 1*time.Minute)
|
||||
}).
|
||||
|
||||
+8
-4
@@ -6,10 +6,9 @@ import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
lipgloss "charm.land/lipgloss/v2"
|
||||
"charm.land/huh/v2/spinner"
|
||||
"charm.land/lipgloss/v2"
|
||||
"charm.land/lipgloss/v2/table"
|
||||
"github.com/charmbracelet/huh/spinner"
|
||||
lipglossv1 "github.com/charmbracelet/lipgloss"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/go-units"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -86,7 +85,12 @@ func runPs(ctx context.Context, uncli *cli.CLI, opts psOptions) error {
|
||||
err = spinner.New().
|
||||
Title(" Collecting container info...").
|
||||
Type(spinner.MiniDot).
|
||||
Style(lipglossv1.NewStyle().Foreground(lipglossv1.Color("3"))).
|
||||
WithTheme(spinner.ThemeFunc(func(isDark bool) *spinner.Styles {
|
||||
return &spinner.Styles{
|
||||
Spinner: lipgloss.NewStyle().Foreground(lipgloss.Yellow),
|
||||
Title: lipgloss.NewStyle(),
|
||||
}
|
||||
})).
|
||||
ActionWithErr(func(ctx context.Context) error {
|
||||
containers, err = collectContainers(ctx, clusterClient)
|
||||
return err
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/charmbracelet/huh"
|
||||
"charm.land/huh/v2"
|
||||
"github.com/docker/compose/v2/pkg/progress"
|
||||
"github.com/psviderski/uncloud/internal/cli"
|
||||
"github.com/psviderski/uncloud/pkg/api"
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/charmbracelet/huh"
|
||||
"charm.land/huh/v2"
|
||||
"github.com/docker/docker/api/types/volume"
|
||||
"github.com/psviderski/uncloud/internal/cli"
|
||||
"github.com/psviderski/uncloud/internal/machine/api/pb"
|
||||
|
||||
Reference in New Issue
Block a user