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 {
.
proxy
(
APROXY_CONF
[
'uri'
])
.
type
(
'form'
)
// 超时
.
timeout
(
REQ_TIMEOUT
)
.
timeout
(
opts
.
timeout
||
REQ_TIMEOUT
)
// 忽略HTTPS
.
ignoreHTTPS
(
opts
[
'ignoreHTTPS'
])
.
send
(
_postData
)
...
...
source/core/base.js
View file @
f7a1178f
...
...
@@ -240,6 +240,7 @@ class Base {
tag_e
:
opt
[
'tag_e'
],
encode
:
this
.
__opts__
[
'encode'
],
ignoreHTTPS
:
(
this
.
__opts__
[
'otherConf'
]
||
{})[
'ignore-https'
]
===
1
,
timeout
:
parseInt
((
this
.
__opts__
[
'otherConf'
]
||
{})[
'request-timeout'
]),
headers
:
(
this
.
__opts__
[
'httpConf'
]
||
{})[
'headers'
]
||
{},
body
:
(
this
.
__opts__
[
'httpConf'
]
||
{})[
'body'
]
||
{}
});
...
...
source/modules/shellmanager/list/form.js
View file @
f7a1178f
...
...
@@ -41,19 +41,21 @@ class Form {
// 回调数据
if
(
callback
)
{
win
.
progressOn
();
callback
(
this
.
_parseFormData
(
this
.
baseForm
.
getValues
(),
this
.
httpForm
.
getValues
(),
this
.
otherForm
.
getValues
()
)).
then
((
msg
)
=>
{
// 添加/保存完毕后回调
win
.
close
();
toastr
.
success
(
msg
,
LANG_T
[
'success'
]);
}).
catch
((
msg
)
=>
{
// 添加/保存错误
win
.
progressOff
();
toastr
.
error
(
msg
,
LANG_T
[
'error'
]);
});
setTimeout
(()
=>
{
callback
(
this
.
_parseFormData
(
this
.
baseForm
.
getValues
(),
this
.
httpForm
.
getValues
(),
this
.
otherForm
.
getValues
()
)).
then
((
msg
)
=>
{
// 添加/保存完毕后回调
win
.
close
();
toastr
.
success
(
msg
,
LANG_T
[
'success'
]);
}).
catch
((
msg
)
=>
{
// 添加/保存错误
win
.
progressOff
();
toastr
.
error
(
msg
,
LANG_T
[
'error'
]);
});
},
100
);
};
});
}
...
...
@@ -268,7 +270,8 @@ class Form {
_createOtherForm
(
arg
)
{
const
opt
=
Object
.
assign
({},
{
'ignore-https'
:
0
,
'terminal-cache'
:
1
'terminal-cache'
:
1
,
'request-timeout'
:
'10000'
},
arg
.
otherConf
);
const
form
=
this
.
accordion
.
cells
(
'other'
).
attachForm
([{
type
:
'settings'
,
position
:
'label-right'
,
inputWidth
:
400
...
...
@@ -280,7 +283,20 @@ class Form {
},
{
type
:
"checkbox"
,
name
:
'terminal-cache'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'notermcache'
],
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
);
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