Browse Source

FIX: getServerStatus() -> fixed timeout notification
FIX: changed submit system
ADD: VERSION to config.ini
ADD: bundle.js?v={{@version}} and bundle.css?v={{@version}} to masterpage.tpl, this is very usefull to force reload to all clients without clear cache

Giancarlo Voci 7 years ago
parent
commit
f1ea2060d1
6 changed files with 14 additions and 12 deletions
  1. 2 1
      cfg/config.ini
  2. 1 1
      package.json
  3. 1 1
      src/OpenMind/FindBox/FindBoxService.php
  4. 1 1
      src/OpenMind/System/System.php
  5. 6 4
      ui/js/omlink.js
  6. 3 4
      ui/masterpage.tpl

+ 2 - 1
cfg/config.ini

@@ -1,4 +1,5 @@
 [globals]
+VERSION=1.0.4
 AUTOLOAD="src/"
 CACHE = TRUE
 UI=ui/
@@ -10,7 +11,7 @@ DSN="mysql:host=localhost;port=3306;dbname=omlink"
 dbuser=root
 dbpass=openmind
 MAX_BLINK_TIME_SEC=600
-MAX_RETRY_FOR_FAULT=5
+MAX_RETRY_FOR_FAULT=10
 DEV=true
 
 ; Path

+ 1 - 1
package.json

@@ -5,7 +5,7 @@
   "scripts": {
     "clean": "rm -rf tmp bundle.css bundle.js ui/css/omlink.css ui/css/omlink.css.map ui/js/omlink.min.js",
     "build": "node build.js",
-    "deploy": "zip -x ui/css/* ui/js/* -9 -r deploy.zip omlink.sql lib cfg/config.bin cfg/labels.ini index.php bundle.* src ui"
+    "deploy": "zip -x ui/css/* ui/js/* -9 -r deploy.zip omlink.sql lib cfg/config.bin cfg/labels.ini index.php bundle.* src_minified ui"
   },
   "author": "Open Mind",
   "dependencies": {

+ 1 - 1
src/OpenMind/FindBox/FindBoxService.php

@@ -108,7 +108,7 @@ class FindBoxService
     } else {  // A valid label id array is returned
       if (isset($labelResponses[$label->id]) && $labelResponses[$label->id]) { // Label exists and is true, mean that's all OK, no error
         $label->retryForFault = $f3->get('MAX_RETRY_FOR_FAULT');
-        $label->tsLastLongBlink = time();
+        $label->tsLastLongBlink = time() + 2;
         return true;
       } else { // Retry to blink to next cycle
         $this->log2console("Label {$label->id} blink error. Try next cycle...\n");

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

@@ -95,7 +95,7 @@ class System extends PluginStrategy
     $qs = new QueueSystem('FindBoxService_isAlive');
     if (!$qs->check()) {
       $lastUpdate = time() - $qs->command;
-      if ($lastUpdate > $f3->get('FINDBOXSERVICE.SLEEPTIME') + 2) { // 2 secondi come piccolo delay
+      if ($lastUpdate > ($f3->get('FINDBOXSERVICE.SLEEPTIME') / 1000) + 2) { // 2 secondi come piccolo delay
         $omlNotifications = new Notifications();
         $omlNotifications->notify(Notifications::FB_NOTALIVE, 'Errore: Servizio di FindBox non disponibile');
       } else {

+ 6 - 4
ui/js/omlink.js

@@ -109,10 +109,12 @@ $(function () {
   ForceFocus(); // INPUT AUTOFOCUS
 
   $('body').on('submit', 'form', function () {
-    $('form input,form select').prop('disabled', false);
-    setTimeout(function () {
-      $('form input,form select').prop('disabled', true);
-    }, 500);
+    $('body').focus();
+    $('form input,form select').prop('readonly', true);
+    
+    // Manual submit for more control
+    this.submit();
+    return false;
   });
 
   setInterval(() => {

+ 3 - 4
ui/masterpage.tpl

@@ -4,8 +4,8 @@
 	<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">
+	<link type="text/css" rel="stylesheet" href="{{@BASEURL}}/bundle.css?v={{@VERSION}}"/>
+	<link rel="shortcut icon" type="image/x-icon" href="{{@BASEURL}}/ui/favicon_{{@CUSTOMERNAME}}.ico?v={{@VERSION}}">
 
 	<script type="text/javascript">
     const BASEURL = '{{@BASEURL}}';
@@ -21,8 +21,7 @@
 
 <include href="footer.tpl"/>
 
-<script src="{{@BASEURL}}/bundle.js"></script>
-
+<script src="{{@BASEURL}}/bundle.js?v={{@VERSION}}"></script>
 
 <check if="{{isset(@REQ_REDIRECT}})">
 	<true>