⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.72
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
admin
/
View File Name :
AdminFeatureTogglesPage.tsx
import { css } from '@emotion/css'; import React, { useState } from 'react'; import { useAsync } from 'react-use'; import { GrafanaTheme2 } from '@grafana/data'; import { useStyles2, Icon } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { getTogglesAPI } from './AdminFeatureTogglesAPI'; import { AdminFeatureTogglesTable } from './AdminFeatureTogglesTable'; export default function AdminFeatureTogglesPage() { const [reload, setReload] = useState(1); const togglesApi = getTogglesAPI(); const featureState = useAsync(() => togglesApi.getFeatureToggles(), [reload]); const styles = useStyles2(getStyles); const handleUpdateSuccess = () => { setReload(reload + 1); }; const EditingAlert = () => { return (
{featureState.value?.restartRequired ? 'A restart is pending for your Grafana instance to apply the latest feature toggle changes' : 'Saving feature toggle changes will prompt a restart of the instance, which may take a few minutes'}
); }; const subTitle = (
View and edit feature toggles. Read more about feature toggles at{' '}
grafana.com
.
); return (
<> {featureState.error} {featureState.loading && 'Fetching feature toggles'}
{featureState.value && (
)} >
); } function getStyles(theme: GrafanaTheme2) { return { warning: css({ display: 'flex', marginTop: theme.spacing(0.25), marginBottom: theme.spacing(0.25), }), icon: css({ color: theme.colors.warning.main, paddingRight: theme.spacing(), }), message: css({ color: theme.colors.text.secondary, marginTop: theme.spacing(0.25), }), }; }