feat(enterprise): support view enterprise by browser
This commit is contained in:
parent
b7d565efed
commit
168959ef91
|
@ -17,7 +17,7 @@ var (
|
||||||
|
|
||||||
var AuthCmd = &cobra.Command{
|
var AuthCmd = &cobra.Command{
|
||||||
Use: "auth",
|
Use: "auth",
|
||||||
Short: "Authenticate Gitee CLI with gitee selector_tui",
|
Short: "Authenticate Gitee CLI with gitee enterprise",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if CookiesFile != "" {
|
if CookiesFile != "" {
|
||||||
// Read cookies from file
|
// Read cookies from 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)
|
url = fmt.Sprintf("https://e.gitee.com/%s/repos/%s/pulls/%s", strings.Split(path, "/")[0], path, t.SelectedKey)
|
||||||
}
|
}
|
||||||
browser.OpenURL(url)
|
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 {
|
} else {
|
||||||
return t, tea.Quit
|
return t, tea.Quit
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue