|
|
@ -1,4 +1,8 @@
|
|
|
|
import { timeParse, formatSmartPercentage } from '@/utils';
|
|
|
|
import {
|
|
|
|
|
|
|
|
timeParse,
|
|
|
|
|
|
|
|
formatSmartPercentage,
|
|
|
|
|
|
|
|
getFirstNonEmptyArray,
|
|
|
|
|
|
|
|
} from '@/utils';
|
|
|
|
|
|
|
|
|
|
|
|
export const getRangeOptions = ({
|
|
|
|
export const getRangeOptions = ({
|
|
|
|
core = [],
|
|
|
|
core = [],
|
|
|
@ -6,6 +10,8 @@ export const getRangeOptions = ({
|
|
|
|
cpu = [],
|
|
|
|
cpu = [],
|
|
|
|
internal = [],
|
|
|
|
internal = [],
|
|
|
|
}) => {
|
|
|
|
}) => {
|
|
|
|
|
|
|
|
const xData = getFirstNonEmptyArray([core, memory, cpu, internal]);
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
legend: {
|
|
|
|
legend: {
|
|
|
|
// data: [],
|
|
|
|
// data: [],
|
|
|
@ -38,7 +44,7 @@ export const getRangeOptions = ({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
xAxis: {
|
|
|
|
xAxis: {
|
|
|
|
type: 'category',
|
|
|
|
type: 'category',
|
|
|
|
data: core.map((item) => timeParse(+item.timestamp)),
|
|
|
|
data: xData.map((item) => timeParse(+item.timestamp)),
|
|
|
|
axisLabel: {
|
|
|
|
axisLabel: {
|
|
|
|
formatter: function (value) {
|
|
|
|
formatter: function (value) {
|
|
|
|
return timeParse(value, 'HH:mm');
|
|
|
|
return timeParse(value, 'HH:mm');
|
|
|
|