mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-01 21:28:23 +00:00
refactor: implement session checking utility, enhance device queries with session validation, and improve UI interactions for device management
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 6m36s
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 6m36s
This commit is contained in:
@ -19,9 +19,13 @@ export default function ClickableRow({
|
||||
<TableRow
|
||||
key={device.id}
|
||||
className={cn(
|
||||
parentalControl === false && "cursor-pointer hover:bg-muted",
|
||||
(parentalControl === false && device.blocked) || device.is_active
|
||||
? "cursor-not-allowed title-bg"
|
||||
: "cursor-pointer hover:bg-muted",
|
||||
)}
|
||||
onClick={() => {
|
||||
if (device.blocked) return;
|
||||
if (device.is_active === true) return;
|
||||
if (parentalControl === true) return;
|
||||
setDeviceCart((prev) =>
|
||||
devices.some((d) => d.id === device.id)
|
||||
@ -33,7 +37,10 @@ export default function ClickableRow({
|
||||
<TableCell>
|
||||
<div className="flex flex-col items-start">
|
||||
<Link
|
||||
className="font-medium hover:underline"
|
||||
className={cn(
|
||||
"hover:underline font-semibold",
|
||||
device.is_active ? "text-green-600" : "",
|
||||
)}
|
||||
href={`/devices/${device.id}`}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
@ -49,7 +56,7 @@ export default function ClickableRow({
|
||||
})}
|
||||
</span>
|
||||
) : (
|
||||
<p>Inactive</p>
|
||||
<p className="text-muted-foreground">Device Inactive</p>
|
||||
)}
|
||||
|
||||
{device.blocked_by === "ADMIN" && device.blocked && (
|
||||
|
Reference in New Issue
Block a user