Skip to content

Commit

Permalink
Merge pull request #42 from iRaziul/main
Browse files Browse the repository at this point in the history
use @svg directive to load icons
  • Loading branch information
bezhanSalleh authored Jan 9, 2024
2 parents 01f819c + e792fc7 commit 295d04d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 59 deletions.
18 changes: 10 additions & 8 deletions resources/views/components/query-preview.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@
<div
class="flex items-center justify-start pb-2 space-x-2 text-xs font-medium leading-6 text-gray-900 dark:text-gray-50">
<div
class="flex items-center gap-x-1 rounded-lg px-2 py-1 text-xs font-medium outline-none transition duration-75 hover:bg-gray-950/5 focus:bg-gray-950/5 dark:hover:bg-white/5 dark:focus:bg-white/5 bg-gray-950/5 dark:bg-white/5 text-primary-600 dark:text-primary-400">
<x-heroicon-s-clock class="h-4 w-4 text-gray-400 dark:text-gray-500" />
class="flex items-center px-2 py-1 text-xs font-medium transition duration-75 rounded-lg outline-none gap-x-1 hover:bg-gray-950/5 focus:bg-gray-950/5 dark:hover:bg-white/5 dark:focus:bg-white/5 bg-gray-950/5 dark:bg-white/5 text-primary-600 dark:text-primary-400">
<x-filament::icon alias="fe::queryClock" class="w-4 h-4 text-gray-400 dark:text-gray-500"
icon="heroicon-s-clock" />
<span>
{{ str($query['time'])->append('MS') }}
</span>
</div>
<div
class="flex items-center gap-x-1 rounded-lg px-2 py-1 text-xs font-medium outline-none transition duration-75 hover:bg-gray-950/5 focus:bg-gray-950/5 dark:hover:bg-white/5 dark:focus:bg-white/5 bg-gray-950/5 dark:bg-white/5 text-primary-600 dark:text-primary-400">
<x-heroicon-s-circle-stack class="h-4 w-4 text-gray-400 dark:text-gray-500" />
class="flex items-center px-2 py-1 text-xs font-medium transition duration-75 rounded-lg outline-none gap-x-1 hover:bg-gray-950/5 focus:bg-gray-950/5 dark:hover:bg-white/5 dark:focus:bg-white/5 bg-gray-950/5 dark:bg-white/5 text-primary-600 dark:text-primary-400">
<x-filament::icon alias="fe::queryConnection" class="w-4 h-4 text-gray-400 dark:text-gray-500"
icon="heroicon-s-circle-stack" />
<span>
{{ str($query['connection_name'])->upper() }}
</span>
</div>
</div>
<div class="p-4 space-y-2 bg-white dark:bg-gray-900 rounded-lg">
<div class="p-4 space-y-2 bg-white rounded-lg dark:bg-gray-900">
<code class="language-sql !text-primary-600 dark:text-primary-600">
{{ $query['sql'] }}
</code>
Expand All @@ -29,13 +31,13 @@ class="flex items-center gap-x-1 rounded-lg px-2 py-1 text-xs font-medium outlin
@if (count($query['bindings']))
<div class="flex flex-row mt-2">
<div
class="w-full overflow-hidden bg-gray-50 rounded-lg dark:bg-gray-900 dark:border dark:border-gray-800">
class="w-full overflow-hidden rounded-lg bg-gray-50 dark:bg-gray-900 dark:border dark:border-gray-800">
@foreach ($query['bindings'] as $key => $value)
<div class="flex px-4 py-2">
<div class="basis-1/12 text-gray-500 dark:text-gray-400 font-mono py-2">{{ $key + 1 }}
<div class="py-2 font-mono text-gray-500 basis-1/12 dark:text-gray-400">{{ $key + 1 }}
</div>
<div
class="basis-11/12 text-gray-500 dark:text-gray-200 bg-gray-950/5 dark:bg-white/5 font-medium py-2 px-4 rounded-lg">
class="px-4 py-2 font-medium text-gray-500 rounded-lg basis-11/12 dark:text-gray-200 bg-gray-950/5 dark:bg-white/5">
{{ $value }}</div>
</div>
@endforeach
Expand Down
104 changes: 53 additions & 51 deletions resources/views/exception.blade.php
Original file line number Diff line number Diff line change
@@ -1,59 +1,61 @@
<div x-data="{ active: 0 }" class="space-y-2 ">
@foreach ($this->frames as $index => $frame)
<div x-data="{
id: {{ $index }},
get section() {
return this.active === this.id
},
set section(value) {
this.active = value ? this.id : null
}
}"
class="rounded-lg bg-gray-100 dark:text-gray-200 dark:bg-gray-800 dark:border dark:border-gray-600">
<div class="flex flex-wrap break-all">
<div x-on:click="section = !section"
class="w-full flex items-center justify-start font-semibold text-sm pr-2 rtl:pl-2 py-2">
<span x-show="section" aria-hidden="true" class="ml-4">
<x-heroicon-o-eye class="h-6 w-6 text-primary-700 dark:text-primary-500 rtl:rotate-0" />
</span>
<span x-show="!section" aria-hidden="true" class="ml-4">
<x-heroicon-o-eye-slash
class="h-6 w-6 text-primary-700 dark:text-primary-500 rtl:rotate-180 " />
</span>
<span class="px-4 py-3 font-mono text-left break-words">
{{ str($frame->file())->replace(base_path() . '/', '') }}
in {{ $frame->method() }}
at line
<span
class="inline-flex items-center justify-center ml-auto rtl:ml-0 rtl:mr-auto min-h-4 px-2 py-0.5 text-xs font-medium tracking-tight rounded-xl whitespace-normal text-primary-600 bg-primary-500/10 dark:text-primary-500">{{ $frame->line() }}</span>
</span>
<div x-data="{ active: 0 }" class="space-y-2 ">
@foreach ($this->frames as $index => $frame)
<div x-data="{
id: {{ $index }},
get section() {
return this.active === this.id
},
set section(value) {
this.active = value ? this.id : null
}
}"
class="bg-gray-100 rounded-lg dark:text-gray-200 dark:bg-gray-800 dark:border dark:border-gray-600">
<div class="flex flex-wrap break-all">
<div x-on:click="section = !section"
class="flex items-center justify-start w-full py-2 pr-2 text-sm font-semibold rtl:pl-2">
<span x-show="section" aria-hidden="true" class="ml-4">
<x-filament::icon alias="fe::sectionOpen"
class="w-6 h-6 text-primary-700 dark:text-primary-500 rtl:rotate-0" icon="heroicon-o-eye" />
</span>
<span x-show="!section" aria-hidden="true" class="ml-4">
<x-filament::icon alias="fe::sectionClose"
class="w-6 h-6 text-primary-700 dark:text-primary-500 rtl:rotate-180"
icon="heroicon-o-eye-slash" />
</span>
<span class="px-4 py-3 font-mono text-left break-words">
{{ str($frame->file())->replace(base_path() . '/', '') }}
in {{ $frame->method() }}
at line
<span
class="inline-flex items-center justify-center ml-auto rtl:ml-0 rtl:mr-auto min-h-4 px-2 py-0.5 text-xs font-medium tracking-tight rounded-xl whitespace-normal text-primary-600 bg-primary-500/10 dark:text-primary-500">{{ $frame->line() }}</span>
</span>

