Skip to content

Commit cabb841

Browse files
committed
Add appAuthorId and appAuthorOrdId for app-usage endpoint
1 parent fe80bb4 commit cabb841

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

client/packages/lowcoder/src/pages/setting/appUsage/dashboard.tsx

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ export function AppUsageDashboard() {
5959
isAnonymous: boolean;
6060
details: Record<string, any>;
6161
geolocationDataJsonb?: Record<string, any>,
62+
applicationAuthor?: string;
63+
applicationAuthorOrgId?: string;
6264
};
6365

6466
const currentUser = useSelector(getUser);
@@ -253,13 +255,17 @@ export function AppUsageDashboard() {
253255
const orgId = e.orgId;
254256
const appId = e.appId;
255257
const name = e.details?.applicationName ?? 'Unknown';
256-
acc[appId] = acc[appId] || { appId, name, orgId, environmentId, count: 0 };
258+
const applicationAuthor = e.applicationAuthor;
259+
const applicationAuthorOrgId = e.applicationAuthorOrgId;
260+
acc[appId] = acc[appId] || { appId, name, orgId, environmentId, applicationAuthor, applicationAuthorOrgId, count: 0 };
257261
acc[appId].count++;
258262
return acc;
259263
}, {} as Record<string, {
260264
appId: string, name: string,
261265
orgId: string,
262266
environmentId: string,
267+
applicationAuthor?: string,
268+
applicationAuthorOrgId?: string,
263269
count: number
264270
}>);
265271
}, [allLogs]);
@@ -352,6 +358,22 @@ export function AppUsageDashboard() {
352358
<a onClick={() => handleClickFilter("environmentId", text)}>{dataMap[text] ?? text}</a>
353359
),
354360
},
361+
{
362+
title: "App Author",
363+
dataIndex: "applicationAuthor",
364+
key: "applicationAuthor",
365+
render: (text: string) => (
366+
text ? <a onClick={() => handleClickFilter("appAuthor", text)}>{text}</a> : '-'
367+
),
368+
},
369+
{
370+
title: "App Author Org ID",
371+
dataIndex: "applicationAuthorOrgId",
372+
key: "applicationAuthorOrgId",
373+
render: (text: string) => (
374+
text ? <a onClick={() => handleClickFilter("appAuthorOrgId", text)}>{dataMap[text] ?? text}</a> : '-'
375+
),
376+
},
355377
{
356378
title: "Total Views",
357379
dataIndex: "count",
@@ -380,7 +402,7 @@ export function AppUsageDashboard() {
380402
const key = Object.keys(changedValue)[0];
381403
if (key === "dateRange") {
382404
handleDateChange(changedValue.dateRange);
383-
} else if (["environmentId", "orgId", "userId", "appId"].includes(key)) {
405+
} else if (["environmentId", "orgId", "userId", "appId", "appAuthor", "appAuthorOrgId"].includes(key)) {
384406
handleInputChange(); // Debounced input change
385407
} else {
386408
// Avoid calling fetchLogs if `handleDateChange` already did
@@ -421,6 +443,15 @@ export function AppUsageDashboard() {
421443
<Input placeholder="App ID" allowClear />
422444
</Form.Item>
423445
</Flex>
446+
447+
<Flex>
448+
<Form.Item name="appAuthor">
449+
<Input placeholder="App Author" allowClear />
450+
</Form.Item>
451+
<Form.Item name="appAuthorOrgId">
452+
<Input placeholder="App Author Org ID" allowClear />
453+
</Form.Item>
454+
</Flex>
424455
</Flex>
425456
</Form>
426457
</Card>

0 commit comments

Comments
 (0)