mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
parent
2c7c812a9d
commit
0582ec5c8c
2 changed files with 4 additions and 2 deletions
|
@ -8,6 +8,7 @@ import { QueryStats } from "../../../api/types";
|
||||||
import { partialWarning, seriesFetchedWarning } from "./warningText";
|
import { partialWarning, seriesFetchedWarning } from "./warningText";
|
||||||
import { AutocompleteOptions } from "../../Main/Autocomplete/Autocomplete";
|
import { AutocompleteOptions } from "../../Main/Autocomplete/Autocomplete";
|
||||||
import { useQueryDispatch } from "../../../state/query/QueryStateContext";
|
import { useQueryDispatch } from "../../../state/query/QueryStateContext";
|
||||||
|
import useDeviceDetect from "../../../hooks/useDeviceDetect";
|
||||||
|
|
||||||
export interface QueryEditorProps {
|
export interface QueryEditorProps {
|
||||||
onChange: (query: string) => void;
|
onChange: (query: string) => void;
|
||||||
|
@ -35,6 +36,7 @@ const QueryEditor: FC<QueryEditorProps> = ({
|
||||||
label,
|
label,
|
||||||
disabled = false
|
disabled = false
|
||||||
}) => {
|
}) => {
|
||||||
|
const { isMobile } = useDeviceDetect();
|
||||||
|
|
||||||
const [openAutocomplete, setOpenAutocomplete] = useState(false);
|
const [openAutocomplete, setOpenAutocomplete] = useState(false);
|
||||||
const [caretPosition, setCaretPosition] = useState([0, 0]);
|
const [caretPosition, setCaretPosition] = useState([0, 0]);
|
||||||
|
@ -115,7 +117,7 @@ const QueryEditor: FC<QueryEditorProps> = ({
|
||||||
value={value}
|
value={value}
|
||||||
label={label}
|
label={label}
|
||||||
type={"textarea"}
|
type={"textarea"}
|
||||||
autofocus={!!value}
|
autofocus={!isMobile}
|
||||||
error={error}
|
error={error}
|
||||||
warning={warning}
|
warning={warning}
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
|
|
|
@ -71,7 +71,7 @@ const ExploreMetricsHeader: FC<ExploreMetricsHeaderProps> = ({
|
||||||
label="Job"
|
label="Job"
|
||||||
placeholder="Please select job"
|
placeholder="Please select job"
|
||||||
onChange={onChangeJob}
|
onChange={onChangeJob}
|
||||||
autofocus={!job}
|
autofocus={!job && !!jobs.length && !isMobile}
|
||||||
searchable
|
searchable
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue