fix:修改 datasource 大小写的问题

This commit is contained in:
zhangyu
2021-12-06 16:13:25 +08:00
parent 958541bf18
commit b4954bbdb1
4 changed files with 14 additions and 10 deletions

View File

@@ -121,6 +121,9 @@ export default {
showFullscreen (show, chartInfo) {
this.fullscreen.chartInfo = chartInfo
this.fullscreen.visible = show
},
cleanData () {
}
},
mounted () {

View File

@@ -77,14 +77,15 @@ export default {
this.query(elements, startTime, endTime, step)
},
query (elements, startTime, endTime, step) {
console.log(this.chartInfo.datasource,elements, startTime, endTime, step)
try {
switch (this.chartInfo.dataSource) {
switch (this.chartInfo.datasource) {
case 'metrics':
case 'logs': {
let urlPre = ''
if (this.chartInfo.dataSource === 1) {
if (this.chartInfo.datasource === 'metrics') {
urlPre = '/prom'
} else if (this.chartInfo.dataSource === 2) {
} else if (this.chartInfo.datasource === 'logs') {
urlPre = '/logs/loki'
}
const requests = elements.map((element) => {

View File

@@ -12,7 +12,7 @@ const chartData = {
name: '123',
panelId: 1243,
groupId: 0,
dataSource: 'metrics',
datasource: 'metrics',
span: 12,
height: 6,
updateBy: 1,
@@ -126,7 +126,7 @@ const chartData = {
name: '233',
panelId: 1243,
groupId: 0,
dataSource: 'metrics',
datasource: 'metrics',
span: 6,
height: 4,
updateBy: 1,
@@ -236,7 +236,7 @@ const chartData = {
type: 'line',
unit: 2,
weight: 2,
dataSource: 'metrics',
datasource: 'metrics',
param: '{' +
' "style":"line",' +
' "showHeader":true,' +
@@ -460,7 +460,7 @@ const chartData = {
type: 'hexagonFigure',
unit: 2,
weight: 2,
dataSource: 'misc',
datasource: 'misc',
param: '{' +
' "from":"module",' +
' "showHeader":true,' +
@@ -667,7 +667,7 @@ const chartData = {
name: '123',
panelId: 1243,
groupId: 0,
dataSource: 6,
datasource: 6,
span: 12,
height: 6,
updateBy: 1,
@@ -782,7 +782,7 @@ const chartData = {
name: '123',
panelId: 1243,
groupId: 0,
dataSource: 5,
datasource: 5,
span: 12,
height: 6,
updateBy: 1,

View File

@@ -367,7 +367,7 @@ export const fromRoute = {
chartTemp: 'chartTemp'
}
export const chartDataSource = [
export const chartdatasource = [
{
label: 'metrics',
value: 1