-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from Hi-Folks/feature/70-better-output
Feature/70 better output
- Loading branch information
Showing
10 changed files
with
158 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<div class="mt-2 mx-1"> | ||
@if (sizeof($rows) > 0) | ||
<div class="flex space-x-1"> | ||
<span class="text-red">CHECK: issues found</span> | ||
<span class="flex-1 content-repeat-[─] text-red"></span> | ||
</div> | ||
@else | ||
<div class="flex space-x-1"> | ||
<span class="text-green">CHECK: everything looks good</span> | ||
<span class="flex-1 content-repeat-[─] text-green"></span> | ||
</div> | ||
@endif | ||
<div> | ||
@foreach ($rows as $row) | ||
@php | ||
$lineType = Arr::get($row, "lineType", HiFolks\LaraLens\ResultLens::LINE_TYPE_DEFAULT); | ||
$label = Arr::get($row, "label", ""); | ||
@endphp | ||
@if ($label === "*** HINT") | ||
<div class="flex space-x-1 mt-1"> | ||
<span class="px-1 text-gray-100">💡 Hint:</span> | ||
<span> | ||
<span class="px-0 text-gray-300"> | ||
{{ Arr::get($row, "value", "") }} | ||
</span> | ||
</span> | ||
</div> | ||
@else | ||
<div @class([ | ||
'w-full mx-1 py-1 mt-1 text-center font-bold', | ||
'bg-red text-white' => $lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_ERROR, | ||
'bg-yellow text-black' => $lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_WARNING, | ||
'bg-green text-white' => $lineType !== HiFolks\LaraLens\ResultLens::LINE_TYPE_ERROR | ||
&& $lineType !== HiFolks\LaraLens\ResultLens::LINE_TYPE_WARNING, | ||
])> | ||
{{ Arr::get($row, "label", "")}} | ||
</div> | ||
<div class="mt-1 mx-1 text-gray-300"> | ||
@if ($lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_ERROR) | ||
{{ Arr::get($row, "value", "")}} | ||
@elseif ($lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_WARNING) | ||
{{ Arr::get($row, "value", "")}} | ||
@else | ||
{{ Str::replace("\\", "/", Arr::get($row, "value", "")) }} | ||
@endif | ||
</div> | ||
@endif | ||
@endforeach | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<div class="mt-1.5 mx-1"> | ||
<div class="flex space-x-1"> | ||
<span class="text-green">{{ $title }}</span> | ||
<span class="flex-1 content-repeat-[─] text-gray"></span> | ||
</div> | ||
<div class="mt-1"> | ||
<span> | ||
@foreach ($rows as $row) | ||
@php | ||
$lineType = Arr::get($row, "lineType", HiFolks\LaraLens\ResultLens::LINE_TYPE_DEFAULT); | ||
$label = Arr::get($row, "label", ""); | ||
@endphp | ||
@if ($label === "*** HINT") | ||
<div class="flex space-x-1"> | ||
<span class=" text-white font-bold">Hint:</span> | ||
<span class="flex-1 content-repeat-[.] text-gray"></span> | ||
<div> | ||
<span class="px-2 text-gray font-bold"> | ||
{{ Arr::get($row, "value", "") }} | ||
</span> | ||
</div> | ||
</div> | ||
@else | ||
<div class="flex space-x-1"> | ||
<span class=" text-white font-bold"> | ||
{{ Arr::get($row, "label", "")}} | ||
</span> | ||
|
||
<span class="flex-1 content-repeat-[.] text-gray"></span> | ||
|
||
<span> | ||
@if ($lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_ERROR) | ||
<span class="text-gray-100 bg-red font-bold"> | ||
{{ Arr::get($row, "value", "")}} | ||
</span> | ||
@elseif ($lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_WARNING) | ||
<span class="text-gray-100 bg-yellow font-bold"> | ||
{{ Arr::get($row, "value", "")}} | ||
</span> | ||
@else | ||
<span class="text-gray-100"> | ||
{{ Str::replace("\\", "/", Arr::get($row, "value", "")) }} | ||
</span> | ||
@endif | ||
</span> | ||
</div> | ||
@endif | ||
@endforeach | ||
</span> | ||
</div> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace HiFolks\LaraLens\Lens\Traits; | ||
|
||
use function Termwind\{render}; | ||
|
||
trait TermOutput | ||
{ | ||
public function printOutputTerm( | ||
string $title, | ||
array $rows | ||
) { | ||
render( | ||
view('lara-lens::laralens.term.table', [ | ||
'title' => $title, | ||
'rows' => $rows | ||
]) | ||
); | ||
} | ||
|
||
public function printChecksTerm(array $rows): void | ||
{ | ||
render( | ||
view('lara-lens::laralens.term.checks', [ | ||
'rows' => $rows | ||
]) | ||
); | ||
} | ||
} |