2019-10-03 13:11:21 +01:00
|
|
|
import React from 'react';
|
2022-01-07 08:59:14 -08:00
|
|
|
import { useAsync } from 'react-use';
|
2019-10-03 13:11:21 +01:00
|
|
|
|
2022-04-22 14:33:13 +01:00
|
|
|
import { getBackendSrv } from '@grafana/runtime';
|
2022-07-06 17:00:56 +02:00
|
|
|
import { Page } from 'app/core/components/Page/Page';
|
2019-10-03 13:11:21 +01:00
|
|
|
|
|
|
|
|
type Settings = { [key: string]: { [key: string]: string } };
|
|
|
|
|
|
2022-09-19 13:21:41 +02:00
|
|
|
function AdminSettings() {
|
2022-10-17 10:10:10 +01:00
|
|
|
const { loading, value: settings } = useAsync(() => getBackendSrv().get<Settings>('/api/admin/settings'), []);
|
2022-01-07 08:59:14 -08:00
|
|
|
|
|
|
|
|
return (
|
2022-09-19 13:21:41 +02:00
|
|
|
<Page navId="server-settings">
|
2022-01-07 08:59:14 -08: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 13:11:21 +01: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 10:54:25 +02:00
|
|
|
<td style={{ whiteSpace: 'break-spaces' }}>{settingValue}</td>
|
2019-10-03 13:11:21 +01:00
|
|
|
</tr>
|
|
|
|
|
))}
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
))}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2022-01-07 08:59:14 -08:00
|
|
|
)}
|
|
|
|
|
</Page.Contents>
|
|
|
|
|
</Page>
|
|
|
|
|
);
|
2019-10-03 13:11:21 +01:00
|
|
|
}
|
|
|
|
|
|
2022-09-19 13:21:41 +02:00
|
|
|
export default AdminSettings;
|