]> lifelog.hopto.org Git - LifeLog.git/commitdiff
Added remove page table style.
authorMetabox <redacted>
Wed, 24 Apr 2019 07:20:18 +0000 (17:20 +1000)
committerMetabox <redacted>
Wed, 24 Apr 2019 07:20:18 +0000 (17:20 +1000)
14 files changed:
.vstags
Installation.txt
dbLifeLog/cgisess_46a0fa1e42f2731eddd3025facc36f0b [new file with mode: 0644]
dbLifeLog/cgisess_4c84e96b89b816bdfdebc4d767d11f2e [new file with mode: 0644]
dbLifeLog/cgisess_71912c3884dcafdddf8f32be1db02ff0 [new file with mode: 0644]
dbLifeLog/cgisess_75c1ba723680ab5c079b6e0a63fb45e1 [new file with mode: 0644]
dbLifeLog/cgisess_ac5c5da7a235175332d773dbd518bbbb [new file with mode: 0644]
dbLifeLog/cgisess_f894200ea978de16fca329c976941e4c [new file with mode: 0644]
htdocs/cgi-bin/remove.cgi
htdocs/cgi-bin/stats.cgi
htdocs/cgi-bin/tempCodeRunnerFile.cgi [new file with mode: 0644]
htdocs/cgi-bin/wsrc/main.css
htdocs/thttpd.pid [new file with mode: 0644]
thttpd.conf

diff --git a/.vstags b/.vstags
index 065d9bb7095300478d5c33e633b79610b335d0d0..12baa8dcf7e7ebcf616cf606bb7c5fbd0c0a8925 100644 (file)
--- a/.vstags
+++ b/.vstags
@@ -4,21 +4,41 @@
 !_TAG_PROGRAM_NAME     Exuberant Ctags //
 !_TAG_PROGRAM_URL      http://ctags.sourceforge.net    /official site/
 !_TAG_PROGRAM_VERSION  5.9~svn20110310 //
-ConfirmedDelition      htdocs/cgi-bin/remove.cgi       132;"   s
-DisplayDateDiffs       htdocs/cgi-bin/remove.cgi       84;"    s
-NotConfirmed   htdocs/cgi-bin/remove.cgi       152;"   s
-authenticate   htdocs/cgi-bin/main.cgi 522;"   s
-big_money      htdocs/cgi-bin/stats.cgi        105;"   s
-boldDate       htdocs/cgi-bin/remove.cgi       126;"   s
+ConfirmedDelition      htdocs/cgi-bin/remove.cgi       151;"   s
+DisplayDateDiffs       htdocs/cgi-bin/remove.cgi       103;"   s
+NotConfirmed   htdocs/cgi-bin/remove.cgi       171;"   s
+authenticate   htdocs/cgi-bin/main.cgi 526;"   s
+big_money      htdocs/cgi-bin/stats.cgi        126;"   s
+boldDate       htdocs/cgi-bin/remove.cgi       145;"   s
 build  htdocs/cgi-bin/search.cgi       85;"    s
-buildNavigationButtons htdocs/cgi-bin/main.cgi 460;"   s
-checkCreateTables      htdocs/cgi-bin/login_ctr.cgi    109;"   s
-dateDiff       htdocs/cgi-bin/remove.cgi       118;"   s
-getConfiguration       htdocs/cgi-bin/config.cgi       225;"   s
-getConfiguration       htdocs/cgi-bin/main.cgi 504;"   s
-processSubmit  htdocs/cgi-bin/config.cgi       127;"   s
-processSubmit  htdocs/cgi-bin/login_ctr.cgi    85;"    s
-processSubmit  htdocs/cgi-bin/main.cgi 374;"   s
-selSQLTbl      htdocs/cgi-bin/login_ctr.cgi    210;"   s
-selectSQL      htdocs/cgi-bin/stats.cgi        94;"    s
+buildNavigationButtons htdocs/cgi-bin/main.cgi 482;"   s
+changeSystemSettings   htdocs/cgi-bin/config.cgi       339;"   s
+checkCreateTables      htdocs/cgi-bin/login_ctr.cgi    112;"   s
+dateDiff       htdocs/cgi-bin/remove.cgi       137;"   s
+exportCategoriesToCSV  htdocs/cgi-bin/config.cgi       405;"   s
+exportLogToCSV htdocs/cgi-bin/config.cgi       375;"   s
+getConfiguration       htdocs/cgi-bin/config.cgi       317;"   s
+getConfiguration       htdocs/cgi-bin/main.cgi 569;"   s
+getConfiguration       htdocs/cgi-bin/remove.cgi       223;"   s
+importCatCSV   htdocs/cgi-bin/config.cgi       437;"   s
+importLogCSV   htdocs/cgi-bin/config.cgi       478;"   s
+insertDefCats  htdocs/cgi-bin/login_ctr.cgi    216;"   s
+main   htdocs/cgi-bin/login_ctr.cgi    6;"     p
+main::checkCreateTables        htdocs/cgi-bin/login_ctr.cgi    112;"   s
+main::insertDefCats    htdocs/cgi-bin/login_ctr.cgi    216;"   s
+main::populateConfig   htdocs/cgi-bin/login_ctr.cgi    231;"   s
+main::processSubmit    htdocs/cgi-bin/login_ctr.cgi    86;"    s
+main::removeOldSessions        htdocs/cgi-bin/login_ctr.cgi    242;"   s
+main::selSQLTbl        htdocs/cgi-bin/login_ctr.cgi    211;"   s
+parseDate      htdocs/cgi-bin/main.cgi 383;"   s
+populateConfig htdocs/cgi-bin/login_ctr.cgi    231;"   s
+processSubmit  htdocs/cgi-bin/config.cgi       214;"   s
+processSubmit  htdocs/cgi-bin/login_ctr.cgi    86;"    s
+processSubmit  htdocs/cgi-bin/main.cgi 397;"   s
+removeOldSessions      htdocs/cgi-bin/login_ctr.cgi    242;"   s
+selSQLTbl      htdocs/cgi-bin/login_ctr.cgi    211;"   s
+selectSQL      htdocs/cgi-bin/stats.cgi        115;"   s
+updConfSetting htdocs/cgi-bin/config.cgi       360;"   s
+updateCATDB    htdocs/cgi-bin/config.cgi       451;"   s
+updateLOGDB    htdocs/cgi-bin/config.cgi       494;"   s
 wanted htdocs/cgi-bin/e_vars.pl        211;"   s
index b54f7c7fca1a17765d7277d8c81f6a3e684afd95..63d4ef4718544ac48e5743535d20f77bd44bfcbc 100644 (file)
@@ -76,7 +76,7 @@ Before installing newer version scripts, perform an data export.
 cd /home/{user}/thttpd_dev/dbLifeLog
 sqlite3 -csv data_log.db "select * from LOG;" > current_log.csv
 
-##Install LifeLog Independantly
+##Install LifeLog Independently
 cd /home/{user}/ 
 git clone https://github.com/wbudic/LifeLog
 mkdir /home/{user}/thttpd_dev/dbLifeLog
@@ -87,14 +87,14 @@ if doing development. Copy also the /home/{user}/LifeLog/.git to /home/{user}/th
 Access the webserver cgi-bin. http://localhost:8080/cgi-bin/main.cgi
 (this might redirect to login.cgi or config.cgi in the future)
 
-##Install LifeLog Dependatly (not automatic, manual developer way)
+##Install LifeLog Dependetly (not automatic, manual developer way)
 cd /home/{user}/ 
 git clone https://github.com/wbudic/LifeLog
 run thttpd with:
 cd LifeLog; ./startDevWebServer.sh
 
 ##Import CSV Exported File
-This requires all CGI working. As it will creat a brand new database for you.
+This requires all CGI working. As it will create a brand new database for you.
 Once created you must import the from above example current_log.csv
 cd /home/{user}/thttpd_dev/dbLifeLog
 see: http://www.sqlitetutorial.net/sqlite-import-csv/
