1
0
Эх сурвалжийг харах

an option to clear last ssh quick connection (fixes #435, fixes #493)

Eugene Pankov 7 жил өмнө
parent
commit
952e8461e6

+ 5 - 3
terminus-ssh/src/components/sshModal.component.pug

@@ -9,11 +9,13 @@
     )
     
     .list-group.mt-3(*ngIf='lastConnection')
-        a.list-group-item.list-group-item-action((click)='connect(lastConnection)') 
+        a.list-group-item.list-group-item-action.d-flex.align-items-center((click)='connect(lastConnection)') 
             i.fa.fa-fw.fa-history
-            span {{lastConnection.name}}
+            .mr-auto {{lastConnection.name}}
+            button.btn.btn-outline-danger.btn-sm((click)='clearLastConnection(); $event.stopPropagation()')
+                i.fa.fa-trash-o
     
-    .list-group.mt-3.connections-list
+    .list-group.mt-3.connections-list(*ngIf='childGroups.length')
         ng-container(*ngFor='let group of childGroups') 
             .list-group-item.list-group-item-action.d-flex.align-items-center(
                 (click)='groupCollapsed[group.name] = !groupCollapsed[group.name]'

+ 5 - 0
terminus-ssh/src/components/sshModal.component.ts

@@ -54,6 +54,11 @@ export class SSHModalComponent {
         this.connect(connection)
     }
 
+    clearLastConnection () {
+        window.localStorage.lastConnection = null
+        this.lastConnection = null
+    }
+
     connect (connection: SSHConnection) {
         this.close()
         this.ssh.connect(connection).catch(error => {