Skip to content

Commit f256c28

Browse files
committed
feat: promql 降采样原始默认改为false
1 parent 6c3e20e commit f256c28

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/profiling/src/datasource/datasource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ export default class DashboardDatasource extends DataSourceApi<ProfilingQuery, Q
117117
this.request<BackendDataSourceResponse>(QueryUrl.query_graph_profile, {
118118
data: {
119119
bk_biz_id: this.bizId,
120-
start: options.range.from.unix(),
121-
end: options.range.to.unix(),
120+
start: options.range.from.valueOf() * 1000,
121+
end: options.range.to.valueOf() * 1000,
122122
app_name: target.app_name,
123123
service_name: target.service_name,
124124
data_type: target.profile_type,

src/timeseries/src/components/editor-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { LanguageContext } from '../utils/context';
3131
export interface IEditorFormProps {
3232
labelStyle?: React.CSSProperties;
3333
metricList?: MetricDetail[];
34-
renderTitle?: () => Element;
34+
renderTitle?: () => React.ReactNode;
3535
style?: React.CSSProperties;
3636
tips?: string;
3737
title?: string;

src/timeseries/src/components/query-editor.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import {
5050
} from '../typings/metric';
5151
import { handleTransformOldQuery } from '../utils/common';
5252
import { LanguageContext } from '../utils/context';
53-
import { getCookie, t } from 'common/utils/utils';
53+
import { language, t } from 'common/utils/utils';
5454
import AddvanceSetting, { type AddvanceSettingKey } from './addvance-setting';
5555
import AliasInput from './alias-input';
5656
import ConditionInput from './condition-input';
@@ -118,7 +118,6 @@ export default class MonitorQueryEditor extends React.PureComponent<IQueryEditor
118118
promqlAlias = '',
119119
source = '',
120120
step = '',
121-
enableDownSampling = true,
122121
} = query;
123122
let expressions: IExpresionItem[] = expressionList;
124123
// 兼容旧版本
@@ -132,6 +131,11 @@ export default class MonitorQueryEditor extends React.PureComponent<IQueryEditor
132131
},
133132
];
134133
}
134+
const stateMode = only_promql || mode === 'code' ? 'code' : 'ui';
135+
let enableDownSampling = query.enableDownSampling;
136+
if (enableDownSampling === undefined) {
137+
enableDownSampling = stateMode !== 'code';
138+
}
135139
this.state = {
136140
cluster,
137141
editorStatus: 'default',
@@ -141,10 +145,10 @@ export default class MonitorQueryEditor extends React.PureComponent<IQueryEditor
141145
host,
142146
inited: false,
143147
isTranform: false,
144-
language: getCookie('blueking_language'),
148+
language: language,
145149
loading: true,
146150
metricList: [{} as any],
147-
mode: only_promql || mode === 'code' ? 'code' : 'ui',
151+
mode: stateMode,
148152
module,
149153
promqlAlias: promqlAlias || alias,
150154
searchState: SearcState.deafult,

0 commit comments

Comments
 (0)