mirror of https://github.com/BRAVO68WEB/shx.git
🗓 added last used in api key list
This commit is contained in:
parent
880e816d83
commit
4527b564c1
|
@ -2,6 +2,7 @@
|
|||
|
||||
import api from '@/api';
|
||||
import Button from '@/components/ui/Button';
|
||||
import { parseDate } from '@/lib/utils';
|
||||
import Cookies from 'js-cookie';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import React, { useState } from 'react';
|
||||
|
@ -47,10 +48,13 @@ function ApiKeyList({ data }: ApiKeyListProps) {
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y p-2">
|
||||
{apiKeys.map(({ key, keyID }) => (
|
||||
{apiKeys.map(({ key, keyID, last_used }) => (
|
||||
<tr className="bg-gray-900 rounded" key={keyID}>
|
||||
<td className="whitespace-nowrap pl-4 text-sm font-medium text-white">
|
||||
<p className="text-xl">{key}</p>
|
||||
<p className="text-xs text-gray-400">
|
||||
Last Used: {parseDate(last_used)}
|
||||
</p>
|
||||
</td>
|
||||
<td className="relative whitespace-nowrap py-4 px-4 text-right text-sm font-medium icons flex center items-center gap-3">
|
||||
<Button
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import Button from '@/components/ui/Button';
|
||||
import { ArrowUpRight, Trash } from 'lucide-react';
|
||||
import React from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { cn, parseDate } from '@/lib/utils';
|
||||
import { UploadsListComponentProps } from '@/types/list';
|
||||
|
||||
export default function LinearList({
|
||||
|
@ -10,9 +10,6 @@ export default function LinearList({
|
|||
onDelete,
|
||||
}: UploadsListComponentProps) {
|
||||
// parse a date from gmt format to iso format
|
||||
const parseDate = (date: string) => {
|
||||
return new Date(date).toISOString().split('T')[0];
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-col w-full gap-2 ">
|
||||
|
|
|
@ -4,3 +4,7 @@ import { twMerge } from 'tailwind-merge';
|
|||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
export const parseDate = (date: string) => {
|
||||
return new Date(date).toISOString().split('T')[0];
|
||||
};
|
|
@ -1,4 +1,5 @@
|
|||
interface IApiKey {
|
||||
key: string;
|
||||
keyID: string;
|
||||
last_used: string;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue