feat(ui): renovate the FDO devices list EE-3669 (#7231)

pull/7356/head
matias-portainer 2 years ago committed by GitHub
parent 87e9d7f8d4
commit 7e3347da2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,7 +12,6 @@ import { useTableSettings } from '@@/datatables/useTableSettings';
import { useRowSelect } from '@@/datatables/useRowSelect'; import { useRowSelect } from '@@/datatables/useRowSelect';
import { import {
Table, Table,
TableActions,
TableContainer, TableContainer,
TableHeaderRow, TableHeaderRow,
TableRow, TableRow,
@ -78,14 +77,12 @@ export function FDOProfilesDatatable({
return ( return (
<TableContainer> <TableContainer>
<TableTitle icon="" label="Device Profiles" /> <TableTitle icon="list" featherIcon label="Device Profiles">
<TableActions>
<FDOProfilesDatatableActions <FDOProfilesDatatableActions
isFDOEnabled={isFDOEnabled} isFDOEnabled={isFDOEnabled}
selectedItems={selectedFlatRows.map((row) => row.original)} selectedItems={selectedFlatRows.map((row) => row.original)}
/> />
</TableActions> </TableTitle>
<Table <Table
className={tableProps.className} className={tableProps.className}

@ -27,8 +27,7 @@ export function FDOProfilesDatatableActions({
return ( return (
<div className="actionBar"> <div className="actionBar">
<Link to="portainer.endpoints.profile" className="space-left"> <Link to="portainer.endpoints.profile" className="space-left">
<Button disabled={!isFDOEnabled}> <Button disabled={!isFDOEnabled} icon="plus-circle" featherIcon>
<i className="fa fa-plus-circle space-right" aria-hidden="true" />
Add Profile Add Profile
</Button> </Button>
</Link> </Link>
@ -36,8 +35,9 @@ export function FDOProfilesDatatableActions({
<Button <Button
disabled={!isFDOEnabled || selectedItems.length !== 1} disabled={!isFDOEnabled || selectedItems.length !== 1}
onClick={() => onDuplicateProfileClick()} onClick={() => onDuplicateProfileClick()}
icon="plus-circle"
featherIcon
> >
<i className="fa fa-plus-circle space-right" aria-hidden="true" />
Duplicate Duplicate
</Button> </Button>
@ -45,8 +45,9 @@ export function FDOProfilesDatatableActions({
disabled={!isFDOEnabled || selectedItems.length < 1} disabled={!isFDOEnabled || selectedItems.length < 1}
color="danger" color="danger"
onClick={() => onDeleteProfileClick()} onClick={() => onDeleteProfileClick()}
icon="trash-2"
featherIcon
> >
<i className="fa fa-trash-alt space-right" aria-hidden="true" />
Remove Remove
</Button> </Button>
</div> </div>

@ -1,6 +1,8 @@
import { PropsWithChildren } from 'react'; import { PropsWithChildren } from 'react';
import clsx from 'clsx'; import clsx from 'clsx';
import { Icon } from '@@/Icon';
type Color = 'orange' | 'blue'; type Color = 'orange' | 'blue';
export interface Props { export interface Props {
@ -11,15 +13,25 @@ export function TextTip({
color = 'orange', color = 'orange',
children, children,
}: PropsWithChildren<Props>) { }: PropsWithChildren<Props>) {
let iconClass: string;
switch (color) {
case 'blue':
iconClass = 'icon-primary';
break;
case 'orange':
iconClass = 'icon-warning';
break;
default:
iconClass = 'icon-warning';
}
return ( return (
<p className="text-muted small"> <p className="text-muted small vertical-center">
<i <Icon
aria-hidden="true" icon="alert-circle"
className={clsx( feather
'fa fa-exclamation-circle', className={clsx(`${iconClass}`, 'space-right')}
`${color}-icon`,
'space-right'
)}
/> />
{children} {children}
</p> </p>

Loading…
Cancel
Save