-
Notifications
You must be signed in to change notification settings - Fork 36
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 #42 from Hi-Folks/develop
v0.2.1
- Loading branch information
Showing
21 changed files
with
413 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
class DashboardController extends Controller | ||
{ | ||
public function index() | ||
{ | ||
$data = []; | ||
$data["title"] = "Ghygen is a GitHub Actions configurator for your Laravel Application."; | ||
$data["description"] = "Setup Database Service, use multiple PHP version, | ||
use multiple Laravel versions, build frontend, cache packages, | ||
execute Browser, Functional, and Unit tests…"; | ||
return view('dashboard.index', $data); | ||
} | ||
} |
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,21 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Dashboard; | ||
|
||
use App\Models\Configuration; | ||
use Livewire\Component; | ||
|
||
class Latest extends Component | ||
{ | ||
public $latest; | ||
|
||
public function mount() | ||
{ | ||
$this->latest = Configuration::latest()->take(5)->get(); | ||
} | ||
public function render() | ||
{ | ||
|
||
return view('livewire.dashboard.latest'); | ||
} | ||
} |
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,42 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Dashboard; | ||
|
||
use App\Models\Configuration; | ||
use Illuminate\Support\Carbon; | ||
use Livewire\Component; | ||
|
||
class Metrics extends Component | ||
{ | ||
public $count; | ||
public $total; | ||
public $last4hours; | ||
public $last24hours; | ||
public $last3days; | ||
|
||
public function mount() | ||
{ | ||
$this->count = Configuration::count(); | ||
$this->total = Configuration::sum('counts'); | ||
$this->last4hours = Configuration::where( | ||
'updated_at', | ||
'>', | ||
Carbon::now()->subHours(3)->toDateTimeString() | ||
)->count(); | ||
$this->last24hours = Configuration::where( | ||
'updated_at', | ||
'>', | ||
Carbon::now()->subHours(24)->toDateTimeString() | ||
)->count(); | ||
$this->last3days = Configuration::where( | ||
'updated_at', | ||
'>', | ||
Carbon::now()->subHours(24 * 3)->toDateTimeString() | ||
)->count(); | ||
} | ||
|
||
public function render() | ||
{ | ||
return view('livewire.dashboard.metrics'); | ||
} | ||
} |
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,20 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Dashboard; | ||
|
||
use App\Models\Configuration; | ||
use Livewire\Component; | ||
|
||
class Top extends Component | ||
{ | ||
public $top; | ||
|
||
public function mount() | ||
{ | ||
$this->top = Configuration::orderBy("counts", "DESC")->take(5)->get(); | ||
} | ||
public function render() | ||
{ | ||
return view('livewire.dashboard.top'); | ||
} | ||
} |
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,19 @@ | ||
<?php | ||
|
||
namespace App\Http\Resources; | ||
|
||
use Illuminate\Http\Resources\Json\ResourceCollection; | ||
|
||
class ConfigurationCollection extends ResourceCollection | ||
{ | ||
/** | ||
* Transform the resource collection into an array. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return array | ||
*/ | ||
public function toArray($request) | ||
{ | ||
return parent::toArray($request); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace App\Http\Resources; | ||
|
||
use Illuminate\Http\Resources\Json\JsonResource; | ||
|
||
class ConfigurationResource extends JsonResource | ||
{ | ||
/** | ||
* Transform the resource into an array. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return array | ||
*/ | ||
public function toArray($request) | ||
{ | ||
return [ | ||
'code' => $this->code, | ||
'counts' => $this->counts, | ||
'created_at' => $this->created_at, | ||
'updated_at' => $this->updated_at, | ||
]; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -103,3 +103,5 @@ public/files | |
public/chunks | ||
public/storage | ||
bootstrap/cache/config.php | ||
|
||
.phpunit.result.cache |
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,5 @@ | ||
@props([ | ||
'url' => '#', | ||
] | ||
) | ||
<a class="text-indigo-600 hover:text-indigo-900" href="{{ $url }}">{{ $slot }}</a> |
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,7 @@ | ||
@props([ | ||
'align' => 'center', | ||
] | ||
) | ||
<td class="px-6 py-4 text-{{ $align }} whitespace-nowrap"> | ||
{{ $slot }} | ||
</td> |
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,7 @@ | ||
@props([ | ||
'title' => '', | ||
] | ||
) | ||
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> | ||
{{ $slot }} | ||
</th> |
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,3 @@ | ||
<p class="pb-3 mt-2 text-3xl leading-8 font-extrabold tracking-tight text-gray-900 sm:text-4xl"> | ||
{{ $slot }} | ||
</p> |
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,53 @@ | ||
<!DOCTYPE html> | ||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>{{ config("app.name") }} - {{ $title }}</title> | ||
<livewire:styles/> | ||
<meta charset="UTF-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
<meta name="description" content="{{ $title }} {{ $description }}" /> | ||
<link href="{{ mix('css/app.css') }}" rel="stylesheet"> | ||
|
||
<script src="{{ mix('js/app.js') }}" defer></script> | ||
<meta property="og:url" content="{{ config('app.url') }}"/> | ||
<meta property="og:type" content="website"/> | ||
<meta property="og:title" content="{{ config("app.name") }} - {{ $title }}"/> | ||
<meta property="og:description" content="{{ $description }}"/> | ||
<meta property="og:image" | ||
content="{{ asset('ghygen-title.png') }}"/> | ||
|
||
</head> | ||
<body class="antialiased"> | ||
<div> | ||
<header class="bg-white shadow"> | ||
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8 "> | ||
<img class="w-48 " src="{{ asset('ghygen-title.png') }}"> | ||
<h1 class="pl-20 text-gray-800"> | ||
{{ $title }} | ||
</h1> | ||
<p class="pl-20 text-gray-500 text-sm"> | ||
{{ $description }} | ||
</p> | ||
|
||
</div> | ||
</header> | ||
<main> | ||
<div class="max-w-7xl mx-auto py-1 sm:px-6 lg:px-8"> | ||
<livewire:dashboard.metrics></livewire:dashboard.metrics> | ||
</div> | ||
<div class="max-w-7xl mx-auto py-1 sm:px-6 lg:px-8"> | ||
<livewire:dashboard.latest></livewire:dashboard.latest> | ||
</div> | ||
<div class="max-w-7xl mx-auto py-1 sm:px-6 lg:px-8"> | ||
<livewire:dashboard.top></livewire:dashboard.top> | ||
</div> | ||
</main> | ||
<x-footer></x-footer> | ||
</div> | ||
<livewire:scripts/> | ||
|
||
|
||
</body> | ||
</html> |
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,51 @@ | ||
<div class="flex flex-col"> | ||
<div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"> | ||
<div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"> | ||
<div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg"> | ||
<x-table.title> | ||
Latest configurations | ||
</x-table.title> | ||
|
||
<table class="w-full divide-y divide-gray-200"> | ||
<thead class="bg-gray-50"> | ||
<tr> | ||
<x-table.th >Code</x-table.th> | ||
<x-table.th >Title</x-table.th> | ||
<x-table.th >MySql</x-table.th> | ||
<x-table.th >Updated At</x-table.th> | ||
<x-table.th >Counts</x-table.th> | ||
|
||
</tr> | ||
</thead> | ||
<tbody class="bg-white divide-y divide-gray-200"> | ||
|
||
@foreach( $latest as $l) | ||
<tr class=""> | ||
<x-table.td> | ||
<x-table.link url='{{ route("index", ["code" => $l->code ]) }}'>{{ $l->code }}</x-table.link> | ||
</x-table.td> | ||
<x-table.td align="left"> | ||
{{ $l->configuration->name }} | ||
</x-table.td> | ||
|
||
<x-table.td align="left"> | ||
@if ($l->configuration->mysqlService) | ||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800"> | ||
{{ $l->configuration->mysqlVersion }} | ||
</span> | ||
@endif | ||
</x-table.td> | ||
<x-table.td align="left"> | ||
{{ $l->updated_at }} | ||
</x-table.td> | ||
<x-table.td align="right"> | ||
{{ $l->counts }} | ||
</x-table.td> | ||
</tr> | ||
@endforeach | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.