Skip to content

Commit

Permalink
update dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
frrg committed May 22, 2020
1 parent 77de63d commit 636ba0c
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 119 deletions.
18 changes: 18 additions & 0 deletions app/Charts/StatsChart.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Charts;

use ConsoleTVs\Charts\Classes\Chartjs\Chart;

class StatsChart extends Chart
{
/**
* Initializes the chart.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
}
9 changes: 8 additions & 1 deletion app/Http/Controllers/b/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace App\Http\Controllers\b;
use App\Http\Controllers\b\BackendController;
use App\Models\Background;
use App\Models\Frame;
use App\Models\Photo;

class HomeController extends BackendController
{
Expand All @@ -23,6 +26,10 @@ public function __construct()
public function index()
{
$bcrum = $this->bcrum('Dashboard');
return view('backend.home',compact('bcrum'));
$frame = Frame::all()->count();
$photo = Photo::all()->count();
$bg = Background::all()->count();

return view('backend.home',compact('bcrum','frame','photo','bg'));
}
}
15 changes: 15 additions & 0 deletions config/charts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

return [
/*
|--------------------------------------------------------------------------
| Default library used in charts.
|--------------------------------------------------------------------------
|
| This value is used as the default chart library used when creating
| any chart in the command line. Feel free to modify it or set it up
| while creating the chart to ignore this value.
|
*/
'default_library' => 'Chartjs',
];
134 changes: 16 additions & 118 deletions resources/views/backend/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@
<div class="container-fluid">
<div class="fade-in">
<div class="row">
<div class="col-sm-6 col-lg-3">
<!-- col -->
<div class="col-sm-12 col-lg-12">
<div class="card text-white bg-gradient-primary">
<div class="card-body card-body pb-0 d-flex justify-content-between align-items-start">
<div>
<div class="text-value-lg">-</div>
<div>Members online (coming soon)</div>
</div>
<div class="btn-group">
<button class="btn btn-transparent dropdown-toggle p-0" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="c-icon cil-settings">
</i>
</button>
<div class="dropdown-menu dropdown-menu-right"><a class="dropdown-item" href="#">Action</a><a class="dropdown-item" href="#">Another action</a><a class="dropdown-item" href="#">Something else here</a></div>
<div class="text-value-lg">{{ $frame }}</div>
<div>Frame</div>
</div>
</div>
<div class="c-chart-wrapper mt-3 mx-3" style="height:70px;">
Expand All @@ -27,134 +21,38 @@
</div>
</div>
<!-- /.col-->
<div class="col-sm-6 col-lg-3">
<div class="card text-white bg-gradient-info">
<div class="card-body card-body pb-0 d-flex justify-content-between align-items-start">
<div>
<div class="text-value-lg">-</div>
<div>Members online (coming soon)</div>
</div>
<div class="btn-group">
<button class="btn btn-transparent dropdown-toggle p-0" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="c-icon cil-settings"></i>
</button>
<div class="dropdown-menu dropdown-menu-right"><a class="dropdown-item" href="#">Action</a><a class="dropdown-item" href="#">Another action</a><a class="dropdown-item" href="#">Something else here</a></div>
</div>
</div>
<div class="c-chart-wrapper mt-3 mx-3" style="height:70px;">
<canvas class="chart" id="card-chart2" height="70"></canvas>
</div>
</div>
</div>
<!-- /.col-->
<div class="col-sm-6 col-lg-3">
<!-- col -->
<div class="col-sm-12 col-lg-12">
<div class="card text-white bg-gradient-warning">
<div class="card-body card-body pb-0 d-flex justify-content-between align-items-start">
<div>
<div class="text-value-lg">-</div>
<div>Members online (coming soon)</div>
</div>
<div class="btn-group">
<button class="btn btn-transparent dropdown-toggle p-0" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="c-icon cil-settings"></i>
</button>
<div class="dropdown-menu dropdown-menu-right"><a class="dropdown-item" href="#">Action</a><a class="dropdown-item" href="#">Another action</a><a class="dropdown-item" href="#">Something else here</a></div>
<div class="text-value-lg">{{ $photo }}</div>
<div>Photo</div>
</div>
</div>
<div class="c-chart-wrapper mt-3" style="height:70px;">
<div class="c-chart-wrapper mt-3 mx-3" style="height:70px;">
<canvas class="chart" id="card-chart3" height="70"></canvas>
</div>
</div>
</div>
<!-- /.col-->
<div class="col-sm-6 col-lg-3">
<div class="card text-white bg-gradient-danger">

