Skip to content

Commit

Permalink
feat: 新增告警数据源插件menu判断
Browse files Browse the repository at this point in the history
  • Loading branch information
liangling0628 committed Jan 23, 2024
1 parent a0b7511 commit dd61724
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions bkmonitor-alert-datasource/src/datasource/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default class DashboardDatasource extends DataSourceApi<QueryData, QueryO
end_time: options.range.to.unix(),
expression: config.refId || '',
...this.handleGetQueryConfig(config, options.scopedVars),
query_configs: [this.handleGetQueryConfig(config, options.scopedVars)],
// query_configs: [this.handleGetQueryConfig(config, options.scopedVars)],
},
method: 'POST',
})
Expand Down Expand Up @@ -527,8 +527,8 @@ export default class DashboardDatasource extends DataSourceApi<QueryData, QueryO
config.where
?.filter?.(item => item.key && item.value?.length)
.map(condition => ({ ...condition, value: this.buildWhereVariables(condition.value, scopedVars) })) || [],
interval: this.repalceInterval(config.interval, config.interval_unit),
interval_unit: 's',
interval: config.interval === 'auto' || !config.interval ? 'auto' : config.interval,
interval_unit: config.interval_unit || 'h',
};
}
async testDatasource() {
Expand Down
4 changes: 2 additions & 2 deletions bkmonitor-alert-datasource/src/typings/metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ export const ALERT_INTERVAL_UNIT_LIST = [
},
{
id: 'h',
name: 'h',
name: 'hour',
},
{
id: 'd',
name: 'd',
name: 'day',
},
];
// 汇聚周期单位
Expand Down

0 comments on commit dd61724

Please sign in to comment.