Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c80905c

Browse files
committed
add time columns in workspaces page
1 parent 096a7d2 commit c80905c

File tree

5 files changed

+36
-1
lines changed

5 files changed

+36
-1
lines changed

‎client/packages/lowcoder/src/api/userApi.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ export interface GetMyOrgsResponse extends ApiResponse {
6565
data: Array<{
6666
orgId: string;
6767
orgName: string;
68+
createdAt?: number;
69+
updatedAt?: number;
6870
}>;
6971
pageNum: number;
7072
pageSize: number;

‎client/packages/lowcoder/src/constants/orgConstants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export type Org = {
5454
createdBy: string;
5555
commonSettings: CommonSettingResponseData;
5656
createTime?: string;
57+
createdAt?: number;
58+
updatedAt?: number;
5759
};
5860

5961
export type OrgAndRole = {

‎client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3062,7 +3062,9 @@ export const en = {
30623062
"inviteSuccessMessage": "Join the Workspace Successfully",
30633063
"inviteFailMessage": "Failed to Join Workspace",
30643064
"uploadErrorMessage": "Upload Error",
3065-
"orgName": "Workspace Name"
3065+
"orgName": "Workspace Name",
3066+
"createdAt": "Created",
3067+
"updatedAt": "Updated"
30663068
},
30673069
"freeLimit": "Free Trial",
30683070

‎client/packages/lowcoder/src/pages/setting/organization/orgList.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ type DataItemInfo = {
170170
del: boolean;
171171
orgName: string;
172172
logoUrl: string;
173+
createdAt?: number;
174+
updatedAt?: number;
173175
};
174176

175177
function OrganizationSetting() {
@@ -193,6 +195,8 @@ function OrganizationSetting() {
193195
pageSize: 10
194196
});
195197

198+
console.log("displayWorkspaces", displayWorkspaces);
199+
196200

197201
// Filter to only show orgs where user has admin permissions
198202
const adminOrgs = displayWorkspaces.filter((org: Org) => {
@@ -205,8 +209,12 @@ function OrganizationSetting() {
205209
del: adminOrgs.length > 1,
206210
orgName: org.name,
207211
logoUrl: org.logoUrl || "",
212+
createdAt: org.createdAt,
213+
updatedAt: org.updatedAt,
208214
}));
209215

216+
console.log("dataSource", dataSource);
217+
210218
return (
211219
<Level1SettingPageContentWithList>
212220
<Level1SettingPageTitleWithBtn>
@@ -264,6 +272,24 @@ function OrganizationSetting() {
264272
);
265273
},
266274
},
275+
{
276+
title: trans("orgSettings.createdAt"),
277+
dataIndex: "createdAt",
278+
width: "150px",
279+
render: (createdAt: number) => {
280+
if (!createdAt) return "-";
281+
return new Date(createdAt * 1000).toLocaleDateString();
282+
},
283+
},
284+
{
285+
title: trans("orgSettings.updatedAt"),
286+
dataIndex: "updatedAt",
287+
width: "150px",
288+
render: (updatedAt: number) => {
289+
if (!updatedAt) return "-";
290+
return new Date(updatedAt * 1000).toLocaleDateString();
291+
},
292+
},
267293
{ title: " ", dataIndex: "operation", width: "208px" },
268294
]}
269295
dataSource={dataSource.map((item, i) => ({

‎client/packages/lowcoder/src/util/useWorkspaceManager.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ export function useWorkspaceManager({
9393
const transformedItems = apiData.data.map(item => ({
9494
id: item.orgId,
9595
name: item.orgName,
96+
createdAt: item.createdAt,
97+
updatedAt: item.updatedAt,
9698
}));
9799

100+
console.log("transformedItems", transformedItems);
98101
dispatch({
99102
type: 'SET_WORKSPACES',
100103
payload: {

0 commit comments

Comments
 (0)