use the metricsNames in PromQLExtension & update the import path
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
This commit is contained in:
parent
7071b94a07
commit
bfc022fdf4
|
@ -11,15 +11,15 @@ import { closeBrackets, closeBracketsKeymap } from '@codemirror/closebrackets';
|
|||
import { searchKeymap, highlightSelectionMatches } from '@codemirror/search';
|
||||
import { commentKeymap } from '@codemirror/comment';
|
||||
import { lintKeymap } from '@codemirror/lint';
|
||||
import { PromQLExtension } from 'codemirror-promql';
|
||||
import { PromQLExtension, CompleteStrategy } from 'codemirror-promql';
|
||||
import { autocompletion, completionKeymap, CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
||||
import { theme, promqlHighlighter } from './CMTheme';
|
||||
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faSearch, faSpinner, faGlobeEurope } from '@fortawesome/free-solid-svg-icons';
|
||||
import MetricsExplorer from './MetricsExplorer';
|
||||
import { CompleteStrategy, newCompleteStrategy } from 'codemirror-promql/complete';
|
||||
import { usePathPrefix } from '../../contexts/PathPrefixContext';
|
||||
import { newCompleteStrategy } from 'codemirror-promql/cjs/complete';
|
||||
|
||||
const promqlExtension = new PromQLExtension();
|
||||
|
||||
|
@ -102,7 +102,7 @@ const CMExpressionInput: FC<CMExpressionInputProps> = ({
|
|||
.setComplete({
|
||||
completeStrategy: new HistoryCompleteStrategy(
|
||||
newCompleteStrategy({
|
||||
remote: { url: pathPrefix },
|
||||
remote: { url: pathPrefix, cache: { initialMetricList: metricNames } },
|
||||
}),
|
||||
queryHistory
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue