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) { showFullscreen (show, chartInfo) {
this.fullscreen.chartInfo = chartInfo this.fullscreen.chartInfo = chartInfo
this.fullscreen.visible = show this.fullscreen.visible = show
},
cleanData () {
} }
}, },
mounted () { mounted () {

View File

@@ -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) => {

View File

@@ -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,

View File

@@ -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