Pi 4 сар өмнө
parent
commit
4743666673

+ 18 - 2
util-sqlpage/goto.sql

@@ -1,3 +1,19 @@
-SET ":inner" = 'goto/Index.sql';
-SELECT 'dynamic' AS component, sqlpage.run_sql('goto/entry.sql') AS properties;
+SET ":title" = 'GoTo';
+SET ":tool" = 'goto';
+SET ":hash" = COALESCE($hash, '');
+SET ":hash" = sqlpage.url_encode(:hash);
+SET ":go" = COALESCE($go, '');
+SET ":color" = '#dc4e41';
+SET ":tabler_color" = 'google';
+SET ":image" = '/static/goto/chain-link2fr-3-2.svg';
+SET ":favicon" = :image;
+SET ":manifest" = '/static/goto/manifest.json';
+SET ":inner" = (CASE :inner
+  WHEN 'sqlpage/Open.sql' THEN :inner
+  ELSE 'goto/Index.sql'
+END);
+SELECT 'dynamic' AS component, sqlpage.run_sql('goto/redirect.sql') AS properties
+WHERE (:go = 'true' AND :hash <> '');
 
+SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/theme.sql') AS properties;
+SELECT 'dynamic' AS component, sqlpage.run_sql(:inner) AS properties;

+ 0 - 16
util-sqlpage/goto/entry.sql

@@ -1,16 +0,0 @@
-SET ":title" = 'GoTo';
-SET ":tool" = 'goto';
-SET ":hash" = COALESCE($hash, '');
-SET ":hash" = sqlpage.url_encode(:hash);
-SET ":go" = COALESCE($go, '');
-SET ":color" = '#dc4e41';
-SET ":tabler_color" = 'google';
-SET ":image" = '/static/goto/chain-link2fr-3-2.svg';
-SET ":favicon" = :image;
-SET ":manifest" = '/static/goto/manifest.json';
-
-SELECT 'dynamic' AS component, sqlpage.run_sql('goto/redirect.sql') AS properties
-WHERE (:go = 'true' AND :hash <> '');
-
-SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/theme.sql') AS properties;
-SELECT 'dynamic' AS component, sqlpage.run_sql(:inner) AS properties;

+ 2 - 2
util-sqlpage/goto/form.sql

@@ -3,12 +3,12 @@ SELECT 'button' AS component;
 SELECT 'Open' AS title
 , 1 AS width
 , :tabler_color AS color
-, '/goto/open.sql?' AS link
+, '/goto/open.sql' AS link
 ;
 SELECT 'New' AS title
 , 1 AS width
 , 'gray-500' AS color
-, 'https://shandan.one/goto.sql?' AS link
+, '/goto.sql' AS link
 ;
 
 SELECT 'form' AS component

+ 1 - 1
util-sqlpage/goto/open.sql

@@ -1,2 +1,2 @@
 SET ":inner" = 'sqlpage/Open.sql';
-SELECT 'dynamic' AS component, sqlpage.run_sql('goto/entry.sql') AS properties;
+SELECT 'dynamic' AS component, sqlpage.run_sql('goto.sql') AS properties;