feat: show who an Azure account signs in as, in Details on its row
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
5355c65284
commit
2e941102a2
7 files changed
+151
-3
No files matched your search
@@ -723,6 +723,8 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
m.askHandlerSetup()
|
||||
m.keys.Login.SetEnabled(m.loginFor() != nil)
|
||||
m.detail.SetMessage(m.selectedProblem())
|
||||
acct, _ := m.selectedAccount()
|
||||
m.detail.SetAccount(acct.Fields)
|
||||
if m.anyLoading() && !m.spinning {
|
||||
m.spinning = true
|
||||
cmds = append(cmds, m.spin.Tick)
|
||||
@@ -1453,6 +1455,9 @@ func (m *Model) describe(o provider.Object) tea.Cmd {
|
||||
func (m *Model) copyValue() tea.Cmd {
|
||||
o, ok := m.detail.Secret()
|
||||
if !ok {
|
||||
if a, ok := m.selectedAccount(); ok && a.Copy != "" && m.focus == paneSources {
|
||||
return m.copyText(a.CopyLabel, a.Copy, false)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if v, ok := m.detail.Value(); ok {
|
||||
@@ -1674,3 +1679,20 @@ func (m Model) loginFor() *provider.AuthError {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// selectedAccount describes the account of the selected provider row, if
|
||||
// its provider can.
|
||||
func (m Model) selectedAccount() (provider.Account, bool) {
|
||||
r, ok := m.sources.Selected()
|
||||
if !ok || r.kind != rowGroup {
|
||||
return provider.Account{}, false
|
||||
}
|
||||
if res := m.sourceResults[r.provider]; res.err != nil {
|
||||
return provider.Account{}, false // the problem shows instead
|
||||
}
|
||||
a, ok := m.byID[r.provider].(provider.Accounts)
|
||||
if !ok {
|
||||
return provider.Account{}, false
|
||||
}
|
||||
return a.Account()
|
||||
}
|
||||
Reference in new issue
Block a user