mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
fix: change header settings (#3391)
This commit is contained in:
parent
805d93dfec
commit
fc8ff75e27
3 changed files with 16 additions and 11 deletions
|
@ -9,11 +9,14 @@ import Tooltip from "../../Main/Tooltip/Tooltip";
|
||||||
import LimitsConfigurator from "./LimitsConfigurator/LimitsConfigurator";
|
import LimitsConfigurator from "./LimitsConfigurator/LimitsConfigurator";
|
||||||
import { SeriesLimits } from "../../../types";
|
import { SeriesLimits } from "../../../types";
|
||||||
import { useCustomPanelDispatch, useCustomPanelState } from "../../../state/customPanel/CustomPanelStateContext";
|
import { useCustomPanelDispatch, useCustomPanelState } from "../../../state/customPanel/CustomPanelStateContext";
|
||||||
|
import { getAppModeEnable } from "../../../utils/app-mode";
|
||||||
|
import classNames from "classnames";
|
||||||
|
|
||||||
const title = "Settings";
|
const title = "Settings";
|
||||||
|
|
||||||
const GlobalSettings: FC = () => {
|
const GlobalSettings: FC = () => {
|
||||||
|
|
||||||
|
const appModeEnable = getAppModeEnable();
|
||||||
const { serverUrl: stateServerUrl } = useAppState();
|
const { serverUrl: stateServerUrl } = useAppState();
|
||||||
const { seriesLimits } = useCustomPanelState();
|
const { seriesLimits } = useCustomPanelState();
|
||||||
|
|
||||||
|
@ -36,7 +39,9 @@ const GlobalSettings: FC = () => {
|
||||||
return <>
|
return <>
|
||||||
<Tooltip title={title}>
|
<Tooltip title={title}>
|
||||||
<Button
|
<Button
|
||||||
className="vm-header-button"
|
className={classNames({
|
||||||
|
"vm-header-button": !appModeEnable
|
||||||
|
})}
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="primary"
|
color="primary"
|
||||||
startIcon={<SettingsIcon/>}
|
startIcon={<SettingsIcon/>}
|
||||||
|
@ -49,13 +54,15 @@ const GlobalSettings: FC = () => {
|
||||||
onClose={handleClose}
|
onClose={handleClose}
|
||||||
>
|
>
|
||||||
<div className="vm-server-configurator">
|
<div className="vm-server-configurator">
|
||||||
<div className="vm-server-configurator__input">
|
{!appModeEnable && (
|
||||||
<ServerConfigurator
|
<div className="vm-server-configurator__input">
|
||||||
serverUrl={serverUrl}
|
<ServerConfigurator
|
||||||
onChange={setServerUrl}
|
serverUrl={serverUrl}
|
||||||
onEnter={handlerApply}
|
onChange={setServerUrl}
|
||||||
/>
|
onEnter={handlerApply}
|
||||||
</div>
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div className="vm-server-configurator__input">
|
<div className="vm-server-configurator__input">
|
||||||
<LimitsConfigurator
|
<LimitsConfigurator
|
||||||
limits={limits}
|
limits={limits}
|
||||||
|
|
|
@ -115,7 +115,7 @@ const Header: FC = () => {
|
||||||
{headerSetup?.timeSelector && <TimeSelector/>}
|
{headerSetup?.timeSelector && <TimeSelector/>}
|
||||||
{headerSetup?.cardinalityDatePicker && <CardinalityDatePicker/>}
|
{headerSetup?.cardinalityDatePicker && <CardinalityDatePicker/>}
|
||||||
{headerSetup?.executionControls && <ExecutionControls/>}
|
{headerSetup?.executionControls && <ExecutionControls/>}
|
||||||
{headerSetup?.globalSettings && !appModeEnable && <GlobalSettings/>}
|
<GlobalSettings/>
|
||||||
<ShortcutKeys/>
|
<ShortcutKeys/>
|
||||||
</div>
|
</div>
|
||||||
</header>;
|
</header>;
|
||||||
|
|
|
@ -19,7 +19,6 @@ const routerOptionsDefault = {
|
||||||
header: {
|
header: {
|
||||||
timeSelector: true,
|
timeSelector: true,
|
||||||
executionControls: true,
|
executionControls: true,
|
||||||
globalSettings: true,
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,7 +28,6 @@ export const routerOptions: {[key: string]: RouterOptions} = {
|
||||||
[router.cardinality]: {
|
[router.cardinality]: {
|
||||||
header: {
|
header: {
|
||||||
cardinalityDatePicker: true,
|
cardinalityDatePicker: true,
|
||||||
globalSettings: true,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue