feat(enterprise): support view enterprise by browser

This commit is contained in:
HJJ 2024-05-16 12:45:30 +08:00
parent b7d565efed
commit 168959ef91
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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
}