mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-10 15:14:09 +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 { SeriesLimits } from "../../../types";
|
||||
import { useCustomPanelDispatch, useCustomPanelState } from "../../../state/customPanel/CustomPanelStateContext";
|
||||
import { getAppModeEnable } from "../../../utils/app-mode";
|
||||
import classNames from "classnames";
|
||||
|
||||
const title = "Settings";
|
||||
|
||||
const GlobalSettings: FC = () => {
|
||||
|
||||
const appModeEnable = getAppModeEnable();
|
||||
const { serverUrl: stateServerUrl } = useAppState();
|
||||
const { seriesLimits } = useCustomPanelState();
|
||||
|
||||
|
@ -36,7 +39,9 @@ const GlobalSettings: FC = () => {
|
|||
return <>
|
||||
<Tooltip title={title}>
|
||||
<Button
|
||||
className="vm-header-button"
|
||||
className={classNames({
|
||||
"vm-header-button": !appModeEnable
|
||||
})}
|
||||
variant="contained"
|
||||
color="primary"
|
||||
startIcon={<SettingsIcon/>}
|
||||
|
@ -49,13 +54,15 @@ const GlobalSettings: FC = () => {
|
|||
onClose={handleClose}
|
||||
>
|
||||
<div className="vm-server-configurator">
|
||||
<div className="vm-server-configurator__input">
|
||||
<ServerConfigurator
|
||||
serverUrl={serverUrl}
|
||||
onChange={setServerUrl}
|
||||
onEnter={handlerApply}
|
||||
/>
|
||||
</div>
|
||||
{!appModeEnable && (
|
||||
<div className="vm-server-configurator__input">
|
||||
<ServerConfigurator
|
||||
serverUrl={serverUrl}
|
||||
onChange={setServerUrl}
|
||||
onEnter={handlerApply}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className="vm-server-configurator__input">
|
||||
<LimitsConfigurator
|
||||
limits={limits}
|
||||
|
|
|
@ -115,7 +115,7 @@ const Header: FC = () => {
|
|||
{headerSetup?.timeSelector && <TimeSelector/>}
|
||||
{headerSetup?.cardinalityDatePicker && <CardinalityDatePicker/>}
|
||||
{headerSetup?.executionControls && <ExecutionControls/>}
|
||||
{headerSetup?.globalSettings && !appModeEnable && <GlobalSettings/>}
|
||||
<GlobalSettings/>
|
||||
<ShortcutKeys/>
|
||||
</div>
|
||||
</header>;
|
||||
|
|
|
@ -19,7 +19,6 @@ const routerOptionsDefault = {
|
|||
header: {
|
||||
timeSelector: true,
|
||||
executionControls: true,
|
||||
globalSettings: true,
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -29,7 +28,6 @@ export const routerOptions: {[key: string]: RouterOptions} = {
|
|||
[router.cardinality]: {
|
||||
header: {
|
||||
cardinalityDatePicker: true,
|
||||
globalSettings: true,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue