improve dashboard
This commit is contained in:
		@@ -11,19 +11,11 @@ class Dashboard extends Component
 | 
			
		||||
{
 | 
			
		||||
    public $projects = [];
 | 
			
		||||
    public $servers = [];
 | 
			
		||||
    public int $s3s = 0;
 | 
			
		||||
    public int $resources = 0;
 | 
			
		||||
 | 
			
		||||
    public function mount()
 | 
			
		||||
    {
 | 
			
		||||
        $this->servers = Server::ownedByCurrentTeam()->get();
 | 
			
		||||
        $this->s3s = S3Storage::ownedByCurrentTeam()->get()->count();
 | 
			
		||||
        $projects = Project::ownedByCurrentTeam()->get();
 | 
			
		||||
        foreach ($projects as $project) {
 | 
			
		||||
            $this->resources += $project->applications->count();
 | 
			
		||||
            $this->resources += $project->postgresqls->count();
 | 
			
		||||
        }
 | 
			
		||||
        $this->projects = $projects;
 | 
			
		||||
        $this->projects = Project::ownedByCurrentTeam()->get();
 | 
			
		||||
    }
 | 
			
		||||
    // public function getIptables()
 | 
			
		||||
    // {
 | 
			
		||||
 
 | 
			
		||||
@@ -14,27 +14,7 @@
 | 
			
		||||
            <span>Your subscription has been activated! Welcome onboard!</span>
 | 
			
		||||
        </div>
 | 
			
		||||
    @endif
 | 
			
		||||
    <div class="w-full rounded stats stats-vertical lg:stats-horizontal">
 | 
			
		||||
        <div class="stat">
 | 
			
		||||
            <div class="stat-title">Servers</div>
 | 
			
		||||
            <div class="stat-value">{{ $servers->count() }} </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="stat">
 | 
			
		||||
            <div class="stat-title">Projects</div>
 | 
			
		||||
            <div class="stat-value">{{ $projects->count() }}</div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="stat">
 | 
			
		||||
            <div class="stat-title">Resources</div>
 | 
			
		||||
            <div class="stat-value">{{ $resources }}</div>
 | 
			
		||||
            <div class="stat-desc">Applications, databases, etc...</div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="stat">
 | 
			
		||||
            <div class="stat-title">S3 Storages</div>
 | 
			
		||||
            <div class="stat-value">{{ $s3s }}</div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <h3 class="pb-4">Projects</h3>
 | 
			
		||||
 | 
			
		||||
    @if ($projects->count() === 1)
 | 
			
		||||
@@ -60,6 +40,10 @@
 | 
			
		||||
                        {{ $project->description }}</div>
 | 
			
		||||
                </a>
 | 
			
		||||
            @endif
 | 
			
		||||
            <a class="mx-4 rounded group-hover:text-white hover:no-underline "
 | 
			
		||||
                href="{{ route('project.resources.new', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => data_get($project, 'environments.0.name', 'production')]) }}">
 | 
			
		||||
                <span class="font-bold hover:text-warning">+ New Resource</span>
 | 
			
		||||
            </a>
 | 
			
		||||
            <a class="mx-4 rounded group-hover:text-white"
 | 
			
		||||
                href="{{ route('project.edit', ['project_uuid' => data_get($project, 'uuid')]) }}">
 | 
			
		||||
                <svg xmlns="http://www.w3.org/2000/svg" class="icon hover:text-warning" viewBox="0 0 24 24"
 | 
			
		||||
@@ -108,11 +92,11 @@
 | 
			
		||||
    </a>
 | 
			
		||||
@endforeach
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
    function gotoProject(uuid) {
 | 
			
		||||
        window.location.href = '/project/' + uuid;
 | 
			
		||||
    }
 | 
			
		||||
   
 | 
			
		||||
</script>
 | 
			
		||||
{{-- <x-forms.button wire:click='getIptables'>Get IPTABLES</x-forms.button> --}}
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -65,8 +65,8 @@
 | 
			
		||||
                                @endif
 | 
			
		||||
                                <div class="text-xs">{{ $application->status }}</div>
 | 
			
		||||
                            </a>
 | 
			
		||||
                            <a class="flex gap-2 p-1 mx-4 text-xs font-bold rounded hover:no-underline hover:text-warning"
 | 
			
		||||
                                href="{{ route('project.service.logs', [...$parameters, 'service_name' => $application->name]) }}">Logs</a>
 | 
			
		||||
                            <a class="flex gap-2 p-1 mx-4 font-bold rounded group-hover:text-white hover:no-underline"
 | 
			
		||||
                                href="{{ route('project.service.logs', [...$parameters, 'service_name' => $application->name]) }}"><span class="hover:text-warning">Logs</span></a>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    @endforeach
 | 
			
		||||
                    @foreach ($databases as $database)
 | 
			
		||||
@@ -94,8 +94,8 @@
 | 
			
		||||
                                @endif
 | 
			
		||||
                                <div class="text-xs">{{ $database->status }}</div>
 | 
			
		||||
                            </a>
 | 
			
		||||
                            <a class="flex gap-2 p-1 mx-4 text-xs font-bold rounded hover:no-underline hover:text-warning"
 | 
			
		||||
                                href="{{ route('project.service.logs', [...$parameters, 'service_name' => $database->name]) }}">Logs</a>
 | 
			
		||||
                            <a class="flex gap-2 p-1 mx-4 font-bold rounded hover:no-underline group-hover:text-white"
 | 
			
		||||
                                href="{{ route('project.service.logs', [...$parameters, 'service_name' => $database->name]) }}"><span class="hover:text-warning">Logs</span></a>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    @endforeach
 | 
			
		||||
                </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -135,7 +135,6 @@ Route::middleware(['auth', 'verified'])->group(function () {
 | 
			
		||||
        Route::get('/force-password-reset', [Controller::class, 'force_passoword_reset'])->name('auth.force-password-reset');
 | 
			
		||||
    });
 | 
			
		||||
    Route::get('/subscription', SubscriptionShow::class)->name('subscription.index');
 | 
			
		||||
    // Route::get('/help', Help::class)->name('help');
 | 
			
		||||
    Route::get('/settings', [Controller::class, 'settings'])->name('settings.configuration');
 | 
			
		||||
    Route::get('/settings/license', [Controller::class, 'license'])->name('settings.license');
 | 
			
		||||
    Route::get('/profile', fn () => view('profile', ['request' => request()]))->name('profile');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user