2019-10-03 07:11:21 -05:00
|
|
|
import React from 'react';
|
2022-01-07 10:59:14 -06:00
|
|
|
import { useAsync } from 'react-use';
|
2019-10-03 07:11:21 -05:00
|
|
|
|
2022-04-22 08:33:13 -05:00
|
|
|
import { getBackendSrv } from '@grafana/runtime';
|
2022-07-06 10:00:56 -05:00
|
|
|
import { Page } from 'app/core/components/Page/Page';
|
2019-10-03 07:11:21 -05:00
|
|
|
|
|
|
|
type Settings = { [key: string]: { [key: string]: string } };
|
|
|
|
|
2022-09-19 06:21:41 -05:00
|
|
|
function AdminSettings() {
|
2022-10-17 04:10:10 -05:00
|
|
|
const { loading, value: settings } = useAsync(() => getBackendSrv().get<Settings>('/api/admin/settings'), []);
|
2022-01-07 10:59:14 -06:00
|
|
|
|
|
|
|
return (
|
2022-09-19 06:21:41 -05:00
|
|
|
<Page navId="server-settings">
|
2022-01-07 10:59:14 -06:00
|
|
|
<Page.Contents isLoading={loading}>
|
|
|
|
<div className="grafana-info-box span8" style={{ margin: '20px 0 25px 0' }}>
|
|
|
|
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.
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{settings && (
|
2019-10-03 07:11:21 -05:00
|
|
|
<table className="filter-table">
|
|
|
|
<tbody>
|
|
|
|
{Object.entries(settings).map(([sectionName, sectionSettings], i) => (
|
|
|
|
<React.Fragment key={`section-${i}`}>
|
|
|
|
<tr>
|
|
|
|
<td className="admin-settings-section">{sectionName}</td>
|
|
|
|
<td />
|
|
|
|
</tr>
|
|
|
|
{Object.entries(sectionSettings).map(([settingName, settingValue], j) => (
|
|
|
|
<tr key={`property-${j}`}>
|
|
|
|
<td style={{ paddingLeft: '25px' }}>{settingName}</td>
|
2020-05-12 03:54:25 -05:00
|
|
|
<td style={{ whiteSpace: 'break-spaces' }}>{settingValue}</td>
|
2019-10-03 07:11:21 -05:00
|
|
|
</tr>
|
|
|
|
))}
|
|
|
|
</React.Fragment>
|
|
|
|
))}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2022-01-07 10:59:14 -06:00
|
|
|
)}
|
|
|
|
</Page.Contents>
|
|
|
|
</Page>
|
|
|
|
);
|
2019-10-03 07:11:21 -05:00
|
|
|
}
|
|
|
|
|
2022-09-19 06:21:41 -05:00
|
|
|
export default AdminSettings;
|