Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Task autotest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
Task autotest
Commits
ae08115b
Commit
ae08115b
authored
Nov 25, 2023
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
web
parent
40279662
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
task_autotest/web/pages.py
+37
-3
37 additions, 3 deletions
task_autotest/web/pages.py
with
37 additions
and
3 deletions
task_autotest/web/pages.py
+
37
−
3
View file @
ae08115b
...
@@ -36,7 +36,7 @@ def json_endpoint(f):
...
@@ -36,7 +36,7 @@ def json_endpoint(f):
def
base_page
(
content
,
head
=
html
.
bucket
(),
limited_size
=
True
,
sticky_head
=
True
,
empty
=
False
,
js_reload
=
None
):
def
base_page
(
content
,
head
=
html
.
bucket
(),
limited_size
=
True
,
sticky_head
=
True
,
empty
=
False
,
js_reload
=
None
):
b
=
html
.
Builder
(
html
.
html
().
set_indent
(
0
))
b
=
html
.
Builder
(
html
.
html
().
set_indent
(
0
))
with
b
.
head
():
with
b
.
head
():
b
.
title
()(
"
KSP hra
"
)
b
.
title
()(
"
Autotestovač úloh
"
)
b
.
meta
(
name
=
"
viewport
"
,
content
=
"
width=device-width, initial-scale=1.0
"
)
b
.
meta
(
name
=
"
viewport
"
,
content
=
"
width=device-width, initial-scale=1.0
"
)
b
.
link
(
rel
=
"
stylesheet
"
,
href
=
app
.
url_for
(
'
static
'
,
filename
=
'
bootstrap.min.css
'
),
type
=
'
text/css
'
,
media
=
"
all
"
)
b
.
link
(
rel
=
"
stylesheet
"
,
href
=
app
.
url_for
(
'
static
'
,
filename
=
'
bootstrap.min.css
'
),
type
=
'
text/css
'
,
media
=
"
all
"
)
b
.
link
(
rel
=
"
stylesheet
"
,
href
=
app
.
url_for
(
'
static
'
,
filename
=
'
ksp-mhd.css
'
),
type
=
'
text/css
'
,
media
=
"
all
"
)
b
.
link
(
rel
=
"
stylesheet
"
,
href
=
app
.
url_for
(
'
static
'
,
filename
=
'
ksp-mhd.css
'
),
type
=
'
text/css
'
,
media
=
"
all
"
)
...
@@ -78,14 +78,48 @@ def base_page(content, head=html.bucket(), limited_size=True, sticky_head=True,
...
@@ -78,14 +78,48 @@ def base_page(content, head=html.bucket(), limited_size=True, sticky_head=True,
def
load_task_commits
():
with
open
(
os
.
path
.
join
(
config
.
DATA_DIR
,
"
task_commits
"
))
as
f
:
return
json
.
load
(
f
)
@app.route
(
"
/
"
,
methods
=
[
'
GET
'
,
'
POST
'
])
@app.route
(
"
/
"
)
def
web_index
():
def
web_index
():
b
=
html
.
Builder
()
b
=
html
.
Builder
()
task_commits
=
load_task_commits
()
with
b
.
table
(
_class
=
"
data
"
):
with
b
.
thead
.
tr
:
b
.
td
(
"
Úloha
"
)
b
.
td
(
"
Větev
"
)
b
.
td
(
"
Commit
"
)
for
branch
,
path
in
config
.
TASKS
:
commit
=
task_commits
.
get
(
task
)
with
b
.
tr
:
b
.
td
(
path
)
b
.
td
(
branch
)
b
.
td
(
commit
)
return
base_page
(
b
.
root
).
print_file
()
@app.route
(
"
/tests/
"
)
def
web_tests
():
b
=
html
.
Builder
()
with
b
.
table
(
_class
=
"
data
"
):
with
b
.
thead
.
tr
:
b
.
td
(
"
Úloha
"
)
b
.
td
(
"
Commit
"
)
for
branch
,
path
in
[]:
with
b
.
tr
:
b
.
td
(
path
)
b
.
td
(
branch
)
return
base_page
(
b
.
root
).
print_file
()
return
base_page
(
b
.
root
).
print_file
()
@app.route
(
"
/
show_
test/<string:task>/<string:commit>/
"
,
methods
=
[
'
GET
'
,
'
POST
'
]
)
@app.route
(
"
/test
s
/<string:task>/<string:commit>/
"
)
def
show_test
(
task
,
commit
):
def
show_test
(
task
,
commit
):
if
not
commit
.
isalnum
():
if
not
commit
.
isalnum
():
raise
werkzeug
.
exceptions
.
Forbidden
()
raise
werkzeug
.
exceptions
.
Forbidden
()
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment