Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Tabby
提交
e1cc1d56
T
Tabby
项目概览
后端镜像
/
Tabby
通知
38
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,发现更多精彩内容 >>
提交
e1cc1d56
编写于
3月 01, 2020
作者:
E
Eugene Pankov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes
上级
df2f4d4a
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
71 addition
and
56 deletion
+71
-56
terminus-core/src/components/welcomeTab.component.pug
terminus-core/src/components/welcomeTab.component.pug
+15
-5
terminus-core/src/components/welcomeTab.component.ts
terminus-core/src/components/welcomeTab.component.ts
+15
-3
terminus-core/src/services/config.service.ts
terminus-core/src/services/config.service.ts
+2
-2
terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts
...in-manager/src/components/pluginsSettingsTab.component.ts
+2
-2
terminus-serial/src/components/serialModal.component.ts
terminus-serial/src/components/serialModal.component.ts
+16
-6
terminus-serial/src/services/serial.service.ts
terminus-serial/src/services/serial.service.ts
+1
-14
terminus-ssh/src/components/sshModal.component.ts
terminus-ssh/src/components/sshModal.component.ts
+18
-9
terminus-ssh/src/services/ssh.service.ts
terminus-ssh/src/services/ssh.service.ts
+1
-14
tsconfig.json
tsconfig.json
+1
-1
未找到文件。
terminus-core/src/components/welcomeTab.component.pug
浏览文件 @
e1cc1d56
.mb-4
.terminus-logo
h1.terminus-title Terminus
sup α
sup α
.container
.text-center.mb-5 Thank you for downloading Terminus!
...
...
@@ -10,10 +10,20 @@
.header
.title Enable analytics
.description Help us track the number of Terminus installs across the world!
toggle(
[(ngModel)]='config.store.enableAnalytics',
(ngModelChange)='config.save(); config.requestRestart()',
)
toggle([(ngModel)]='config.store.enableAnalytics')
.form-line
.header
.title Enable SSH plugin
.description Adds an SSH connection manager UI to Terminus
toggle([(ngModel)]='enableSSH')
.form-line
.header
.title Enable Serial plugin
.description Allows attaching Terminus to serial ports
toggle([(ngModel)]='enableSerial')
.text-center.mt-5
button.btn.btn-primary((click)='closeAndDisable()') Close and never show again
terminus-core/src/components/welcomeTab.component.ts
浏览文件 @
e1cc1d56
import
{
Component
}
from
'
@angular/core
'
import
{
BaseTabComponent
}
from
'
./baseTab.component
'
import
{
ConfigService
}
from
'
../services/config.service
'
import
{
AppService
}
from
'
../services/a
pp.service
'
import
{
HostAppService
}
from
'
../services/hostA
pp.service
'
/** @hidden */
@
Component
({
...
...
@@ -10,17 +10,29 @@ import { AppService } from '../services/app.service'
styles
:
[
require
(
'
./welcomeTab.component.scss
'
)],
})
export
class
WelcomeTabComponent
extends
BaseTabComponent
{
enableSSH
=
false
enableSerial
=
false
constructor
(
private
app
:
AppService
,
private
hostApp
:
Host
AppService
,
public
config
:
ConfigService
,
)
{
super
()
this
.
setTitle
(
'
Welcome
'
)
this
.
enableSSH
=
!
config
.
store
.
pluginBlacklist
.
includes
(
'
ssh
'
)
this
.
enableSerial
=
!
config
.
store
.
pluginBlacklist
.
includes
(
'
serial
'
)
}
closeAndDisable
()
{
this
.
config
.
store
.
enableWelcomeTab
=
false
this
.
config
.
store
.
pluginBlacklist
=
[]
if
(
!
this
.
enableSSH
)
{
this
.
config
.
store
.
pluginBlacklist
.
push
(
'
ssh
'
)
}
if
(
!
this
.
enableSerial
)
{
this
.
config
.
store
.
pluginBlacklist
.
push
(
'
serial
'
)
}
this
.
config
.
save
()
this
.
app
.
closeTab
(
this
)
this
.
hostApp
.
getWindow
().
reload
(
)
}
}
terminus-core/src/services/config.service.ts
浏览文件 @
e1cc1d56
...
...
@@ -191,8 +191,8 @@ export class ConfigService {
const
ngModule
=
window
[
'
rootModule
'
].
ɵinj
for
(
const
imp
of
ngModule
.
imports
)
{
const
module
=
imp
[
'
ngModule
'
]
||
imp
if
(
module
.
ngInjectorDef
&&
module
.
ngInjectorDef
.
providers
)
{
this
.
servicesCache
[
module
[
'
pluginName
'
]]
=
module
.
ngInjectorDef
.
providers
.
map
(
provider
=>
{
if
(
module
.
ɵinj
?
.
providers
)
{
this
.
servicesCache
[
module
[
'
pluginName
'
]]
=
module
.
ɵinj
.
providers
.
map
(
provider
=>
{
return
provider
[
'
useClass
'
]
||
provider
})
}
...
...
terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts
浏览文件 @
e1cc1d56
import
{
BehaviorSubject
,
Observable
}
from
'
rxjs
'
import
{
debounceTime
,
distinctUntilChanged
,
first
,
tap
,
flatMap
,
map
}
from
'
rxjs/operators
'
import
*
as
semver
from
'
semver
'
import
semverGt
from
'
semver/functions/gt
'
import
{
Component
,
Input
}
from
'
@angular/core
'
import
{
ConfigService
,
ElectronService
}
from
'
terminus-core
'
...
...
@@ -48,7 +48,7 @@ export class PluginsSettingsTabComponent {
return
plugins
})).
subscribe
(
available
=>
{
for
(
const
plugin
of
this
.
pluginManager
.
installedPlugins
)
{
this
.
knownUpgrades
[
plugin
.
name
]
=
available
.
find
(
x
=>
x
.
name
===
plugin
.
name
&&
semver
.
g
t
(
x
.
version
,
plugin
.
version
))
||
null
this
.
knownUpgrades
[
plugin
.
name
]
=
available
.
find
(
x
=>
x
.
name
===
plugin
.
name
&&
semver
G
t
(
x
.
version
,
plugin
.
version
))
||
null
}
})
}
...
...
terminus-serial/src/components/serialModal.component.ts
浏览文件 @
e1cc1d56
import
{
Component
}
from
'
@angular/core
'
import
{
Component
,
NgZone
}
from
'
@angular/core
'
import
{
NgbActiveModal
}
from
'
@ng-bootstrap/ng-bootstrap
'
import
{
ToastrService
}
from
'
ngx-toastr
'
import
{
ConfigService
,
AppService
}
from
'
terminus-core
'
import
{
SettingsTabComponent
}
from
'
terminus-settings
'
import
{
SerialService
}
from
'
../services/serial.service
'
import
{
SerialConnection
,
SerialPortInfo
,
BAUD_RATES
}
from
'
../api
'
import
{
SerialTabComponent
}
from
'
./serialTab.component
'
/** @hidden */
@
Component
({
...
...
@@ -22,6 +23,7 @@ export class SerialModalComponent {
private
config
:
ConfigService
,
private
serial
:
SerialService
,
private
app
:
AppService
,
private
zone
:
NgZone
,
private
toastr
:
ToastrService
,
)
{
}
...
...
@@ -61,15 +63,23 @@ export class SerialModalComponent {
this
.
lastConnection
=
null
}
connect
(
connection
:
SerialConnection
)
{
async
connect
(
connection
:
SerialConnection
)
{
this
.
close
()
this
.
serial
.
openTab
(
connection
).
catch
(
error
=>
{
this
.
toastr
.
error
(
`Could not connect:
${
error
}
`
)
}).
then
(()
=>
{
try
{
const
tab
=
this
.
zone
.
run
(()
=>
this
.
app
.
openNewTab
(
SerialTabComponent
,
{
connection
}
)
as
SerialTabComponent
)
if
(
connection
.
color
)
{
(
this
.
app
.
getParentTab
(
tab
)
||
tab
).
color
=
connection
.
color
}
setTimeout
(()
=>
{
this
.
app
.
activeTab
.
emitFocused
()
})
})
}
catch
(
error
)
{
this
.
toastr
.
error
(
`Could not connect:
${
error
}
`
)
}
}
manageConnections
()
{
...
...
terminus-serial/src/services/serial.service.ts
浏览文件 @
e1cc1d56
import
{
Injectable
,
NgZone
}
from
'
@angular/core
'
import
SerialPort
from
'
serialport
'
import
{
ToastrService
}
from
'
ngx-toastr
'
import
{
AppService
,
LogService
}
from
'
terminus-core
'
import
{
LogService
}
from
'
terminus-core
'
import
{
SerialConnection
,
SerialSession
,
SerialPortInfo
}
from
'
../api
'
import
{
SerialTabComponent
}
from
'
../components/serialTab.component
'
@
Injectable
({
providedIn
:
'
root
'
})
export
class
SerialService
{
private
constructor
(
private
log
:
LogService
,
private
app
:
AppService
,
private
zone
:
NgZone
,
private
toastr
:
ToastrService
,
)
{
}
...
...
@@ -21,17 +19,6 @@ export class SerialService {
}))
}
async
openTab
(
connection
:
SerialConnection
):
Promise
<
SerialTabComponent
>
{
const
tab
=
this
.
zone
.
run
(()
=>
this
.
app
.
openNewTab
(
SerialTabComponent
,
{
connection
}
)
as
SerialTabComponent
)
if
(
connection
.
color
)
{
(
this
.
app
.
getParentTab
(
tab
)
||
tab
).
color
=
connection
.
color
}
return
tab
}
createSession
(
connection
:
SerialConnection
):
SerialSession
{
const
session
=
new
SerialSession
(
connection
)
session
.
logger
=
this
.
log
.
create
(
`serial-
${
connection
.
port
}
`
)
...
...
terminus-ssh/src/components/sshModal.component.ts
浏览文件 @
e1cc1d56
import
{
Component
}
from
'
@angular/core
'
import
{
Component
,
NgZone
}
from
'
@angular/core
'
import
{
NgbActiveModal
}
from
'
@ng-bootstrap/ng-bootstrap
'
import
{
ToastrService
}
from
'
ngx-toastr
'
import
{
ConfigService
,
AppService
}
from
'
terminus-core
'
import
{
SettingsTabComponent
}
from
'
terminus-settings
'
import
{
SSHService
}
from
'
../services/ssh.service
'
import
{
SSHConnection
,
SSHConnectionGroup
}
from
'
../api
'
import
{
SSHTabComponent
}
from
'
./sshTab.component
'
/** @hidden */
@
Component
({
...
...
@@ -22,9 +22,9 @@ export class SSHModalComponent {
constructor
(
public
modalInstance
:
NgbActiveModal
,
private
config
:
ConfigService
,
private
ssh
:
SSHService
,
private
app
:
AppService
,
private
toastr
:
ToastrService
,
private
zone
:
NgZone
,
)
{
}
ngOnInit
()
{
...
...
@@ -63,15 +63,24 @@ export class SSHModalComponent {
this
.
lastConnection
=
null
}
connect
(
connection
:
SSHConnection
)
{
async
connect
(
connection
:
SSHConnection
)
{
this
.
close
()
this
.
ssh
.
openTab
(
connection
).
catch
(
error
=>
{
this
.
toastr
.
error
(
`Could not connect:
${
error
}
`
)
}).
then
(()
=>
{
try
{
const
tab
=
this
.
zone
.
run
(()
=>
this
.
app
.
openNewTab
(
SSHTabComponent
,
{
connection
}
)
as
SSHTabComponent
)
if
(
connection
.
color
)
{
(
this
.
app
.
getParentTab
(
tab
)
||
tab
).
color
=
connection
.
color
}
setTimeout
(()
=>
{
this
.
app
.
activeTab
.
emitFocused
()
this
.
app
.
activeTab
?
.
emitFocused
()
})
})
}
catch
(
error
)
{
this
.
toastr
.
error
(
`Could not connect:
${
error
}
`
)
}
}
manageConnections
()
{
...
...
terminus-ssh/src/services/ssh.service.ts
浏览文件 @
e1cc1d56
...
...
@@ -8,10 +8,9 @@ import { execFile } from 'mz/child_process'
import
*
as
path
from
'
path
'
import
*
as
sshpk
from
'
sshpk
'
import
{
ToastrService
}
from
'
ngx-toastr
'
import
{
AppService
,
HostAppService
,
Platform
,
Logger
,
LogService
,
ElectronService
}
from
'
terminus-core
'
import
{
HostAppService
,
Platform
,
Logger
,
LogService
,
ElectronService
}
from
'
terminus-core
'
import
{
SSHConnection
,
SSHSession
}
from
'
../api
'
import
{
PromptModalComponent
}
from
'
../components/promptModal.component
'
import
{
SSHTabComponent
}
from
'
../components/sshTab.component
'
import
{
PasswordStorageService
}
from
'
./passwordStorage.service
'
import
{
SSH2Stream
}
from
'
ssh2-streams
'
...
...
@@ -25,7 +24,6 @@ export class SSHService {
private
constructor
(
private
log
:
LogService
,
private
app
:
AppService
,
private
electron
:
ElectronService
,
private
zone
:
NgZone
,
private
ngbModal
:
NgbModal
,
...
...
@@ -36,17 +34,6 @@ export class SSHService {
this
.
logger
=
log
.
create
(
'
ssh
'
)
}
async
openTab
(
connection
:
SSHConnection
):
Promise
<
SSHTabComponent
>
{
const
tab
=
this
.
zone
.
run
(()
=>
this
.
app
.
openNewTab
(
SSHTabComponent
,
{
connection
}
)
as
SSHTabComponent
)
if
(
connection
.
color
)
{
(
this
.
app
.
getParentTab
(
tab
)
||
tab
).
color
=
connection
.
color
}
return
tab
}
createSession
(
connection
:
SSHConnection
):
SSHSession
{
const
session
=
new
SSHSession
(
connection
)
session
.
logger
=
this
.
log
.
create
(
`ssh-
${
connection
.
host
}
-
${
connection
.
port
}
`
)
...
...
tsconfig.json
浏览文件 @
e1cc1d56
{
"compilerOptions"
:
{
"module"
:
"es2015"
,
"target"
:
"es201
6
"
,
"target"
:
"es201
7
"
,
"moduleResolution"
:
"node"
,
"noImplicitAny"
:
false
,
"removeComments"
:
false
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录