Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
adc2019-system
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
adc2019
adc2019-system
Commits
8b045708
Commit
8b045708
authored
Jul 26, 2019
by
Kento HASEGAWA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve GUI behavior when stopping solver
parent
fe01ca25
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
adc2019.js
static/js/adc2019.js
+8
-10
No files found.
static/js/adc2019.js
View file @
8b045708
...
@@ -65,6 +65,7 @@ class StatusView {
...
@@ -65,6 +65,7 @@ class StatusView {
show
:
true
show
:
true
});
});
_this
.
container
.
find
(
'#solver-processing-modal'
).
on
(
'hidden.bs.modal'
,
function
(
e
){
_this
.
container
.
find
(
'#solver-processing-modal'
).
on
(
'hidden.bs.modal'
,
function
(
e
){
clearInterval
(
_this
.
request_refresh_timer
);
_this
.
show_problem
();
_this
.
show_problem
();
_this
.
fire
(
'refresh'
);
_this
.
fire
(
'refresh'
);
})
})
...
@@ -73,7 +74,10 @@ class StatusView {
...
@@ -73,7 +74,10 @@ class StatusView {
_this
.
stop_solver
();
_this
.
stop_solver
();
});
});
_this
.
get_request_status
(
request_id
,
timeout
);
_this
.
request_refresh_timer
=
setInterval
((
function
_t
(){
_this
.
get_request_status
(
request_id
);
return
_t
;
}()),
1000
);
});
});
}
}
...
@@ -86,8 +90,7 @@ class StatusView {
...
@@ -86,8 +90,7 @@ class StatusView {
dataType
:
"json"
,
dataType
:
"json"
,
url
:
"/api/stop"
,
url
:
"/api/stop"
,
}).
done
((
d
)
=>
{
}).
done
((
d
)
=>
{
_this
.
request_refresh_timer
=
'stopped'
;
alert
(
'Stopped'
);
alert
(
d
);
});
});
}
}
...
@@ -108,7 +111,7 @@ class StatusView {
...
@@ -108,7 +111,7 @@ class StatusView {
});
});
}
}
get_request_status
(
request_id
,
timeout
){
get_request_status
(
request_id
){
var
_this
=
this
;
var
_this
=
this
;
$
.
ajax
({
$
.
ajax
({
type
:
'GET'
,
type
:
'GET'
,
...
@@ -119,13 +122,8 @@ class StatusView {
...
@@ -119,13 +122,8 @@ class StatusView {
_this
.
container
.
find
(
'#request-status-container'
).
html
(
d
);
_this
.
container
.
find
(
'#request-status-container'
).
html
(
d
);
status
=
$
(
d
).
find
(
'#request-status-value'
).
text
();
status
=
$
(
d
).
find
(
'#request-status-value'
).
text
();
// console.log(status);
if
(
status
==
'done'
){
if
(
status
==
'done'
){
_this
.
request_refresh_timer
=
null
;
clearInterval
(
_this
.
request_refresh_timer
);
}
else
if
(
_this
.
request_refresh_timer
==
'stopped'
){
_this
.
request_refresh_timer
=
null
;
}
else
{
_this
.
request_refresh_timer
=
setTimeout
(
_this
.
get_request_status
(
request_id
,
timeout
),
1000
);
}
}
});
});
}
}
...
...
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