fix: monaco editor

fix: apex charts
This commit is contained in:
Andras Bacsai
2024-06-24 11:21:39 +02:00
parent f2c8a6bac5
commit 5201818f52
12 changed files with 492 additions and 582 deletions

View File

@@ -60,78 +60,4 @@
@endforelse
</div>
@endif
{{-- <section x-data="apex_app" class="container p-5 mx-auto my-20 bg-white drop-shadow-xl rounded-xl">
<div class="w-full" x-ref="chart"></div>
</section>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
<script>
document.addEventListener("alpine:init", () => {
Alpine.data("apex_app", () => ({
data: @js($cpu),
init() {
let chart = new ApexCharts(this.$refs.chart, this.options);
chart.render();
this.$watch("data", () => {
chart.updateOptions(this.options);
});
},
get options() {
return {
colors: [function({
value,
seriesIndex,
w
}) {
if (value < 55) {
return '#7E36AF'
} else {
return '#D9534F'
}
}, function({
value,
seriesIndex,
w
}) {
if (value < 111) {
return '#7E36AF'
} else {
return '#D9534F'
}
}],
xaxis: {
type: 'datetime'
},
dataLabels: {
enabled: false
},
series: [{
name: "Series name",
data: this.data
}],
tooltip: {
enabled: true
},
chart: {
stroke: {
curve: 'smooth',
},
height: 500,
width: "100%",
type: "line",
toolbar: {
show: true
},
animations: {
initialAnimation: {
enabled: false
}
}
},
};
}
}));
});
</script> --}}
</div>

View File

@@ -40,15 +40,15 @@
id: '{!! $chartId !!}-cpu',
type: 'area',
toolbar: {
show: false,
show: true,
tools: {
download: true,
download: false,
selection: false,
zoom: false,
zoom: true,
zoomin: false,
zoomout: false,
pan: false,
reset: false
reset: true
},
},
animations: {
@@ -77,6 +77,7 @@
type: 'datetime',
},
series: [{
name: "CPU %",
data: []
}],
noData: {
@@ -86,7 +87,10 @@
}
},
tooltip: {
enabled: false,
enabled: true,
marker: {
show: false,
}
},
legend: {
show: false
@@ -145,15 +149,15 @@
id: '{!! $chartId !!}-memory',
type: 'area',
toolbar: {
show: false,
show: true,
tools: {
download: true,
download: false,
selection: false,
zoom: false,
zoom: true,
zoomin: false,
zoomout: false,
pan: false,
reset: false
reset: true
},
},
animations: {
@@ -188,6 +192,7 @@
}
},
series: [{
name: "Memory (MB)",
data: []
}],
noData: {
@@ -197,7 +202,10 @@
}
},
tooltip: {
enabled: false,
enabled: true,
marker: {
show: false,
}
},
legend: {
show: false