mirror of
https://github.com/coder/coder.git
synced 2025-07-10 23:53:15 +00:00
* Improve CLI documentation * feat: Allow workspace resources to attach multiple agents This enables a "kubernetes_pod" to attach multiple agents that could be for multiple services. Each agent is required to have a unique name, so SSH syntax is: `coder ssh <workspace>.<agent>` A resource can have zero agents too, they aren't required. * Add tree view * Improve table UI * feat: Allow workspace resources to attach multiple agents This enables a "kubernetes_pod" to attach multiple agents that could be for multiple services. Each agent is required to have a unique name, so SSH syntax is: `coder ssh <workspace>.<agent>` A resource can have zero agents too, they aren't required. * Rename `tunnel` to `skip-tunnel` This command was `true` by default, which causes a confusing user experience. * Add disclaimer about editing templates * Add help to template create * Improve workspace create flow * Add end-to-end test for config-ssh * Improve testing of config-ssh * Fix workspace list * Fix config ssh tests * Update cli/configssh.go Co-authored-by: Cian Johnston <public@cianjohnston.ie> * Fix requested changes * Remove socat requirement * Fix resources not reading in TTY Co-authored-by: Cian Johnston <public@cianjohnston.ie>
57 lines
1.5 KiB
Go
57 lines
1.5 KiB
Go
package cliui
|
|
|
|
import (
|
|
"github.com/charmbracelet/charm/ui/common"
|
|
"github.com/charmbracelet/lipgloss"
|
|
"golang.org/x/xerrors"
|
|
)
|
|
|
|
var (
|
|
Canceled = xerrors.New("canceled")
|
|
|
|
defaultStyles = common.DefaultStyles()
|
|
)
|
|
|
|
// ValidateNotEmpty is a helper function to disallow empty inputs!
|
|
func ValidateNotEmpty(s string) error {
|
|
if s == "" {
|
|
return xerrors.New("Must be provided!")
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Styles compose visual elements of the UI!
|
|
var Styles = struct {
|
|
Bold,
|
|
Checkmark,
|
|
Code,
|
|
Crossmark,
|
|
Error,
|
|
Field,
|
|
Keyword,
|
|
Paragraph,
|
|
Placeholder,
|
|
Prompt,
|
|
FocusedPrompt,
|
|
Fuschia,
|
|
Logo,
|
|
Warn,
|
|
Wrap lipgloss.Style
|
|
}{
|
|
Bold: lipgloss.NewStyle().Bold(true),
|
|
Checkmark: defaultStyles.Checkmark,
|
|
Code: defaultStyles.Code,
|
|
Crossmark: defaultStyles.Error.Copy().SetString("✘"),
|
|
Error: defaultStyles.Error,
|
|
Field: defaultStyles.Code.Copy().Foreground(lipgloss.AdaptiveColor{Light: "#000000", Dark: "#FFFFFF"}),
|
|
Keyword: defaultStyles.Keyword,
|
|
Paragraph: defaultStyles.Paragraph,
|
|
Placeholder: lipgloss.NewStyle().Foreground(lipgloss.Color("240")),
|
|
Prompt: defaultStyles.Prompt.Foreground(lipgloss.AdaptiveColor{Light: "#9B9B9B", Dark: "#5C5C5C"}),
|
|
FocusedPrompt: defaultStyles.FocusedPrompt.Foreground(lipgloss.Color("#651fff")),
|
|
Fuschia: defaultStyles.SelectedMenuItem.Copy(),
|
|
Logo: defaultStyles.Logo.SetString("Coder"),
|
|
Warn: lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#04B575", Dark: "#ECFD65"}),
|
|
Wrap: defaultStyles.Wrap,
|
|
}
|