Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KADMOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LR-FPP-MDO
KADMOS
Commits
6e93a9af
Commit
6e93a9af
authored
7 years ago
by
Lukas Müller
Browse files
Options
Downloads
Patches
Plain Diff
Added switch for compressing labels to the interface
Former-commit-id: 17e9db1b6be86a4ecc5fed4f0fc46b619ce5283c
parent
f12f219e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#192635
canceled
2 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
kadmos/interface/interface.py
+4
-1
4 additions, 1 deletion
kadmos/interface/interface.py
kadmos/interface/templates/view.html
+15
-1
15 additions, 1 deletion
kadmos/interface/templates/view.html
with
19 additions
and
2 deletions
kadmos/interface/interface.py
+
4
−
1
View file @
6e93a9af
...
...
@@ -109,8 +109,11 @@ def view(temp_id=None, action=None, error=None, message=None):
mpg
=
None
# Perform actions
if
action
==
'
pdf
'
:
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
temp_dir
,
'
graph.pdf
'
)):
compressed_labels
=
bool
(
request
.
args
.
get
(
'
compressed_labels
'
,
False
))
reset
=
bool
(
request
.
args
.
get
(
'
reset
'
,
False
))
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
temp_dir
,
'
graph.pdf
'
))
or
reset
:
graph
.
create_dsm
(
'
graph
'
,
summarize_vars
=
compressed_labels
,
destination_folder
=
temp_dir
,
mpg
=
mpg
)
return
send_file
(
os
.
path
.
join
(
temp_dir
,
'
graph.pdf
'
))
...
...
This diff is collapsed.
Click to expand it.
kadmos/interface/templates/view.html
+
15
−
1
View file @
6e93a9af
...
...
@@ -98,6 +98,8 @@
</div>
<div
class=
"panel-body blue"
>
Save XML files in a pretty style
<input
id=
"pretty_print"
class=
"off"
type=
"checkbox"
data-toggle=
"toggle"
>
<br>
Create PDF files with compressed labels
<input
id=
"compressed_labels"
class=
"off"
type=
"checkbox"
data-toggle=
"toggle"
>
</div>
</div>
</div>
...
...
@@ -136,9 +138,15 @@ Morris.Bar({
<script>
// AJAX logic
function
pdf
()
{
var
url
=
'
{{ temp_id }}/pdf?reset=True
'
;
if
(
document
.
getElementById
(
'
compressed_labels
'
).
checked
)
{
url
+=
'
&compressed_labels=True
'
;
}
// Timestamp needs to be added to prevent caching
url
+=
'
×tamp=
'
+
new
Date
().
getTime
();
$
.
ajax
({
type
:
'
GET
'
,
url
:
'
{{ temp_id }}/pdf
'
,
url
:
url
,
beforeSend
:
function
()
{
$
(
"
#pdf
"
).
find
(
'
.pull-left
'
).
html
(
'
A (X)DSM PDF file is currently being created...
'
);
$
(
"
#pdf
"
).
find
(
'
.pull-right
'
).
html
(
'
<span class="glyphicon glyphicon-refresh spin" aria-hidden="true"></span>
'
);
...
...
@@ -233,6 +241,7 @@ function vispackstatus() {
jQuery
(
document
).
ready
(
function
(
$
)
{
// Clone relevant divs
var
cmdows_clone
=
$
(
"
#cmdows
"
).
html
();
var
pdf_clone
=
$
(
"
#pdf
"
).
html
();
// Activate toggle switch
$
(
'
input[type="checkbox"]
'
).
bootstrapToggle
();
...
...
@@ -243,6 +252,11 @@ jQuery(document).ready(function($) {
$
(
"
#cmdows
"
).
attr
(
'
onclick
'
,
'
cmdows()
'
);
$
(
"
#cmdows
"
).
removeAttr
(
'
href
'
);
});
$
(
'
#compressed_labels
'
).
change
(
function
()
{
$
(
"
#pdf
"
).
empty
().
html
(
pdf_clone
);
$
(
"
#pdf
"
).
attr
(
'
onclick
'
,
'
pdf()
'
);
$
(
"
#pdf
"
).
removeAttr
(
'
href
'
);
});
});
</script>
{% endblock %}
\ No newline at end of file
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
register
or
sign in
to comment