From: wbudic Date: Thu, 19 Aug 2021 22:55:57 +0000 (+1000) Subject: upd. after full tests. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=dd86f66e8c2062defaa51fed7f098df4d8aeeb0a;p=LifeLog.git upd. after full tests. --- diff --git a/Current Development Check List.md b/Current Development Check List.md index 6b0a1f3..dfbe74c 100644 --- a/Current Development Check List.md +++ b/Current Development Check List.md @@ -10,7 +10,10 @@ * 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. <<1000>>> +* ✔ 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. * ✔ Fix themes. Themes don't display and set consistently the pages throughout. * Login page should use standard default or last set theme. diff --git a/htdocs/cgi-bin/config.cgi b/htdocs/cgi-bin/config.cgi index e83147e..14dd293 100755 --- a/htdocs/cgi-bin/config.cgi +++ b/htdocs/cgi-bin/config.cgi @@ -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{ diff --git a/htdocs/cgi-bin/wsrc/main.js b/htdocs/cgi-bin/wsrc/main.js index a9e6332..51da926 100644 --- a/htdocs/cgi-bin/wsrc/main.js +++ b/htdocs/cgi-bin/wsrc/main.js @@ -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); }