|
|
@ -71,11 +71,12 @@ const DeviceList = ({devices}: {devices: Device[]}) => { |
|
|
return ( |
|
|
return ( |
|
|
<div className="flex rounded-md border border-dashed border-slate-200 h-1/2 p-3 mb-2 dark:border-slate-700"> |
|
|
<div className="flex rounded-md border border-dashed border-slate-200 h-1/2 p-3 mb-2 dark:border-slate-700"> |
|
|
{devices.length ? ( |
|
|
{devices.length ? ( |
|
|
|
|
|
<div className="flex flex-col justify-between w-full"> |
|
|
<ul role="list" className="grow divide-y divide-gray-200"> |
|
|
<ul role="list" className="grow divide-y divide-gray-200"> |
|
|
{devices.map((device, index) => { |
|
|
{devices.map((device, index) => { |
|
|
return ( |
|
|
return ( |
|
|
<li key={device.id}> |
|
|
<li key={device.id}> |
|
|
<div className="px-4 py-4 sm:px-6"> |
|
|
<div className="py-4"> |
|
|
<div className="flex items-center justify-between"> |
|
|
<div className="flex items-center justify-between"> |
|
|
<p className="truncate text-sm font-medium text-accent"> |
|
|
<p className="truncate text-sm font-medium text-accent"> |
|
|
{device.nodes.get(device.hardware.myNodeNum)?.user |
|
|
{device.nodes.get(device.hardware.myNodeNum)?.user |
|
|
@ -103,7 +104,7 @@ const DeviceList = ({devices}: {devices: Device[]}) => { |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div className="mt-1 sm:flex sm:justify-between"> |
|
|
<div className="mt-1 sm:flex sm:justify-between"> |
|
|
<div className="flex gap-2 items-center text-sm text-gray-500"> |
|
|
<div className="flex gap-2 w-full items-center text-sm text-gray-500"> |
|
|
<UsersIcon |
|
|
<UsersIcon |
|
|
size={20} |
|
|
size={20} |
|
|
className="text-gray-400" |
|
|
className="text-gray-400" |
|
|
@ -113,7 +114,7 @@ const DeviceList = ({devices}: {devices: Device[]}) => { |
|
|
<Button |
|
|
<Button |
|
|
variant={devicesToFlash[index] ? "default" : "outline"} |
|
|
variant={devicesToFlash[index] ? "default" : "outline"} |
|
|
size="sm" |
|
|
size="sm" |
|
|
className="w-full justify-start gap-2" |
|
|
className="w-full gap-2 h-8" |
|
|
onClick={() => { |
|
|
onClick={() => { |
|
|
// TODO: HACKY AF, fix.
|
|
|
// TODO: HACKY AF, fix.
|
|
|
// Used to make sure page rerenders but this has issues
|
|
|
// Used to make sure page rerenders but this has issues
|
|
|
@ -125,7 +126,7 @@ const DeviceList = ({devices}: {devices: Device[]}) => { |
|
|
// toggleDeviceFlash(device);
|
|
|
// toggleDeviceFlash(device);
|
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
{devicesToFlash[index] ? "Yes" : "No"} |
|
|
{devicesToFlash[index] ? "Enabled" : "Disabled"} |
|
|
</Button> |
|
|
</Button> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
@ -135,6 +136,13 @@ const DeviceList = ({devices}: {devices: Device[]}) => { |
|
|
); |
|
|
); |
|
|
})} |
|
|
})} |
|
|
</ul> |
|
|
</ul> |
|
|
|
|
|
<Button |
|
|
|
|
|
className="gap-2" |
|
|
|
|
|
onClick={() => setConnectDialogOpen(true)} |
|
|
|
|
|
> |
|
|
|
|
|
Flash |
|
|
|
|
|
</Button> |
|
|
|
|
|
</div> |
|
|
) : ( |
|
|
) : ( |
|
|
<div className="m-auto flex flex-col gap-3 text-center"> |
|
|
<div className="m-auto flex flex-col gap-3 text-center"> |
|
|
<ListPlusIcon size={48} className="mx-auto text-textSecondary" /> |
|
|
<ListPlusIcon size={48} className="mx-auto text-textSecondary" /> |
|
|
|