</div>
</div>
{{-- class="sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 font-mono break-all" --}}
<div x-show="section" x-collapse>
<div class="pb-4 px-4 dark:bg-gray-800 dark:text-200 rounded-lg">
<pre data-start="{!! $frame->getCodeBlock()->getStartLine() - 1 !!}" data-line="{!! $frame->line() - $frame->getCodeBlock()->getStartLine() + 2 !!}" class="line-numbers">
</div>
{{-- class="font-mono break-all sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6" --}}
<div x-show="section" x-collapse>
<div class="px-4 pb-4 rounded-lg dark:bg-gray-800 dark:text-200">
<pre data-start="{!! $frame->getCodeBlock()->getStartLine() - 1 !!}" data-line="{!! $frame->line() - $frame->getCodeBlock()->getStartLine() + 2 !!}" class="line-numbers">
<code class="language-php">
{!! $frame->getCodeBlock()->output() !!}
</code>
</pre>
@if (count($frame->args()))
<table
class="table args bg-gray-400 text-white rounded-sm mt-4 dark:even:bg-gray-600 dark:even:text-gray-50 p-1">
<tbody>
@foreach ($frame->args() as $name => $val)
<tr>
<td style="">&nbsp;</td>
<td class="name"><strong>{{ $name }}</strong></td>
<td class="value">{{ $val }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
</div>
@if (count($frame->args()))
<table
class="table p-1 mt-4 text-white bg-gray-400 rounded-sm args dark:even:bg-gray-600 dark:even:text-gray-50">
<tbody>
@foreach ($frame->args() as $name => $val)
<tr>
<td style="">&nbsp;</td>
<td class="name"><strong>{{ $name }}</strong></td>
<td class="value">{{ $val }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
</div>
</div>
@endforeach
</div>
</div>
@endforeach
</div>

0 comments on commit 295d04d

Please sign in to comment.