Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into #20-add-pages-for-every-tab
  • Loading branch information
AmonDeShir committed Aug 6, 2024
2 parents c68dbda + 5a3f5eb commit ba6f532
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 19 deletions.
7 changes: 7 additions & 0 deletions app/Http/Controllers/GithubController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Bus;
use Inertia\Inertia;
use Inertia\Response;
use Laravel\Socialite\Facades\Socialite;
use Symfony\Component\HttpFoundation\RedirectResponse;

Expand Down Expand Up @@ -73,4 +75,9 @@ public function status(string $batchId): JsonResponse
"finished" => $batch->finished(),
]);
}

public function login(): Response
{
return Inertia::render("Login");
}
}
4 changes: 4 additions & 0 deletions resources/css/app.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root, body, #app {
height: 100%;
}
20 changes: 20 additions & 0 deletions resources/js/Layouts/GuestLayout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<template>
<div class="flex h-5/6 justify-center items-center px-2 sm:px-0">
<main class="w-full max-w-96 h-80 bg-white rounded-xl p-4 shadow flex">
<div class="flex-1 w-full p-6">
<slot />
</div>
</main>
</div>
<div class="container mx-auto">
<div class="block uppercase text-white font-semibold text-xs tracking-widest" />
</div>
<footer>
<div class="w-full flex items-center justify-center text-white">
<span class="font-semibold text-xs tracking-widest">developed by</span>
<a href="https://blumilk.pl/" target="_blank">
<img class="w-32" src="../../assets/images/blumilk.png" alt="Blumilk">
</a>
</div>
</footer>
</template>
9 changes: 0 additions & 9 deletions resources/js/Pages/Home.vue

This file was deleted.

19 changes: 19 additions & 0 deletions resources/js/Pages/Login.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script setup lang="ts">
import GuestLayout from '@/Layouts/GuestLayout.vue'
import { Head } from '@inertiajs/vue3'
</script>

<template>
<Head title="Login" />
<div class="flex flex-col justify-between h-full items-center">
<h2 class="text-2xl text-center">Welcome in Github Analyzer</h2>
<p class="text-center my-auto">Login with Github to analyze your GitHub Actions and monitor usage minutes!</p>
<a class="bg-gray-800 rounded-md block text-center text-white w-5/6 py-3 hover:bg-gray-700" href="/auth/redirect">Login via Github</a>
</div>
</template>

<script lang="ts">
export default {
layout: GuestLayout,
}
</script>
4 changes: 2 additions & 2 deletions resources/views/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
@vite('resources/js/app.ts')
@inertiaHead
</head>
<body class="h-full bg-gradient-to-r from-white to-blue-400">
<div class="container py-4 mx-auto">
<body class="bg-gradient-to-r from-white to-blue-400">
<div class="h-full container py-4 mx-auto">
@inertia
</div>
</body>
Expand Down
16 changes: 8 additions & 8 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
use App\Http\Controllers\TableController;
use Illuminate\Support\Facades\Route;

Route::inertia("/", "Home");
Route::middleware("auth")->group(function (): void {
Route::get("/table", [TableController::class, "show"]);
Route::get("/repositories", [RepositoriesController::class, "show"]);
Route::get("/authors", [AuthorsController::class, "show"]);

Route::get("/table", [TableController::class, "show"]);

Route::get("/repositories", [RepositoriesController::class, "show"]);

Route::get("/authors", [AuthorsController::class, "show"]);
Route::get("/{organizationId}/fetch", [GithubController::class, "fetchData"])->middleware("auth");
});

Route::redirect("/", "table");
Route::get("/auth/login", [GithubController::class, "login"])->name("login");
Route::get("/auth/redirect", [GithubController::class, "redirect"]);
Route::get("/auth/callback", [GithubController::class, "callback"]);

Route::get("/{organizationId}/fetch", [GithubController::class, "fetchData"]);

0 comments on commit ba6f532

Please sign in to comment.