]> lifelog.hopto.org Git - LifeLog.git/commitdiff
upd. after full tests.
authorwbudic <redacted>
Thu, 19 Aug 2021 22:55:57 +0000 (08:55 +1000)
committerwbudic <redacted>
Thu, 19 Aug 2021 22:55:57 +0000 (08:55 +1000)
Current Development Check List.md
htdocs/cgi-bin/config.cgi
htdocs/cgi-bin/wsrc/main.js

index 6b0a1f372ffeaa648e352aaac53a364d67dbbc03..dfbe74c8a24115beec532d5eb90742870df85bb8 100644 (file)
   * Like, Warning! - Existing entry has been changed, are you sure do you want to overwrite it?
 * Configuration needs to be updated, to use CNF 2.2, for system reset, etc.
   * Config file "Data Fix* reset of settings updated to properly revert to factory defaults.
-* Backup/Restore made various db engine aware and compatible. As the data is the same.
+  * We need to also display stats for log file of the web server.
+    * Maybe provide an rotational purge on config page access. i.e. if line count is over 1000, purge to tail -n 1000.
+      * This sure an config file setting. i.e. <<WEB_SERVER_LOG_TAIL_LIMIT><1000>>>
+* &#10004; Backup/Restore made various db engine aware and compatible. As the data is the same.
   * The data is the same, Structure, binary data and password handling is different, engine dependant.
 * &#10004; Fix themes. Themes don't display and set consistently the pages throughout.
   * Login page should use standard default or last set theme.
index e83147efc050a8cb730e8612bba4cdf28e99ee13..14dd293047fb82594223d79684c58d026bd3c36b 100755 (executable)
@@ -1167,7 +1167,11 @@ try{
 };
 }
 
-
+# Notice -> Fetch on the page calls this subroutine, and if it fails to produce one,
+# the most likely problem is that the Notes table has a wrong binary type.
+# since v.2.4 this method has been tested and will not fail any db engine structure.
+# As the backup produced is in the original deployed source, which is sqlite not the other db engine.
+# Here the insert stament is FROM (data...) into -> SQLite.NOTES((LID INT PRIMARY KEY NOT NULL, DOC BLOB)
 sub backup {
 
    my $pass = Settings::pass();   
@@ -1194,15 +1198,17 @@ sub backup {
                 $in->execute($c[0],$c[1],$c[2]);
                 }
 
-                $in = $dbB->prepare('INSERT INTO LOG (ID_CAT, DATE, LOG, RTF, AMOUNT, AFLAG, STICKY) VALUES (?,?,?,?,?,?,?);');
-                $st = Settings::selectRecords($db,'SELECT ID_CAT, DATE, LOG, RTF, AMOUNT, AFLAG, STICKY FROM LOG order by DATE;');       
+                $in = $dbB->prepare('INSERT INTO LOG     (ID_CAT, DATE, LOG, RTF, AMOUNT, AFLAG, STICKY) VALUES (?,?,?,?,?,?,?);');
+                $st = Settings::selectRecords($db,'SELECT ID_CAT, DATE, LOG, RTF, AMOUNT, AFLAG, STICKY  FROM LOG order by DATE;');       
                 while(my @c = $st->fetchrow_array()){          
                     $in->execute($c[0],$c[1],$c[2],$c[3],$c[4],$c[5],$c[6]);
                 }
                 $in = $dbB->prepare('INSERT INTO NOTES VALUES (?,?)');
                 $st = Settings::selectRecords($db,'SELECT LID, DOC FROM NOTES;');       
-                while(my @c = $st->fetchrow_array()){          
-                    $in->execute($c[0],$c[1]);
+                while(my @c = $st->fetchrow_array()){
+                    $in->bind_param(1, $c[0]);
+                    $in->bind_param(2, $c[1]);#, { pg_type => DBD::Pg::PG_BYTEA });
+                    $in->execute();
                 }
                 $dbB->disconnect();                
    }else{
@@ -1428,7 +1434,7 @@ my $fh; open( $fh, ">>", &Settings::logPath."backup_restore.log");
 
 $b_db->disconnect();
 $db->disconnect();
-#`rm -rf $dbck/`;
+`rm -rf $dbck/`;
 
 }
 catch{
index a9e6332deb33bd09fb98226affdb8b28a624a696..51da926a046676f8668bd6a9a9b07892be95ab60 100644 (file)
@@ -1073,7 +1073,7 @@ function saveRTF(id, action) {
     $.post('json.cgi', {action:'store', id:id, bg:bg, doc: JSON.stringify(
             QUILL.getContents())},saveRTFResult).fail(
                  function(response) {
-                     dialogModal("Server Error: "+response.status,response.responseText);
+                     dialogModal("Service Error: "+response.status,response.responseText);
                 }
                                                  );
     if(is_submit){        
@@ -1143,6 +1143,7 @@ function loadRTF(under, id){
           //console.log("Panel query json.cgi action -> load, id:" + id);
           $.post('json.cgi', {action:'load', id:id}, loadRTFPnlResult);
           $("#q-rtf"+id).show();
+          display("Load id -> " + id + " issued!", 1);
         return false;
     }
 
@@ -1152,7 +1153,7 @@ function loadRTF(under, id){
 
     QUILL.setText('Loading Document...\n');    
     $.post('json.cgi', {action:'load', id:id}, loadRTFResult).fail(
-           function(response) {dialogModal("Server Error: "+response.status,response.responseText);}
+           function(response) {dialogModal("Service Error: "+response.status,response.responseText);}
     );
 
     $("#rtf_doc").show();
@@ -1192,7 +1193,7 @@ function loadRTFResult(content, result, prms, quill) {
 
     let msg = json.response;
     if(json.error){
-        dialogModal("Server Error", json.error);
+        dialogModal("Service Error", json.error);
     }
     if(json.log_id==0){
         console.log(msg = "Loaded in Buffer");
@@ -1201,7 +1202,7 @@ function loadRTFResult(content, result, prms, quill) {
         console.log(msg = "Loaded in document by lid -> "+json.log_id);
         $('#btn_load_doc').show();
     }
-    display(msg, 5);    
+    display(msg, 3);    
 }