mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-14 00:37:33 +00:00
fix query
This commit is contained in:
parent
cfe74b0888
commit
3f20f6165e
@ -154,6 +154,7 @@ export function useQueryProcessor(config: any) {
|
||||
}
|
||||
});
|
||||
const queryStr = `query queryData(${variables}) {${fragment}}`;
|
||||
console.log(queryStr);
|
||||
return {
|
||||
queryStr,
|
||||
conditions,
|
||||
@ -257,10 +258,12 @@ export function useQueryPodsMetrics(
|
||||
config: { metrics: string[]; metricTypes: string[] },
|
||||
scope: string
|
||||
) {
|
||||
if (!(config.metrics && config.metrics[0])) {
|
||||
const metricTypes = (config.metricTypes || []).filter((m: string) => m);
|
||||
if (!metricTypes.length) {
|
||||
return;
|
||||
}
|
||||
if (!(config.metricTypes && config.metricTypes[0])) {
|
||||
const metrics = (config.metrics || []).filter((m: string) => m);
|
||||
if (!metrics.length) {
|
||||
return;
|
||||
}
|
||||
const appStore = useAppStoreWithOut();
|
||||
@ -282,8 +285,8 @@ export function useQueryPodsMetrics(
|
||||
endpointName: scope === "Endpoint" ? d.label : undefined,
|
||||
normal: scope === "Service" ? d.normal : currentService.normal,
|
||||
};
|
||||
const f = config.metrics.map((name: string, idx: number) => {
|
||||
const metricType = config.metricTypes[idx] || "";
|
||||
const f = metrics.map((name: string, idx: number) => {
|
||||
const metricType = metricTypes[idx] || "";
|
||||
conditions[`condition${index}${idx}`] = {
|
||||
name,
|
||||
entity: param,
|
||||
|
@ -191,7 +191,10 @@ async function setMetricType(chart?: any) {
|
||||
states.metricList = (arr || []).filter(
|
||||
(d: { catalog: string; type: string }) => {
|
||||
if (states.isList) {
|
||||
if (d.type === MetricsType.REGULAR_VALUE) {
|
||||
if (
|
||||
d.type === MetricsType.REGULAR_VALUE ||
|
||||
d.type === MetricsType.LABELED_VALUE
|
||||
) {
|
||||
return d;
|
||||
}
|
||||
} else if (g.type === "Table") {
|
||||
|
@ -194,6 +194,7 @@ function clickService(scope: any) {
|
||||
router.push(path);
|
||||
}
|
||||
async function queryServiceMetrics(currentServices: Service[]) {
|
||||
// console.log(services.value);
|
||||
if (!currentServices.length) {
|
||||
return;
|
||||
}
|
||||
@ -219,7 +220,7 @@ async function queryServiceMetrics(currentServices: Service[]) {
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(services.value);
|
||||
services.value = currentServices;
|
||||
}
|
||||
function objectSpanMethod(param: any): any {
|
||||
|
Loading…
Reference in New Issue
Block a user