<!-- col -->
<div class="col-sm-12 col-lg-12">
<div class="card text-white bg-gradient-info">
<div class="card-body card-body pb-0 d-flex justify-content-between align-items-start">
<div>
<div class="text-value-lg">-</div>
<div>Members online (coming soon)</div>
</div>
<div class="btn-group">
<button class="btn btn-transparent dropdown-toggle p-0" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="c-icon cil-settings"></i>
</button>
<div class="dropdown-menu dropdown-menu-right"><a class="dropdown-item" href="#">Action</a><a class="dropdown-item" href="#">Another action</a><a class="dropdown-item" href="#">Something else here</a></div>
<div class="text-value-lg">{{ $bg }}</div>
<div>Background</div>
</div>
</div>
<div class="c-chart-wrapper mt-3 mx-3" style="height:70px;">
<canvas class="chart" id="card-chart4" height="70"></canvas>
<canvas class="chart" id="card-chart2" height="70"></canvas>
</div>
</div>
</div>
<!-- /.col-->
</div>
<!-- /.row-->
<div class="card">
<div class="card-body">
<div class="d-flex justify-content-between">
<div>
<h4 class="card-title mb-0">Traffic (coming soon)</h4>
<div class="small text-muted">September 2019</div>
</div>
<div class="btn-toolbar d-none d-md-block" role="toolbar" aria-label="Toolbar with buttons">
<div class="btn-group btn-group-toggle mx-3" data-toggle="buttons">
<label class="btn btn-outline-secondary">
<input id="option1" type="radio" name="options" autocomplete="off"> Day
</label>
<label class="btn btn-outline-secondary active">
<input id="option2" type="radio" name="options" autocomplete="off" checked=""> Month
</label>
<label class="btn btn-outline-secondary">
<input id="option3" type="radio" name="options" autocomplete="off"> Year
</label>
</div>
<button class="btn btn-primary" type="button">
<i class="c-icon cil-cloud-download"></i>
</button>
</div>
</div>
<div class="c-chart-wrapper" style="height:300px;margin-top:40px;">
<canvas class="chart" id="main-chart" height="300"></canvas>
</div>
</div>
<div class="card-footer">
<div class="row text-center">
<div class="col-sm-12 col-md mb-sm-2 mb-0">
<div class="text-muted">Visits</div><strong>29.703 Users (40%)</strong>
<div class="progress progress-xs mt-2">
<div class="progress-bar bg-gradient-success" role="progressbar" style="width: 40%" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="col-sm-12 col-md mb-sm-2 mb-0">
<div class="text-muted">Unique</div><strong>24.093 Users (20%)</strong>
<div class="progress progress-xs mt-2">
<div class="progress-bar bg-gradient-info" role="progressbar" style="width: 20%" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="col-sm-12 col-md mb-sm-2 mb-0">
<div class="text-muted">Pageviews</div><strong>78.706 Views (60%)</strong>
<div class="progress progress-xs mt-2">
<div class="progress-bar bg-gradient-warning" role="progressbar" style="width: 60%" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="col-sm-12 col-md mb-sm-2 mb-0">
<div class="text-muted">New Users</div><strong>22.123 Users (80%)</strong>
<div class="progress progress-xs mt-2">
<div class="progress-bar bg-gradient-danger" role="progressbar" style="width: 80%" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="col-sm-12 col-md mb-sm-2 mb-0">
<div class="text-muted">Bounce Rate</div><strong>40.15%</strong>
<div class="progress progress-xs mt-2">
<div class="progress-bar" role="progressbar" style="width: 40%" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
</div>
</div>
</div>
<!-- /.card-->
<!-- /.row-->
<!-- /.row-->
</div>
</div>
@endsection
Expand Down

0 comments on commit 636ba0c

Please sign in to comment.