Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Tabby
提交
d1f5ebd5
T
Tabby
项目概览
后端镜像
/
Tabby
通知
31
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Tabby
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d1f5ebd5
编写于
3月 11, 2020
作者:
N
Nikolaos Stefanou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Have multiple recent connections in history instead of just one
上级
2773c616
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
31 addition
and
21 deletion
+31
-21
terminus-ssh/src/components/sshModal.component.pug
terminus-ssh/src/components/sshModal.component.pug
+16
-13
terminus-ssh/src/components/sshModal.component.ts
terminus-ssh/src/components/sshModal.component.ts
+14
-8
terminus-ssh/src/config.ts
terminus-ssh/src/config.ts
+1
-0
未找到文件。
terminus-ssh/src/components/sshModal.component.pug
浏览文件 @
d1f5ebd5
...
...
@@ -8,11 +8,14 @@
(keyup.enter)='quickConnect()'
)
.list-group.mt-3(*ngIf='lastConnection')
a.list-group-item.list-group-item-action.d-flex.align-items-center((click)='connect(lastConnection)')
.list-group.mt-3(*ngIf='recentConnections')
a.list-group-item.list-group-item-action.d-flex.align-items-center(
*ngFor='let connection of recentConnections',
(click)='connect(connection)'
)
i.fas.fa-fw.fa-history
.mr-auto {{
lastC
onnection.name}}
button.btn.btn-outline-danger.btn-sm((click)='clear
LastConnection(
); $event.stopPropagation()')
.mr-auto {{
c
onnection.name}}
button.btn.btn-outline-danger.btn-sm((click)='clear
Connection(connection
); $event.stopPropagation()')
i.fas.fa-trash
.list-group.mt-3.connections-list(*ngIf='childGroups.length')
...
...
terminus-ssh/src/components/sshModal.component.ts
浏览文件 @
d1f5ebd5
...
...
@@ -16,7 +16,7 @@ export class SSHModalComponent {
connections
:
SSHConnection
[]
childFolders
:
SSHConnectionGroup
[]
quickTarget
:
string
lastConnection
:
SSHConnection
|
null
=
null
recentConnections
:
SSHConnection
[]
childGroups
:
SSHConnectionGroup
[]
groupCollapsed
:
{[
id
:
string
]:
boolean
}
=
{}
...
...
@@ -30,9 +30,7 @@ export class SSHModalComponent {
ngOnInit
()
{
this
.
connections
=
this
.
config
.
store
.
ssh
.
connections
if
(
window
.
localStorage
.
lastConnection
)
{
this
.
lastConnection
=
JSON
.
parse
(
window
.
localStorage
.
lastConnection
)
}
this
.
recentConnections
=
this
.
config
.
store
.
ssh
.
recentConnections
this
.
refresh
()
}
...
...
@@ -55,13 +53,21 @@ export class SSHModalComponent {
user
,
port
,
}
window
.
localStorage
.
lastConnection
=
JSON
.
stringify
(
connection
)
this
.
recentConnections
.
unshift
(
connection
)
if
(
this
.
recentConnections
.
length
>
5
)
{
this
.
recentConnections
.
pop
()
}
this
.
config
.
store
.
ssh
.
recentConnections
=
this
.
recentConnections
this
.
config
.
save
()
this
.
connect
(
connection
)
}
clearLastConnection
()
{
window
.
localStorage
.
lastConnection
=
null
this
.
lastConnection
=
null
clearConnection
(
connection
)
{
this
.
recentConnections
=
this
.
recentConnections
.
filter
(
function
(
el
)
{
return
el
===
connection
})
this
.
config
.
store
.
ssh
.
recentConnections
=
this
.
recentConnections
this
.
config
.
save
()
}
async
connect
(
connection
:
SSHConnection
)
{
...
...
terminus-ssh/src/config.ts
浏览文件 @
d1f5ebd5
...
...
@@ -5,6 +5,7 @@ export class SSHConfigProvider extends ConfigProvider {
defaults
=
{
ssh
:
{
connections
:
[],
recentConnections
:
[],
options
:
{
},
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录