This is an automated email from the ASF dual-hosted git repository.

mintsweet pushed a commit to branch feat-api-key-expired
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit b9a801a384dbe6d17ce833a29738472642d58b6f
Author: mintsweet <[email protected]>
AuthorDate: Tue Oct 24 21:03:36 2023 +1300

    feat(config-ui): support show expired tag in api-keys
---
 config-ui/src/routes/api-keys/api-keys.tsx | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/config-ui/src/routes/api-keys/api-keys.tsx 
b/config-ui/src/routes/api-keys/api-keys.tsx
index cfb8419fc..d57118d79 100644
--- a/config-ui/src/routes/api-keys/api-keys.tsx
+++ b/config-ui/src/routes/api-keys/api-keys.tsx
@@ -17,7 +17,8 @@
  */
 
 import { useState, useMemo } from 'react';
-import { Button, Intent, InputGroup } from '@blueprintjs/core';
+import { Button, Tag, Intent, InputGroup } from '@blueprintjs/core';
+import dayjs from 'dayjs';
 
 import API from '@/api';
 import { PageHeader, Table, Dialog, FormItem, Selector, ExternalLink, 
CopyText, Message } from '@/components';
@@ -107,7 +108,12 @@ export const ApiKeys = () => {
             dataIndex: 'expiredAt',
             key: 'expiredAt',
             width: 200,
-            render: (val) => (val ? formatTime(val, 'YYYY-MM-DD') : 'No 
expiration'),
+            render: (val) => (
+              <div>
+                <span>{val ? formatTime(val, 'YYYY-MM-DD') : 'No 
expiration'}</span>
+                {dayjs().isAfter(dayjs(val)) && <Tag style={{ marginLeft: 8 
}}>Expired</Tag>}
+              </div>
+            ),
           },
           {
             title: 'Allowed Path',

Reply via email to