This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row v-if="this.formState.ready" v-resize="onResize">
|
<v-row v-if="this.formState.ready">
|
||||||
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
||||||
<v-col cols="3">
|
<v-col cols="3">
|
||||||
<v-select
|
<v-select
|
||||||
@@ -13,14 +13,14 @@
|
|||||||
<v-btn @click="getDataFromApi">
|
<v-btn @click="getDataFromApi">
|
||||||
<v-icon>fa-sync</v-icon>
|
<v-icon>fa-sync</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<!-- {{ $vuetify.breakpoint.name }} -->
|
{{ $vuetify.breakpoint.name }}
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" class="my-1">
|
<v-col cols="12" class="my-1">
|
||||||
<v-sheet elevation="4">
|
<v-sheet elevation="4">
|
||||||
<gz-chart-line :chartData="memAllChartData" :options="mmChartOptions" />
|
<gz-chart-line :chartData="memAllChartData" :options="mmChartOptions" />
|
||||||
</v-sheet>
|
</v-sheet>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" class="my-1">
|
<v-col cols="12" class="my-1" v-resize="onResize">
|
||||||
<v-sheet elevation="4">
|
<v-sheet elevation="4">
|
||||||
<gz-chart-line :chartData="cpuChartData" :options="mmChartOptions" />
|
<gz-chart-line :chartData="cpuChartData" :options="mmChartOptions" />
|
||||||
</v-sheet>
|
</v-sheet>
|
||||||
@@ -93,6 +93,7 @@ export default {
|
|||||||
selectLists: {
|
selectLists: {
|
||||||
dateFilterTokens: []
|
dateFilterTokens: []
|
||||||
},
|
},
|
||||||
|
lastFetchBreakPoint: null,
|
||||||
formState: {
|
formState: {
|
||||||
ready: false,
|
ready: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -167,8 +168,22 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onResize() {
|
onResize() {
|
||||||
|
let breakPoint = "xl";
|
||||||
this.getDataFromApi();
|
if (window.innerWidth < 1904) {
|
||||||
|
breakPoint = "lg";
|
||||||
|
}
|
||||||
|
if (window.innerWidth < 1264) {
|
||||||
|
breakPoint = "md";
|
||||||
|
}
|
||||||
|
if (window.innerWidth < 960) {
|
||||||
|
breakPoint = "sm";
|
||||||
|
}
|
||||||
|
if (window.innerWidth < 600) {
|
||||||
|
breakPoint = "xs";
|
||||||
|
}
|
||||||
|
if (breakPoint != this.lastFetchBreakPoint) {
|
||||||
|
this.getDataFromApi(breakPoint);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
timePeriodChanged: function() {
|
timePeriodChanged: function() {
|
||||||
this.getDataFromApi();
|
this.getDataFromApi();
|
||||||
@@ -176,7 +191,7 @@ export default {
|
|||||||
form() {
|
form() {
|
||||||
return window.$gz.form;
|
return window.$gz.form;
|
||||||
},
|
},
|
||||||
getDataFromApi() {
|
getDataFromApi(breakPoint) {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
if (vm.formState.loading) {
|
if (vm.formState.loading) {
|
||||||
return;
|
return;
|
||||||
@@ -186,6 +201,9 @@ export default {
|
|||||||
);
|
);
|
||||||
|
|
||||||
vm.formState.loading = true;
|
vm.formState.loading = true;
|
||||||
|
if (breakPoint == null) {
|
||||||
|
breakPoint = vm.$vuetify.breakpoint.name;
|
||||||
|
}
|
||||||
//##########################################################################################################################################
|
//##########################################################################################################################################
|
||||||
//Visually, 200 points max looks best on full screen widths and 40 on galaxy s9 minimum standard
|
//Visually, 200 points max looks best on full screen widths and 40 on galaxy s9 minimum standard
|
||||||
//there is no relevant loss of fidelity with this downsampling
|
//there is no relevant loss of fidelity with this downsampling
|
||||||
@@ -194,7 +212,8 @@ export default {
|
|||||||
//Note: used geometric progression of 1.5 for this
|
//Note: used geometric progression of 1.5 for this
|
||||||
//40*1.5=60, 60*1.5=90 etc etc etc
|
//40*1.5=60, 60*1.5=90 etc etc etc
|
||||||
//wanted it to fit between 40 at lowest end and 200 at highest end
|
//wanted it to fit between 40 at lowest end and 200 at highest end
|
||||||
switch (vm.$vuetify.breakpoint.name) {
|
|
||||||
|
switch (breakPoint) {
|
||||||
case "xs":
|
case "xs":
|
||||||
max = 40;
|
max = 40;
|
||||||
break;
|
break;
|
||||||
@@ -240,7 +259,7 @@ export default {
|
|||||||
window.$gz.form.setErrorBoxErrors(vm);
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
} else {
|
} else {
|
||||||
vm.obj = res.data;
|
vm.obj = res.data;
|
||||||
|
vm.lastFetchBreakPoint = breakPoint;
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: vm,
|
vm: vm,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user