54 lines
1.6 KiB
PHP
54 lines
1.6 KiB
PHP
@extends('layouts.main')
|
|
|
|
@section('content')
|
|
|
|
<h2>
|
|
<i class="fas fa-cogs"></i>
|
|
{{ __('Maintenance') }}
|
|
</h2>
|
|
<div class="error-log">
|
|
<h5><i class="fas fa-file-alt"></i> {{ __("Erreur d'appels") }} :</h5>
|
|
<canvas id="myChart" height="300" width="200"></canvas>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('scripts')
|
|
<script src="{{ mix('js/Chart.js', 'build') }}" charset="utf-8"></script>
|
|
<script>
|
|
var truc = {!! json_encode($logs, JSON_UNESCAPED_SLASHES) !!};
|
|
var labels = [];
|
|
var errorCount = [];
|
|
$.each(truc, function(index, value) {
|
|
labels.push(value.month);
|
|
errorCount.push(value.count);
|
|
});
|
|
|
|
//---- GRAPH ERRORS
|
|
var ctx = document.getElementById("myChart").getContext('2d');
|
|
ctx.height = 300;
|
|
var myChart = new Chart(ctx, {
|
|
type: 'bar',
|
|
data: {
|
|
labels: labels,
|
|
datasets: [{
|
|
label: '{{ __("Erreurs") }}',
|
|
data: errorCount,
|
|
backgroundColor: 'rgba(255, 0, 0, 0.2)',
|
|
borderColor: 'rgba(255,0,0,1)',
|
|
borderWidth: 1
|
|
}]
|
|
},
|
|
options: {
|
|
maintainAspectRatio: false,
|
|
scales: {
|
|
yAxes: [{
|
|
ticks: {
|
|
beginAtZero: true,
|
|
stepSize: 1,
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
@endsection
|