Skip to content
Snippets Groups Projects
Commit 3182c4a3 authored by Lucio Zambon's avatar Lucio Zambon
Browse files

Update panther.php

parent 36cf89f3
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
$machine = empty($_REQUEST['machine'])? 'elettra': strtolower($_REQUEST['machine']); $machine = empty($_REQUEST['machine'])? 'elettra': strtolower($_REQUEST['machine']);
$simulator = false; $simulator = false;
if (strpos($machine, 'simulator_')!==false) {$simulator = true; list($trash, $machine) = explode('_', $machine, 2);} if (strpos($machine, 'simulator_')!==false) {$simulator = true; list($trash, $machine) = explode('_', $machine, 2);}
$l = file_get_contents($simulator? 'http://'.$_SERVER["HTTP_HOST"].strtr($_SERVER["PHP_SELF"], array('panther.php'=>'')).'simulator.php?lattice&machine='.$machine: $machine.'_lattice.json'); $l = file_get_contents($simulator? 'http://'.$_SERVER["HTTP_HOST"].strtr($_SERVER["PHP_SELF"], array('panther.php'=>'', 'index.php'=>'')).'simulator.php?lattice&machine='.$machine: $machine.'_lattice.json');
$lattice = json_decode($l, true); $lattice = json_decode($l, true);
$modules = ''; $modules = '';
if (!empty($lattice['conf']['modules'])) foreach ($lattice['conf']['modules'] as $m) { if (!empty($lattice['conf']['modules'])) foreach ($lattice['conf']['modules'] as $m) {
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
} }
$mode = isset($_REQUEST['fast'])? 'fast': (isset($_REQUEST['premium'])? 'premium': (isset($_REQUEST['plus'])? 'plus': '')); $mode = isset($_REQUEST['fast'])? 'fast': (isset($_REQUEST['premium'])? 'premium': (isset($_REQUEST['plus'])? 'plus': ''));
$mode = !empty($_REQUEST['fast'])? 'all': $mode; $mode = !empty($_REQUEST['fast'])? 'all': $mode;
$threejs = empty($_REQUEST['threejs'])? 'threejs': 'threejs'.$_REQUEST['threejs'];
file_put_contents('./logs'.date('Y').'.txt', date('Y-m-d H:i:s').' '.$_SERVER['REMOTE_ADDR'].'_'.$_SERVER['HTTP_X_FORWARDED_FOR'].' - '.$_SERVER['QUERY_STRING'].PHP_EOL , FILE_APPEND | LOCK_EX); file_put_contents('./logs'.date('Y').'.txt', date('Y-m-d H:i:s').' '.$_SERVER['REMOTE_ADDR'].'_'.$_SERVER['HTTP_X_FORWARDED_FOR'].' - '.$_SERVER['QUERY_STRING'].PHP_EOL , FILE_APPEND | LOCK_EX);
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
...@@ -27,8 +28,8 @@ ...@@ -27,8 +28,8 @@
<script type="importmap"> <script type="importmap">
{ {
"imports": { "imports": {
"three": "<?php echo ($local? './threejs': 'https://cdn.jsdelivr.net/npm/three@0.161.0/build');?>/three.module.js", "three": "<?php echo ($local? "./$threejs": 'https://cdn.jsdelivr.net/npm/three@0.161.0/build');?>/three.module.js",
"three/addons/": "<?php echo ($local? './threejs/': 'https://cdn.jsdelivr.net/npm/three@0.161.0/examples/jsm/');?>", "three/addons/": "<?php echo ($local? "./$threejs/": 'https://cdn.jsdelivr.net/npm/three@0.161.0/examples/jsm/');?>",
"components/": "./components/src/", "components/": "./components/src/",
"bundle": "./components/bundle_<?php echo $simulator? 'simulator': $machine.$mode;?>.js"<?php echo $modules;?> "bundle": "./components/bundle_<?php echo $simulator? 'simulator': $machine.$mode;?>.js"<?php echo $modules;?>
} }
...@@ -86,7 +87,7 @@ ...@@ -86,7 +87,7 @@
<text transform="rotate(45)" x="14" y="-6" font-size="70%" fill="white"> all numbers are random</text> <text transform="rotate(45)" x="14" y="-6" font-size="70%" fill="white"> all numbers are random</text>
</svg> </svg>
</div> </div>
<script type="module" src="./panther.js"></script> <script type="module" src="./panther<?php echo empty($_REQUEST['threejs'])? '': $_REQUEST['threejs'];?>.js"></script>
<div id='tooltip' style='position:absolute; display:none; z-index: 100000000;'> <div id='tooltip' style='position:absolute; display:none; z-index: 100000000;'>
<div style='width: 490px; background-color: white; padding:5px; border-width: 3px; border-color: blue; border-top-left-radius: 5px; border-top-right-radius: 5px;'><button id='compdb'>find component <span id='compname'/> on components DB</button></div> <div style='width: 490px; background-color: white; padding:5px; border-width: 3px; border-color: blue; border-top-left-radius: 5px; border-top-right-radius: 5px;'><button id='compdb'>find component <span id='compname'/> on components DB</button></div>
<iframe id='tooltipFrame' style="border:0; position:absolute; background:transparent; " width="240px" height="220px" src=''></iframe> <iframe id='tooltipFrame' style="border:0; position:absolute; background:transparent; " width="240px" height="220px" src=''></iframe>
...@@ -98,4 +99,4 @@ ...@@ -98,4 +99,4 @@
Data source <a href='https://drive.elettra.eu/group/268/'>https://drive.elettra.eu/group/268/</a> Data source <a href='https://drive.elettra.eu/group/268/'>https://drive.elettra.eu/group/268/</a>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment