Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Tabby
提交
7bfc13da
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,发现更多精彩内容 >>
提交
7bfc13da
编写于
5月 20, 2018
作者:
E
Eugene Pankov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bumped angular & webpack
上级
7cb6642f
变更
31
展开全部
隐藏空白更改
内联
并排
Showing
31 changed file
with
3234 addition
and
1296 deletion
+3234
-1296
app/package.json
app/package.json
+11
-11
app/src/preload.scss
app/src/preload.scss
+4
-0
app/webpack.config.js
app/webpack.config.js
+16
-10
app/yarn.lock
app/yarn.lock
+46
-48
package.json
package.json
+8
-7
terminus-community-color-schemes/webpack.config.js
terminus-community-color-schemes/webpack.config.js
+11
-9
terminus-core/package.json
terminus-core/package.json
+1
-2
terminus-core/src/components/tabBody.component.ts
terminus-core/src/components/tabBody.component.ts
+1
-1
terminus-core/src/index.ts
terminus-core/src/index.ts
+10
-5
terminus-core/src/services/config.service.ts
terminus-core/src/services/config.service.ts
+4
-6
terminus-core/webpack.config.js
terminus-core/webpack.config.js
+11
-8
terminus-core/yarn.lock
terminus-core/yarn.lock
+12
-7
terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts
...in-manager/src/components/pluginsSettingsTab.component.ts
+12
-8
terminus-plugin-manager/src/services/pluginManager.service.ts
...inus-plugin-manager/src/services/pluginManager.service.ts
+13
-12
terminus-plugin-manager/webpack.config.js
terminus-plugin-manager/webpack.config.js
+10
-8
terminus-settings/src/components/hotkeyInputModal.component.ts
...nus-settings/src/components/hotkeyInputModal.component.ts
+2
-1
terminus-settings/src/components/settingsTab.component.ts
terminus-settings/src/components/settingsTab.component.ts
+2
-2
terminus-settings/src/components/settingsTabBody.component.ts
...inus-settings/src/components/settingsTabBody.component.ts
+1
-1
terminus-settings/webpack.config.js
terminus-settings/webpack.config.js
+10
-8
terminus-ssh/package.json
terminus-ssh/package.json
+0
-4
terminus-ssh/webpack.config.js
terminus-ssh/webpack.config.js
+10
-8
terminus-ssh/yarn.lock
terminus-ssh/yarn.lock
+13
-772
terminus-terminal/src/buttonProvider.ts
terminus-terminal/src/buttonProvider.ts
+3
-6
terminus-terminal/src/components/terminalSettingsTab.component.ts
...-terminal/src/components/terminalSettingsTab.component.ts
+7
-5
terminus-terminal/src/components/terminalTab.component.ts
terminus-terminal/src/components/terminalTab.component.ts
+8
-5
terminus-terminal/src/persistence/tmux.ts
terminus-terminal/src/persistence/tmux.ts
+3
-2
terminus-terminal/src/services/sessions.service.ts
terminus-terminal/src/services/sessions.service.ts
+20
-10
terminus-terminal/src/services/terminal.service.ts
terminus-terminal/src/services/terminal.service.ts
+7
-5
terminus-terminal/webpack.config.js
terminus-terminal/webpack.config.js
+17
-13
tsconfig.json
tsconfig.json
+1
-1
yarn.lock
yarn.lock
+2960
-311
未找到文件。
app/package.json
浏览文件 @
7bfc13da
...
...
@@ -12,14 +12,14 @@
"watch"
:
"webpack --progress --color --watch"
},
"dependencies"
:
{
"@angular/animations"
:
"
4.3.0
"
,
"@angular/common"
:
"
4.3.0
"
,
"@angular/compiler"
:
"
4.3.0
"
,
"@angular/core"
:
"
4.3.0
"
,
"@angular/forms"
:
"
4.3.0
"
,
"@angular/platform-browser"
:
"
4.3.0
"
,
"@angular/platform-browser-dynamic"
:
"
4.3.0
"
,
"@ng-bootstrap/ng-bootstrap"
:
"^
1.0.0-beta.2
"
,
"@angular/animations"
:
"
6.0.2
"
,
"@angular/common"
:
"
6.0.2
"
,
"@angular/compiler"
:
"
6.0.2
"
,
"@angular/core"
:
"
6.0.2
"
,
"@angular/forms"
:
"
6.0.2
"
,
"@angular/platform-browser"
:
"
6.0.2
"
,
"@angular/platform-browser-dynamic"
:
"
6.0.2
"
,
"@ng-bootstrap/ng-bootstrap"
:
"^
2.0.0
"
,
"devtron"
:
"1.4.0"
,
"electron-config"
:
"0.2.1"
,
"electron-debug"
:
"^1.0.1"
,
...
...
@@ -27,10 +27,10 @@
"electron-squirrel-startup"
:
"^1.0.0"
,
"js-yaml"
:
"3.8.2"
,
"mz"
:
"^2.6.0"
,
"ngx-toastr"
:
"^8.
0.0
"
,
"ngx-toastr"
:
"^8.
7.3
"
,
"path"
:
"0.12.7"
,
"rxjs"
:
"
5.3
.0"
,
"zone.js"
:
"
0.8.12
"
"rxjs"
:
"
^6.1
.0"
,
"zone.js"
:
"
~0.8.26
"
},
"devDependencies"
:
{
"@types/mz"
:
"0.0.31"
...
...
app/src/preload.scss
浏览文件 @
7bfc13da
...
...
@@ -62,3 +62,7 @@
.modal-dialog
{
-webkit-app-region
:
no-drag
;
}
[
ngbradiogroup
]
input
[
type
=
"radio"
]
{
display
:
none
;
}
app/webpack.config.js
浏览文件 @
7bfc13da
...
...
@@ -21,28 +21,34 @@ module.exports = {
extensions
:
[
'
.ts
'
,
'
.js
'
],
},
module
:
{
loader
s
:
[
rule
s
:
[
{
test
:
/
\.
ts$/
,
loader
:
'
awesome-typescript-loader
'
,
options
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
use
:
{
loader
:
'
awesome-typescript-loader
'
,
options
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
}
}
},
{
test
:
/
\.
scss$/
,
use
:
[
'
style-loader
'
,
'
css-loader
'
,
'
sass-loader
'
]
},
{
test
:
/
\.
css$/
,
use
:
[
'
style-loader
'
,
'
css-loader
'
,
'
sass-loader
'
]
},
{
test
:
/
\.(
png|svg
)
$/
,
loader
:
"
file-loader
"
,
options
:
{
name
:
'
images/[name].[ext]
'
use
:
{
loader
:
'
file-loader
'
,
options
:
{
name
:
'
images/[name].[ext]
'
}
}
},
{
test
:
/
\.(
ttf|eot|otf|woff|woff2
)(\?
v=
[
0-9
]\.[
0-9
]\.[
0-9
])?
$/
,
loader
:
"
file-loader
"
,
options
:
{
name
:
'
fonts/[name].[ext]
'
use
:
{
loader
:
'
file-loader
'
,
options
:
{
name
:
'
fonts/[name].[ext]
'
}
}
}
]
...
...
app/yarn.lock
浏览文件 @
7bfc13da
...
...
@@ -2,51 +2,51 @@
# yarn lockfile v1
"@angular/animations@
4.3.0
":
version "
4.3.0
"
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-
4.3.0.tgz#56f34b84649379202ac359929b82eb0b915e9c72
"
"@angular/animations@
6.0.2
":
version "
6.0.2
"
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-
6.0.2.tgz#92063f612c3b33d962eddc9ad538cadd231fbe47
"
dependencies:
tslib "^1.
7.1
"
tslib "^1.
9.0
"
"@angular/common@
4.3.0
":
version "
4.3.0
"
resolved "https://registry.yarnpkg.com/@angular/common/-/common-
4.3.0.tgz#13a54a6929dd52f9729b16ae446fad58fe163053
"
"@angular/common@
6.0.2
":
version "
6.0.2
"
resolved "https://registry.yarnpkg.com/@angular/common/-/common-
6.0.2.tgz#e4cbb7d45d8d2f35e918d62f0cbfd8c87e9168f7
"
dependencies:
tslib "^1.
7.1
"
tslib "^1.
9.0
"
"@angular/compiler@
4.3.0
":
version "
4.3.0
"
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-
4.3.0.tgz#55503bf27a1f062f71b9495393f3311903a8fc43
"
"@angular/compiler@
6.0.2
":
version "
6.0.2
"
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-
6.0.2.tgz#b9d29b7e032c767179967540f1ed7f8777a615a1
"
dependencies:
tslib "^1.
7.1
"
tslib "^1.
9.0
"
"@angular/core@
4.3.0
":
version "
4.3.0
"
resolved "https://registry.yarnpkg.com/@angular/core/-/core-
4.3.0.tgz#bd2249c3de1224a7c6536c4aba728d6565329334
"
"@angular/core@
6.0.2
":
version "
6.0.2
"
resolved "https://registry.yarnpkg.com/@angular/core/-/core-
6.0.2.tgz#d183730d73182a4590a5d71083db45655f210e69
"
dependencies:
tslib "^1.
7.1
"
tslib "^1.
9.0
"
"@angular/forms@
4.3.0
":
version "
4.3.0
"
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-
4.3.0.tgz#7d0c7a854737e9a30a5fd9665f8d4f56a1b91bd8
"
"@angular/forms@
6.0.2
":
version "
6.0.2
"
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-
6.0.2.tgz#a0647930e8b6e7fbd48f55eb69b399a41bcd091a
"
dependencies:
tslib "^1.
7.1
"
tslib "^1.
9.0
"
"@angular/platform-browser-dynamic@
4.3.0
":
version "
4.3.0
"
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-
4.3.0.tgz#551fb18851b27ee8f3e4b0ee25aad10bd7b312e
3"
"@angular/platform-browser-dynamic@
6.0.2
":
version "
6.0.2
"
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-
6.0.2.tgz#755689df9f02bbcb270c7872a75a2ffe7e0b0c3
3"
dependencies:
tslib "^1.
7.1
"
tslib "^1.
9.0
"
"@angular/platform-browser@
4.3.0
":
version "
4.3.0
"
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-
4.3.0.tgz#02389489185185c3becf06359346100e5479c7e1
"
"@angular/platform-browser@
6.0.2
":
version "
6.0.2
"
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-
6.0.2.tgz#19f56f6efbd0e7af5f35fe2f8cde3557dc8ba689
"
dependencies:
tslib "^1.
7.1
"
tslib "^1.
9.0
"
"@ng-bootstrap/ng-bootstrap@^
1.0.0-beta.2
":
version "
1.0.0-beta.2
"
resolved "https://registry.yarnpkg.com/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-
1.0.0-beta.2.tgz#3d4b567b0334a9ee631b73c72156cd3a9d3cd29f
"
"@ng-bootstrap/ng-bootstrap@^
2.0.0
":
version "
2.0.0
"
resolved "https://registry.yarnpkg.com/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-
2.0.0.tgz#65f78c7dd5a8ac424f44bb2050a9eab247cdeb0c
"
"@types/mz@0.0.31":
version "0.0.31"
...
...
@@ -195,9 +195,11 @@ mz@^2.6.0:
object-assign "^4.0.1"
thenify-all "^1.0.0"
ngx-toastr@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/ngx-toastr/-/ngx-toastr-8.0.0.tgz#f3bc53146b2f7da3eabf3daa1b1bbdf65cb49697"
ngx-toastr@^8.7.3:
version "8.7.3"
resolved "https://registry.yarnpkg.com/ngx-toastr/-/ngx-toastr-8.7.3.tgz#d3b7a8077ba1c860dd8a44779ccad38c5ea15c92"
dependencies:
tslib "^1.9.0"
object-assign@^4.0.1:
version "4.1.1"
...
...
@@ -236,20 +238,16 @@ process@^0.11.1:
version "0.11.10"
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
rxjs@
5.3
.0:
version "
5.3
.0"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-
5.3.0.tgz#d88ccbdd46af290cbdb97d5d8055e52453fabe2d
"
rxjs@
^6.1
.0:
version "
6.1
.0"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-
6.1.0.tgz#833447de4e4f6427b9cec3e5eb9f56415cd28315
"
dependencies:
symbol-observable "^1.0.1
"
tslib "^1.9.0
"
sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
symbol-observable@^1.0.1:
version "1.0.4"
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d"
thenify-all@^1.0.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726"
...
...
@@ -262,9 +260,9 @@ thenify-all@^1.0.0:
dependencies:
any-promise "^1.0.0"
tslib@^1.
7.1
:
version "1.
7
.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.
7.1.tgz#bc8004164691923a79fe8378bbeb3da2017538ec
"
tslib@^1.
9.0
:
version "1.
9
.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.
9.1.tgz#a5d1f0532a49221c87755cfcc89ca37197242ba7
"
util@^0.10.3:
version "0.10.3"
...
...
@@ -272,6 +270,6 @@ util@^0.10.3:
dependencies:
inherits "2.0.1"
zone.js@
0.8.12
:
version "0.8.
12
"
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.
12.tgz#86ff5053c98aec291a0bf4bbac501d694a05cfbb
"
zone.js@
~0.8.26
:
version "0.8.
26
"
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.
26.tgz#7bdd72f7668c5a7ad6b118148b4ea39c59d08d2d
"
package.json
浏览文件 @
7bfc13da
...
...
@@ -5,7 +5,7 @@
"
@types/node
"
:
"
7.0.5
"
,
"
@types/webpack-env
"
:
"
1.13.0
"
,
"
apply-loader
"
:
"
0.1.0
"
,
"
awesome-typescript-loader
"
:
"
3.1.2
"
,
"
awesome-typescript-loader
"
:
"
^5.0.0
"
,
"
core-js
"
:
"
2.4.1
"
,
"
cross-env
"
:
"
4.0.0
"
,
"
css-loader
"
:
"
0.28.0
"
,
...
...
@@ -13,7 +13,7 @@
"
electron-builder
"
:
"
17.1.1
"
,
"
electron-builder-squirrel-windows
"
:
"
17.0.1
"
,
"
electron-rebuild
"
:
"
1.5.11
"
,
"
file-loader
"
:
"
0.9.0
"
,
"
file-loader
"
:
"
^1.1.11
"
,
"
font-awesome
"
:
"
4.7.0
"
,
"
graceful-fs
"
:
"
^4.1.11
"
,
"
html-loader
"
:
"
0.4.4
"
,
...
...
@@ -25,13 +25,13 @@
"
node-sass
"
:
"
^4.5.3
"
,
"
npmlog
"
:
"
4.1.0
"
,
"
npx
"
:
"
^9.7.1
"
,
"
pug
"
:
"
2.0.0-beta11
"
,
"
pug
"
:
"
^2.0.3
"
,
"
pug-html-loader
"
:
"
1.0.9
"
,
"
pug-loader
"
:
"
2.3
.0
"
,
"
pug-loader
"
:
"
^2.4
.0
"
,
"
pug-static-loader
"
:
"
0.0.1
"
,
"
raven-js
"
:
"
3.16.0
"
,
"
raw-loader
"
:
"
0.5.1
"
,
"
sass-loader
"
:
"
6.0.3
"
,
"
sass-loader
"
:
"
^7.0.1
"
,
"
shelljs
"
:
"
0.7.7
"
,
"
source-sans-pro
"
:
"
2.0.10
"
,
"
style-loader
"
:
"
0.13.1
"
,
...
...
@@ -39,10 +39,11 @@
"
tslint
"
:
"
5.1.0
"
,
"
tslint-config-standard
"
:
"
5.0.2
"
,
"
tslint-eslint-rules
"
:
"
4.0.0
"
,
"
typescript
"
:
"
2.2.2
"
,
"
typescript
"
:
"
^2.8.3
"
,
"
url-loader
"
:
"
0.5.7
"
,
"
val-loader
"
:
"
0.5.0
"
,
"
webpack
"
:
"
^3.0.0
"
,
"
webpack
"
:
"
^4.8.3
"
,
"
webpack-cli
"
:
"
^2.1.3
"
,
"
yaml-loader
"
:
"
0.4.0
"
,
"
yarn
"
:
"
^1.3.2
"
},
...
...
terminus-community-color-schemes/webpack.config.js
浏览文件 @
7bfc13da
...
...
@@ -18,20 +18,22 @@ module.exports = {
extensions
:
[
'
.ts
'
,
'
.js
'
],
},
module
:
{
loader
s
:
[
rule
s
:
[
{
test
:
/
\.
ts$/
,
loader
:
'
awesome-typescript-loader
'
,
options
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
typeRoots
:
[
path
.
resolve
(
__dirname
,
'
node_modules/@types
'
)],
paths
:
{
"
terminus-*
"
:
[
path
.
resolve
(
__dirname
,
'
../terminus-*
'
)],
"
*
"
:
[
path
.
resolve
(
__dirname
,
'
../app/node_modules/*
'
)],
use
:
{
loader
:
'
awesome-typescript-loader
'
,
options
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
typeRoots
:
[
path
.
resolve
(
__dirname
,
'
node_modules/@types
'
)],
paths
:
{
"
terminus-*
"
:
[
path
.
resolve
(
__dirname
,
'
../terminus-*
'
)],
"
*
"
:
[
path
.
resolve
(
__dirname
,
'
../app/node_modules/*
'
)],
}
}
}
},
{
test
:
/
[\\\/]
schemes
[\\\/]
/
,
loader
:
"
raw-loader
"
},
{
test
:
/
[\\\/]
schemes
[\\\/]
/
,
use
:
"
raw-loader
"
},
]
},
externals
:
[
...
...
terminus-core/package.json
浏览文件 @
7bfc13da
...
...
@@ -25,8 +25,7 @@
"bootstrap"
:
"4.0.0-alpha.6"
,
"core-js"
:
"^2.4.1"
,
"electron-updater"
:
"^2.8.9"
,
"ngx-perfect-scrollbar"
:
"4.0.0"
,
"typescript"
:
"^2.4.1"
"ngx-perfect-scrollbar"
:
"^6.0.0"
},
"peerDependencies"
:
{
"@angular/animations"
:
"4.0.1"
,
...
...
terminus-core/src/components/tabBody.component.ts
浏览文件 @
7bfc13da
...
...
@@ -7,7 +7,7 @@ import { BaseTabComponent } from '../components/baseTab.component'
<perfect-scrollbar [config]="{ suppressScrollX: true }" *ngIf="scrollable">
<ng-template #scrollablePlaceholder></ng-template>
</perfect-scrollbar>
<
template #nonScrollablePlaceholder [ngIf]="!scrollable"></
template>
<
ng-template #nonScrollablePlaceholder *ngIf="!scrollable"></ng-
template>
`
,
styles
:
[
require
(
'
./tabBody.component.scss
'
),
...
...
terminus-core/src/index.ts
浏览文件 @
7bfc13da
...
...
@@ -3,7 +3,7 @@ import { BrowserModule } from '@angular/platform-browser'
import
{
BrowserAnimationsModule
}
from
'
@angular/platform-browser/animations
'
import
{
FormsModule
}
from
'
@angular/forms
'
import
{
NgbModule
}
from
'
@ng-bootstrap/ng-bootstrap
'
import
{
PerfectScrollbarModule
}
from
'
ngx-perfect-scrollbar
'
import
{
PerfectScrollbarModule
,
PERFECT_SCROLLBAR_CONFIG
}
from
'
ngx-perfect-scrollbar
'
import
{
AppService
}
from
'
./services/app.service
'
import
{
ConfigService
}
from
'
./services/config.service
'
...
...
@@ -34,7 +34,7 @@ import { Theme } from './api/theme'
import
{
StandardTheme
,
StandardCompactTheme
}
from
'
./theme
'
import
{
CoreConfigProvider
}
from
'
./config
'
import
'
perfect-scrollbar/
dist/
css/perfect-scrollbar.css
'
import
'
perfect-scrollbar/css/perfect-scrollbar.css
'
const
PROVIDERS
=
[
AppService
,
...
...
@@ -52,6 +52,7 @@ const PROVIDERS = [
{
provide
:
Theme
,
useClass
:
StandardTheme
,
multi
:
true
},
{
provide
:
Theme
,
useClass
:
StandardCompactTheme
,
multi
:
true
},
{
provide
:
ConfigProvider
,
useClass
:
CoreConfigProvider
,
multi
:
true
},
{
provide
:
PERFECT_SCROLLBAR_CONFIG
,
useValue
:
{
suppressScrollX
:
true
}}
]
@
NgModule
({
...
...
@@ -60,9 +61,7 @@ const PROVIDERS = [
BrowserAnimationsModule
,
FormsModule
,
NgbModule
.
forRoot
(),
PerfectScrollbarModule
.
forRoot
({
suppressScrollX
:
true
,
}),
PerfectScrollbarModule
,
],
declarations
:
[
AppRootComponent
,
...
...
@@ -92,5 +91,11 @@ export default class AppModule {
}
}
// PerfectScrollbar fix
import
{
fromEvent
}
from
'
rxjs/internal/observable/fromEvent
'
import
{
merge
}
from
'
rxjs/internal/observable/merge
'
require
(
'
rxjs
'
).
fromEvent
=
fromEvent
require
(
'
rxjs
'
).
merge
=
merge
export
{
AppRootComponent
as
bootstrap
}
export
*
from
'
./api
'
terminus-core/src/services/config.service.ts
浏览文件 @
7bfc13da
...
...
@@ -6,7 +6,6 @@ import { Injectable, Inject } from '@angular/core'
import
{
ConfigProvider
}
from
'
../api/configProvider
'
import
{
ElectronService
}
from
'
./electron.service
'
import
{
HostAppService
}
from
'
./hostApp.service
'
import
*
as
Reflect
from
'
core-js/es7/reflect
'
const
configMerge
=
(
a
,
b
)
=>
require
(
'
deepmerge
'
)(
a
,
b
,
{
arrayMerge
:
(
_d
,
s
)
=>
s
})
...
...
@@ -104,12 +103,11 @@ export class ConfigService {
enabledServices
<
T
>
(
services
:
T
[]):
T
[]
{
if
(
!
this
.
servicesCache
)
{
this
.
servicesCache
=
{}
let
ngModule
=
Reflect
.
getMetadata
(
'
annotations
'
,
window
[
'
rootModule
'
])[
0
]
let
ngModule
=
window
[
'
rootModule
'
].
ngInjectorDef
for
(
let
imp
of
ngModule
.
imports
)
{
let
module
=
imp
[
'
module
'
]
||
imp
let
annotations
=
Reflect
.
getMetadata
(
'
annotations
'
,
module
)
if
(
annotations
)
{
this
.
servicesCache
[
module
[
'
pluginName
'
]]
=
annotations
[
0
].
providers
.
map
(
provider
=>
{
let
module
=
(
imp
[
'
ngModule
'
]
||
imp
)
if
(
module
.
ngInjectorDef
&&
module
.
ngInjectorDef
.
providers
)
{
this
.
servicesCache
[
module
[
'
pluginName
'
]]
=
module
.
ngInjectorDef
.
providers
.
map
(
provider
=>
{
return
provider
[
'
useClass
'
]
||
provider
})
}
...
...
terminus-core/webpack.config.js
浏览文件 @
7bfc13da
...
...
@@ -6,6 +6,7 @@ module.exports = {
entry
:
'
src/index.ts
'
,
devtool
:
'
source-map
'
,
context
:
__dirname
,
mode
:
'
development
'
,
output
:
{
path
:
path
.
resolve
(
__dirname
,
'
dist
'
),
filename
:
'
index.js
'
,
...
...
@@ -18,16 +19,18 @@ module.exports = {
extensions
:
[
'
.ts
'
,
'
.js
'
],
},
module
:
{
loader
s
:
[
rule
s
:
[
{
test
:
/
\.
ts$/
,
loader
:
'
awesome-typescript-loader
'
,
options
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
typeRoots
:
[
path
.
resolve
(
__dirname
,
'
node_modules/@types
'
)],
paths
:
{
"
terminus-*
"
:
[
path
.
resolve
(
__dirname
,
'
../terminus-*
'
)],
"
*
"
:
[
path
.
resolve
(
__dirname
,
'
../app/node_modules/*
'
)],
use
:
{
loader
:
'
awesome-typescript-loader
'
,
options
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
typeRoots
:
[
path
.
resolve
(
__dirname
,
'
node_modules/@types
'
)],
paths
:
{
"
terminus-*
"
:
[
path
.
resolve
(
__dirname
,
'
../terminus-*
'
)],
"
*
"
:
[
path
.
resolve
(
__dirname
,
'
../app/node_modules/*
'
)],
}
}
}
},
...
...
terminus-core/yarn.lock
浏览文件 @
7bfc13da
...
...
@@ -185,15 +185,20 @@ ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
ngx-perfect-scrollbar@
4
.0.0:
version "
4
.0.0"
resolved "https://registry.yarnpkg.com/ngx-perfect-scrollbar/-/ngx-perfect-scrollbar-
4.0.0.tgz#f1e19449fa97d7f16e1ceb1fe1739e4bb646bebe
"
ngx-perfect-scrollbar@
^6
.0.0:
version "
6
.0.0"
resolved "https://registry.yarnpkg.com/ngx-perfect-scrollbar/-/ngx-perfect-scrollbar-
6.0.0.tgz#92b51957c04ed6a6d416beca2707bab005667b68
"
dependencies:
perfect-scrollbar "~0.6.0"
perfect-scrollbar "^1.3.0"
resize-observer-polyfill "^1.4.0"
perfect-scrollbar@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/perfect-scrollbar/-/perfect-scrollbar-1.3.0.tgz#61da56f94b58870d8e0a617bce649cee17d1e3b2"
perfect-scrollbar@~0.6
.0:
version "
0.6.16
"
resolved "https://registry.yarnpkg.com/
perfect-scrollbar/-/perfect-scrollbar-0.6.16.tgz#b1d61a5245cf3962bb9a8407a3fc669d923212fc
"
resize-observer-polyfill@^1.4
.0:
version "
1.5.0
"
resolved "https://registry.yarnpkg.com/
resize-observer-polyfill/-/resize-observer-polyfill-1.5.0.tgz#660ff1d9712a2382baa2cad450a4716209f9ca69
"
sax@^1.2.1:
version "1.2.4"
...
...
terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts
浏览文件 @
7bfc13da
import
{
BehaviorSubject
,
Observable
}
from
'
rxjs
'
import
{
debounceTime
,
distinctUntilChanged
,
first
,
tap
,
flatMap
}
from
'
rxjs/operators
'
import
*
as
semver
from
'
semver
'
import
{
Component
,
Input
}
from
'
@angular/core
'
...
...
@@ -33,15 +34,18 @@ export class PluginsSettingsTabComponent {
ngOnInit
()
{
this
.
availablePlugins$
=
this
.
availablePluginsQuery$
.
debounceTime
(
200
)
.
distinctUntilChanged
()
.
flatMap
(
query
=>
{
this
.
availablePluginsReady
=
false
return
this
.
pluginManager
.
listAvailable
(
query
).
do
(()
=>
{
this
.
availablePluginsReady
=
true
.
asObservable
()
.
pipe
(
debounceTime
(
200
),
distinctUntilChanged
(),
flatMap
(
query
=>
{
this
.
availablePluginsReady
=
false
return
this
.
pluginManager
.
listAvailable
(
query
).
pipe
(
tap
(()
=>
{
this
.
availablePluginsReady
=
true
}))
})
}
)
this
.
availablePlugins$
.
first
(
).
subscribe
(
available
=>
{
)
this
.
availablePlugins$
.
pipe
(
first
()
).
subscribe
(
available
=>
{
for
(
let
plugin
of
this
.
pluginManager
.
installedPlugins
)
{
this
.
knownUpgrades
[
plugin
.
name
]
=
available
.
find
(
x
=>
x
.
name
===
plugin
.
name
&&
semver
.
gt
(
x
.
version
,
plugin
.
version
))
}
...
...
terminus-plugin-manager/src/services/pluginManager.service.ts
浏览文件 @
7bfc13da
...
...
@@ -2,7 +2,8 @@ import * as path from 'path'
import
*
as
fs
from
'
mz/fs
'
import
{
exec
}
from
'
mz/child_process
'
import
axios
from
'
axios
'
import
{
Observable
}
from
'
rxjs
'
import
{
Observable
,
from
}
from
'
rxjs
'
import
{
map
}
from
'
rxjs/operators
'
import
{
Injectable
}
from
'
@angular/core
'
import
{
Logger
,
LogService
,
ConfigService
,
HostAppService
,
Platform
}
from
'
terminus-core
'
...
...
@@ -70,15 +71,14 @@ export class PluginManagerService {
}
listAvailable
(
query
?:
string
):
Observable
<
IPluginInfo
[]
>
{
return
Observable
.
fromPromise
(
axios
.
get
(
`https://www.npmjs.com/search?q=keywords%3A
${
KEYWORD
}
+
${
encodeURIComponent
(
query
||
''
)}
&from=0&size=1000`
,
{
headers
:
{
'
x-spiferack
'
:
'
1
'
,
}
})
)
.
map
(
response
=>
response
.
data
.
objects
.
map
(
item
=>
({
return
from
(
axios
.
get
(
`https://www.npmjs.com/search?q=keywords%3A
${
KEYWORD
}
+
${
encodeURIComponent
(
query
||
''
)}
&from=0&size=1000`
,
{
headers
:
{
'
x-spiferack
'
:
'
1
'
,
}
})
).
pipe
(
map
(
response
=>
response
.
data
.
objects
.
map
(
item
=>
({
name
:
item
.
package
.
name
.
substring
(
NAME_PREFIX
.
length
),
packageName
:
item
.
package
.
name
,
description
:
item
.
package
.
description
,
...
...
@@ -86,8 +86,9 @@ export class PluginManagerService {
homepage
:
item
.
package
.
links
.
homepage
,
author
:
(
item
.
package
.
author
||
{}).
name
,
isOfficial
:
item
.
package
.
publisher
.
username
===
OFFICIAL_NPM_ACCOUNT
,
})))
.
map
(
plugins
=>
plugins
.
filter
(
x
=>
x
.
packageName
.
startsWith
(
NAME_PREFIX
)))
}))),
map
(
plugins
=>
plugins
.
filter
(
x
=>
x
.
packageName
.
startsWith
(
NAME_PREFIX
))),
)
}
async
installPlugin
(
plugin
:
IPluginInfo
)
{
...
...
terminus-plugin-manager/webpack.config.js
浏览文件 @
7bfc13da
...
...
@@ -18,16 +18,18 @@ module.exports = {
extensions
:
[
'
.ts
'
,
'
.js
'
],
},
module
:
{
loader
s
:
[
rule
s
:
[
{
test
:
/
\.
ts$/
,
loader
:
'
awesome-typescript-loader
'
,
query
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
typeRoots
:
[
path
.
resolve
(
__dirname
,
'
node_modules/@types
'
)],
paths
:
{
"
terminus-*
"
:
[
path
.
resolve
(
__dirname
,
'
../terminus-*
'
)],
"
*
"
:
[
path
.
resolve
(
__dirname
,
'
../app/node_modules/*
'
)],
use
:
{
loader
:
'
awesome-typescript-loader
'
,
query
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
typeRoots
:
[
path
.
resolve
(
__dirname
,
'
node_modules/@types
'
)],
paths
:
{
"
terminus-*
"
:
[
path
.
resolve
(
__dirname
,
'
../terminus-*
'
)],
"
*
"
:
[
path
.
resolve
(
__dirname
,
'
../app/node_modules/*
'
)],
}
}
}
},
...
...
terminus-settings/src/components/hotkeyInputModal.component.ts
浏览文件 @
7bfc13da
import
{
Component
,
Input
,
trigger
,
transition
,
style
,
animate
}
from
'
@angular/core
'
import
{
Component
,
Input
}
from
'
@angular/core
'
import
{
trigger
,
transition
,
style
,
animate
}
from
'
@angular/animations
'
import
{
NgbActiveModal
}
from
'
@ng-bootstrap/ng-bootstrap
'
import
{
Subscription
}
from
'
rxjs
'
import
{
HotkeysService
}
from
'
terminus-core
'
...
...
terminus-settings/src/components/settingsTab.component.ts
浏览文件 @
7bfc13da
...
...
@@ -14,8 +14,8 @@ import { SettingsTabProvider } from '../api'
export
class
SettingsTabComponent
extends
BaseTabComponent
{
@
Input
()
activeTab
:
string
hotkeyFilter
=
''
private
hotkeyDescriptions
:
IHotkeyDescription
[]
private
screens
hotkeyDescriptions
:
IHotkeyDescription
[]
screens
:
any
[]
constructor
(
public
config
:
ConfigService
,
...
...
terminus-settings/src/components/settingsTabBody.component.ts
浏览文件 @
7bfc13da
...
...
@@ -8,7 +8,7 @@ import { SettingsTabProvider } from '../api'
export
class
SettingsTabBodyComponent
{
@
Input
()
provider
:
SettingsTabProvider
@
ViewChild
(
'
placeholder
'
,
{
read
:
ViewContainerRef
})
placeholder
:
ViewContainerRef
private
component
:
ComponentRef
<
Component
>
component
:
ComponentRef
<
Component
>
constructor
(
private
componentFactoryResolver
:
ComponentFactoryResolver
)
{
}
...
...
terminus-settings/webpack.config.js
浏览文件 @
7bfc13da
...
...
@@ -18,16 +18,18 @@ module.exports = {
extensions
:
[
'
.ts
'
,
'
.js
'
],
},
module
:
{
loader
s
:
[
rule
s
:
[
{
test
:
/
\.
ts$/
,
loader
:
'
awesome-typescript-loader
'
,
options
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
typeRoots
:
[
path
.
resolve
(
__dirname
,
'
node_modules/@types
'
)],
paths
:
{
"
terminus-*
"
:
[
path
.
resolve
(
__dirname
,
'
../terminus-*
'
)],
"
*
"
:
[
path
.
resolve
(
__dirname
,
'
../app/node_modules/*
'
)],
use
:
{
loader
:
'
awesome-typescript-loader
'
,
options
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
typeRoots
:
[
path
.
resolve
(
__dirname
,
'
node_modules/@types
'
)],
paths
:
{
"
terminus-*
"
:
[
path
.
resolve
(
__dirname
,
'
../terminus-*
'
)],
"
*
"
:
[
path
.
resolve
(
__dirname
,
'
../app/node_modules/*
'
)],
}
}
}
},
...
...
terminus-ssh/package.json
浏览文件 @
7bfc13da
...
...
@@ -19,12 +19,8 @@
"devDependencies"
:
{
"@types/ssh2"
:
"^0.5.35"
,
"@types/webpack-env"
:
"^1.13.0"
,
"apply-loader"
:
"^2.0.0"
,
"awesome-typescript-loader"
:
"^3.1.2"
,
"electron"
:
"^1.6.11"
,
"ngx-toastr"
:
"^8.0.0"
,
"pug"
:
"^2.0.0-rc.3"
,
"pug-loader"
:
"^2.3.0"
,
"rxjs"
:
"^5.4.0"
,
"typescript"
:
"^2.2.2"
,
"webpack"
:
"^2.3.3"
...
...
terminus-ssh/webpack.config.js
浏览文件 @
7bfc13da
...
...
@@ -17,16 +17,18 @@ module.exports = {
extensions
:
[
'
.ts
'
,
'
.js
'
],
},
module
:
{
loader
s
:
[
rule
s
:
[
{
test
:
/
\.
ts$/
,
loader
:
'
awesome-typescript-loader
'
,
query
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
typeRoots
:
[
path
.
resolve
(
__dirname
,
'
node_modules/@types
'
)],
paths
:
{
"
terminus-*
"
:
[
path
.
resolve
(
__dirname
,
'
../terminus-*
'
)],
"
*
"
:
[
path
.
resolve
(
__dirname
,
'
../app/node_modules/*
'
)],
use
:
{
loader
:
'
awesome-typescript-loader
'
,
options
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
typeRoots
:
[
path
.
resolve
(
__dirname
,
'
node_modules/@types
'
)],
paths
:
{
"
terminus-*
"
:
[
path
.
resolve
(
__dirname
,
'
../terminus-*
'
)],
"
*
"
:
[
path
.
resolve
(
__dirname
,
'
../app/node_modules/*
'
)],
}
}
}
},
...
...
terminus-ssh/yarn.lock
浏览文件 @
7bfc13da
此差异已折叠。
点击以展开。
terminus-terminal/src/buttonProvider.ts
浏览文件 @
7bfc13da
import
*
as
fs
from
'
mz/fs
'
import
*
as
path
from
'
path
'
import
{
first
}
from
'
rxjs/operators
'
import
{
Injectable
}
from
'
@angular/core
'
import
{
HotkeysService
,
ToolbarButtonProvider
,
IToolbarButton
,
ConfigService
,
HostAppService
,
ElectronService
,
Logger
,
LogService
}
from
'
terminus-core
'
import
{
HotkeysService
,
ToolbarButtonProvider
,
IToolbarButton
,
ConfigService
,
HostAppService
,
ElectronService
}
from
'
terminus-core
'
import
{
TerminalService
}
from
'
./services/terminal.service
'
@
Injectable
()
export
class
ButtonProvider
extends
ToolbarButtonProvider
{
private
logger
:
Logger
constructor
(
private
terminal
:
TerminalService
,
private
config
:
ConfigService
,
log
:
LogService
,
hostApp
:
HostAppService
,
electron
:
ElectronService
,
hotkeys
:
HotkeysService
,
)
{
super
()
this
.
logger
=
log
.
create
(
'
newTerminalButton
'
)
hotkeys
.
matchedHotkey
.
subscribe
(
async
(
hotkey
)
=>
{
if
(
hotkey
===
'
new-tab
'
)
{
this
.
openNewTab
()
...
...
@@ -47,7 +44,7 @@ export class ButtonProvider extends ToolbarButtonProvider {
}
async
openNewTab
(
cwd
?:
string
):
Promise
<
void
>
{
let
shells
=
await
this
.
terminal
.
shells$
.
first
(
).
toPromise
()
let
shells
=
await
this
.
terminal
.
shells$
.
pipe
(
first
()
).
toPromise
()
let
shell
=
shells
.
find
(
x
=>
x
.
id
===
this
.
config
.
store
.
terminal
.
shell
)
this
.
terminal
.
openTab
(
shell
,
cwd
)
}
...
...
terminus-terminal/src/components/terminalSettingsTab.component.ts
浏览文件 @
7bfc13da
import
{
Observable
}
from
'
rxjs
'
import
{
debounceTime
,
distinctUntilChanged
,
map
}
from
'
rxjs/operators
'
import
{
exec
}
from
'
mz/child_process
'
const
equal
=
require
(
'
deep-equal
'
)
const
fontManager
=
require
(
'
font-manager
'
)
...
...
@@ -51,11 +52,12 @@ export class TerminalSettingsTabComponent {
}
fontAutocomplete
=
(
text$
:
Observable
<
string
>
)
=>
{
return
text$
.
debounceTime
(
200
)
.
distinctUntilChanged
()
.
map
(
query
=>
this
.
fonts
.
filter
(
v
=>
new
RegExp
(
query
,
'
gi
'
).
test
(
v
)))
.
map
(
list
=>
Array
.
from
(
new
Set
(
list
)))
return
text$
.
pipe
(
debounceTime
(
200
),
distinctUntilChanged
(),
map
(
query
=>
this
.
fonts
.
filter
(
v
=>
new
RegExp
(
query
,
'
gi
'
).
test
(
v
))),
map
(
list
=>
Array
.
from
(
new
Set
(
list
))),
)
}
editScheme
(
scheme
:
ITerminalColorScheme
)
{
...
...
terminus-terminal/src/components/terminalTab.component.ts
浏览文件 @
7bfc13da
import
{
BehaviorSubject
,
Subject
,
Subscription
}
from
'
rxjs
'
import
{
Observable
,
BehaviorSubject
,
Subject
,
Subscription
}
from
'
rxjs
'
import
{
first
}
from
'
rxjs/operators
'
import
{
ToastrService
}
from
'
ngx-toastr
'
import
{
Component
,
NgZone
,
Inject
,
Optional
,
ViewChild
,
HostBinding
,
Input
}
from
'
@angular/core
'
import
{
AppService
,
ConfigService
,
BaseTabComponent
,
ElectronService
,
ThemesService
,
HostAppService
,
HotkeysService
,
Platform
}
from
'
terminus-core
'
...
...
@@ -32,7 +33,8 @@ export class TerminalTabComponent extends BaseTabComponent {
hotkeysSubscription
:
Subscription
bell$
=
new
Subject
()
size
:
ResizeEvent
resize$
=
new
Subject
<
ResizeEvent
>
()
resize$
:
Observable
<
ResizeEvent
>
private
resize_
=
new
Subject
<
ResizeEvent
>
()
input$
=
new
Subject
<
string
>
()
output$
=
new
Subject
<
string
>
()
contentUpdated$
=
new
Subject
<
void
>
()
...
...
@@ -58,9 +60,10 @@ export class TerminalTabComponent extends BaseTabComponent {
@
Optional
()
@
Inject
(
TerminalDecorator
)
private
decorators
:
TerminalDecorator
[],
)
{
super
()
this
.
resize$
=
this
.
resize_
.
asObservable
()
this
.
decorators
=
this
.
decorators
||
[]
this
.
setTitle
(
'
Terminal
'
)
this
.
resize$
.
first
().
subscribe
(
async
(
resizeEvent
)
=>
{
this
.
resize$
.
pipe
(
first
()).
subscribe
(
async
resizeEvent
=>
{
if
(
!
this
.
session
)
{
this
.
session
=
this
.
sessions
.
addSession
(
Object
.
assign
({},
this
.
sessionOptions
,
resizeEvent
)
...
...
@@ -330,7 +333,7 @@ export class TerminalTabComponent extends BaseTabComponent {
if
(
this
.
session
)
{
this
.
session
.
resize
(
columns
,
rows
)
}
this
.
resize
$
.
next
(
this
.
size
)
this
.
resize
_
.
next
(
this
.
size
)
})
}
}
...
...
@@ -452,7 +455,7 @@ export class TerminalTabComponent extends BaseTabComponent {
if
(
this
.
sessionCloseSubscription
)
{
this
.
sessionCloseSubscription
.
unsubscribe
()
}
this
.
resize
$
.
complete
()
this
.
resize
_
.
complete
()
this
.
input$
.
complete
()
this
.
output$
.
complete
()
this
.
contentUpdated$
.
complete
()
...
...
terminus-terminal/src/persistence/tmux.ts
浏览文件 @
7bfc13da
...
...
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'
import
{
execFileSync
}
from
'
child_process
'
import
*
as
AsyncLock
from
'
async-lock
'
import
{
ConnectableObservable
,
AsyncSubject
,
Subject
}
from
'
rxjs
'
import
{
first
,
publish
}
from
'
rxjs/operators
'
import
*
as
childProcess
from
'
child_process
'
import
{
Logger
}
from
'
terminus-core
'
...
...
@@ -102,7 +103,7 @@ export class TMuxCommandProcess {
}
})
this
.
response$
=
this
.
block$
.
publish
()
this
.
response$
=
this
.
block$
.
asObservable
().
pipe
(
publish
())
as
ConnectableObservable
<
TMuxBlock
>
this
.
response$
.
connect
()
this
.
block$
.
subscribe
(
block
=>
{
...
...
@@ -116,7 +117,7 @@ export class TMuxCommandProcess {
command
(
command
:
string
):
Promise
<
TMuxBlock
>
{
return
this
.
lock
.
acquire
(
'
key
'
,
()
=>
{
let
p
=
this
.
response$
.
take
(
1
).
toPromise
()
let
p
=
this
.
response$
.
pipe
(
first
()
).
toPromise
()
this
.
logger
.
debug
(
'
command:
'
,
command
)
this
.
process
.
stdin
.
write
(
command
+
'
\n
'
)
return
p
...
...
terminus-terminal/src/services/sessions.service.ts
浏览文件 @
7bfc13da
const
psNode
=
require
(
'
ps-node
'
)
let
nodePTY
import
*
as
fs
from
'
mz/fs
'
import
{
Subject
}
from
'
rxjs
'
import
{
Observable
,
Subject
}
from
'
rxjs
'
import
{
first
}
from
'
rxjs/operators
'
import
{
Injectable
,
Inject
}
from
'
@angular/core
'
import
{
Logger
,
LogService
,
ElectronService
,
ConfigService
}
from
'
terminus-core
'
import
{
exec
}
from
'
mz/child_process
'
...
...
@@ -17,25 +18,34 @@ export interface IChildProcess {
export
abstract
class
BaseSession
{
open
:
boolean
name
:
string
output$
=
new
Subject
<
string
>
()
closed$
=
new
Subject
<
void
>
()
destroyed$
=
new
Subject
<
void
>
()
recoveryId
:
string
truePID
:
number
output$
:
Observable
<
string
>
closed$
:
Observable
<
void
>
destroyed$
:
Observable
<
void
>
protected
output_
=
new
Subject
<
string
>
()
protected
closed_
=
new
Subject
<
void
>
()
protected
destroyed_
=
new
Subject
<
void
>
()
private
initialDataBuffer
=
''
private
initialDataBufferReleased
=
false
constructor
()
{
this
.
output$
=
this
.
output_
.
asObservable
()
this
.
closed$
=
this
.
closed_
.
asObservable
()
this
.
destroyed$
=
this
.
destroyed_
.
asObservable
()
}
emitOutput
(
data
:
string
)
{
if
(
!
this
.
initialDataBufferReleased
)
{
this
.
initialDataBuffer
+=
data
}
else
{
this
.
output
$
.
next
(
data
)
this
.
output
_
.
next
(
data
)
}
}
releaseInitialDataBuffer
()
{
this
.
initialDataBufferReleased
=
true
this
.
output
$
.
next
(
this
.
initialDataBuffer
)
this
.
output
_
.
next
(
this
.
initialDataBuffer
)
this
.
initialDataBuffer
=
null
}
...
...
@@ -49,9 +59,9 @@ export abstract class BaseSession {
async
destroy
():
Promise
<
void
>
{
if
(
this
.
open
)
{
this
.
open
=
false
this
.
closed
$
.
next
()
this
.
destroyed
$
.
next
()
this
.
output
$
.
complete
()
this
.
closed
_
.
next
()
this
.
destroyed
_
.
next
()
this
.
output
_
.
complete
()
await
this
.
gracefullyKillProcess
()
}
}
...
...
@@ -220,7 +230,7 @@ export class SessionsService {
options
.
name
=
`session-
${
this
.
lastID
}
`
let
session
=
new
Session
(
options
)
let
persistence
=
this
.
getPersistence
()
session
.
destroyed$
.
first
(
).
subscribe
(()
=>
{
session
.
destroyed$
.
pipe
(
first
()
).
subscribe
(()
=>
{
delete
this
.
sessions
[
session
.
name
]
if
(
persistence
)
{
persistence
.
terminateSession
(
session
.
recoveryId
)
...
...
terminus-terminal/src/services/terminal.service.ts
浏览文件 @
7bfc13da
import
{
AsyncSubject
}
from
'
rxjs
'
import
{
Observable
,
AsyncSubject
}
from
'
rxjs
'
import
{
Injectable
,
Inject
}
from
'
@angular/core
'
import
{
AppService
,
Logger
,
LogService
,
ConfigService
}
from
'
terminus-core
'
import
{
IShell
,
ShellProvider
}
from
'
../api
'
...
...
@@ -7,7 +7,8 @@ import { TerminalTabComponent } from '../components/terminalTab.component'
@
Injectable
()
export
class
TerminalService
{
shells$
=
new
AsyncSubject
<
IShell
[]
>
()
shells$
:
Observable
<
IShell
[]
>
private
shells_
=
new
AsyncSubject
<
IShell
[]
>
()
private
logger
:
Logger
constructor
(
...
...
@@ -26,10 +27,11 @@ export class TerminalService {
}
async
reloadShells
()
{
this
.
shells$
=
new
AsyncSubject
<
IShell
[]
>
()
this
.
shells_
=
new
AsyncSubject
<
IShell
[]
>
()
this
.
shells$
=
this
.
shells_
.
asObservable
()
let
shellLists
=
await
Promise
.
all
(
this
.
config
.
enabledServices
(
this
.
shellProviders
).
map
(
x
=>
x
.
provide
()))
this
.
shells
$
.
next
(
shellLists
.
reduce
((
a
,
b
)
=>
a
.
concat
(
b
)))
this
.
shells
$
.
complete
()
this
.
shells
_
.
next
(
shellLists
.
reduce
((
a
,
b
)
=>
a
.
concat
(
b
)))
this
.
shells
_
.
complete
()
}
async
openTab
(
shell
?:
IShell
,
cwd
?:
string
):
Promise
<
TerminalTabComponent
>
{
...
...
terminus-terminal/webpack.config.js
浏览文件 @
7bfc13da
...
...
@@ -18,27 +18,31 @@ module.exports = {
extensions
:
[
'
.ts
'
,
'
.js
'
],
},
module
:
{
loader
s
:
[
rule
s
:
[
{
test
:
/
\.
ts$/
,
loader
:
'
awesome-typescript-loader
'
,
query
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
typeRoots
:
[
path
.
resolve
(
__dirname
,
'
node_modules/@types
'
)],
paths
:
{
"
terminus-*
"
:
[
path
.
resolve
(
__dirname
,
'
../terminus-*
'
)],
"
*
"
:
[
path
.
resolve
(
__dirname
,
'
../app/node_modules/*
'
)],
}
}
use
:
{
loader
:
'
awesome-typescript-loader
'
,
query
:
{
configFileName
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
typeRoots
:
[
path
.
resolve
(
__dirname
,
'
node_modules/@types
'
)],
paths
:
{
"
terminus-*
"
:
[
path
.
resolve
(
__dirname
,
'
../terminus-*
'
)],
"
*
"
:
[
path
.
resolve
(
__dirname
,
'
../app/node_modules/*
'
)],
}
},
},
},
{
test
:
/
\.
pug$/
,
use
:
[
'
apply-loader
'
,
'
pug-loader
'
]
},
{
test
:
/
\.
scss$/
,
use
:
[
'
to-string-loader
'
,
'
css-loader
'
,
'
sass-loader
'
]
},
{
test
:
/
\.
css$/
,
use
:
[
'
to-string-loader
'
,
'
css-loader
'
]
},
{
test
:
/
\.(
ttf|eot|otf|woff|woff2|ogg
)(\?
v=
[
0-9
]\.[
0-9
]\.[
0-9
])?
$/
,
loader
:
"
url-loader
"
,
options
:
{
limit
:
999999999999
,
use
:
{
loader
:
'
url-loader
'
,
options
:
{
limit
:
999999999999
,
}
}
},
]
...
...
tsconfig.json
浏览文件 @
7bfc13da
...
...
@@ -2,9 +2,9 @@
"compilerOptions"
:
{
"module"
:
"commonjs"
,
"target"
:
"es2016"
,
"declaration"
:
false
,
"noImplicitAny"
:
false
,
"removeComments"
:
false
,
"emitDeclarationOnly"
:
false
,
"emitDecoratorMetadata"
:
true
,
"experimentalDecorators"
:
true
,
"sourceMap"
:
true
,
...
...
yarn.lock
浏览文件 @
7bfc13da
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录