@fortawesome/free-solid-svg-icons#faEllipsis JavaScript Examples
The following examples show how to use
@fortawesome/free-solid-svg-icons#faEllipsis.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: List.js From web-client with Apache License 2.0 | 5 votes |
ClientsList = () => {
const navigate = useNavigate();
const [clients, updateTasks] = useFetch('/clients')
const destroy = useDelete('/clients/', updateTasks);
const handleCreateClient = () => {
navigate(`/clients/create`)
}
return <>
<PageTitle value="Clients" />
<div className='heading'>
<Breadcrumb />
<ButtonGroup isAttached>
<CreateButton onClick={handleCreateClient}>Add client</CreateButton>
<Menu>
<MenuButton as={IconButton} aria-label='Options' icon={<FontAwesomeIcon icon={faEllipsis} />} variant='outline' />
<MenuList>
<ExportMenuItem entity="clients" />
</MenuList>
</Menu>
</ButtonGroup>
</div>
<Title title='Clients' icon={<IconBriefcase />} />
<Table>
<Thead>
<Tr>
<Th>Name</Th>
<Th>Address</Th>
<Th>URL</Th>
<Th>Number of contacts</Th>
<Th> </Th>
</Tr>
</Thead>
<Tbody>
{null === clients && <LoadingTableRow numColumns={5} />}
{null !== clients && 0 === clients.length && <NoResultsTableRow numColumns={5} />}
{null !== clients && 0 < clients.length && clients.map(client =>
<Tr key={client.id}>
<Td><ClientLink clientId={client.id}>{client.name}</ClientLink></Td>
<Td>{client.address || '-'}</Td>
<Td>{client.url ? <ExternalLink href={client.url}>{client.url}</ExternalLink> : '-'}</Td>
<Td>{client.num_contacts}</Td>
<Td textAlign="right">
<LinkButton href={`/clients/${client.id}/edit`}>Edit</LinkButton>
<DeleteIconButton onClick={() => destroy(client.id)} />
</Td>
</Tr>
)
}
</Tbody>
</Table>
</>
}
Example #2
Source File: List.js From web-client with Apache License 2.0 | 5 votes |
CommandsListPage = () => {
const navigate = useNavigate();
const query = useQuery();
let pageNumber = query.get('page');
pageNumber = pageNumber !== null ? parseInt(pageNumber) : 1;
const apiPageNumber = pageNumber - 1;
const [numberPages, setNumberPages] = useState(1);
const [totalCount, setTotalCount] = useState('?');
const [commands, setCommands] = useState([]);
const onAddCommandClick = ev => {
ev.preventDefault();
navigate('/commands/add');
}
const handlePrev = () => {
const queryParams = new URLSearchParams();
queryParams.set('page', pageNumber - 1);
const url = `/commands?${queryParams.toString()}`;
navigate(url);
}
const handleNext = () => {
const queryParams = new URLSearchParams();
queryParams.set('page', pageNumber + 1);
const url = `/commands?${queryParams.toString()}`;
navigate(url);
}
const reloadCommands = useCallback(() => {
setCommands(null);
const queryParams = new URLSearchParams();
queryParams.set('page', apiPageNumber);
const url = `/commands?${queryParams.toString()}`;
secureApiFetch(url, { method: 'GET' })
.then(resp => {
if (resp.headers.has('X-Page-Count')) {
setNumberPages(resp.headers.get('X-Page-Count'))
}
if (resp.headers.has('X-Total-Count')) {
setTotalCount(resp.headers.get('X-Total-Count'))
}
return resp.json()
})
.then(commands => {
setCommands(commands);
});
}, [setCommands, apiPageNumber]);
const destroy = useDelete('/commands/', reloadCommands);
useEffect(() => {
reloadCommands()
}, [reloadCommands])
return <div>
<PageTitle value="Commands" />
<div className='heading'>
<Breadcrumb />
<Pagination page={apiPageNumber} total={numberPages} handlePrev={handlePrev} handleNext={handleNext} />
<ButtonGroup isAttached>
<CreateButton onClick={onAddCommandClick}>Add command</CreateButton>
<Menu>
<MenuButton as={IconButton} aria-label='Options' icon={<FontAwesomeIcon icon={faEllipsis} />} variant='outline' />
<MenuList>
<ExportMenuItem entity="commands" />
</MenuList>
</Menu>
</ButtonGroup>
</div>
<Title title={`Commands (${totalCount})`} icon={<IconFolder />} />
<CommandsTable commands={commands} onDeleteCallback={destroy} />
</div>
}
Example #3
Source File: EllipsisMenuButton.js From web-client with Apache License 2.0 | 5 votes |
EllipsisMenuButton = () => <MenuButton as={IconButton} aria-label="Options" icon={<FontAwesomeIcon icon={faEllipsis} />} variant="outline" />
Example #4
Source File: Details.js From web-client with Apache License 2.0 | 4 votes |
ProjectDetails = () => {
const navigate = useNavigate();
const { projectId } = useParams();
const { colorMode } = useColorMode()
const [project, updateProject] = useFetch(`/projects/${projectId}`)
const [users] = useFetch(`/projects/${projectId}/users`)
const destroy = useDelete(`/projects/`, updateProject);
const handleGenerateReport = () => {
navigate(`/projects/${project.id}/report`)
}
const handleManageTeam = () => {
navigate(`/projects/${project.id}/membership`)
}
const onArchiveButtonClick = (project) => {
secureApiFetch(`/projects/${project.id}`, {
method: 'PATCH',
body: JSON.stringify({ archived: !project.archived })
})
.then(() => {
updateProject();
actionCompletedToast('The project has been updated.');
})
.catch(err => console.error(err))
}
if (project && project.is_template) {
return <Navigate to={`/projects/templates/${project.id}`} />
}
return <>
<div className='heading'>
<Breadcrumb>
<Link to="/projects">Projects</Link>
</Breadcrumb>
{project && <>
<PageTitle value={`${project.name} project`} />
<ProjectTeam project={project} users={users} />
<ButtonGroup isAttached>
<RestrictedComponent roles={['administrator', 'superuser', 'user']}>
{!project.archived && <>
<LinkButton href={`/projects/${project.id}/edit`}>Edit</LinkButton>
<SecondaryButton onClick={handleGenerateReport} leftIcon={<IconClipboardCheck />}>Report</SecondaryButton>
<SecondaryButton onClick={handleManageTeam} leftIcon={<IconUserGroup />}>Membership</SecondaryButton>
</>}
<Menu>
<MenuButton as={IconButton} aria-label='Options' icon={<FontAwesomeIcon icon={faEllipsis} />} variant='outline' />
<MenuList>
<MenuItem onClick={() => onArchiveButtonClick(project)}>{project.archived ? 'Unarchive' : 'Archive'}</MenuItem>
<MenuItem icon={<FontAwesomeIcon icon={faTrash} />} color={colorMode === "light" ? "red.500" : "red.400"} onClick={() => destroy(project.id)}>Delete</MenuItem>
</MenuList>
</Menu>
</RestrictedComponent>
</ButtonGroup>
</>}
</div>
{!project ? <Loading /> :
<>
<Title title={project.name} type="Project" icon={<IconFolder />} />
<Tabs>
<TabList>
<Tab>Details</Tab>
<Tab>Targets</Tab>
<Tab>Tasks</Tab>
<Tab>Vulnerabilities</Tab>
<Tab>Notes</Tab>
<Tab>Attachments</Tab>
<Tab>Vault</Tab>
</TabList>
<TabPanels>
<TabPanel><ProjectDetailsTab project={project} /></TabPanel>
<TabPanel><ProjectTargets project={project} /></TabPanel>
<TabPanel><ProjectTasks project={project} /></TabPanel>
<TabPanel><ProjectVulnerabilities project={project} /></TabPanel>
<TabPanel><ProjectNotesTab project={project} /></TabPanel>
<TabPanel><ProjectAttachmentsTab project={project} /></TabPanel>
<TabPanel><ProjectVaultTab project={project} /></TabPanel>
</TabPanels>
</Tabs>
</>
}
</>
}