Überarbeitung Dashboard

This commit is contained in:
Giò Diani committed 2025-01-14 22:11:31 +01:00
1 parent 8bef4b9621
commit a5a21fb925
10 files changed
+242 -95

No files matched your search

+44 -13
View File
@@ -11,12 +11,6 @@
<dt>Zum letzten mal gefunden</dt>
<dd>{{ $base['last_found'] }}</dd>
</dl>
<h2>Kurzzeitmietobjekte in der Nähe</h2>
<ul>
@foreach($neighbours as $n)
<li><a href="/prop/{{ $n['id'] }}">{{ $n['lat'] }}, {{$n['lon']}}</a></li>
@endforeach
</ul>
</div>
@endsection
@@ -27,8 +21,13 @@
<article class="header" style="grid-area: chart1;">
<header>
<h2 id="belegung-title">
Belegung am
</h2>
Kalenderansicht der Belegung am <span class="date">{{ $startDate }}</span>
</h2><button popovertarget="popup-cal"></button>
<div popover id="popup-cal">
<p>
Das Kalenderdiagram zeigt die drei Verfügbarkeitskategorien des Mietobjekts.
</p>
</div>
</header>
<div id="chart-calendar"></div>
</article>
@@ -43,7 +42,7 @@
<article class="header" style="grid-area: chart3;">
<header>
<h2>
Auslastung nach Monat am 2024-04-15T07:06:22
Belegung Mietobjekt Monate am <span class="date">{{ $startDate }}</span>
</h2>
</header>
<div id="chart-capacity-monthly">
@@ -65,12 +64,35 @@
<article class="header" style="grid-area: chart4;">
<header>
<h2>
Auslastung Tage für Monat
Belegung Mietobjekt Tage am <span class="date">{{ $startDate }}</span>
</h2>
</header>
<div id="chart-capacity-daily">
</article>
<script type="module">
const sharedOptions = {
basic: {
color: {!! $chartOptions['colors'] !!},
grid: {
top: 20,
left: 60,
right: 0,
bottom: 50
},
name: (opt) => {
return {
name: opt.name,
nameLocation: opt.location,
nameGap: 24,
nameTextStyle: {
fontWeight: 'bold',
},
}
}
}
}
const chartTimeline = document.getElementById('timeline');
const cTimeline = echarts.init(chartTimeline);
@@ -123,6 +145,9 @@ const cCapacityMonthlyOptions = {
},
series: [{
type: 'bar',
itemStyle: {
color: sharedOptions.basic.color[3]
},
data: {!! json_encode($cM['capacities']) !!}
}]
},
@@ -132,7 +157,6 @@ const cCapacityMonthlyOptions = {
cCapacityMonthly.setOption(cCapacityMonthlyOptions);
const chartCapacityDaily = document.getElementById('chart-capacity-daily');
const cCapacityDaily = echarts.init(chartCapacityDaily);
@@ -163,6 +187,9 @@ const cCapacityDailyOptions = {
},
series: [{
type: 'bar',
itemStyle: {
color: sharedOptions.basic.color[3]
},
data: {!! json_encode($cD['capacities']) !!}
}]
},
@@ -176,7 +203,7 @@ const chartCapacity = document.getElementById('chart-capacity');
const cCapacity = echarts.init(chartCapacity);
const cCapacityOptions = {
color: ['#9ecae1','#6baed6','#4292c6','#2171b5','#084594'],
color: sharedOptions.basic.color,
legend: {
data: ['Auslastung Property', 'Auslastung {{ $base['region_name'] }}', 'Auslastung alle Regionen']
},
@@ -324,7 +351,10 @@ cCalendar.setOption(cCalendarOptions);
cTimeline.on('timelinechanged', (e) => {
h2Belegung.innerText = "Belegung am "+cCalendarOptions.timeline.data[e.currentIndex];
let dateTitles = document.querySelectorAll('span.date');
dateTitles.forEach(el => {
el.innerText = cTimelineOptions.timeline.data[e.currentIndex];
});
// Set markpoint on linechart
let x = cCapacityOptions.xAxis.data[e.currentIndex];
@@ -373,6 +403,7 @@ function icon(id = 0){
}
const markers = L.featureGroup([
L.marker([{{ $base['check_data'] }}], {icon: icon(1)}),
@foreach($neighbours as $n)
L.marker([{{ $n['lat'] }}, {{ $n['lon'] }}], {icon: icon()}).bindPopup('<a href="/property/{{ $n['id'] }}">{{ $n['lat'] }}, {{ $n['lon'] }}</a>'),
@endforeach