Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
oldroco
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mehtank
oldroco
Commits
9d0c21ad
Commit
9d0c21ad
authored
6 years ago
by
mehtank
Browse files
Options
Downloads
Patches
Plain Diff
Display SVG
parent
23375465
Branches
Branches containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
flaskapp/app.py
+3
-3
3 additions, 3 deletions
flaskapp/app.py
flaskapp/static/my.js
+2
-1
2 additions, 1 deletion
flaskapp/static/my.js
flaskapp/templates/combined.html
+6
-1
6 additions, 1 deletion
flaskapp/templates/combined.html
with
11 additions
and
5 deletions
flaskapp/app.py
+
3
−
3
View file @
9d0c21ad
...
...
@@ -89,13 +89,13 @@ def catchall(path):
ss
=
make
(
f
,
component
,
request
.
form
)
return
"
Good
"
elif
ext
==
"
svg
"
:
make
(
f
,
component
,
request
.
args
,
mkstl
=
Tru
e
,
mkdxf
=
False
,
mksvg
=
Fals
e
)
#
make(f, component, request.args, mkstl=
Fals
e, mkdxf=False, mksvg=
Tru
e)
return
send_from_directory
(
join
(
app
.
static_folder
,
component
),
"
graph-print.svg
"
,
as_attachment
=
True
,
cache_timeout
=-
1
)
elif
ext
==
"
stl
"
:
make
(
f
,
component
,
request
.
args
,
mkstl
=
True
,
mkdxf
=
False
,
mksvg
=
False
)
#
make(f, component, request.args, mkstl=True, mkdxf=False, mksvg=False)
return
send_from_directory
(
join
(
app
.
static_folder
,
component
),
"
graph-model.stl
"
,
as_attachment
=
True
,
cache_timeout
=-
1
)
elif
ext
==
"
dxf
"
:
make
(
f
,
component
,
request
.
args
,
mkstl
=
False
,
mkdxf
=
True
,
mksvg
=
False
)
#
make(f, component, request.args, mkstl=False, mkdxf=True, mksvg=False)
return
send_from_directory
(
join
(
app
.
static_folder
,
component
),
"
graph-silhouette.dxf
"
,
as_attachment
=
True
,
cache_timeout
=-
1
)
elif
ext
:
abort
(
400
)
...
...
This diff is collapsed.
Click to expand it.
flaskapp/static/my.js
+
2
−
1
View file @
9d0c21ad
...
...
@@ -121,6 +121,7 @@ function remake() {
console
.
log
(
'
success:
'
);
console
.
log
(
event
.
target
.
responseText
);
stlreload
();
svgreload
();
});
// Define what happens in case of error
...
...
@@ -133,7 +134,7 @@ function remake() {
}
window
.
onload
=
function
(
e
){
stlreload
();
remake
();
}
...
...
This diff is collapsed.
Click to expand it.
flaskapp/templates/combined.html
+
6
−
1
View file @
9d0c21ad
...
...
@@ -79,10 +79,15 @@
<div
id=
"stl"
></div>
<div
id=
"dxf"
>
<img
src=
"{{ component }}.svg"
>
<img
id=
"svg"
src=
"{{ component }}.svg"
>
</div>
<script>
stlmodel
=
'
static/{{ component }}/graph-model.stl
'
</script>
<script>
function
svgreload
()
{
document
.
getElementById
(
'
svg
'
).
src
=
"
{{ component }}.svg?random=
"
+
new
Date
().
getTime
();
}
</script>
<script
src=
"static/my.js"
></script>
</body>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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
register
or
sign in
to comment