Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VR-demos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nomad-lab
VR-demos
Commits
97cdff34
Commit
97cdff34
authored
8 years ago
by
Ruben Jesus Garcia Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
CGI scripts for setting up the VR config files
parent
32ec4e46
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webserver/cgi-bin/NOMAD/configuredmaterial
+46
-0
46 additions, 0 deletions
webserver/cgi-bin/NOMAD/configuredmaterial
webserver/cgi-bin/NOMAD/configurematerial
+46
-0
46 additions, 0 deletions
webserver/cgi-bin/NOMAD/configurematerial
with
92 additions
and
0 deletions
webserver/cgi-bin/NOMAD/configuredmaterial
0 → 100644
+
46
−
0
View file @
97cdff34
#!/bin/bash
if
[
"
$QUERY_STRING
"
eq
""
]
then
#echo Location: /NOMAD/
echo
Location:http://mrs-srv.srv.lrz.de/NOMAD/
echo
''
else
#http://stackoverflow.com/questions/3919755/how-to-parse-query-string-from-a-bash-cgi-script
saveIFS
=
$IFS
IFS
=
'=&'
parm
=(
$QUERY_STRING
)
IFS
=
$saveIFS
#material 1
Mat
=
${
parm
[1]
}
if
[
"
$Mat
"
eq
""
]
then
echo
"Content-type: text-plain"
echo
''
echo
Missing material
exit
fi
#RGB 3,5,7,
Col
=
`
echo
${
parm
[3]
}
${
parm
[5]
}
${
parm
[7]
}
`
#repetitions 9 11 13
Rep
=
`
echo
${
parm
[9]
}
${
parm
[11]
}
${
parm
[13]
}
`
#traj 15
Traj
=
${
parm
[15]
}
#screenshot 17
#encoded http://unix.stackexchange.com/questions/159253/decoding-url-encoding-percent-encoding
Shot
=
$(
printf
'%b'
"
${
parm
[17]//%/\\x
}
"
)
echo
"Content-type: text-plain"
echo
"Content-disposition: attachment; filename=
${
Mat
}
.ncfg"
echo
''
echo
-e
\#
Material
$Mat
\\
r
\\
n
echo
-e
baseurl
\"
http://enc-testing-nomad.esc.rzg.mpg.de/v1.0/materials/
\"
\\
r
\\
n
echo
-e
jsonurl
\"
$Mat
\"
\\
r
\\
n
echo
-e
repetitions
$Rep
\\
r
\\
n
echo
-e
trajectories
$Traj
\\
r
\\
n
echo
-e
background
$Col
\\
r
\\
n
echo
screenshot
\"
$Shot
\"
echo
-e
\\
r
\\
n
echo
-e
atomscaling 0.5
\\
r
\\
n
fi
\ No newline at end of file
This diff is collapsed.
Click to expand it.
webserver/cgi-bin/NOMAD/configurematerial
0 → 100644
+
46
−
0
View file @
97cdff34
#!/bin/bash
echo "Content-type: application/xhtml+xml"
echo ''
cat
<
<
ENDA
<?
xml
version=
"1.0"
encoding=
"utf-8"
?
>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xml:lang=
"en"
>
<head>
<title>
Material configurator for VR viewing
</title>
</head>
<body>
<form
action=
"/cgi-bin/NOMAD/configuredmaterial"
>
<fieldset>
Material Number from NOMAD encyclopaedia
<input
type=
"text"
name=
"material"
ENDA
echo
value=
\"$QUERY_STRING\"
cat
<<
ENDB
/><br/>
Background Color (RGB, 0-1)
<input
type=
"text"
name=
"R"
value=
"0"
/>
<input
type=
"text"
name=
"G"
value=
"0"
/>
<input
type=
"text"
name=
"B"
value=
"0"
/><br/>
Repetitions along a,b,c vectors of the unit cell
<input
type=
"text"
name=
"Ra"
value=
"1"
/>
<input
type=
"text"
name=
"Rb"
value=
"1"
/>
<input
type=
"text"
name=
"Rc"
value=
"1"
/><br/>
Show Trajectory of atoms (-1: all; otherwise empty or space separarated list of numbers)
<input
type=
"text"
name=
"Traj"
value=
""
/><br/>
Screenshot Basename
<input
type=
"text"
name=
"Shot"
value=
"C:\\temp\\frame"
/><br/>
<input
type=
"submit"
name=
"submit"
value=
"Get Material"
/>
</fieldset>
</form>
<p>
<a
href=
"http://validator.w3.org/check?uri=referer"
><img
src=
"/w3.org/valid-xhtml11.png"
alt=
"Valid XHTML 1.1"
height=
"31"
width=
"88"
/></a>
</p>
</body>
</html>
ENDB
\ 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