git add .
git commit "fix(assets): self-host Chart.js instead of loading from CDN"
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
</th>
|
||||
|
||||
<th>
|
||||
کاربر
|
||||
مدیر
|
||||
</th>
|
||||
|
||||
<th>
|
||||
@@ -76,7 +76,7 @@
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ $log->admin->name ?? '-' }}
|
||||
{{ $log->admin->first_name ?? '-' }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<th>کاربر</th>
|
||||
<th>مدیر</th>
|
||||
<th>عملیات</th>
|
||||
<th>بخش</th>
|
||||
<th>تاریخ</th>
|
||||
@@ -124,7 +124,7 @@
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
{{ $log->admin->name ?? '-' }}
|
||||
{{ $log->admin->first_name ?? '-' }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -164,18 +164,28 @@
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<canvas id="viewsChart" height="100"></canvas>
|
||||
<canvas id="tourViewsChart" height="100"></canvas>
|
||||
|
||||
</div>
|
||||
<div class="card-header bg-white fw-bold">
|
||||
|
||||
نمودار بازدید پروازها در ۱۰ روز اخیر
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<canvas id="flightViewsChart" height="100"></canvas>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="{{asset('assets/js/chart.js')}}"></script>
|
||||
<script>
|
||||
const ctx = document.getElementById('viewsChart');
|
||||
const tourChart = document.getElementById('tourViewsChart');
|
||||
|
||||
new Chart(ctx, {
|
||||
new Chart(tourChart, {
|
||||
|
||||
type: 'bar',
|
||||
|
||||
@@ -191,6 +201,42 @@
|
||||
}]
|
||||
},
|
||||
|
||||
options: {
|
||||
responsive:true,
|
||||
|
||||
plugins:{
|
||||
|
||||
legend:{
|
||||
|
||||
position:'top'
|
||||
}
|
||||
},
|
||||
scales:{
|
||||
|
||||
y:{
|
||||
beginAtZero:true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
const flightChart = document.getElementById('flightViewsChart');
|
||||
|
||||
new Chart(flightChart, {
|
||||
|
||||
type: 'bar',
|
||||
|
||||
data: {
|
||||
labels: @json($flightViews->pluck('date')),
|
||||
|
||||
datasets: [{
|
||||
|
||||
label: 'بازدید پرواز ها',
|
||||
|
||||
data: @json($flightViews->pluck('total')),
|
||||
|
||||
}]
|
||||
},
|
||||
|
||||
options: {
|
||||
responsive:true,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user