Pi 4 mesiacov pred
rodič
commit
801e17001c

+ 5 - 0
util-sqlpage/clip/download.sql

@@ -0,0 +1,5 @@
+SET content = (SELECT content FROM clip WHERE hash = $hash);
+SELECT 'shell-empty' AS component;
+SELECT 'text' AS component
+, $content AS html
+;

+ 24 - 0
util-sqlpage/goto.sql

@@ -0,0 +1,24 @@
+SELECT 'shell' AS component
+, 'dark' AS theme
+, 'GoTo' AS title
+, 'https://shandan.one/static/goto/goto-favicon_square.svg' AS image
+, 'https://cdn.jsdelivr.net/npm/purecss@2.1.0/build/pure-min.css' AS css
+;
+
+SET color = '#8f4f4f';
+SET tabler_color = 'google';
+SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/Style.sql') AS properties;
+
+SET tool = 'goto';
+SET hash = CASE $hash = ''
+  WHEN TRUE THEN NULL
+  ELSE $hash
+END;
+SET inner = CASE COALESCE($content,'') <> '' AND COALESCE($action, '') = 'Shrtn It!'
+  WHEN TRUE THEN 'goto/save.sql'
+  ELSE CASE $hash IS NULL
+    WHEN TRUE THEN 'sqlpage/Link.sql'
+    ELSE 'sqlpage/link.sql'
+  END
+END;
+SELECT 'dynamic' AS component, sqlpage.run_sql($inner) AS properties;

+ 7 - 0
util-sqlpage/sqlpage/migrations/001_goto.sql

@@ -0,0 +1,7 @@
+DROP TABLE IF EXISTS goto;
+CREATE TABLE IF NOT EXISTS goto(
+  hash text PRIMARY KEY,
+  content text,
+  qr text,
+  created timestamp
+);