Compare commits
No commits in common. "master" and "v1.0.0" have entirely different histories.
@ -36,23 +36,19 @@ summary {cursor:pointer;}
|
|||||||
#body-footer {background: #fff;color: #333;height: 30px;line-height: 30px;font-size: 0.8rem;padding: 0 0.5rem;text-align: right;border-top:1px solid #ebedee;}
|
#body-footer {background: #fff;color: #333;height: 30px;line-height: 30px;font-size: 0.8rem;padding: 0 0.5rem;text-align: right;border-top:1px solid #ebedee;}
|
||||||
|
|
||||||
/* Sidebar */
|
/* Sidebar */
|
||||||
#main-nav {background:#373737;width:240px;color:#fff;font-family:consolas, courier new, monospace;font-size:0.9rem;position:fixed;top:0;bottom:0;overflow-y:scroll;padding-bottom:2rem;border-right: 2px solid #333;}
|
#main-nav {background:#242528;width:240px;color:#fff;font-family:consolas, courier new, monospace;font-size:0.9rem;position:fixed;top:0;bottom:0;overflow-y:scroll;padding-bottom:2rem;border-right: 2px solid #333;}
|
||||||
#main-nav .app-title {font-size:1.3rem; text-align:center;padding:1.8rem 0}
|
#main-nav .app-title {font-size:1.3rem; text-align:center;padding:1.8rem 0}
|
||||||
#main-nav .app-title:before {content:"🔳"; margin-right:10px}
|
#main-nav .app-title:before {content:"🔳"; margin-right:10px}
|
||||||
#main-nav label {color: #a4a4a4;text-transform:uppercase ; display:block;padding:0.8rem 1rem;font-size:1.15em;}
|
#main-nav label {color: #a4a4a4;text-transform:uppercase ; display:block;padding:0.8rem 1rem;font-size:1.15em;}
|
||||||
#main-nav label:before {content:"⊙"; margin-right:10px}
|
#main-nav label:before {content:"⊙"; margin-right:10px}
|
||||||
#main-nav a {color: #efecec;text-decoration:none;display:block;padding:0 1rem 0 2rem;transition:all 0.3s ease;line-height:2.5em;font-size:0.9em}
|
#main-nav a {color: #efecec;text-decoration:none;display:block;padding:0 1rem 0 2rem;transition:all 0.3s ease;line-height:3em;font-size:0.9em}
|
||||||
#main-nav a:before {content:"›"; margin-right:10px;}
|
#main-nav a:before {content:"›"; margin-right:10px;line-height:3em}
|
||||||
#main-nav a:hover {background:rgba(255,255,255,0.1)}
|
#main-nav a:hover {background:rgba(255,255,255,0.1)}
|
||||||
|
|
||||||
/* Main content */
|
/* Main content */
|
||||||
#main-content {padding:4vh 2vw;width:100%;margin-left:auto;}
|
#main-content {padding:4vh 2vw;width:100%;margin-left:auto;}
|
||||||
#main-content section {border-radius:0.3rem;box-shadow: 0 1px 2px rgba(56,65,74,.15);display: flex;flex-direction: column;}
|
#main-content section {border-radius:0.3rem;box-shadow: 0 1px 2px rgba(56,65,74,.15)}
|
||||||
#main-content section article {border-radius:0.3rem;font-family: Courier New , Courier, monospace;font-size: 0.8em;background:#fff;padding:1.5rem;border: 1px solid #00000029;}
|
#main-content section article {border-radius:0.3rem;font-family: Courier New , Courier, monospace;font-size: 0.8em;background:#fff;padding:1.5rem;}
|
||||||
#main-content section header + article {border-top:0;border-top-left-radius: unset;border-top-right-radius: unset}
|
#main-content section header {border-top-left:0.3rem;border-top-right:4px;background:#fff;padding:1rem 1rem;font-size:1.2em;color: #4b4848;border-bottom:1px solid #e9ebec;display:flex;align-items:center}
|
||||||
#main-content section header:has(+ article) {border: 1px solid #00000029;border-bottom:0}
|
#main-content section footer {border-bottom-left:0.3rem;border-bottom-right:0.3rem;background:#f9f9f9;padding:2vh 1vw;}
|
||||||
#main-content section header {border-top-left-radius:0.3rem;border-top-right-radius:0.3rem;background:#373737;padding:1rem 1rem;font-size:1.2em;color: #fff;border-bottom:1px solid #7b7b7b;display:flex;align-items:center}
|
|
||||||
#main-content section article:has(+ footer) {border-bottom-left-radius:unset;border-bottom-right-radius:unset;border-bottom:0}
|
|
||||||
#main-content section footer {border-bottom-left-radius:0.3rem;border-bottom-right-radius:0.3rem;background:#f9f9f9;padding:1.5vh 1vw;line-height:1.5vh}
|
|
||||||
#main-content section article + footer {border: 1px solid #00000029;border-top:0}
|
|
||||||
#main-content section article [class*="col-"] {overflow-x:auto}
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Lean\Console\Cli;
|
namespace Lean\Console\Cli;
|
||||||
|
|
||||||
use Mcnd\CLI\OptionValueTypeEnum;
|
|
||||||
use Notes\CLI\Attribute\{Option, Command};
|
use Notes\CLI\Attribute\{Option, Command};
|
||||||
use Psr\Http\Message\{ServerRequestInterface, ResponseInterface};
|
use Psr\Http\Message\{ServerRequestInterface, ResponseInterface};
|
||||||
|
|
||||||
@ -22,10 +21,10 @@ use Lean\Console\{Lib, };
|
|||||||
Try #[color:gray, bg: black]'lean console --help'[#] for more information.
|
Try #[color:gray, bg: black]'lean console --help'[#] for more information.
|
||||||
CLI
|
CLI
|
||||||
, command: 'console')]
|
, command: 'console')]
|
||||||
#[Option(switch: ['-h', '--help'], description: "Display help for the given command. When no command is given display help for the list command")]
|
#[Option(toggle: ['-h', '--help'], description: "Display help for the given command. When no command is given display help for the list command")]
|
||||||
#[Option(switch: ['-q', '--quiet'], description: "Do not output any message")]
|
#[Option(toggle: ['-q', '--quiet'], description: "Do not output any message")]
|
||||||
#[Option(switch: ['-n', '--no-interaction'], description: "Run script without user interaction")]
|
#[Option(toggle: ['-n', '--no-interaction'], description: "Run script without user interaction")]
|
||||||
#[Option(switch: ['-v', '-vv', '-vvv', '--verbose'], description: "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug", value: OptionValueTypeEnum::OptionalValue)]
|
#[Option(toggle: ['-v', '-vv', '-vvv', '--verbose'], description: "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug", argument: Option::ARGUMENT_OPTIONAL)]
|
||||||
class Console
|
class Console
|
||||||
{
|
{
|
||||||
use Lib\ConsoleControllerTrait;
|
use Lib\ConsoleControllerTrait;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Lean\Console\Cli;
|
namespace Lean\Console\Cli;
|
||||||
|
|
||||||
use Mcnd\CLI\OptionValueTypeEnum;
|
|
||||||
use Notes\CLI\Attribute\{Option, Command};
|
use Notes\CLI\Attribute\{Option, Command};
|
||||||
use Psr\Http\Message\{ServerRequestInterface, ResponseInterface};
|
use Psr\Http\Message\{ServerRequestInterface, ResponseInterface};
|
||||||
|
|
||||||
@ -23,16 +22,16 @@ use Lean\Console\{Lib, };
|
|||||||
Try #[color:gray, bg: black]'lean console storage --help'[#] for more information.
|
Try #[color:gray, bg: black]'lean console storage --help'[#] for more information.
|
||||||
CLI
|
CLI
|
||||||
, command: 'console storage')]
|
, command: 'console storage')]
|
||||||
#[Option(switch: ['-h', '--help'], description: "Display help for the given command. When no command is given display help for the list command")]
|
#[Option(toggle: ['-h', '--help'], description: "Display help for the given command. When no command is given display help for the list command")]
|
||||||
#[Option(switch: ['-q', '--quiet'], description: "Do not output any message")]
|
#[Option(toggle: ['-q', '--quiet'], description: "Do not output any message")]
|
||||||
#[Option(switch: ['-n', '--no-interaction'], description: "Run script without user interaction")]
|
#[Option(toggle: ['-n', '--no-interaction'], description: "Run script without user interaction")]
|
||||||
#[Option(switch: ['-v', '-vv', '-vvv', '--verbose'], description: "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug", value: OptionValueTypeEnum::OptionalValue)]
|
#[Option(toggle: ['-v', '-vv', '-vvv', '--verbose'], description: "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug", argument: Option::ARGUMENT_OPTIONAL)]
|
||||||
class Storage
|
class Storage
|
||||||
{
|
{
|
||||||
use Lib\ConsoleControllerTrait;
|
use Lib\ConsoleControllerTrait;
|
||||||
|
|
||||||
#[Command(description: "Generate entities based on an existing connection", command: "entity:generate")]
|
#[Command(description: "Generate entities based on an existing connection", command: "entity:generate")]
|
||||||
#[Option(switch: ['-l', '--list'], description: "")]
|
#[Option(toggle: ['-l', '--list'], description: "")]
|
||||||
public function generate_entity(ServerRequestInterface $request, array $arguments): ResponseInterface
|
public function generate_entity(ServerRequestInterface $request, array $arguments): ResponseInterface
|
||||||
{
|
{
|
||||||
dump($arguments);
|
dump($arguments);
|
||||||
|
@ -27,7 +27,6 @@ class Console {
|
|||||||
|
|
||||||
$status = iterator_to_array($git->run("/usr/bin/git status -s"));
|
$status = iterator_to_array($git->run("/usr/bin/git status -s"));
|
||||||
$diff = iterator_to_array($git->run("/usr/bin/git diff"));
|
$diff = iterator_to_array($git->run("/usr/bin/git diff"));
|
||||||
$lastUpdate = iterator_to_array($git->run("/usr/bin/git show --no-patch --format=%ci"))[0] ?? null;
|
|
||||||
|
|
||||||
return $this->renderView("lean-console/page/update/index", get_defined_vars());
|
return $this->renderView("lean-console/page/update/index", get_defined_vars());
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ use Picea\Compiler\Context;
|
|||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Ulmus\Common\EntityResolver;
|
use Ulmus\Common\EntityResolver;
|
||||||
use \Ulmus\Entity\InformationSchema\Table;
|
use \Ulmus\Entity\InformationSchema\Table;
|
||||||
use Ulmus\Ulmus;
|
|
||||||
|
|
||||||
class Migrate implements FormInterface
|
class Migrate implements FormInterface
|
||||||
{
|
{
|
||||||
@ -48,11 +47,6 @@ class Migrate implements FormInterface
|
|||||||
$this->definition[$entity]['columns'] = new Lib\Database\DefinitionCollection();
|
$this->definition[$entity]['columns'] = new Lib\Database\DefinitionCollection();
|
||||||
|
|
||||||
foreach($table->fieldList(EntityResolver::KEY_COLUMN_NAME, true) as $field => $definition) {
|
foreach($table->fieldList(EntityResolver::KEY_COLUMN_NAME, true) as $field => $definition) {
|
||||||
|
|
||||||
if ( isset($definition->value) ) {
|
|
||||||
$definition->value = $entity::repository()->adapter->adapter()->writableValue($definition->value);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->definition[$entity]['columns'][$field] = $def = new Lib\Database\Definition(
|
$this->definition[$entity]['columns'][$field] = $def = new Lib\Database\Definition(
|
||||||
entity: $entity,
|
entity: $entity,
|
||||||
field: $field,
|
field: $field,
|
||||||
@ -66,12 +60,17 @@ class Migrate implements FormInterface
|
|||||||
# Column do not exists
|
# Column do not exists
|
||||||
if ( $column === null ) {
|
if ( $column === null ) {
|
||||||
$def->action = "add";
|
$def->action = "add";
|
||||||
|
|
||||||
|
$def->modifier = new Lib\Database\Modifier(
|
||||||
|
type: Lib\Database\ModifierTypeEnum::Alter,
|
||||||
|
query: $entity::repository()
|
||||||
|
->alterSqlQuery([ $def->toArray() ])
|
||||||
|
->getSqlQuery(true)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
elseif ( ! $column->matchFieldDefinition($definition) ) {
|
elseif ( ! $column->matchFieldDefinition($definition) ) {
|
||||||
$def->action = "change";
|
$def->action = "change";
|
||||||
}
|
|
||||||
|
|
||||||
if ($def->action) {
|
|
||||||
$def->modifier = new Lib\Database\Modifier(
|
$def->modifier = new Lib\Database\Modifier(
|
||||||
type: Lib\Database\ModifierTypeEnum::Alter,
|
type: Lib\Database\ModifierTypeEnum::Alter,
|
||||||
query: $entity::repository()
|
query: $entity::repository()
|
||||||
@ -81,6 +80,7 @@ class Migrate implements FormInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ALTER TABLE `ajustements` CHANGE `annee` `annee` INT(11) NULL;
|
||||||
$alter = $this->definition[$entity]['columns']->filterAlter();
|
$alter = $this->definition[$entity]['columns']->filterAlter();
|
||||||
|
|
||||||
if ( $alter->count() ) {
|
if ( $alter->count() ) {
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Lean\Console\Lib;
|
namespace Lean\Console\Lib;
|
||||||
|
|
||||||
use DI\Attribute\Inject;
|
|
||||||
use Notes\Attribute\Ignore;
|
use Notes\Attribute\Ignore;
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface;
|
||||||
|
|
||||||
@ -21,7 +20,6 @@ trait ConsoleControllerTrait
|
|||||||
{
|
{
|
||||||
use \Lean\ControllerTrait;
|
use \Lean\ControllerTrait;
|
||||||
|
|
||||||
#[Inject]
|
|
||||||
protected ContainerInterface $container;
|
protected ContainerInterface $container;
|
||||||
|
|
||||||
#[Ignore]
|
#[Ignore]
|
||||||
|
@ -37,4 +37,3 @@
|
|||||||
<li><a href="{% route 'lean.console:debugging-phpinfo' %}">{% lang "lean.nav.debugging.phpinfo" %}</a></li>
|
<li><a href="{% route 'lean.console:debugging-phpinfo' %}">{% lang "lean.nav.debugging.phpinfo" %}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<hr>
|
|
@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
{% function routeHtml($route) %}
|
{% function routeHtml($route) %}
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<strong class="col-2 route-name">{{ $route->name }}</strong>
|
<strong class="col route-name">{{ $route->name }}</strong>
|
||||||
<div class="col-3 route-uri">{{ $route->getRoute() }}</div>
|
<div class="col route-uri">{{ $route->getRoute() }}</div>
|
||||||
<div class="col-2 route-methods">{{ implode(', ', (array) ( $route->method ?? $route->methods )) }}</div>
|
<div class="col route-methods">{{ implode(', ', (array) ( $route->method ?? $route->methods )) }}</div>
|
||||||
<div class="col controller-method">
|
<div class="col controller-method">
|
||||||
<span class="class">{{ $route->class }}</span>::<span>{{ $route->classMethod }}</span>
|
<span class="class">{{ $route->class }}</span>::<span>{{ $route->classMethod }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -28,9 +28,9 @@
|
|||||||
<article class="routes">
|
<article class="routes">
|
||||||
{% if $routes %}
|
{% if $routes %}
|
||||||
<strong class="grid">
|
<strong class="grid">
|
||||||
<div class="col-2 route-name">{% _ 'route.name' %}</div>
|
<div class="col route-name">{% _ 'route.name' %}</div>
|
||||||
<div class="col-3 route-uri">{% _ 'route.uri' %}</div>
|
<div class="col route-uri">{% _ 'route.uri' %}</div>
|
||||||
<div class="col-2 route-methods">{% _ 'route.methods' %}</div>
|
<div class="col route-methods">{% _ 'route.methods' %}</div>
|
||||||
<div class="col controller-method">{% _ 'route.target' %}</div>
|
<div class="col controller-method">{% _ 'route.target' %}</div>
|
||||||
</strong>
|
</strong>
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
{% endsection %}
|
{% endsection %}
|
||||||
|
|
||||||
{% section "content" %}
|
{% section "content" %}
|
||||||
|
|
||||||
{% if $connections %}
|
{% if $connections %}
|
||||||
{% foreach $connections as $connection %}
|
{% foreach $connections as $connection %}
|
||||||
<section>
|
<section>
|
||||||
@ -94,7 +95,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.databases strong.grid {background: #888a91;color:#fff}
|
.databases strong.grid {background: #242528;color:#fff}
|
||||||
|
|
||||||
.databases .db-grid {padding:0.66rem 0.3rem}
|
.databases .db-grid {padding:0.66rem 0.3rem}
|
||||||
.databases .db-grid strong {color:#444}
|
.databases .db-grid strong {color:#444}
|
||||||
|
@ -4,30 +4,6 @@
|
|||||||
|
|
||||||
{% title _("title") %}
|
{% title _("title") %}
|
||||||
|
|
||||||
|
|
||||||
{% function setStatusModifierClass($line) : string %}
|
|
||||||
{% return match(substr($line, 0, 2)) {
|
|
||||||
'??' => "action-add",
|
|
||||||
default => false,
|
|
||||||
} ?: match(substr($line, 0, 1)) {
|
|
||||||
'M' => "action-delete",
|
|
||||||
default => "",
|
|
||||||
}%}
|
|
||||||
{% endfunction %}
|
|
||||||
|
|
||||||
{% function setDiffModifierClass($line) : string %}
|
|
||||||
{% return match(substr($line, 0, 2)) {
|
|
||||||
'--' => "action-delete",
|
|
||||||
'++' => "action-add",
|
|
||||||
'@@' => "action-group",
|
|
||||||
default => false,
|
|
||||||
} ?: match(substr($line, 0, 1)) {
|
|
||||||
'-' => "action-delete",
|
|
||||||
'+' => "action-add",
|
|
||||||
default => "",
|
|
||||||
}%}
|
|
||||||
{% endfunction %}
|
|
||||||
|
|
||||||
{% section "content" %}
|
{% section "content" %}
|
||||||
<section>
|
<section>
|
||||||
<header>
|
<header>
|
||||||
@ -40,7 +16,7 @@
|
|||||||
|
|
||||||
<code style="white-space:normal;font-size:120%">
|
<code style="white-space:normal;font-size:120%">
|
||||||
{% foreach $status as $line %}
|
{% foreach $status as $line %}
|
||||||
<div class="{{ setStatusModifierClass($line) }}">
|
<div>
|
||||||
{% if $line %}
|
{% if $line %}
|
||||||
{{ $line }}
|
{{ $line }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -54,7 +30,7 @@
|
|||||||
|
|
||||||
<code style="white-space:normal;font-size:120%">
|
<code style="white-space:normal;font-size:120%">
|
||||||
{% foreach $diff as $line %}
|
{% foreach $diff as $line %}
|
||||||
<div class="{{ setDiffModifierClass($line) }}">
|
<div>
|
||||||
{% if $line %}
|
{% if $line %}
|
||||||
{{ $line }}
|
{{ $line }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -63,14 +39,5 @@
|
|||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
<footer>
|
|
||||||
{{ $lastUpdate }}
|
|
||||||
</footer>
|
|
||||||
</section>
|
</section>
|
||||||
{% endsection %}
|
{% endsection %}
|
||||||
|
|
||||||
<style>
|
|
||||||
.action-delete {color:#f88}
|
|
||||||
.action-add {color: #88ff8a}
|
|
||||||
.action-group {color:#88bcff}
|
|
||||||
</style>
|
|
Loading…
x
Reference in New Issue
Block a user