From 0a5c9ea2b53ed881767ec8ad28773c871e00b36c Mon Sep 17 00:00:00 2001 From: Lucio Zambon <lucio.zambon@elettra.eu> Date: Wed, 13 Nov 2024 02:10:13 +0000 Subject: [PATCH] Update panther.php --- panther.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/panther.php b/panther.php index b49ef67..a7ff7e7 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'); } -- GitLab