fix:修改 datasource 大小写的问题
This commit is contained in:
@@ -121,6 +121,9 @@ export default {
|
|||||||
showFullscreen (show, chartInfo) {
|
showFullscreen (show, chartInfo) {
|
||||||
this.fullscreen.chartInfo = chartInfo
|
this.fullscreen.chartInfo = chartInfo
|
||||||
this.fullscreen.visible = show
|
this.fullscreen.visible = show
|
||||||
|
},
|
||||||
|
cleanData () {
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|||||||
@@ -77,14 +77,15 @@ export default {
|
|||||||
this.query(elements, startTime, endTime, step)
|
this.query(elements, startTime, endTime, step)
|
||||||
},
|
},
|
||||||
query (elements, startTime, endTime, step) {
|
query (elements, startTime, endTime, step) {
|
||||||
|
console.log(this.chartInfo.datasource,elements, startTime, endTime, step)
|
||||||
try {
|
try {
|
||||||
switch (this.chartInfo.dataSource) {
|
switch (this.chartInfo.datasource) {
|
||||||
case 'metrics':
|
case 'metrics':
|
||||||
case 'logs': {
|
case 'logs': {
|
||||||
let urlPre = ''
|
let urlPre = ''
|
||||||
if (this.chartInfo.dataSource === 1) {
|
if (this.chartInfo.datasource === 'metrics') {
|
||||||
urlPre = '/prom'
|
urlPre = '/prom'
|
||||||
} else if (this.chartInfo.dataSource === 2) {
|
} else if (this.chartInfo.datasource === 'logs') {
|
||||||
urlPre = '/logs/loki'
|
urlPre = '/logs/loki'
|
||||||
}
|
}
|
||||||
const requests = elements.map((element) => {
|
const requests = elements.map((element) => {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const chartData = {
|
|||||||
name: '123',
|
name: '123',
|
||||||
panelId: 1243,
|
panelId: 1243,
|
||||||
groupId: 0,
|
groupId: 0,
|
||||||
dataSource: 'metrics',
|
datasource: 'metrics',
|
||||||
span: 12,
|
span: 12,
|
||||||
height: 6,
|
height: 6,
|
||||||
updateBy: 1,
|
updateBy: 1,
|
||||||
@@ -126,7 +126,7 @@ const chartData = {
|
|||||||
name: '233',
|
name: '233',
|
||||||
panelId: 1243,
|
panelId: 1243,
|
||||||
groupId: 0,
|
groupId: 0,
|
||||||
dataSource: 'metrics',
|
datasource: 'metrics',
|
||||||
span: 6,
|
span: 6,
|
||||||
height: 4,
|
height: 4,
|
||||||
updateBy: 1,
|
updateBy: 1,
|
||||||
@@ -236,7 +236,7 @@ const chartData = {
|
|||||||
type: 'line',
|
type: 'line',
|
||||||
unit: 2,
|
unit: 2,
|
||||||
weight: 2,
|
weight: 2,
|
||||||
dataSource: 'metrics',
|
datasource: 'metrics',
|
||||||
param: '{' +
|
param: '{' +
|
||||||
' "style":"line",' +
|
' "style":"line",' +
|
||||||
' "showHeader":true,' +
|
' "showHeader":true,' +
|
||||||
@@ -460,7 +460,7 @@ const chartData = {
|
|||||||
type: 'hexagonFigure',
|
type: 'hexagonFigure',
|
||||||
unit: 2,
|
unit: 2,
|
||||||
weight: 2,
|
weight: 2,
|
||||||
dataSource: 'misc',
|
datasource: 'misc',
|
||||||
param: '{' +
|
param: '{' +
|
||||||
' "from":"module",' +
|
' "from":"module",' +
|
||||||
' "showHeader":true,' +
|
' "showHeader":true,' +
|
||||||
@@ -667,7 +667,7 @@ const chartData = {
|
|||||||
name: '123',
|
name: '123',
|
||||||
panelId: 1243,
|
panelId: 1243,
|
||||||
groupId: 0,
|
groupId: 0,
|
||||||
dataSource: 6,
|
datasource: 6,
|
||||||
span: 12,
|
span: 12,
|
||||||
height: 6,
|
height: 6,
|
||||||
updateBy: 1,
|
updateBy: 1,
|
||||||
@@ -782,7 +782,7 @@ const chartData = {
|
|||||||
name: '123',
|
name: '123',
|
||||||
panelId: 1243,
|
panelId: 1243,
|
||||||
groupId: 0,
|
groupId: 0,
|
||||||
dataSource: 5,
|
datasource: 5,
|
||||||
span: 12,
|
span: 12,
|
||||||
height: 6,
|
height: 6,
|
||||||
updateBy: 1,
|
updateBy: 1,
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ export const fromRoute = {
|
|||||||
chartTemp: 'chartTemp'
|
chartTemp: 'chartTemp'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const chartDataSource = [
|
export const chartdatasource = [
|
||||||
{
|
{
|
||||||
label: 'metrics',
|
label: 'metrics',
|
||||||
value: 1
|
value: 1
|
||||||
|
|||||||
Reference in New Issue
Block a user