From 54b3fc3ae643d994bdb0f231e6831ac5943a68b5 Mon Sep 17 00:00:00 2001
From: Pablo Lara
Date: Sun, 28 Jul 2024 16:40:29 +0200
Subject: [PATCH] chore: install shadcn for tables, adding sttings page
---
app/(prowler)/layout.tsx | 4 ++--
app/(prowler)/settings/page.tsx | 12 ++++++++++++
app/data/dataProvider.ts | 8 --------
app/data/index.ts | 1 -
config/fonts.ts | 5 ++++-
dataProviders.json | 2 +-
package.json | 9 +++++++--
types/components.ts | 25 +++++++++++++++++++++++++
8 files changed, 51 insertions(+), 15 deletions(-)
create mode 100644 app/(prowler)/settings/page.tsx
delete mode 100644 app/data/dataProvider.ts
delete mode 100644 app/data/index.ts
diff --git a/app/(prowler)/layout.tsx b/app/(prowler)/layout.tsx
index 149a706445..13319c3540 100644
--- a/app/(prowler)/layout.tsx
+++ b/app/(prowler)/layout.tsx
@@ -1,12 +1,12 @@
import "@/styles/globals.css";
-import clsx from "clsx";
import { Metadata, Viewport } from "next";
import React from "react";
import { SidebarWrap } from "@/components";
import { fontSans } from "@/config/fonts";
import { siteConfig } from "@/config/site";
+import { cn } from "@/lib/utils";
import { Providers } from "../providers";
@@ -38,7 +38,7 @@ export default function RootLayout({
+
+
+ >
+ );
+}
diff --git a/app/data/dataProvider.ts b/app/data/dataProvider.ts
deleted file mode 100644
index 429f18f4cc..0000000000
--- a/app/data/dataProvider.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import "server-only";
-
-export default async function getProvider() {
- const res = await fetch("http://localhost:3000/api/providers");
- const product = await res.json();
-
- return product;
-}
diff --git a/app/data/index.ts b/app/data/index.ts
deleted file mode 100644
index 138e0c8df1..0000000000
--- a/app/data/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./dataProvider";
diff --git a/config/fonts.ts b/config/fonts.ts
index 0e7d9c9422..16c934d5a6 100644
--- a/config/fonts.ts
+++ b/config/fonts.ts
@@ -1,4 +1,7 @@
-import { Fira_Code as FontMono, Inter as FontSans } from "next/font/google";
+import {
+ Fira_Code as FontMono,
+ Plus_Jakarta_Sans as FontSans,
+} from "next/font/google";
export const fontSans = FontSans({
subsets: ["latin"],
diff --git a/dataProviders.json b/dataProviders.json
index 6aec7c9584..5199fe7228 100644
--- a/dataProviders.json
+++ b/dataProviders.json
@@ -37,7 +37,7 @@
"id": "16aaeb4e-d3cd-4bb6-86f8-6c39cf93821e",
"type": "providers",
"attributes": {
- "provider": "aws",
+ "provider": "azure",
"provider_id": "1234567891",
"alias": "mock_aws_not_connected",
"connection": {
diff --git a/package.json b/package.json
index c3aaef6df5..c0dd46c781 100644
--- a/package.json
+++ b/package.json
@@ -5,16 +5,21 @@
"@nextui-org/theme": "2.2.5",
"@react-aria/ssr": "3.9.4",
"@react-aria/visually-hidden": "3.8.12",
- "clsx": "2.1.1",
+ "@tanstack/react-table": "^8.19.3",
+ "class-variance-authority": "^0.7.0",
+ "clsx": "^2.1.1",
"date-fns": "^3.6.0",
"framer-motion": "~11.1.1",
"intl-messageformat": "^10.5.0",
+ "lucide-react": "^0.417.0",
"next": "14.2.3",
"next-themes": "^0.2.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"server-only": "^0.0.1",
- "swr": "^2.2.5"
+ "swr": "^2.2.5",
+ "tailwind-merge": "^2.4.0",
+ "tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@iconify/react": "^5.0.1",
diff --git a/types/components.ts b/types/components.ts
index c9b078e314..14bfe0b219 100644
--- a/types/components.ts
+++ b/types/components.ts
@@ -8,3 +8,28 @@ export type IconProps = {
icon: React.FC;
style?: React.CSSProperties;
};
+
+export interface ProviderProps {
+ id: string;
+ type: "providers";
+ attributes: {
+ provider: "aws" | "azure" | "gcp";
+ provider_id: string;
+ alias: string;
+ connection: {
+ connected: boolean;
+ last_checked_at: string;
+ };
+ scanner_args: {
+ only_logs: boolean;
+ excluded_checks: string[];
+ aws_retries_max_attempts: number;
+ };
+ inserted_at: string;
+ updated_at: string;
+ created_by: {
+ object: string;
+ id: string;
+ };
+ };
+}