Skip to content

Commit

Permalink
add login page
Browse files Browse the repository at this point in the history
  • Loading branch information
PrabuckiDominik committed Aug 5, 2024
1 parent e36dc65 commit 991fdfb
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 5 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");
}
}
Binary file added resources/assets/images/blumilk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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;

#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>
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>
10 changes: 6 additions & 4 deletions resources/views/app.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" class="h-full">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
@vite('resources/js/app.ts')
@inertiaHead
</head>
<body>
@inertia
<body class="h-full bg-gradient-to-r from-white to-blue-400">
<div class="h-full container py-4 mx-auto">
@inertia
</div>
</body>
</html>
</html>
3 changes: 2 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use Inertia\Response;

Route::get("/", fn(): Response => inertia("Welcome"));
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"]);
Route::get("/{organizationId}/fetch", [GithubController::class, "fetchData"])->middleware("auth");

0 comments on commit 991fdfb

Please sign in to comment.