From bacbe5d35a8b7ae8acc37d2ca74196300cd8b2ae Mon Sep 17 00:00:00 2001 From: biondizzle Date: Wed, 11 Mar 2026 21:55:13 -0400 Subject: [PATCH] tweax --- .env | 33 --- src/Service/DynamoService.php | 6 +- templates/table/browse.html.twig | 376 ++++++++++++++-------------- templates/table/item_form.html.twig | 2 +- 4 files changed, 193 insertions(+), 224 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index b6f26d4..0000000 --- a/.env +++ /dev/null @@ -1,33 +0,0 @@ -# In all environments, the following files are loaded if they exist, -# the latter taking precedence over the former: -# -# * .env contains default values for the environment variables needed by the app -# * .env.local uncommitted file with local overrides -# * .env.$APP_ENV committed environment-specific defaults -# * .env.$APP_ENV.local uncommitted environment-specific overrides -# -# Real environment variables win over .env files. -# -# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. -# https://symfony.com/doc/current/configuration/secrets.html -# -# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). -# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration - -###> symfony/framework-bundle ### -APP_ENV=dev -APP_SECRET= -APP_SHARE_DIR=var/share -###< symfony/framework-bundle ### - -###> symfony/routing ### -# Configure how to generate URLs in non-HTTP contexts, such as CLI commands. -# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands -DEFAULT_URI=http://localhost -###< symfony/routing ### - -# DynamoDB / JormunDB connection -DYNAMO_REGION=us-east-1 -DYNAMO_ENDPOINT=http://45.76.2.182:8002 -DYNAMO_KEY=AKIAIOSFODNN7EXAMPLE -DYNAMO_SECRET=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY diff --git a/src/Service/DynamoService.php b/src/Service/DynamoService.php index 4a010fc..f7bdf40 100644 --- a/src/Service/DynamoService.php +++ b/src/Service/DynamoService.php @@ -15,10 +15,10 @@ class DynamoService $this->client = new DynamoDbClient([ 'region' => $_ENV['DYNAMO_REGION'] ?? 'us-east-1', 'version' => 'latest', - 'endpoint' => $_ENV['DYNAMO_ENDPOINT'] ?? 'http://127.0.0.1:8002', + 'endpoint' => $_ENV['DYNAMO_ENDPOINT'] ?? 'https://jormun-write-through-dev.vultrlabs.dev', 'credentials' => [ - 'key' => $_ENV['DYNAMO_KEY'] ?? 'AKIAIOSFODNN7EXAMPLE', - 'secret' => $_ENV['DYNAMO_SECRET'] ?? 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + 'key' => $_ENV['DYNAMO_KEY'], + 'secret' => $_ENV['DYNAMO_SECRET'], ], ]); diff --git a/templates/table/browse.html.twig b/templates/table/browse.html.twig index f0c6046..a97af3f 100644 --- a/templates/table/browse.html.twig +++ b/templates/table/browse.html.twig @@ -4,211 +4,213 @@ {% block title %}{{ tableName }} — Browse · Jormun Admin{% endblock %} {% block breadcrumbs %} - Home - / - {{ tableName }} - / - Browse + Home + / + {{ tableName }} + / + Browse {% endblock %} {% block sidebar_tables %} - {{ macros.sidebar_table_links(tables, tableName) }} + {{ macros.sidebar_table_links(tables, tableName) }} {% endblock %} {% block content %} {# Op Tabs #} {# Error #} {% if error %}
- {{ error }} + {{ error }}
{% endif %} {# Stats row #} {% if not error %}
- {{ tableName }} - {{ (desc.TableStatus ?? 'UNKNOWN')|lower }} - ~{{ (desc.ItemCount ?? 0)|number_format }} items - showing {{ count }} of {{ scannedCount }} scanned + {{ tableName }} + {{ (desc.TableStatus ?? 'UNKNOWN')|lower }} + ~{{ (desc.ItemCount ?? 0)|number_format }} items + showing {{ count }} of {{ scannedCount }} scanned
{% endif %} {# Main data card #}
-
-
Rows
-
- - -
-
+
+
Rows
+
+ + +
+
- {% if items is empty %} -
- -
No items found
-
This table is empty.
-
- {% else %} -
- - - - - {% for col in columns %} - - {% endfor %} - - - - {% for item in items %} - {% set itemKey = {} %} - {% if keySchema.HASH is defined %} - {% set itemKey = itemKey|merge({(keySchema.HASH.name): item[keySchema.HASH.name]}) %} - {% endif %} - {% if keySchema.RANGE is defined %} - {% set itemKey = itemKey|merge({(keySchema.RANGE.name): item[keySchema.RANGE.name]}) %} - {% endif %} - - - {% for col in columns %} - - {% endfor %} - - {% endfor %} - -
Actions - {{ col }} - {% if keySchema.HASH is defined and keySchema.HASH.name == col %} - PK - {% endif %} - {% if keySchema.RANGE is defined and keySchema.RANGE.name == col %} - SK - {% endif %} -
- - - - - - {% if item[col] is defined %} - {% set val = item[col] %} - {% if val is iterable %} - - {{ val|json_encode|slice(0, 40) }}{% if val|json_encode|length > 40 %}…{% endif %} - - {% else %} - {{ val|e|slice(0, 60) }}{% if (val|e|length) > 60 %}…{% endif %} - {% endif %} - {% else %} - NULL - {% endif %} -
-
+ {% if items is empty %} +
+ +
No items found
+
This table is empty.
+
+ {% else %} +
+ + + + + {% for col in columns %} + + {% endfor %} + + + + {% for item in items %} + {% set itemKey = {} %} + {% if keySchema.HASH is defined %} + {% set itemKey = itemKey|merge({(keySchema.HASH.name): item[keySchema.HASH.name]}) %} + {% endif %} + {% if keySchema.RANGE is defined %} + {% set itemKey = itemKey|merge({(keySchema.RANGE.name): item[keySchema.RANGE.name]}) %} + {% endif %} + + + {% for col in columns %} + + {% endfor %} + + {% endfor %} + +
Actions + {{ col }} + {% if keySchema.HASH is defined and keySchema.HASH.name == col %} + PK + {% endif %} + {% if keySchema.RANGE is defined and keySchema.RANGE.name == col %} + SK + {% endif %} +
+ + + + + + {% if item[col] is defined %} + {% set val = item[col] %} + {% if val is iterable %} + + {{ val|json_encode|slice(0, 40) }}{% if val|json_encode|length > 40 %}…{% endif %} + + {% else %} + {% set valStr = val is iterable ? val|json_encode : val|e %} + {{ valStr|slice(0, 60) }}{% if valStr|length > 60 %}…{% endif %} + {% endif %} + {% else %} + NULL + {% endif %} +
+
- {# Pagination #} -
-
- Showing {{ count }} item{{ count != 1 ? 's' : '' }} -
-
- {% if prevKeys is not empty %} - {% set prevStack = prevKeys[0:(prevKeys|length - 1)] %} - {% set prevLastKey = prevKeys|last %} - - Prev - - {% endif %} + {# Pagination #} +
+
+ Showing {{ count }} item{{ count != 1 ? 's' : '' }} +
+
+ {% if prevKeys is not empty %} + {% set prevStack = prevKeys[0:(prevKeys|length - 1)] %} + {% set prevLastKey = prevKeys|last %} + + Prev + + {% endif %} - {% if nextKey %} - {% set newPrevKeys = prevKeys %} - {% if currentKey %} - {% set newPrevKeys = newPrevKeys|merge([currentKey]) %} - {% else %} - {# first page, push empty marker #} - {% set newPrevKeys = newPrevKeys|merge(['null']) %} - {% endif %} - - Next - - {% endif %} -
-
- {% endif %} + {% if nextKey %} + {% set newPrevKeys = prevKeys %} + {% if currentKey %} + {% set newPrevKeys = newPrevKeys|merge([currentKey]) %} + {% else %} + {# first page, push empty marker #} + {% set newPrevKeys = newPrevKeys|merge(['']) %} + {% endif %} + + Next + + {% endif %} +
+
+ {% endif %} - {# Delete item modal #} -
-
-
- Delete Item -
-

This will permanently delete the item with key:

-

-            
- -
- - -
-
-
-
+ {# Delete item modal #} +
+
+
+ Delete Item +
+

This will permanently delete the item with key:

+

+			
+ +
+ + +
+
+
+
{# Drop Table modal #}
-
-
-
- Drop Table -
-

- Are you sure you want to drop {{ tableName }}? This action is irreversible and will delete all data. -

-
- -
- -
-
-
-
+
+
+
+ Drop Table +
+

+ Are you sure you want to drop {{ tableName }}? This action is irreversible and will delete all data. +

+
+ +
+ +
+
+
+
{% endblock %} @@ -216,25 +218,25 @@ {% block scripts %} {% endblock %} diff --git a/templates/table/item_form.html.twig b/templates/table/item_form.html.twig index 94262ba..488c24c 100644 --- a/templates/table/item_form.html.twig +++ b/templates/table/item_form.html.twig @@ -112,7 +112,7 @@