Skip to content

Commit

Permalink
Merge pull request #6 from DanielRTRD/master
Browse files Browse the repository at this point in the history
Improved styling of views + locale for datetime
  • Loading branch information
aglipanci authored Apr 5, 2022
2 parents 06a9737 + 1448ccc commit aced159
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 51 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ In your dashboard view you can use the `livewire:forge-server-tile` and `livewir
<livewire:forge-recent-events-tile position="b1"/>
...
</x-dashboard>
```

## Customizing the view

If you want to customize the view used to render this tile, run this command:

```bash
php artisan vendor:publish --provider="aglipanci\ForgeTile\ForgeTileServiceProvider" --tag="dashboard-forge-tile-views"
```

## Testing
Expand Down
46 changes: 21 additions & 25 deletions resources/views/recent-events.blade.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
<x-dashboard-tile :position="$position">
<div class="grid grid-rows-auto-1 gap-2 h-full">
<div class="flex items-center justify-center">
<h1 class="text-xl leading-none mt-1">{{$title ?? 'Forge Recent Events'}}</h1>
<h1 class="text-xl leading-none mt-1">{{ $title ?? 'Forge Recent Events' }}</h1>
</div>
<div class="h-full overflow-scroll">
<div class="h-full overflow-auto">
<ul wire:poll.{{ $refreshIntervalInSeconds }}s class="self-center divide-y-2 divide-canvas">
@if(count($events))
@foreach($events as $event)
<li class="py-1">
<div class="my-2">
<div class="font-medium text-sm">
{{ \Carbon\Carbon::parse($event['createdAt'])->format('F j, g:m:i A') }}
</div>
<div class="text-xs text-gray-600 mb-1">
{{ $event['serverName'] }}
</div>
<div class="text-xs">
{{ $event['description'] }}
</div>
</div>
</li>
@endforeach
@else
<div class="bg-yellow-300 pl-2 p-2 rounded-md">
<span class="inline-block">
<div class="rounded-full h-4 w-4 flex items-center justify-center bg-yellow-900 text-white text-xs inline-block">!</div>
</span>
<span class="text-xs text-yellow-900 leading-none break-words">Currently there are no events. Make sure you have configured the background command.</span>
@forelse($events as $event)
<li class="py-2 my-2">
<div class="font-medium text-sm">
{{ \Carbon\Carbon::parse($event['createdAt'])->isoFormat('LLL') }}
</div>
<div class="text-xs text-gray-600">
{{ $event['serverName'] }}
</div>
<div class="text-xs">
{{ $event['description'] }}
</div>
</li>
@empty
<div class="bg-yellow-300 pl-2 p-2 rounded-md text-yellow-900">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline-block" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
</svg>
<span class="text-xs leading-none break-words">Currently there are no events. Make sure you have configured the background command.</span>
</div>
@endif
@endforelse
</ul>
</div>
</div>
Expand Down
49 changes: 23 additions & 26 deletions resources/views/servers.blade.php
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
<x-dashboard-tile :position="$position">
<div class="grid grid-rows-auto-1 gap-2 h-full">
<div class="flex items-center justify-center">
<h1 class="text-xl leading-none mt-1">{{$title ?? 'Forge Servers'}}</h1>
<h1 class="text-xl leading-none mt-1">{{ $title ?? 'Forge Servers' }}</h1>
</div>

<div class="h-full overflow-scroll">
<div class="h-full overflow-auto">
<ul wire:poll.{{ $refreshIntervalInSeconds }}s class="self-center divide-y-2 divide-canvas">
@if(count($servers))
@foreach($servers as $server)
<li class="py-1">
<div class="my-2">
<div class="font-medium">
<span class="rounded-full h-3 w-3 inline-block mr-1 @if($server['isReady']) bg-green-200 @else bg-gray-200 @endif"></span>
{{ $server['name'] }}
</div>
<div class="text-gray-700 text-sm">{{ $server['provider'] }}</div>
<div class="text-gray-700 text-sm">{{ $server['ipAddress'] }}</div>
<div class="mt-1">
@foreach($server['tags'] as $tag)
<span class="bg-gray-200 rounded p-1 text-xs text-gray-600 mb-1 inline-block">{{ $tag['name'] }}</span>
@endforeach
</div>
@forelse($servers as $server)
<li class="my-2 py-2">
<div class="font-medium">
<span class="rounded-full h-3 w-3 inline-block mr-1 @if($server['isReady']) bg-green-300 @else bg-gray-200 @endif"></span>
{{ $server['name'] }}
</div>
<div class="text-gray-700 text-sm">{{ $server['provider'] }} &middot; {{ $server['ipAddress'] }}</div>
@if($server['tags'])
<div class="mt-1">
@foreach($server['tags'] as $tag)
<span class="bg-gray-200 rounded p-1 text-xs text-gray-600 mb-1 inline-block">{{ $tag['name'] }}</span>
@endforeach
</div>
</li>
@endforeach
@else
<div class="bg-yellow-300 pl-2 p-2 rounded-md">
<span class="inline-block">
<div class="rounded-full h-4 w-4 flex items-center justify-center bg-yellow-900 text-white text-xs inline-block">!</div>
</span>
<span class="text-xs text-yellow-900 leading-none break-words">Currently there are no servers. Make sure you have configured the background command.</span>
@endif
</li>
@empty
<div class="bg-yellow-300 pl-2 p-2 text-yellow-900 rounded-md">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline-block" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
</svg>
<span class="text-xs leading-none break-words">Currently there are no servers. Make sure you have configured the background command.</span>
</div>
@endif
@endforelse
</ul>
</div>
</div>
Expand Down

0 comments on commit aced159

Please sign in to comment.