Compare commits
7 Commits
d451331c66
...
8ab2ddbe8e
Author | SHA1 | Date | |
---|---|---|---|
8ab2ddbe8e | |||
7f9b719b2b | |||
2b7f4995ef | |||
321f4087e1 | |||
9d19b470bc | |||
68493be36e | |||
f8772f8de2 |
@ -13,6 +13,8 @@ import ApiServicesPage from "./pages/ApiServices";
|
|||||||
import AdminLayout from "./layout/AdminLayout";
|
import AdminLayout from "./layout/AdminLayout";
|
||||||
import ApiServiceCreatePage from "./pages/ApiServices/Create";
|
import ApiServiceCreatePage from "./pages/ApiServices/Create";
|
||||||
import ViewApiServicePage from "./pages/ApiServices/View";
|
import ViewApiServicePage from "./pages/ApiServices/View";
|
||||||
|
import NotAllowedPage from "./pages/NotAllowed";
|
||||||
|
import NotFoundPage from "./pages/NotFound";
|
||||||
|
|
||||||
const router = createBrowserRouter([
|
const router = createBrowserRouter([
|
||||||
{
|
{
|
||||||
@ -62,6 +64,14 @@ const router = createBrowserRouter([
|
|||||||
{ path: "authenticate", element: <AuthenticatePage /> },
|
{ path: "authenticate", element: <AuthenticatePage /> },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/not-allowed",
|
||||||
|
element: <NotAllowedPage />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "*",
|
||||||
|
element: <NotFoundPage />,
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const App: FC = () => {
|
const App: FC = () => {
|
||||||
|
@ -25,7 +25,7 @@ const Breadcrumbs: FC<IBreadcrumbsProps> = ({ items, className }) => {
|
|||||||
) : (
|
) : (
|
||||||
<p>{item.label}</p>
|
<p>{item.label}</p>
|
||||||
)}
|
)}
|
||||||
{index + 1 < items.length && <p>/</p>}
|
{index + 1 < items.length && <p className="text-gray-500">/</p>}
|
||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
@ -33,7 +33,7 @@ const AdminLayout: FC = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!profile?.isAdmin) {
|
if (!profile?.isAdmin) {
|
||||||
return <Navigate to="/" />;
|
return <Navigate to="/not-allowed" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return <Outlet />;
|
return <Outlet />;
|
||||||
|
@ -90,7 +90,7 @@ const ApiServiceCreatePage: FC = () => {
|
|||||||
{...register("description", {
|
{...register("description", {
|
||||||
required: "Description is required",
|
required: "Description is required",
|
||||||
})}
|
})}
|
||||||
className="dark:text-gray-100 border border-gray-600 dark:border-gray-700 rounded placeholder:text-gray-600 text-sm p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
className="dark:text-gray-100 border border-gray-300 dark:border-gray-700 rounded placeholder:text-gray-600 text-sm p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
placeholder="Some description goes here..."
|
placeholder="Some description goes here..."
|
||||||
></textarea>
|
></textarea>
|
||||||
{errors.description && (
|
{errors.description && (
|
||||||
@ -116,7 +116,7 @@ const ApiServiceCreatePage: FC = () => {
|
|||||||
{...register("redirectUris", {
|
{...register("redirectUris", {
|
||||||
required: "At least one URI is required",
|
required: "At least one URI is required",
|
||||||
})}
|
})}
|
||||||
className="dark:text-gray-100 border border-gray-600 dark:border-gray-700 rounded placeholder:text-gray-600 text-sm p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
className="dark:text-gray-100 border border-gray-300 dark:border-gray-700 rounded placeholder:text-gray-600 text-sm p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
placeholder="Enter multiple URIs separated with new line"
|
placeholder="Enter multiple URIs separated with new line"
|
||||||
></textarea>
|
></textarea>
|
||||||
{errors.redirectUris && (
|
{errors.redirectUris && (
|
||||||
|
@ -56,7 +56,7 @@ const ViewApiServicePage: FC = () => {
|
|||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="p-4">
|
<div className="sm:p-4 pt-4">
|
||||||
{/* 📋 Main Details */}
|
{/* 📋 Main Details */}
|
||||||
<InfoCard title="API Service Details">
|
<InfoCard title="API Service Details">
|
||||||
<div className="flex flex-col gap-4 text-sm text-gray-700 dark:text-gray-300">
|
<div className="flex flex-col gap-4 text-sm text-gray-700 dark:text-gray-300">
|
||||||
|
@ -84,7 +84,7 @@ const ApiServicesPage: FC = () => {
|
|||||||
key={service.id}
|
key={service.id}
|
||||||
className="hover:bg-gray-50 dark:hover:bg-gray-800"
|
className="hover:bg-gray-50 dark:hover:bg-gray-800"
|
||||||
>
|
>
|
||||||
<td className="px-6 py-4 text-sm font-medium text-blue-600 border border-gray-700">
|
<td className="px-6 py-4 text-sm font-medium text-blue-600 border border-gray-300 dark:border-gray-700">
|
||||||
<Link
|
<Link
|
||||||
to={`/admin/api-services/view/${service.id}`}
|
to={`/admin/api-services/view/${service.id}`}
|
||||||
className="hover:underline hover:text-gray-600 dark:hover:text-gray-300 transition-colors"
|
className="hover:underline hover:text-gray-600 dark:hover:text-gray-300 transition-colors"
|
||||||
@ -92,10 +92,10 @@ const ApiServicesPage: FC = () => {
|
|||||||
{service.name}
|
{service.name}
|
||||||
</Link>
|
</Link>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-4 text-sm text-gray-700 dark:text-gray-300 border border-gray-700">
|
<td className="px-6 py-4 text-sm text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-700">
|
||||||
{service.client_id}
|
{service.client_id}
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-4 text-sm border border-gray-700">
|
<td className="px-6 py-4 text-sm border border-gray-300 dark:border-gray-700">
|
||||||
<span
|
<span
|
||||||
className={`inline-block px-2 py-1 text-xs rounded-full font-semibold ${
|
className={`inline-block px-2 py-1 text-xs rounded-full font-semibold ${
|
||||||
service.is_active
|
service.is_active
|
||||||
@ -106,10 +106,10 @@ const ApiServicesPage: FC = () => {
|
|||||||
{service.is_active ? "Yes" : "No"}
|
{service.is_active ? "Yes" : "No"}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400 border border-gray-700">
|
<td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400 border border-gray-300 dark:border-gray-700">
|
||||||
{new Date(service.created_at).toLocaleString()}
|
{new Date(service.created_at).toLocaleString()}
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400 border border-gray-700">
|
<td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400 border border-gray-300 dark:border-gray-700">
|
||||||
{new Date(service.updated_at).toLocaleString()}
|
{new Date(service.updated_at).toLocaleString()}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
7
web/src/pages/NotAllowed/index.tsx
Normal file
7
web/src/pages/NotAllowed/index.tsx
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import type { FC } from "react";
|
||||||
|
|
||||||
|
const NotAllowedPage: FC = () => {
|
||||||
|
return <div>this resource is not allowed</div>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default NotAllowedPage;
|
7
web/src/pages/NotFound/index.tsx
Normal file
7
web/src/pages/NotFound/index.tsx
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import type { FC } from "react";
|
||||||
|
|
||||||
|
const NotFoundPage: FC = () => {
|
||||||
|
return <div>404 - Not Found</div>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default NotFoundPage;
|
Reference in New Issue
Block a user