Skip to content
Snippets Groups Projects
Commit 21f00cfe authored by Tibo's avatar Tibo
Browse files

Fix login and register pages

parent 71e8865a
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ class LoginController extends Controller ...@@ -25,7 +25,7 @@ class LoginController extends Controller
* *
* @var string * @var string
*/ */
protected $redirectTo = '/home'; protected $redirectTo = '/app/dashboard';
/** /**
* Create a new controller instance. * Create a new controller instance.
......
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Auth;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$organization = Auth::user()->organizations()->get();
foreach($organization as $org){
$servers = $org->servers()->get();
foreach($servers as $server){
$server->lastState = $server->getLastState();
}
$org->servers = $servers;
}
return view("home",['organization' => $organization]);
}
}
This diff is collapsed.
This diff is collapsed.
...@@ -35,11 +35,9 @@ $theme-colors: ( ...@@ -35,11 +35,9 @@ $theme-colors: (
$body-bg: white; $body-bg: white;
$body-color: #333; $body-color: #333;
$body-color-inverse: invert($body-color) !default; $body-color-inverse: invert($body-color) !default;
$link-color: #FFF; $link-color: #FFF;
// Fonts // Fonts
$font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; $font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
$headings-font-family: $font-family-base; $headings-font-family: $font-family-base;
...@@ -51,8 +49,6 @@ $lead-font-size: 1.30rem; ...@@ -51,8 +49,6 @@ $lead-font-size: 1.30rem;
$spacer: 1.5rem; $spacer: 1.5rem;
html,body { html,body {
height:100%; height:100%;
} }
...@@ -157,3 +153,7 @@ html,body { ...@@ -157,3 +153,7 @@ html,body {
.bg-primary { .bg-primary {
background-color: #333 !important; background-color: #333 !important;
} }
nav.navbar {
margin-bottom: 30px;
}
\ No newline at end of file
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div class="py-5"> <div class="container">
<div class="container bg-light"> <div class="row justify-content-center">
<div class="row"> <div class="col-md-8">
<div class="col-md-8 col-md-offset-2"> <div class="card">
<div class="col-md-12"> <div class="card-header">
<h3 class="display-5">Login</h3> <h3>Login</h3>
</div> </div>
<div class="panel-body"> <div class="card-body">
<form class="form-horizontal" method="POST" action="{{ route('login') }}"> <form class="form-horizontal" method="POST" action="{{ route('login') }}">
{{ csrf_field() }} {{ csrf_field() }}
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label> <label for="email" class="control-label">E-Mail Address</label>
<div class="col-md-6"> <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus>
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus>
@if ($errors->has('email')) @if ($errors->has('email'))
<span class="help-block"> <span class="help-block">
<strong>{{ $errors->first('email') }}</strong> <strong>{{ $errors->first('email') }}</strong>
</span> </span>
@endif @endif
</div>
</div> </div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label> <label for="password" class="control-label">Password</label>
<div class="col-md-6"> <input id="password" type="password" class="form-control" name="password" required>
<input id="password" type="password" class="form-control" name="password" required>
@if ($errors->has('password')) @if ($errors->has('password'))
<span class="help-block"> <span class="help-block">
<strong>{{ $errors->first('password') }}</strong> <strong>{{ $errors->first('password') }}</strong>
</span> </span>
@endif @endif
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-md-6 col-md-offset-4"> <div class="checkbox">
<div class="checkbox"> <label>
<label> <input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}> Remember Me
<input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}> Remember Me </label>
</label>
</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-md-8 col-md-offset-4"> <button type="submit" class="btn btn-primary">
<button type="submit" class="btn btn-primary"> Login
Login </button>
</button>
<a class="btn btn-link" href="{{ route('password.request') }}"> <a class="btn btn-link" href="{{ route('password.request') }}">
Forgot Your Password? Forgot Your Password?
</a> </a>
</div>
</div> </div>
</form> </form>
</div> </div>
......
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div class="py-5"> <div class="container">
<div class="container bg-light"> <div class="row justify-content-center">
<div class="row"> <div class="col-md-8 ">
<div class="col-md-8 col-md-offset-2"> <div class="card">
<div class="col-md-12"> <div class="card-header">
<h3 class="display-5">Register</h3> <h3>Register</h3>
</div> </div>
<div class="panel-body">
<div class="card-body">
<form class="form-horizontal" method="POST" action="{{ route('register') }}"> <form class="form-horizontal" method="POST" action="{{ route('register') }}">
{{ csrf_field() }} {{ csrf_field() }}
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-4 control-label">Name</label> <label for="name" class="control-label">Name</label>
<input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" required autofocus>
<div class="col-md-6"> @if ($errors->has('name'))
<input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" required autofocus> <span class="help-block">
<strong>{{ $errors->first('name') }}</strong>
@if ($errors->has('name')) </span>
<span class="help-block"> @endif
<strong>{{ $errors->first('name') }}</strong>
</span>
@endif
</div>
</div> </div>
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label> <label for="email" class="control-label">E-Mail Address</label>
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required>
<div class="col-md-6"> @if ($errors->has('email'))
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required> <span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
@if ($errors->has('email')) </span>
<span class="help-block"> @endif
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div> </div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label> <label for="password" class="control-label">Password</label>
<input id="password" type="password" class="form-control" name="password" required>
<div class="col-md-6"> @if ($errors->has('password'))
<input id="password" type="password" class="form-control" name="password" required> <span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
@if ($errors->has('password')) </span>
<span class="help-block"> @endif
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="password-confirm" class="col-md-4 control-label">Confirm Password</label> <label for="password-confirm" class="control-label">Confirm Password</label>
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-md-6 col-md-offset-4"> <button type="submit" class="btn btn-primary">
<button type="submit" class="btn btn-primary"> Register
Register </button>
</button>
</div>
</div> </div>
</form> </form>
</div> </div>
......
...@@ -16,7 +16,9 @@ Route::get('/', function () { ...@@ -16,7 +16,9 @@ Route::get('/', function () {
}); });
Auth::routes(); Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
Route::get('app/dashboard', function() {
return view("dashboard");
})->name('dashboard');
Route::resource('app/organizations', 'OrganizationController'); Route::resource('app/organizations', 'OrganizationController');
Route::resource('app/servers', 'ServerController'); Route::resource('app/servers', 'ServerController');
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment