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

Add organization dashboard

parent 4af54739
No related branches found
No related tags found
No related merge requests found
...@@ -78,6 +78,11 @@ class OrganizationController extends Controller ...@@ -78,6 +78,11 @@ class OrganizationController extends Controller
return view("organization.show", array("organization" => $organization)); return view("organization.show", array("organization" => $organization));
} }
public function dashboard(Organization $organization)
{
return view("organization.dashboard", array("organization" => $organization));
}
/** /**
* Show the form for editing the specified resource. * Show the form for editing the specified resource.
* *
......
...@@ -24,7 +24,7 @@ class ServerController extends Controller ...@@ -24,7 +24,7 @@ class ServerController extends Controller
protected function validator(array $data) protected function validator(array $data)
{ {
return Validator::make($data, [ return Validator::make($data, [
'name' => 'required|string|regex:/^[a-zA-Z0-9\s-\.]+$/|max:255' 'name' => 'required|string|regex:/^[a-zA-Z0-9\s\-\.]+$/|max:255'
]); ]);
} }
......
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<h1>{{ $organization->name }}</h1>
<div class="row">
@foreach($organization->servers()->orderBy("name")->get() as $server)
<div class="col-md-3">
<div class="card">
<div class="card-header">
<h5 class="card-title">
{{ $server->name }}
</h5>
</div>
<div class="card-body">
{!! $server->getBadge() !!}
<p>
{{ $server->lastRecordTime()->diffForHumans() }}
</p>
</div>
<div class="card-footer">
<a class="btn btn-primary btn-sm"
href="{{ action("ServerController@show", ["server" => $server]) }}">
View
</a>
</div>
</div>
</div>
@endforeach
</div>
</div>
@endsection
...@@ -22,10 +22,11 @@ Route::get("home", function() { ...@@ -22,10 +22,11 @@ Route::get("home", function() {
}); });
Route::get('app/dashboard', function() { Route::get('app/dashboard', function() {
//return view("dashboard");
return redirect(action("OrganizationController@index")); return redirect(action("OrganizationController@index"));
})->name('dashboard'); })->name('dashboard');
Route::get('app/organizations/{organization}/dashboard', 'OrganizationController@dashboard');
Route::resource('app/organizations', 'OrganizationController'); Route::resource('app/organizations', 'OrganizationController');
Route::resource("app/organizations.user", "OrganizationUserController"); Route::resource("app/organizations.user", "OrganizationUserController");
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