Pi 3 months ago
parent
commit
c28951fb78
2 changed files with 8 additions and 5 deletions
  1. 2 1
      activities/sqlpage/sqlpage.json
  2. 6 4
      activities/www/index.sql

+ 2 - 1
activities/sqlpage/sqlpage.json

@@ -1,4 +1,5 @@
 {
 {
-  "database_url": "sqlite://:memory:",
+  "database_url": "sqlite://./activities.db",
+  "site_prefix": "/activity",
   "max_database_pool_connections": 16
   "max_database_pool_connections": 16
 }
 }

+ 6 - 4
activities/www/index.sql

@@ -1,20 +1,22 @@
+SET ":user" = 'shannon';
 INSERT INTO activities(user, activity, ts)
 INSERT INTO activities(user, activity, ts)
 SELECT :user, :activity, COALESCE(CASE COALESCE(:ts, '')
 SELECT :user, :activity, COALESCE(CASE COALESCE(:ts, '')
   WHEN '' THEN NULL
   WHEN '' THEN NULL
   ELSE datetime(:ts, 'utc')
   ELSE datetime(:ts, 'utc')
 END, CURRENT_TIMESTAMP)
 END, CURRENT_TIMESTAMP)
 WHERE COALESCE(:activity, '') <> ''
 WHERE COALESCE(:activity, '') <> ''
-RETURNING 'redirect' AS component, '/' AS link
+RETURNING 'redirect' AS component, '/activity' AS link
 ;
 ;
 
 
-SET ":user" = 'shannon';
 SET ":title" = 'Activities';
 SET ":title" = 'Activities';
 SELECT 'shell' AS component
 SELECT 'shell' AS component
 , 'dark' AS theme
 , 'dark' AS theme
 , :title AS title
 , :title AS title
 ;
 ;
 
 
-SELECT 'form' AS component;
+SELECT 'form' AS component
+, '/activity/index.sql' AS action
+;
 SELECT 'select' AS type
 SELECT 'select' AS type
 , 'Activity' AS label
 , 'Activity' AS label
 , 'activity' AS name
 , 'activity' AS name
@@ -38,7 +40,7 @@ SELECT 'datetime-local' AS type
 ;
 ;
 
 
 SELECT date(datetime(CURRENT_TIMESTAMP, '-'|| value ||'  days')) AS title
 SELECT date(datetime(CURRENT_TIMESTAMP, '-'|| value ||'  days')) AS title
-, '/chart.sql'||
+, '/activity/chart.sql'||
 '?user='||:user||
 '?user='||:user||
 '&date='|| REPLACE(datetime(CURRENT_TIMESTAMP, '-'|| value ||'  days'), ' ', '+') ||
 '&date='|| REPLACE(datetime(CURRENT_TIMESTAMP, '-'|| value ||'  days'), ' ', '+') ||
 '&_sqlpage_embed' AS embed
 '&_sqlpage_embed' AS embed