Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
f7a1178f
Commit
f7a1178f
authored
Jun 29, 2016
by
Antoor
Committed by
GitHub
Jun 29, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #67 from antoor/v2.0-beta-request-timeout
v2.0-beta::request timeout setting
parents
533280f5
e22185d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
16 deletions
+33
-16
request.js
modules/request.js
+1
-1
base.js
source/core/base.js
+1
-0
form.js
source/modules/shellmanager/list/form.js
+31
-15
No files found.
modules/request.js
View file @
f7a1178f
...
@@ -106,7 +106,7 @@ class Request {
...
@@ -106,7 +106,7 @@ class Request {
.
proxy
(
APROXY_CONF
[
'uri'
])
.
proxy
(
APROXY_CONF
[
'uri'
])
.
type
(
'form'
)
.
type
(
'form'
)
// 超时
// 超时
.
timeout
(
REQ_TIMEOUT
)
.
timeout
(
opts
.
timeout
||
REQ_TIMEOUT
)
// 忽略HTTPS
// 忽略HTTPS
.
ignoreHTTPS
(
opts
[
'ignoreHTTPS'
])
.
ignoreHTTPS
(
opts
[
'ignoreHTTPS'
])
.
send
(
_postData
)
.
send
(
_postData
)
...
...
source/core/base.js
View file @
f7a1178f
...
@@ -240,6 +240,7 @@ class Base {
...
@@ -240,6 +240,7 @@ class Base {
tag_e
:
opt
[
'tag_e'
],
tag_e
:
opt
[
'tag_e'
],
encode
:
this
.
__opts__
[
'encode'
],
encode
:
this
.
__opts__
[
'encode'
],
ignoreHTTPS
:
(
this
.
__opts__
[
'otherConf'
]
||
{})[
'ignore-https'
]
===
1
,
ignoreHTTPS
:
(
this
.
__opts__
[
'otherConf'
]
||
{})[
'ignore-https'
]
===
1
,
timeout
:
parseInt
((
this
.
__opts__
[
'otherConf'
]
||
{})[
'request-timeout'
]),
headers
:
(
this
.
__opts__
[
'httpConf'
]
||
{})[
'headers'
]
||
{},
headers
:
(
this
.
__opts__
[
'httpConf'
]
||
{})[
'headers'
]
||
{},
body
:
(
this
.
__opts__
[
'httpConf'
]
||
{})[
'body'
]
||
{}
body
:
(
this
.
__opts__
[
'httpConf'
]
||
{})[
'body'
]
||
{}
});
});
...
...
source/modules/shellmanager/list/form.js
View file @
f7a1178f
...
@@ -41,19 +41,21 @@ class Form {
...
@@ -41,19 +41,21 @@ class Form {
// 回调数据
// 回调数据
if
(
callback
)
{
if
(
callback
)
{
win
.
progressOn
();
win
.
progressOn
();
callback
(
this
.
_parseFormData
(
setTimeout
(()
=>
{
this
.
baseForm
.
getValues
(),
callback
(
this
.
_parseFormData
(
this
.
httpForm
.
getValues
(),
this
.
baseForm
.
getValues
(),
this
.
otherForm
.
getValues
()
this
.
httpForm
.
getValues
(),
)).
then
((
msg
)
=>
{
this
.
otherForm
.
getValues
()
// 添加/保存完毕后回调
)).
then
((
msg
)
=>
{
win
.
close
();
// 添加/保存完毕后回调
toastr
.
success
(
msg
,
LANG_T
[
'success'
]);
win
.
close
();
}).
catch
((
msg
)
=>
{
toastr
.
success
(
msg
,
LANG_T
[
'success'
]);
// 添加/保存错误
}).
catch
((
msg
)
=>
{
win
.
progressOff
();
// 添加/保存错误
toastr
.
error
(
msg
,
LANG_T
[
'error'
]);
win
.
progressOff
();
});
toastr
.
error
(
msg
,
LANG_T
[
'error'
]);
});
},
100
);
};
};
});
});
}
}
...
@@ -268,7 +270,8 @@ class Form {
...
@@ -268,7 +270,8 @@ class Form {
_createOtherForm
(
arg
)
{
_createOtherForm
(
arg
)
{
const
opt
=
Object
.
assign
({},
{
const
opt
=
Object
.
assign
({},
{
'ignore-https'
:
0
,
'ignore-https'
:
0
,
'terminal-cache'
:
1
'terminal-cache'
:
1
,
'request-timeout'
:
'10000'
},
arg
.
otherConf
);
},
arg
.
otherConf
);
const
form
=
this
.
accordion
.
cells
(
'other'
).
attachForm
([{
const
form
=
this
.
accordion
.
cells
(
'other'
).
attachForm
([{
type
:
'settings'
,
position
:
'label-right'
,
inputWidth
:
400
type
:
'settings'
,
position
:
'label-right'
,
inputWidth
:
400
...
@@ -280,7 +283,20 @@ class Form {
...
@@ -280,7 +283,20 @@ class Form {
},
{
},
{
type
:
"checkbox"
,
name
:
'terminal-cache'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'notermcache'
],
type
:
"checkbox"
,
name
:
'terminal-cache'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'notermcache'
],
checked
:
opt
[
'terminal-cache'
]
===
1
checked
:
opt
[
'terminal-cache'
]
===
1
}
},
{
type
:
"label"
,
label
:
'请求超时'
},
{
type
:
"combo"
,
label
:
'/ms'
,
inputWidth
:
100
,
name
:
"request-timeout"
,
readonly
:
true
,
options
:
[
{
text
:
"5000"
,
value
:
"5000"
,
selected
:
opt
[
'request-timeout'
]
===
'5000'
},
{
text
:
"10000"
,
value
:
"10000"
,
selected
:
opt
[
'request-timeout'
]
===
'10000'
},
{
text
:
"30000"
,
value
:
"30000"
,
selected
:
opt
[
'request-timeout'
]
===
'30000'
},
{
text
:
"60000"
,
value
:
"60000"
,
selected
:
opt
[
'request-timeout'
]
===
'60000'
}
]},
]}],
true
);
]}],
true
);
return
form
;
return
form
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment