import React from 'react'; import { connect } from 'react-redux'; import { useAsync } from 'react-use'; import { NavModel } from '@grafana/data'; import { getBackendSrv } from '@grafana/runtime'; import Page from 'app/core/components/Page/Page'; import { getNavModel } from 'app/core/selectors/navModel'; import { StoreState } from 'app/types'; type Settings = { [key: string]: { [key: string]: string } }; interface Props { navModel: NavModel; } function AdminSettings({ navModel }: Props) { const { loading, value: settings } = useAsync( () => getBackendSrv().get('/api/admin/settings') as Promise, [] ); return (
These system settings are defined in grafana.ini or custom.ini (or overridden in ENV variables). To change these you currently need to restart Grafana.
{settings && ( {Object.entries(settings).map(([sectionName, sectionSettings], i) => ( {Object.entries(sectionSettings).map(([settingName, settingValue], j) => ( ))} ))}
{sectionName}
{settingName} {settingValue}
)}
); } const mapStateToProps = (state: StoreState) => ({ navModel: getNavModel(state.navIndex, 'server-settings'), }); export default connect(mapStateToProps)(AdminSettings);