tweax
This commit is contained in:
33
.env
33
.env
@@ -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
|
|
||||||
@@ -15,10 +15,10 @@ class DynamoService
|
|||||||
$this->client = new DynamoDbClient([
|
$this->client = new DynamoDbClient([
|
||||||
'region' => $_ENV['DYNAMO_REGION'] ?? 'us-east-1',
|
'region' => $_ENV['DYNAMO_REGION'] ?? 'us-east-1',
|
||||||
'version' => 'latest',
|
'version' => 'latest',
|
||||||
'endpoint' => $_ENV['DYNAMO_ENDPOINT'] ?? 'http://127.0.0.1:8002',
|
'endpoint' => $_ENV['DYNAMO_ENDPOINT'] ?? 'https://jormun-write-through-dev.vultrlabs.dev',
|
||||||
'credentials' => [
|
'credentials' => [
|
||||||
'key' => $_ENV['DYNAMO_KEY'] ?? 'AKIAIOSFODNN7EXAMPLE',
|
'key' => $_ENV['DYNAMO_KEY'],
|
||||||
'secret' => $_ENV['DYNAMO_SECRET'] ?? 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
|
'secret' => $_ENV['DYNAMO_SECRET'],
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@
|
|||||||
<div class="d-flex align-items-center gap-2">
|
<div class="d-flex align-items-center gap-2">
|
||||||
<label style="font-size:0.72rem;color:#64748b;">Rows per page</label>
|
<label style="font-size:0.72rem;color:#64748b;">Rows per page</label>
|
||||||
<select class="jormun-select" onchange="changeLimit(this.value)" style="width:auto;">
|
<select class="jormun-select" onchange="changeLimit(this.value)" style="width:auto;">
|
||||||
|
{% set limit = limit is defined ? limit : 25 %}
|
||||||
{% for l in [10, 25, 50, 100] %}
|
{% for l in [10, 25, 50, 100] %}
|
||||||
<option value="{{ l }}" {% if l == limit %}selected{% endif %}>{{ l }}</option>
|
<option value="{{ l }}" {% if l == limit %}selected{% endif %}>{{ l }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -117,15 +118,16 @@
|
|||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
{% for col in columns %}
|
{% for col in columns %}
|
||||||
<td class="{% if keySchema.HASH is defined and keySchema.HASH.name == col %}pk-cell{% endif %} cell-value" title="{{ item[col] is defined ? item[col]|json_encode : 'null' }}">
|
<td class="{% if keySchema.HASH is defined and keySchema.HASH.name == col %}pk-cell{% endif %} cell-value" title="{{ item[col] is defined ? item[col]|json_encode|e('html_attr') : 'null' }}">
|
||||||
{% if item[col] is defined %}
|
{% if item[col] is defined %}
|
||||||
{% set val = item[col] %}
|
{% set val = item[col] %}
|
||||||
{% if val is iterable %}
|
{% if val is iterable %}
|
||||||
<span style="color:#6366f1;" title="{{ val|json_encode }}">
|
<span style="color:#6366f1;" title="{{ val|json_encode|e('html_attr') }}">
|
||||||
<i class="bi bi-braces"></i> {{ val|json_encode|slice(0, 40) }}{% if val|json_encode|length > 40 %}…{% endif %}
|
<i class="bi bi-braces"></i> {{ val|json_encode|slice(0, 40) }}{% if val|json_encode|length > 40 %}…{% endif %}
|
||||||
</span>
|
</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ val|e|slice(0, 60) }}{% if (val|e|length) > 60 %}…{% endif %}
|
{% set valStr = val is iterable ? val|json_encode : val|e %}
|
||||||
|
{{ valStr|slice(0, 60) }}{% if valStr|length > 60 %}…{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="null-val">NULL</span>
|
<span class="null-val">NULL</span>
|
||||||
@@ -158,7 +160,7 @@
|
|||||||
{% set newPrevKeys = newPrevKeys|merge([currentKey]) %}
|
{% set newPrevKeys = newPrevKeys|merge([currentKey]) %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{# first page, push empty marker #}
|
{# first page, push empty marker #}
|
||||||
{% set newPrevKeys = newPrevKeys|merge(['null']) %}
|
{% set newPrevKeys = newPrevKeys|merge(['']) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{{ path('table_browse', {name: tableName, lastKey: nextKey, prevKeys: newPrevKeys|json_encode, limit: limit}) }}" class="btn-jormun">
|
<a href="{{ path('table_browse', {name: tableName, lastKey: nextKey, prevKeys: newPrevKeys|json_encode, limit: limit}) }}" class="btn-jormun">
|
||||||
Next <i class="bi bi-chevron-right"></i>
|
Next <i class="bi bi-chevron-right"></i>
|
||||||
|
|||||||
@@ -112,7 +112,7 @@
|
|||||||
<script>
|
<script>
|
||||||
document.addEventListener('alpine:init', () => {
|
document.addEventListener('alpine:init', () => {
|
||||||
Alpine.data('itemForm', () => ({
|
Alpine.data('itemForm', () => ({
|
||||||
jsonText: JSON.stringify({{ item ? item|json_encode|raw : '{}' }}, null, 2),
|
jsonText: JSON.stringify(JSON.parse({{ (item is not empty) ? item|json_encode : '{}' }}), null, 2),
|
||||||
jsonError: '',
|
jsonError: '',
|
||||||
validateJson() {
|
validateJson() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user