Compare commits
No commits in common. "console" and "master" have entirely different histories.
@ -1,7 +0,0 @@
|
|||||||
class ApiConsole {
|
|
||||||
constructor(options) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -9,6 +9,14 @@ use Picea\Extension\UrlExtension;
|
|||||||
|
|
||||||
class RouteDescriptor
|
class RouteDescriptor
|
||||||
{
|
{
|
||||||
|
public string $routeLine = <<<HTML
|
||||||
|
<li>
|
||||||
|
<span><a href='%s' title="%s" style='font-family:monospace;font-size:.85em'>%s</a> - %s</span>
|
||||||
|
<span style='color:#ac1b1b'>%s</span>
|
||||||
|
<small style="color:#374300">%s</small>
|
||||||
|
</li>
|
||||||
|
HTML;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public object $controller,
|
public object $controller,
|
||||||
protected UrlExtension $urlExtension,
|
protected UrlExtension $urlExtension,
|
||||||
@ -37,7 +45,7 @@ class RouteDescriptor
|
|||||||
'path' => $base.$path,
|
'path' => $base.$path,
|
||||||
'cleaned' => $cleaned,
|
'cleaned' => $cleaned,
|
||||||
'description'=> $route->description,
|
'description'=> $route->description,
|
||||||
'methods' => $route->method,
|
'methods' =>implode(', ', (array)$route->method),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,31 +1,9 @@
|
|||||||
{% function printMethods(array|string $methods) %}
|
|
||||||
{% foreach (array) $methods as $method %}
|
|
||||||
<a style="color:#ac1b1b" href="#" class="method-item" data-method="{{ $method }}">{{ $method }}</a>
|
|
||||||
{% endforeach %}
|
|
||||||
{% endfunction %}
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{% foreach $routes as $route %}
|
{% foreach $routes as $route %}
|
||||||
<li>
|
<li>
|
||||||
<span><a href="{{ $route['route'] }}" title="{{ $route['path'] }}" style='font-family:monospace;font-size:.85em'>{{ $route['cleaned'] }}</a> - {{= $route['description'] }}</span>
|
<span><a href="{{ $route['route'] }}" title="{{ $route['path'] }}" style='font-family:monospace;font-size:.85em'>{{ $route['cleaned'] }}</a> - {{= $route['description'] }}</span>
|
||||||
<span>{{ printMethods($route['methods']) }}</span>
|
<span style='color:#ac1b1b'>{{ $route['methods'] }}</span>
|
||||||
<small style="color:#374300">{{ $route['name'] }}</small>
|
<small style="color:#374300">{{ $route['name'] }}</small>
|
||||||
</li>
|
</li>
|
||||||
{% endforeach %}
|
{% endforeach %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="api-console">
|
|
||||||
<label>Corps / body (JSON)</label>
|
|
||||||
<ui-textarea name="breeder_description">
|
|
||||||
<div slot="input">
|
|
||||||
{% ui:textarea "body" %}
|
|
||||||
</div>
|
|
||||||
</ui-textarea>
|
|
||||||
<div></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
document.querySelectorAll('[data-method]').forEach((e) => {
|
|
||||||
|
|
||||||
});
|
|
||||||
</script>
|
|
@ -31,8 +31,6 @@
|
|||||||
ol .title { display: flex;justify-content: space-between;background: #ffffffb2;padding: 9px 5px;border: 1px solid #fff;}
|
ol .title { display: flex;justify-content: space-between;background: #ffffffb2;padding: 9px 5px;border: 1px solid #fff;}
|
||||||
.field-desc > div {padding:5px;}
|
.field-desc > div {padding:5px;}
|
||||||
|
|
||||||
.api-console {padding:20px 15px;border:1px solid #aeaeae;border-left-width: 5px;background:#ccc}
|
|
||||||
|
|
||||||
.forms ol {background: #ccdef2;}
|
.forms ol {background: #ccdef2;}
|
||||||
.forms li {border-color: #859aae;}
|
.forms li {border-color: #859aae;}
|
||||||
.forms .form-name {background: #9cc5e6;color: #284168;font-size:110%}
|
.forms .form-name {background: #9cc5e6;color: #284168;font-size:110%}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user