Switched to bootstrap

This commit is contained in:
2017-09-23 23:45:01 +02:00
parent e4e55dfabc
commit 736cbd3ac7
40 changed files with 16973 additions and 208 deletions

View File

@@ -16,22 +16,22 @@ public function dashboard() {
$activeNav = 'dashboard';
$temperature = Stats::select('temperature')
->limit('1440')
->limit('144')
->orderBy('created_at', 'desc')
->pluck('temperature');
$humidity = Stats::select('humidity')
->limit('1440')
->limit('144')
->orderBy('created_at', 'desc')
->pluck('humidity');
$gm3 = Stats::select('gm3')
->limit('1440')
->limit('144')
->orderBy('created_at', 'desc')
->pluck('gm3');
$created_at = Stats::select('created_at')
->limit('1440')
->limit('144')
->orderBy('created_at', 'desc')
->pluck('created_at');
@@ -56,6 +56,7 @@ public function dashboard() {
$latestHumidity = '' . $latestHumidity[0];
$latestGM3 = '' . $latestGM3[0];
$latestShit = 'Temp: ' . $latestTemp . ' Hum: ' . $latestHumidity . ' g/m³: ' . $latestGM3;
$chart = Charts::multi('line', 'material')
@@ -66,8 +67,8 @@ public function dashboard() {
// You could always set them manually
// ->colors(['#2196F3', '#F44336', '#FFC107'])
// Setup the diferent datasets (this is a multi chart)
->dataset('Temperatur', $temperature)
->dataset('Luftfeuchtigkeit', $humidity)
->dataset('°C', $temperature)
->dataset('%', $humidity)
->dataset('g/m³', $gm3)
// Setup what the values mean
->labels($created_at);
@@ -83,4 +84,33 @@ public function dashboard() {
]);
}
public function welcome() {
$pagetitle = 'Willkommen';
$activeNav = 'welcome';
$latestTemp = Stats::select('temperature')
->orderBy('created_at', 'desc')
->limit('1')
->pluck('temperature');
$latestHumidity = Stats::select('humidity')
->orderBy('created_at', 'desc')
->limit('1')
->pluck('humidity');
$latestGM3 = Stats::select('gm3')
->orderBy('created_at', 'desc')
->limit('1')
->pluck('gm3');
return view('welcome')->with([
'pagetitle' => $pagetitle,
'activeNav' => $activeNav,
'latestTemp' => $latestTemp,
'latestHumidity' => $latestHumidity,
'latestGM3' => $latestGM3,
]);
}
}