Changes done in constant folder

This commit is contained in:
2026-07-29 18:40:34 +05:30
parent 152be044ec
commit 65add5799e
7 changed files with 185 additions and 10 deletions

View File

@@ -1,9 +1,7 @@
import React from "react";
import { TableProps } from "@/types/types";
type TableProps = {
headers: string[];
rows: React.ReactNode[][];
};
export default function Table({ headers, rows }: TableProps) {
return (

View File

@@ -11,7 +11,7 @@ import Button from "@/components/common/button";
import StatCard from "@/components/common/dashStatCard";
import InfoBanner from '@/components/common/infoBanner';
import Table from '@/components/common/dataTable';
import { auditLogHeaders, auditLogRows, trustedDeviceHeaders, trustedDeviceRows } from "@/constants/tabledata";
import { auditLogHeaders, auditLogRows, trustedDeviceHeaders, trustedDeviceRows } from "@/constants/adminTableData";
export default function SecurityPortal() {

View File

@@ -11,7 +11,7 @@ import Button from "@/components/common/button";
import Table from '@/components/common/dataTable';
import { siteHeaders, siteRows } from "@/constants/adminTableDatat";
import { siteHeaders, siteRows } from "@/constants/adminTableData";
export default function SitePortal() {

View File

@@ -12,7 +12,7 @@ import {
import Button from "@/components/common/button";
import Table from '@/components/common/dataTable';
import { organizationHeaders, organizationRows } from "@/constants/adminTableDatat";
import { organizationHeaders, organizationRows } from "@/constants/adminTableData";

View File

@@ -8,7 +8,7 @@ import {
} from "lucide-react";
import Button from "@/components/common/button";
import Table from '@/components/common/dataTable';
import { userHeaders, userRows } from '@/constants/adminTableDatat';
import { userHeaders, userRows } from '@/constants/adminTableData';

View File

@@ -514,3 +514,174 @@ export const userRows = [
<UserActionButtons />,
],
];
// Security in admin
export const auditLogHeaders = [
"WHEN",
"USER",
"EVENT",
"IP",
"RESULT",
];
export const auditLogRows = [
[
<span className="font-mono text-slate-300">Today 08:12</span>,
<span className="font-mono text-slate-300">dhananjay@kafm.io</span>,
<span className="text-slate-200">Sign-in · password + MFA</span>,
<span className="font-mono text-slate-300">103.212.14.8</span>,
<StatusBadge
text="OK"
color="bg-emerald-500/15 text-emerald-400"
/>,
],
[
<span className="font-mono text-slate-300">Today 07:56</span>,
<span className="font-mono text-slate-300">kavya@kafm.io</span>,
<span className="text-slate-200">
Role changed · Technician M&E Supervisor
</span>,
<span className="font-mono text-slate-300">49.37.201.55</span>,
<StatusBadge
text="OK"
color="bg-emerald-500/15 text-emerald-400"
/>,
],
[
<span className="font-mono text-slate-300">Today 07:31</span>,
<span className="font-mono text-slate-300">unknown@ext.net</span>,
<span className="text-slate-200">
Sign-in · wrong password (3rd attempt)
</span>,
<span className="font-mono text-slate-300">91.240.118.7</span>,
<StatusBadge
text="FAILED"
color="bg-rose-500/15 text-rose-400"
/>,
],
[
<span className="font-mono text-slate-300">Today 06:58</span>,
<span className="font-mono text-slate-300">rahul@kafm.io</span>,
<span className="text-slate-200">
Device trusted · KAFM Mobile (30 days)
</span>,
<span className="font-mono text-slate-300">152.58.33.104</span>,
<StatusBadge
text="OK"
color="bg-emerald-500/15 text-emerald-400"
/>,
],
[
<span className="font-mono text-slate-300">Yesterday 17:40</span>,
<span className="font-mono text-slate-300">kavya@kafm.io</span>,
<span className="text-slate-200">
Password reset · self-service link
</span>,
<span className="font-mono text-slate-300">49.37.201.55</span>,
<StatusBadge
text="OK"
color="bg-emerald-500/15 text-emerald-400"
/>,
],
[
<span className="font-mono text-slate-300">Yesterday 14:05</span>,
<span className="font-mono text-slate-300">meera@kafm.io</span>,
<span className="text-slate-200">
MFA reset by admin · device revoked
</span>,
<span className="font-mono text-slate-300">103.212.14.31</span>,
<StatusBadge
text="PENDING"
color="bg-amber-500/15 text-amber-400"
/>,
],
[
<span className="font-mono text-slate-300">Jun 30 09:12</span>,
<span className="font-mono text-slate-300">admin@kafm.io</span>,
<span className="text-slate-200">
Sign-in policy updated · idle timeout 30 min
</span>,
<span className="font-mono text-slate-300">103.212.14.8</span>,
<StatusBadge
text="OK"
color="bg-emerald-500/15 text-emerald-400"
/>,
],
];
export const trustedDeviceHeaders = [
"USER",
"DEVICE",
"IP",
"LAST SEEN",
"EXPIRES",
"STATUS",
"ACTIONS",
];
export const trustedDeviceRows = [
[
<span className="font-semibold text-white">Dhananjay T.</span>,
"Chrome 126 · Windows 11",
<span className="font-mono">103.212.14.8</span>,
<span className="font-mono">Today, 08:12</span>,
<span className="font-mono">Jul 30, 2026</span>,
<StatusBadge
text="TRUSTED"
color="bg-emerald-500/15 text-emerald-400"
/>,
<Button className="rounded-md border border-slate-700/80 bg-slate-800/40 px-3 py-1 text-xs text-slate-300 hover:bg-slate-800 transition-colors">
Revoke
</Button>,
],
[
<span className="font-semibold text-white">Kavya Raghunathan</span>,
"Safari 18 · macOS",
<span className="font-mono">49.37.201.55</span>,
<span className="font-mono">Yesterday, 17:40</span>,
<span className="font-mono">Jul 21, 2026</span>,
<StatusBadge
text="TRUSTED"
color="bg-emerald-500/15 text-emerald-400"
/>,
<Button className="rounded-md border border-slate-700/80 bg-slate-800/40 px-3 py-1 text-xs text-slate-300 hover:bg-slate-800 transition-colors">
Revoke
</Button>,
],
[
<span className="font-semibold text-white">Rahul Iyer</span>,
"KAFM Mobile · Android 15",
<span className="font-mono">152.58.33.104</span>,
<span className="font-mono">Today, 06:58</span>,
<span className="font-mono">Jul 12, 2026</span>,
<StatusBadge
text="TRUSTED"
color="bg-emerald-500/15 text-emerald-400"
/>,
<Button className="rounded-md border border-slate-700/80 bg-slate-800/40 px-3 py-1 text-xs text-slate-300 hover:bg-slate-800 transition-colors">
Revoke
</Button>,
],
[
<span className="font-semibold text-white">Meera Pillai</span>,
"Edge 126 · Windows 10",
<span className="font-mono">103.212.14.31</span>,
<span className="font-mono">Jun 18, 2026</span>,
<span className="font-mono text-slate-400">Expired</span>,
<StatusBadge
text="REVOKED"
color="bg-slate-700/50 text-slate-400"
/>,
<span className="text-slate-500 text-center"></span>,
],
];

View File

@@ -115,3 +115,9 @@ export interface TableRowData {
approval: boolean;
status: 'ACTIVE' | 'INACTIVE';
}
export type TableProps = {
headers: string[];
rows: React.ReactNode[][];
};