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
79827d1a
Commit
79827d1a
authored
Aug 21, 2019
by
Kento HASEGAWA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for the problem viewer and dragging blocks in viewers
parent
fb0ef6af
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
184 additions
and
197 deletions
+184
-197
main.py
main.py
+3
-3
host.py
roles/host.py
+8
-7
adc2019-viewer.js
static/js/adc2019-viewer.js
+171
-186
adc2019.js
static/js/adc2019.js
+1
-1
part_problem_status.html
templates/part_problem_status.html
+1
-0
viewer.html
templates/viewer.html
+0
-0
No files found.
main.py
View file @
79827d1a
...
@@ -16,9 +16,9 @@ def webui_index():
...
@@ -16,9 +16,9 @@ def webui_index():
# return adc2019system.role.role
# return adc2019system.role.role
return
render_template
(
'index.html'
)
return
render_template
(
'index.html'
)
@
webui
.
route
(
'/view
/solution
'
)
@
webui
.
route
(
'/view
er
'
)
def
webui_view
_solution
():
def
webui_view
er
():
return
render_template
(
'view
-solution
.html'
)
return
render_template
(
'view
er
.html'
)
@
webui
.
route
(
'/part/problems'
)
@
webui
.
route
(
'/part/problems'
)
def
webui_part_problems
():
def
webui_part_problems
():
...
...
roles/host.py
View file @
79827d1a
...
@@ -106,16 +106,17 @@ class Host(object):
...
@@ -106,16 +106,17 @@ class Host(object):
else
:
else
:
return
{
'status'
:
'unknown request'
}
return
{
'status'
:
'unknown request'
}
def
get_
solution_for_viewer
(
self
,
problem_key
,
solution_id
):
def
get_
viewer_data
(
self
,
problem_key
,
solution_id
):
problem
=
self
.
get_problem
(
problem_key
)
problem
=
self
.
get_problem
(
problem_key
)
if
problem
is
None
:
if
problem
is
None
:
return
None
return
None
problem_data
=
problem
.
get_d3json
()
problem_data
=
problem
.
get_d3json
()
solution
=
problem
.
get_solution
(
solution_id
)
if
solution_id
is
None
:
if
solution
is
None
:
solution_data
=
None
return
None
else
:
solution_data
=
solution
.
get_d3json
()
solution
=
problem
.
get_solution
(
solution_id
)
solution_data
=
solution
.
get_d3json
()
return
{
return
{
'problem'
:
problem_data
,
'problem'
:
problem_data
,
...
@@ -146,10 +147,10 @@ class Host(object):
...
@@ -146,10 +147,10 @@ class Host(object):
elif
cmd
==
'stop'
:
elif
cmd
==
'stop'
:
self
.
worker_manager
.
request_stop
()
self
.
worker_manager
.
request_stop
()
return
{}
return
{}
elif
cmd
==
'view
/solution
'
:
elif
cmd
==
'view'
:
problem_key
=
params
[
'problem'
]
problem_key
=
params
[
'problem'
]
solution_id
=
params
[
'solution'
]
solution_id
=
params
[
'solution'
]
return
self
.
get_
solution_for_viewer
(
problem_key
,
solution_id
)
return
self
.
get_
viewer_data
(
problem_key
,
solution_id
)
elif
cmd
==
'adccli/login'
:
elif
cmd
==
'adccli/login'
:
with
open
(
'path-to-adccli-login'
,
'r'
)
as
fp
:
with
open
(
'path-to-adccli-login'
,
'r'
)
as
fp
:
d
=
json
.
load
(
fp
)
d
=
json
.
load
(
fp
)
...
...
static/js/adc2019-viewer.js
View file @
79827d1a
This diff is collapsed.
Click to expand it.
static/js/adc2019.js
View file @
79827d1a
...
@@ -38,7 +38,7 @@ class StatusView {
...
@@ -38,7 +38,7 @@ class StatusView {
_this
.
container
.
find
(
'.solution-detail-row.valid-solution td'
).
click
((
e
)
=>
{
_this
.
container
.
find
(
'.solution-detail-row.valid-solution td'
).
click
((
e
)
=>
{
var
solution_id
=
$
(
e
.
target
).
parent
(
"tr"
).
data
(
"solution-id"
);
var
solution_id
=
$
(
e
.
target
).
parent
(
"tr"
).
data
(
"solution-id"
);
var
problem_name
=
$
(
e
.
target
).
parent
(
"tr"
).
data
(
"problem"
);
var
problem_name
=
$
(
e
.
target
).
parent
(
"tr"
).
data
(
"problem"
);
var
viewer_url
=
"/view
/solution
#"
+
problem_name
+
"/"
+
solution_id
;
var
viewer_url
=
"/view
er
#"
+
problem_name
+
"/"
+
solution_id
;
window
.
open
(
viewer_url
,
"_blank"
);
window
.
open
(
viewer_url
,
"_blank"
);
});
});
...
...
templates/part_problem_status.html
View file @
79827d1a
<div>
<div>
<h4
class=
'inline-heading'
id=
'problem-status-title'
>
{{problem.name}}
</h4>
<h4
class=
'inline-heading'
id=
'problem-status-title'
>
{{problem.name}}
</h4>
<a
href=
"/viewer#{{problem.name}}"
target=
"_blank"
>
Viewer
</a>
{#% # if localmode %#}
{#% # if localmode %#}
<button
class=
"btn btn-primary btn-lg start-button"
type=
"button"
data-qname=
"{{problem.name}}"
>
Start
</button>
<button
class=
"btn btn-primary btn-lg start-button"
type=
"button"
data-qname=
"{{problem.name}}"
>
Start
</button>
<!-- <button class="btn btn-danger btn-lg stop-button" type="button" data-qname="all">Stop</button> -->
<!-- <button class="btn btn-danger btn-lg stop-button" type="button" data-qname="all">Stop</button> -->
...
...
templates/view
-solution
.html
→
templates/view
er
.html
View file @
79827d1a
File moved
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