diff --git a/panther.php b/panther.php index b49ef677ca231c768a11ef10175950c827557d06..a7ff7e730726cea1c86194f53f7559e1d19fecbf 100644 --- a/panther.php +++ b/panther.php @@ -1,6 +1,14 @@ <?php $local = (isset($_REQUEST['cdn']) || $_SERVER['SERVER_NAME']=='mac3d.elettra.eu')? false: true; // true = use only locally installed modules, false = use cdn $machine = empty($_REQUEST['machine'])? 'elettra': strtolower($_REQUEST['machine']); + $simulator = false; + 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'); + $lattice = json_decode($l, true); + $modules = ''; + if (!empty($lattice['conf']['modules'])) foreach ($lattice['conf']['modules'] as $m) { + $modules .= ",\n \"$m\": \"./$m.js\""; + } $mode = isset($_REQUEST['fast'])? 'fast': (isset($_REQUEST['premium'])? 'premium': (isset($_REQUEST['plus'])? 'plus': '')); $mode = !empty($_REQUEST['fast'])? 'all': $mode; 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); @@ -22,7 +30,7 @@ "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/');?>", "components/": "./components/src/", - "bundle": "./components/bundle_<?php echo $machine.$mode;?>.js" + "bundle": "./components/bundle_<?php echo $simulator? 'simulator': $machine.$mode;?>.js"<?php echo $modules;?> } } </script> @@ -61,7 +69,7 @@ document.location = './ff63/'+fermi; } if (document.location.pathname.indexOf('ff63')>-1) { - $('#tooltip').show(); + // $('#tooltip').show(); $('#tooltip').css('left', '5px'); $('#tooltip').css('top', '5px'); }