File tree Expand file tree Collapse file tree 5 files changed +41
-4
lines changed
Expand file tree Collapse file tree 5 files changed +41
-4
lines changed Original file line number Diff line number Diff line change 11build /bin /
22wailsjs /
33hack /node_modules /
4+ omni-socat.zip
5+ build /windows /wails.exe.manifest
6+ cmd /agent-bench /agent-bench
7+ cmd /agent-bench /agent-bench.exe
8+ test * /
9+ pkg /muxconn
10+ pkg /stdioconn
Original file line number Diff line number Diff line change @@ -167,8 +167,14 @@ func (a *App) onSign(pubkey *agent.Key) error {
167167 return errors .New ("private key not found" )
168168 }
169169
170- a .ti .ShowBalloonNotification (wintray .ID ,
171- fmt .Sprintf ("SSH Key '%s' was used" , privkey .PublicKey .Comment ))
170+ name := privkey .PublicKey .Comment
171+ if len (name ) == 0 {
172+ name = truncateString (privkey .PublicKey .SHA256 )
173+ }
174+ msg := fmt .Sprintf ("SSH Key '%s' was used" , name )
175+ if a .settings .ShowBalloon {
176+ a .ti .ShowBalloonNotification (wintray .ID , msg )
177+ }
172178 return nil
173179}
174180
@@ -256,7 +262,15 @@ func (a *App) Save(s store.SaveData) error {
256262 a .settings .SaveData .UnixSocketAgent = s .UnixSocketAgent
257263 a .settings .SaveData .UnixSocketPath = s .UnixSocketPath
258264 a .settings .SaveData .CygWinAgent = s .CygWinAgent
265+ a .settings .SaveData .ShowBalloon = s .ShowBalloon
259266 a .settings .SaveData .CygWinSocketPath = s .CygWinSocketPath
260267 a .settings .SaveData .ProxyModeOfNamedPipe = s .ProxyModeOfNamedPipe
261268 return a .settings .Save ()
262269}
270+
271+ func truncateString (s string ) string {
272+ if len (s ) <= 16 {
273+ return s
274+ }
275+ return s [:16 ] + "..."
276+ }
Original file line number Diff line number Diff line change 11{
22 "fixed" : {
3- "file_version" : " 0.3.5 "
3+ "file_version" : " 0.5.0 "
44 },
55 "info" : {
66 "0000" : {
7- "ProductVersion" : " 0.3.5 " ,
7+ "ProductVersion" : " 0.5.0 " ,
88 "CompanyName" : " OmniSSHAgent" ,
99 "FileDescription" : " OmniSSHAgent" ,
1010 "LegalCopyright" : " Copyright........." ,
Original file line number Diff line number Diff line change 3333 NamedPipeAgent: false ,
3434 UnixSocketAgent: false ,
3535 CygWinAgent: false ,
36+ ShowBalloon: false ,
3637 UnixSocketPath: " " ,
3738 CygWinSocketPath: " " ,
3839 ProxyModeOfNamedPipe: false ,
103104 >
104105 </FormField >
105106 </div >
107+ <div >
108+ <FormField >
109+ <Switch
110+ bind:checked ={data .ShowBalloon }
111+ value =" Show a balloon notification when an SSH key is used"
112+ />
113+ <span
114+ >{data .ShowBalloon
115+ ? " Show a balloon notification when an SSH key is used"
116+ : " Do not show a balloon notification when an SSH key is used" }</span
117+ >
118+ </FormField >
119+ </div >
106120 <div >
107121 <FormField >
108122 <Switch bind:checked ={data .PageantAgent } value =" Enable pageant" />
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ type SaveData struct {
2626 NamedPipeAgent bool
2727 UnixSocketAgent bool
2828 CygWinAgent bool
29+ ShowBalloon bool
2930 UnixSocketPath string
3031 CygWinSocketPath string
3132
@@ -46,6 +47,7 @@ func initSetting() SaveData {
4647 NamedPipeAgent : true ,
4748 UnixSocketAgent : true ,
4849 CygWinAgent : true ,
50+ ShowBalloon : true ,
4951 UnixSocketPath : filepath .Join (home , "OmniSSHAgent.sock" ),
5052 CygWinSocketPath : filepath .Join (home , "OmniSSHCygwin.sock" ),
5153
You can’t perform that action at this time.
0 commit comments