Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
-布谷鸟-
nosqlclient
提交
c5e30fe2
N
nosqlclient
项目概览
-布谷鸟-
/
nosqlclient
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nosqlclient
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c5e30fe2
编写于
4月 16, 2017
作者:
R
rsercano
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
resolves #347, and improved tunnelSSH
上级
1d7ca582
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
50 addition
and
11 deletion
+50
-11
client/imports/views/layouts/top_navbar/connections/connections.html
...rts/views/layouts/top_navbar/connections/connections.html
+22
-2
client/imports/views/layouts/top_navbar/connections/connections.js
...ports/views/layouts/top_navbar/connections/connections.js
+7
-1
client/imports/views/pages/database_stats/database_stats.js
client/imports/views/pages/database_stats/database_stats.js
+2
-1
server/imports/internal/internal_methods.js
server/imports/internal/internal_methods.js
+2
-0
server/imports/mongodb/methods_common.js
server/imports/mongodb/methods_common.js
+17
-7
未找到文件。
client/imports/views/layouts/top_navbar/connections/connections.html
浏览文件 @
c5e30fe2
...
...
@@ -331,7 +331,7 @@
class=
"form-control"
>
<span
class=
"input-group-addon"
>
Seconds
</span>
</div>
<span
class=
"help-block m-b-none"
>
Enter to override
<b>
default
</b>
connection timeout
<b>
from settings
</b></span>
<span
class=
"help-block m-b-none"
>
Enter to override
<b>
default
</b>
connection timeout
<b>
from settings
</b>
,
<b>
0
</b>
is infinite
</span>
</div>
</div>
...
...
@@ -347,7 +347,7 @@
class=
"form-control"
>
<span
class=
"input-group-addon"
>
Seconds
</span>
</div>
<span
class=
"help-block m-b-none"
>
Enter to override
<b>
default
</b>
socket timeout
<b>
from settings
</b></span>
<span
class=
"help-block m-b-none"
>
Enter to override
<b>
default
</b>
socket timeout
<b>
from settings
</b>
,
<b>
0
</b>
is infinite
</span>
</div>
</div>
...
...
@@ -419,6 +419,26 @@
class=
"form-control"
>
</div>
</div>
<div
class=
"form-group"
><label
class=
"col-lg-2 control-label"
>
Destination Port
</label>
<div
class=
"col-lg-10"
><input
id=
"inputSshDestinationPort"
data-required=
"true"
min=
"1"
type=
"number"
placeholder=
"Destination port"
class=
"form-control"
>
<span
class=
"help-block m-b-none"
>
Remote
<b>
mongod/mongos
</b>
instance's port
</span>
</div>
</div>
<div
class=
"form-group"
><label
class=
"col-lg-2 control-label"
>
Local Port
</label>
<div
class=
"col-lg-10"
><input
id=
"inputSshLocalPort"
data-required=
"true"
min=
"1"
type=
"number"
placeholder=
"Local port"
class=
"form-control"
>
<span
class=
"help-block m-b-none"
>
By default it's same as
<b>
MongoDB
</b>
port in the first tab, you can optionally set another port to
<b>
here
</b>
and
<b>
first tab
</b></span>
</div>
</div>
<div
class=
"form-group"
><label
class=
"col-lg-2 control-label"
>
Username
</label>
<div
class=
"col-lg-10"
><input
id=
"inputSshUsername"
...
...
client/imports/views/layouts/top_navbar/connections/connections.js
浏览文件 @
c5e30fe2
...
...
@@ -146,6 +146,8 @@ const fillFormBasicAuth = function (obj) {
const
fillFormSsh
=
function
(
connection
)
{
$
(
'
#inputSshHostname
'
).
val
(
connection
.
ssh
.
host
);
$
(
'
#inputSshPort
'
).
val
(
connection
.
ssh
.
port
);
$
(
'
#inputSshLocalPort
'
).
val
(
connection
.
ssh
.
localPort
);
$
(
'
#inputSshDestinationPort
'
).
val
(
connection
.
ssh
.
destinationPort
);
$
(
'
#inputSshUsername
'
).
val
(
connection
.
ssh
.
username
);
const
certificateForm
=
$
(
'
#formSshCertificateAuth
'
);
...
...
@@ -355,11 +357,15 @@ const loadCertificate = function (currentVal, input, done) {
const
fillSsh
=
function
(
connection
)
{
const
port
=
$
(
'
#inputSshPort
'
).
val
();
const
localPort
=
$
(
'
#inputSshLocalPort
'
).
val
();
const
destinationPort
=
$
(
'
#inputSshDestinationPort
'
).
val
();
connection
.
ssh
=
{
enabled
:
$
(
'
#inputUseSSH
'
).
iCheck
(
'
update
'
)[
0
].
checked
,
host
:
$
(
'
#inputSshHostname
'
).
val
(),
port
:
port
?
parseInt
(
port
)
:
''
,
localPort
:
localPort
?
parseInt
(
localPort
)
:
''
,
destinationPort
:
destinationPort
?
parseInt
(
destinationPort
)
:
''
,
username
:
$
(
'
#inputSshUsername
'
).
val
(),
certificateFileName
:
$
(
'
#inputSshCertificate
'
).
siblings
(
'
.bootstrap-filestyle
'
).
children
(
'
input
'
).
val
(),
passPhrase
:
$
(
'
#inputSshPassPhrase
'
).
val
(),
...
...
@@ -440,7 +446,7 @@ const resetForm = function () {
$
(
'
#inputConnectionName, #inputUrl, #inputKerberosUsername, #inputKerberosPassword, #inputKerberosServiceName,
'
+
'
#inputLdapUsername, #inputLdapPassword, #inputConnectionTimeout, #inputSocketTimeout, #inputSshHostname,
'
+
'
#inputSshPort, #inputSshUsername, #inputSshPassPhrase, #inputSshPassword, #inputUser, #inputPassword,
'
+
'
#inputSshPort, #inputSsh
LocalPort, #inputSshDestinationPort, #inputSsh
Username, #inputSshPassPhrase, #inputSshPassword, #inputUser, #inputPassword,
'
+
'
#inputAuthenticationDB, #inputPassPhrase, #inputX509Username
'
).
val
(
''
);
$
(
'
#inputDatabaseName
'
).
val
(
'
test
'
);
$
(
'
#cmbAuthenticationType, #cmbSshAuthType, #cmbReadPreference
'
).
find
(
'
option
'
).
prop
(
'
selected
'
,
false
).
trigger
(
'
chosen:updated
'
);
...
...
client/imports/views/pages/database_stats/database_stats.js
浏览文件 @
c5e30fe2
...
...
@@ -687,7 +687,8 @@ Template.databaseStats.onDestroyed(function () {
Template
.
databaseStats
.
helpers
({
isSubscribed
(){
return
Settings
.
findOne
().
subscribed
;
const
settings
=
Settings
.
findOne
();
return
settings
?
settings
.
subscribed
:
false
;
},
getServerStatus
()
{
...
...
server/imports/internal/internal_methods.js
浏览文件 @
c5e30fe2
...
...
@@ -68,6 +68,7 @@ export const parseUrl = function (connection) {
};
const
checkConnection
=
function
(
connection
)
{
LOGGER
.
info
(
'
[checkConnection]
'
,
JSON
.
stringify
(
connection
));
if
(
connection
.
url
)
connection
=
parseUrl
(
connection
);
if
(
connection
.
servers
.
length
===
0
)
throw
new
Meteor
.
Error
(
'
At least one server is required !
'
);
...
...
@@ -81,6 +82,7 @@ const checkConnection = function (connection) {
if
(
connection
.
ssl
&&
!
connection
.
ssl
.
enabled
)
delete
connection
.
ssl
;
if
(
connection
.
ssh
)
{
if
(
!
connection
.
ssh
.
enabled
)
delete
connection
.
ssh
;
if
(
!
connection
.
ssh
.
destinationPort
)
throw
new
Meteor
.
Error
(
'
Destination port is required for SSH !
'
);
if
(
!
connection
.
ssh
.
username
)
throw
new
Meteor
.
Error
(
'
Username is required for SSH !
'
);
if
(
!
connection
.
ssh
.
host
)
throw
new
Meteor
.
Error
(
'
Host is required for SSH !
'
);
if
(
!
connection
.
ssh
.
port
)
throw
new
Meteor
.
Error
(
'
Port is required for SSH !
'
);
...
...
server/imports/mongodb/methods_common.js
浏览文件 @
c5e30fe2
...
...
@@ -20,6 +20,7 @@ const os = require('os');
export
let
database
;
let
spawnedShell
;
let
tunnel
;
const
connectToShell
=
function
(
connectionId
)
{
try
{
...
...
@@ -103,6 +104,10 @@ const proceedConnectingMongodb = function (dbName, connectionUrl, connectionOpti
LOGGER
.
error
(
mainError
,
db
);
done
(
mainError
,
db
);
if
(
db
)
db
.
close
();
if
(
tunnel
)
{
tunnel
.
close
();
tunnel
=
null
;
}
return
;
}
database
=
db
.
db
(
dbName
);
...
...
@@ -113,10 +118,11 @@ const proceedConnectingMongodb = function (dbName, connectionUrl, connectionOpti
catch
(
ex
)
{
LOGGER
.
error
(
'
[connect]
'
,
ex
);
done
(
new
Meteor
.
Error
(
ex
.
message
),
null
);
if
(
db
)
{
db
.
close
();
if
(
db
)
db
.
close
();
if
(
tunnel
)
{
tunnel
.
close
();
tunnel
=
null
;
}
}
});
};
...
...
@@ -288,7 +294,8 @@ Meteor.methods({
try
{
if
(
connection
.
ssh
&&
connection
.
ssh
.
enabled
)
{
let
config
=
{
dstPort
:
connection
.
port
,
dstPort
:
connection
.
ssh
.
destinationPort
,
localPort
:
connection
.
ssh
.
localPort
?
connection
.
ssh
.
localPort
:
connection
.
servers
[
0
].
port
,
host
:
connection
.
ssh
.
host
,
port
:
connection
.
ssh
.
port
,
username
:
connection
.
ssh
.
username
...
...
@@ -298,7 +305,8 @@ Meteor.methods({
if
(
connection
.
ssh
.
passPhrase
)
config
.
passphrase
=
connection
.
ssh
.
passPhrase
;
if
(
connection
.
ssh
.
password
)
config
.
password
=
connection
.
ssh
.
password
;
const
tunnel
=
tunnelSsh
(
config
,
Meteor
.
bindEnvironment
(
function
(
error
)
{
LOGGER
.
info
(
'
[connect]
'
,
'
[ssh]
'
,
'
ssh is enabled, config is
'
+
JSON
.
stringify
(
config
));
tunnel
=
tunnelSsh
(
config
,
Meteor
.
bindEnvironment
(
function
(
error
)
{
if
(
error
)
{
done
(
new
Meteor
.
Error
(
error
.
message
),
null
);
return
;
...
...
@@ -309,8 +317,10 @@ Meteor.methods({
}));
tunnel
.
on
(
'
error
'
,
function
(
err
)
{
if
(
err
)
{
done
(
new
Meteor
.
Error
(
err
.
message
),
null
);
if
(
err
)
done
(
new
Meteor
.
Error
(
err
.
message
),
null
);
if
(
tunnel
)
{
tunnel
.
close
();
tunnel
=
null
;
}
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录