diff --git a/dbLifeLog/cgisess_46a0fa1e42f2731eddd3025facc36f0b b/dbLifeLog/cgisess_46a0fa1e42f2731eddd3025facc36f0b
new file mode 100644 (file)
index 0000000..71c9101
--- /dev/null
@@ -0,0 +1 @@
+$D = {'_SESSION_CTIME' => 1556077243,'_SESSION_ATIME' => 1556077243,'_SESSION_REMOTE_ADDR' => '127.0.0.1','_SESSION_ID' => '46a0fa1e42f2731eddd3025facc36f0b'};;$D
\ No newline at end of file
diff --git a/dbLifeLog/cgisess_4c84e96b89b816bdfdebc4d767d11f2e b/dbLifeLog/cgisess_4c84e96b89b816bdfdebc4d767d11f2e
new file mode 100644 (file)
index 0000000..6640ed3
--- /dev/null
@@ -0,0 +1 @@
+$D = {'_SESSION_ID' => '4c84e96b89b816bdfdebc4d767d11f2e','_SESSION_ATIME' => 1556063110,'_SESSION_CTIME' => 1556063110,'_SESSION_REMOTE_ADDR' => '127.0.0.1'};;$D
\ No newline at end of file
diff --git a/dbLifeLog/cgisess_71912c3884dcafdddf8f32be1db02ff0 b/dbLifeLog/cgisess_71912c3884dcafdddf8f32be1db02ff0
new file mode 100644 (file)
index 0000000..7df973c
--- /dev/null
@@ -0,0 +1 @@
+$D = {'_SESSION_CTIME' => 1556067062,'_SESSION_ATIME' => 1556067062,'_SESSION_REMOTE_ADDR' => '127.0.0.1','_SESSION_ID' => '71912c3884dcafdddf8f32be1db02ff0','_SESSION_ETIME' => 1800};;$D
\ No newline at end of file
diff --git a/dbLifeLog/cgisess_75c1ba723680ab5c079b6e0a63fb45e1 b/dbLifeLog/cgisess_75c1ba723680ab5c079b6e0a63fb45e1
new file mode 100644 (file)
index 0000000..c38e44d
--- /dev/null
@@ -0,0 +1 @@
+$D = {'_SESSION_REMOTE_ADDR' => '127.0.0.1','_SESSION_CTIME' => 1556086450,'_SESSION_ATIME' => 1556086450,'_SESSION_ID' => '75c1ba723680ab5c079b6e0a63fb45e1'};;$D
\ No newline at end of file
diff --git a/dbLifeLog/cgisess_ac5c5da7a235175332d773dbd518bbbb b/dbLifeLog/cgisess_ac5c5da7a235175332d773dbd518bbbb
new file mode 100644 (file)
index 0000000..53bf32a
--- /dev/null
@@ -0,0 +1 @@
+$D = {'_SESSION_ATIME' => 1556089997,'_SESSION_ID' => 'ac5c5da7a235175332d773dbd518bbbb','_SESSION_CTIME' => 1556086450,'_SESSION_ETIME' => 1200,'_SESSION_REMOTE_ADDR' => '127.0.0.1','alias' => 'admin','passw' => '42FAP5H0JUSZM','database' => 'data_admin_log.db'};;$D
\ No newline at end of file
diff --git a/dbLifeLog/cgisess_f894200ea978de16fca329c976941e4c b/dbLifeLog/cgisess_f894200ea978de16fca329c976941e4c
new file mode 100644 (file)
index 0000000..32160c9
--- /dev/null
@@ -0,0 +1 @@
+$D = {'_SESSION_ID' => 'f894200ea978de16fca329c976941e4c','_SESSION_CTIME' => 1556082147,'_SESSION_ATIME' => 1556082147,'_SESSION_REMOTE_ADDR' => '127.0.0.1'};;$D
\ No newline at end of file
index 3920d92f7068ef30c0938698196765a0cbdb4844..c6c7a2015e543058e363d9914a59be2584075443 100755 (executable)
@@ -68,8 +68,8 @@ while(my @row = $st->fetchrow_array()) {
 my $stmS = "SELECT rowid, ID_CAT, DATE, LOG from LOG WHERE";
 my $stmE = " ORDER BY DATE DESC, rowid DESC;";
 my $tbl = '<form name="frm_log_del" action="remove.cgi" onSubmit="return formDelValidation();">
-               <table class="tbl" width="'.$PRC_WIDTH.'%">
-               <tr class="r0"><th>Date</th><th>Time</th><th>Log</th><th>Category</th></tr>';
+                  <table class="tbl_rem" width="'.$PRC_WIDTH.'%">
+                  <tr class="r0"><th class="r0">Date</th> <th class="r0">Time</th><th class="r0">Log</th><th>Category</th></tr>';
 
 
 my $datediff = $cgi->param("datediff");
@@ -123,7 +123,7 @@ my  @prms = $cgi->param('chk');
                 my $dt = DateTime::Format::SQLite->parse_datetime( $row[0] );
                 my $dif = dateDiff($dt_prev, $dt);
                 $tbl .= '<tr class="r1"><td>'. $dt->ymd . '</td> 
-                         </td><td style="text-align:left;">'.$row[1]."</td></tr>".
+                             </td><td style="text-align:left;">'.$row[1]."</td></tr>".
                          '<tr class="r0"><td colspan="2">'.$dif. '</td> </tr>';        
                $dt_prev = $dt;
        }
