2024-06-19 08:33:34 +00:00
|
|
|
<div @if ($poll) wire:poll.5000ms='pollData' @endif x-init="$wire.loadData()">
|
2024-06-20 11:17:06 +00:00
|
|
|
<h3>Memory (MB)</h3>
|
2024-06-18 14:42:42 +00:00
|
|
|
<x-forms.select label="Interval" wire:change="setInterval" id="interval">
|
2024-06-19 07:30:56 +00:00
|
|
|
<option value="5">5 minutes (live)</option>
|
|
|
|
<option value="10">10 minutes (live)</option>
|
2024-06-18 14:42:42 +00:00
|
|
|
<option value="30">30 minutes</option>
|
|
|
|
<option value="60">1 hour</option>
|
|
|
|
<option value="720">12 hours</option>
|
|
|
|
<option value="10080">1 week</option>
|
|
|
|
<option value="43200">30 days</option>
|
|
|
|
</x-forms.select>
|
|
|
|
<div wire:ignore id="{!! $chartId !!}"></div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
checkTheme();
|
|
|
|
const optionsServerMemory = {
|
2024-06-19 06:58:57 +00:00
|
|
|
stroke: {
|
|
|
|
curve: 'straight',
|
|
|
|
},
|
2024-06-18 14:42:42 +00:00
|
|
|
chart: {
|
|
|
|
height: '150px',
|
|
|
|
id: '{!! $chartId !!}',
|
|
|
|
type: 'area',
|
|
|
|
toolbar: {
|
|
|
|
show: false,
|
|
|
|
tools: {
|
|
|
|
download: true,
|
|
|
|
selection: false,
|
|
|
|
zoom: false,
|
|
|
|
zoomin: false,
|
|
|
|
zoomout: false,
|
|
|
|
pan: false,
|
|
|
|
reset: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
animations: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
fill: {
|
|
|
|
type: 'gradient',
|
|
|
|
},
|
|
|
|
dataLabels: {
|
|
|
|
enabled: false,
|
|
|
|
offsetY: -10,
|
|
|
|
style: {
|
|
|
|
colors: ['#FCD452'],
|
|
|
|
},
|
|
|
|
background: {
|
|
|
|
enabled: false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
grid: {
|
|
|
|
show: true,
|
|
|
|
borderColor: '',
|
|
|
|
},
|
|
|
|
colors: [baseColor],
|
|
|
|
xaxis: {
|
|
|
|
type: 'datetime',
|
|
|
|
labels: {
|
|
|
|
show: true,
|
|
|
|
style: {
|
|
|
|
colors: textColor,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
series: [{
|
2024-06-19 08:37:01 +00:00
|
|
|
data: []
|
2024-06-18 14:42:42 +00:00
|
|
|
}],
|
2024-06-19 08:37:01 +00:00
|
|
|
noData: {
|
|
|
|
text: 'Loading...',
|
|
|
|
style: {
|
|
|
|
color: textColor,
|
|
|
|
}
|
|
|
|
},
|
2024-06-18 14:42:42 +00:00
|
|
|
tooltip: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
legend: {
|
|
|
|
show: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const serverMemoryChart = new ApexCharts(document.getElementById(`{!! $chartId !!}`), optionsServerMemory);
|
|
|
|
serverMemoryChart.render();
|
|
|
|
document.addEventListener('livewire:init', () => {
|
|
|
|
Livewire.on('refreshChartData-{!! $chartId !!}', (chartData) => {
|
|
|
|
checkTheme();
|
|
|
|
serverMemoryChart.updateOptions({
|
|
|
|
series: [{
|
|
|
|
data: chartData[0].seriesData,
|
|
|
|
}],
|
|
|
|
colors: [baseColor],
|
|
|
|
xaxis: {
|
2024-06-19 07:42:44 +00:00
|
|
|
type: 'datetime',
|
2024-06-18 14:42:42 +00:00
|
|
|
labels: {
|
2024-06-19 07:42:44 +00:00
|
|
|
show: true,
|
2024-06-18 14:42:42 +00:00
|
|
|
style: {
|
|
|
|
colors: textColor,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
yaxis: {
|
2024-06-19 07:42:44 +00:00
|
|
|
min: 0,
|
|
|
|
show: true,
|
2024-06-18 14:42:42 +00:00
|
|
|
labels: {
|
2024-06-19 07:42:44 +00:00
|
|
|
show: true,
|
2024-06-18 14:42:42 +00:00
|
|
|
style: {
|
|
|
|
colors: textColor,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
noData: {
|
2024-06-19 07:42:44 +00:00
|
|
|
text: 'Loading...',
|
2024-06-18 14:42:42 +00:00
|
|
|
style: {
|
|
|
|
color: textColor,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</div>
|