From 168959ef913f8e468e9831fb8ad07d962f9d2da0 Mon Sep 17 00:00:00 2001 From: HJJ <1916787042@qq.com> Date: Thu, 16 May 2024 12:45:30 +0800 Subject: [PATCH] feat(enterprise): support view enterprise by browser --- cmd/auth/auth.go | 2 +- utils/tui/table.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/auth/auth.go b/cmd/auth/auth.go index 6ad7ea0..2cbea76 100644 --- a/cmd/auth/auth.go +++ b/cmd/auth/auth.go @@ -17,7 +17,7 @@ var ( var AuthCmd = &cobra.Command{ Use: "auth", - Short: "Authenticate Gitee CLI with gitee selector_tui", + Short: "Authenticate Gitee CLI with gitee enterprise", Run: func(cmd *cobra.Command, args []string) { if CookiesFile != "" { // Read cookies from file diff --git a/utils/tui/table.go b/utils/tui/table.go index 4e797de..e5c2c84 100644 --- a/utils/tui/table.go +++ b/utils/tui/table.go @@ -193,6 +193,10 @@ func (t Table) Update(msg tea.Msg) (tea.Model, tea.Cmd) { url = fmt.Sprintf("https://e.gitee.com/%s/repos/%s/pulls/%s", strings.Split(path, "/")[0], path, t.SelectedKey) } browser.OpenURL(url) + } else if t.ResourceType == Enterprise { + path := t.table.SelectedRow()[2] + url := fmt.Sprintf("https://e.gitee.com/%s", path) + browser.OpenURL(url) } else { return t, tea.Quit }