@@ -192,9 +192,10 @@ while(my @row = $st->fetchrow_array()) {
         my $ct = $hshCats{$row[1]};
         my $dt = DateTime::Format::SQLite->parse_datetime( $row[2] );
 
-        $tbl = $tbl . '<tr class="r1"><td>'. $dt->ymd . "</td>" . 
-                 "<td>" . $dt->hms . "</td>" . "<td>" . $row[3] . "</td>\n".
-                 "<td>" . $ct. '<input type="hidden" name="chk" value="'.$row[0].'"></td></tr>';       
+        $tbl = $tbl . '<tr class="r1"><td class="r1">'. $dt->ymd . "</td>" . 
+                 '<td class="r1">' . $dt->hms . "</td>" .
+                 '<td class="r1"><b>' . $row[3] . "</b></td>\n".
+                 '<td>' . $ct. '<input type="hidden" name="chk" value="'.$row[0].'"></td></tr>';       
        $r_cnt++;
 }
 my $plural = "";
index f52daac184c1e6c7b072a7cf7b662480649c7659..6cba7c8f2442fe5cf38b081d9a38d5c9706b3ee9 100755 (executable)
@@ -80,6 +80,8 @@ my $hardware_status =`inxi -b -c0;uptime -p`;
 $hardware_status =~ s/\n/<br\/>/g;
 $hardware_status =~ s/Memory:/<b>Memory:/g;
 $hardware_status =~ s/Init:/<\/b>Initial:/g;
+$hardware_status =~ s/up\s/<b>Server is up: /g;
+$hardware_status .= '</b>';
 my $prc = 'ps -eo size,pid,user,command --sort -size | awk \'{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }\'';
 
 
diff --git a/htdocs/cgi-bin/tempCodeRunnerFile.cgi b/htdocs/cgi-bin/tempCodeRunnerFile.cgi
new file mode 100644 (file)
index 0000000..837e13e
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+#
+# Programed in vim by: Will Budic
+# Open Source License -> https://choosealicense.com/licenses/isc/
+#
+use strict;
+use warnings;
+
+our $LOG_PATH    = '/home/will/dev/LifeLog/dbLifeLog/';
+
+&removeOldSessions;
+
+sub removeOldSessions{
+       opendir(DIR, $LOG_PATH);
+       my @files = grep(/cgisess_*/,readdir(DIR));
+       closedir(DIR);
+
+       my $now = time - (24 * 60 * 60);
+
+       foreach my $file (@files) {
+               my $mod = (stat("$LOG_PATH/$file"))[9];
+               if($mod<$now){
+                   print "$file\n";
+               }
+       }
+}
\ No newline at end of file
index 6237c91065ec1ce6d137bc9dafb340b119cc8f3e..9d55bdb29f097f42d30df56cdece1fd0dbe22b75 100644 (file)
@@ -33,13 +33,27 @@ div {
     padding-left: 5px;
 }
 
+.tbl_rem {
+    border: 1px solid black;
+    border-right: 1px solid black;
+    border-bottom: 1px solid black;
+    padding-top: 5px;
+    padding-right: 5px;
+    padding-bottom: 5px;
+    padding-left: 5px;
+    text-align: left;
+}
+
 .r0 {
     background-color: #e6ffff;
     border: 1px solid black;
+    border-right: 1px solid black;
 }
 
 .r1 {
     background-color: #ccffff;
+    border: 1px solid black;
+    border-right: 1px solid black;
 }
 
 .edit {
diff --git a/htdocs/thttpd.pid b/htdocs/thttpd.pid
new file mode 100644 (file)
index 0000000..ec13183
--- /dev/null
@@ -0,0 +1 @@
+5885
index df281364eb6f043cbbd234c70c18fb1bb6979ff4..f8a51e6a2ea7a4a1d8cabad385eca2b6e14295b4 100644 (file)
@@ -1,8 +1,8 @@
 # This section overrides defaults
-dir=/home/will/dev/LifeLog/htdocs
+dir=./htdocs
 user=will
 logfile=/home/will/dev/LifeLog/log/thttpd.log
-pidfile=/home/will/dev/LifeLog/run/thttpd.pid
+pidfile=thttpd.pid
 # This section _documents_ defaults in effect
 port=8080
 nosymlinkcheck # default = !chroot