Browse Source

* Dual frame in modo da poter vedere l'interfaccia di icam nella stessa videata
* Workaround per l'errore "mysql server has gone away", nella versione windows vengono disattivate le connessioni persistenti

Giancarlo Voci 8 years ago
parent
commit
46d80e0f09

+ 1 - 0
src/Modules/Dimatec/Dimatec.php

@@ -27,6 +27,7 @@ class Dimatec extends PluginStrategy
 
     $this->AddRoute('GET|POST /pick2light/@step', __NAMESPACE__ . '\Pages->Pick2Light');
     $this->AddRoute("GET|POST /bind", __NAMESPACE__ . '\Pages->Bind');
+    $this->AddRoute("GET|POST /dualframe", __NAMESPACE__ . '\Pages->IcamControlIFrame');
 
     $imgClass = 'shadow p-3 rounded bg-white';
 

+ 5 - 0
src/Modules/Dimatec/Pages.php

@@ -193,4 +193,9 @@ class Pages extends Controller
     $f3->set('CONTENT', 'distinta.tpl');
     echo \Template::instance()->render('masterpage.tpl');
   }
+
+  public function IcamControlIFrame($f3)
+  {
+    echo \Template::instance()->render('icamcontrol.tpl');
+  }
 }

+ 0 - 27
src/OpenMind/FindBox/FindBox.php

@@ -17,33 +17,6 @@ class FindBox extends PluginStrategy
     // CLI scripts
     $this->AddRoute('GET /cli.fb.service', __NAMESPACE__ . '\FindBoxService->Main');
   }
-
-  /**
-   * Check if is running, Spawn and detach the OM-Link background service.
-   * With DEBUG>0 enable XDEBUG to stop to breakpoints
-   */
-  private function SpawnServiceProcess()
-  {
-    global $f3;
-
-    if ($f3->get('DEBUG') > 0)
-      putenv('XDEBUG_CONFIG="remote_enable=1 remote_mode=req remote_port=9000 remote_host=127.0.0.1 remote_connect_back=0"');
-
-    $apiCall = "index.php /cli.fb.service";
-    switch (strtolower(PHP_OS_FAMILY)) {
-      case 'linux':
-        // TODO: da TESTARE sotto Linux, specialmente putenv()
-        $command = "nohup {$f3->get('PHP_PATH')} {$apiCall} &";
-        break;
-      case 'windows':
-        $command = "start {$f3->get('PHP_PATH')} {$apiCall}";
-        break;
-      default:
-        throw new \Exception('Operative system not detected');
-        break;
-    }
-    pclose(popen($command, 'r'));
-  }
 }
 
 /** @var \OpenMind\FindBox\FindBox $FindBox */

+ 1 - 1
src/OpenMind/System/System.php

@@ -29,7 +29,7 @@ class System extends PluginStrategy
           $f3->get('dbpass'),
           array(
             \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
-            \PDO::ATTR_PERSISTENT => FALSE
+            \PDO::ATTR_PERSISTENT => (strtolower(PHP_OS_FAMILY) == 'linux') ? TRUE : FALSE  // To avoid massive new persistant connections due to php-cgi processes
           )));
     } catch (PDOException $e) {
       die($e->getMessage());

+ 5 - 3
ui/footer.tpl

@@ -4,7 +4,9 @@
 	</check>
 	<div class="nav-item">Utente: {{@COOKIE.username}}</div>
 	<div class="collapse navbar-collapse"></div>
-	<a class="navbar-brand" href="{{@BASEURL}}">
-		<img src="{{@BASEURL}}/ui/images/om-link-logo.png" height="40"/>
-	</a>
+	<div class="navbar-brand">
+		<a href="{{@BASEURL}}">
+			<img src="{{@BASEURL}}/ui/images/om-link-logo.png" height="40"/>
+		</a>
+	</div>
 </nav>

+ 31 - 0
ui/icamcontrol.tpl

@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="it">
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
+	<title>{{@SITENAME}}</title>
+	<link type="text/css" rel="stylesheet" href="{{@BASEURL}}/bundle.css"/>
+	<link rel="shortcut icon" type="image/x-icon" href="{{@BASEURL}}/ui/favicon_{{@CUSTOMERNAME}}.ico">
+
+	<script type="text/javascript">
+    const BASEURL = '{{@BASEURL}}';
+	</script>
+</head>
+<body>
+
+<div class="container-fluid" style="position: absolute; top: 0; bottom: 0">
+	<div class="row" style="height: 100%">
+		<div class="col" style="height: 100%">
+			<iframe src="http://localhost/omlink" width="100%" height="100%"></iframe>
+		</div>
+		<div class="col" style="height: 100%">
+			<iframe src="http://192.168.253.128/" width="100%" height="100%"></iframe>
+		</div>
+	</div>
+</div>
+
+<script src="{{@BASEURL}}/bundle.js"></script>
+
+</body>
+</html>
+