- Update on database migration

This commit is contained in:
mcndave committed 2023-08-29 20:28:45 +00:00
1 parent 5035a65672
commit d133ac662e
17 files changed
+174 -33

No files matched your search

@@ -26,4 +26,10 @@
<ul>
<li><a href="{% route 'lean.console:caching' %}">{% lang "lean.nav.templating.picea" %}</a></li>
</ul>
<label>{% lang "lean.nav.debugging.label" %}</label>
<ul>
<li><a href="{% route 'lean.console:debugging-logs' %}">{% lang "lean.nav.debugging.logs" %}</a></li>
</ul>
</nav>
+11 -3
View File
@@ -13,16 +13,24 @@
<section>
<header>
<h1>{{ $path }}</h1>
{% ui.form.post "caching.picea" %}
{% ui:form.post "caching.picea" %}
<button class="btn-red" type="submit">{% _ 'clear' %}</button>
{% ui.endform %}
{% ui:endform %}
</header>
<article class="picea">
{% foreach $folder as $file %}
{% php $import = include($file) %}
<div class="grid">
<strong class="col route-name">{{ substr($file, strlen($path)) }}</strong>
<div>
<div class="col">
{{ $import['namespace'] }}
</div>
<div class="col">
{{ $import['view'] }}
</div>
</div>
{% endforeach %}
@@ -0,0 +1,36 @@
{% extends "lean-console/base/layout" %}
{% language.set "lean.caching" %}
{% title _("title") %}
{% section "header" %}
<div class="page-title">{% _ "page-title" %}</div>
{% endsection %}
{% section "content" %}
<section>
<header>
<h1>{{ $path }}</h1>
{% ui:form.get current_url() %}
{% ui:select 'logfile', array_combine($files, $files), get('file') ?? $open %}
{% ui:endform %}
</header>
<article class="logs">
<div class="log-item">
{% foreach array_reverse($content) as $line %}
<div class="line">{{ $line }}</div>
{% endforeach %}
</div>
</article>
</section>
<style>
section > header {display:flex;justify-content: space-between}
.log-item {max-height: 60vh; overflow-y:auto}
.log-item .line {padding:0.5rem}
.log-item .line {background: #efefef}
.log-item .line:nth-child(even) {background: #ccc}
</style>
{% endsection %}
@@ -40,14 +40,14 @@
<div class="col text-right">{% _ 'database.table.actions' %}</div>
</strong>
{% ui.form.post "database" %}
{% ui:form.post "database" %}
{% foreach array_filter($migrations->entities, fn($e) => $e->databaseAdapter() === $connection) as $entity => $item %}
<div class="grid table-item align-items-center">
<div class="col"><span>📄</span> <span>{{ $item->tableName() }}</span></div>
<div class="col">{% _ "database.table.fields", [ 'count' => count( $item->fieldList() ) ] %}</div>
<div class="col col-grow-2">
{% if $context->definition[$entity]['table']->modifier->query %}
<code>{{ $context->definition[$entity]['table']->modifier->query }}</code>
<code>{{= implode('<br><br>',(array) $context->definition[$entity]['table']->modifier->query) }}</code>
{% else %}
<div>🗸 This table is up-to-date</div>
{% endif %}
@@ -86,7 +86,7 @@
<button name="alterAll" value="{{ implode(',', $alterAll) }}" class="btn-red">🗸 {% _ 'database.table.alterAll' %}</button>
</div>
{% endif %}
{% ui.endform %}
{% ui:endform %}
</div>
</article>
</section>
@@ -10,7 +10,7 @@
{% section "content" %}
{% if $connections %}
{% ui.form.post "database.import" %}
{% ui:form.post "database.import" %}
<section>
<header>Import data from a connection into another</header>
@@ -19,15 +19,15 @@
{% php $select = array_combine(array_column($connections, 'name'), array_column($connections, 'name')) %}
<div class="db-grid">
Source connection: {% ui.select "source", $select %}
Source connection: {% ui:select "source", $select %}
</div>
<div class="db-grid">
Destination connection: {% ui.select "destination", $select %}
Destination connection: {% ui:select "destination", $select %}
</div>
{% else %}
{% ui.hidden 'source', $context->source %}
{% ui.hidden 'destination', $context->destination %}
{% ui:hidden 'source', $context->source %}
{% ui:hidden 'destination', $context->destination %}
<div class="db-grid">
COPY DATA FROM → TO:
@@ -35,7 +35,7 @@
{% foreach $dest as $key => $value %}
<div class="db-grid">
<span>{% ui.select "copy[$key]", [ null => '' ] + $context->sourceTables->buildArray('entityClass', 'entityClass') %}</span>
<span>{% ui:select "copy[$key]", [ null => '' ] + $context->sourceTables->buildArray('entityClass', 'entityClass') %}</span>
<span>→</span>
<span>{{ sprintf('%s (%s)', $key, $value->tableName()) }}</span>
</div>
@@ -49,7 +49,7 @@
<a href="{% route 'lean.console:storage.database' %}" class="btn-red">Cancel</a>
</footer>
</section>
{% ui.endform %}
{% ui:endform %}
{% else %}
No connection found
{% endif %}