The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/features/datasources/settings/ButtonRow.tsx

40 lines
1.0 KiB

import React, { FC } from 'react';
import config from 'app/core/config';
export interface Props {
isReadOnly: boolean;
onDelete: () => void;
onSubmit: (event: any) => void;
onTest: (event: any) => void;
}
const ButtonRow: FC<Props> = ({ isReadOnly, onDelete, onSubmit, onTest }) => {
return (
<div className="gf-form-button-row">
{!isReadOnly && (
<button
type="submit"
className="btn btn-primary"
disabled={isReadOnly}
onClick={event => onSubmit(event)}
aria-label="Save and Test button"
>
Save &amp; Test
</button>
)}
{isReadOnly && (
<button type="submit" className="btn btn-success" onClick={onTest}>
Test
</button>
)}
<button type="submit" className="btn btn-danger" disabled={isReadOnly} onClick={onDelete}>
Delete
</button>
<a className="btn btn-inverse" href={`${config.appSubUrl}/datasources`}>
Back
</a>
</div>
);
};
export default ButtonRow;