Skip to content

Commit 5c75250

Browse files
author
FalkWolsky
committed
Updating Readme for new ENV Variables
1 parent 2044b0a commit 5c75250

File tree

2 files changed

+102
-26
lines changed

2 files changed

+102
-26
lines changed

client/packages/lowcoder/src/pages/setting/permission/styledComponents.tsx

Lines changed: 66 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { validateResponse } from "api/apiUtils";
2121
import ReactJson from "react-json-view";
2222
import { StyledLink } from "pages/common/styledComponent";
2323
import _ from "lodash";
24+
import { Avatar, Card, List } from "antd";
2425

2526
export const StyledTable = styled(AntdTable)`
2627
.ant-table-cell {
@@ -362,38 +363,45 @@ const UserDetailPopWrapper = styled.div`
362363
}
363364
`;
364365

366+
interface User {
367+
id: string;
368+
name: string;
369+
avatarUrl: string;
370+
uiLanguage: string;
371+
email: string;
372+
ip: string;
373+
groups: Group[];
374+
extra: any;
375+
}
376+
377+
interface Group {
378+
groupName: string;
379+
groupId: string;
380+
}
381+
365382
export function UserDetailPopup(props: { userId: string; title: string }) {
366383
const { userId, title } = props;
367-
const [userInfo, setUserInfo] = useState({ success: false, view: <></> });
384+
const [userInfo, setUserInfo] = useState<User | null>(null);
368385
const [visible, setVisible] = useState(false);
386+
const [loading, setLoading] = useState(false);
387+
const [error, setError] = useState('');
369388

370389
useEffect(() => {
371-
if (!userInfo.success && visible) {
372-
setUserInfo({ success: false, view: <WhiteLoading className="loading-class" /> });
390+
if (userId) {
391+
setLoading(true);
392+
setError('');
373393
UserApi.getUserDetail(userId)
374-
.then((resp) => {
394+
.then(resp => {
375395
if (validateResponse(resp)) {
376-
setUserInfo({
377-
success: true,
378-
view: (
379-
<ReactJson
380-
name={false}
381-
src={resp.data.data}
382-
collapsed={3}
383-
style={{ wordBreak: "break-word" }}
384-
/>
385-
),
386-
});
396+
setUserInfo(resp.data.data);
397+
} else {
398+
throw new Error('Invalid response from server');
387399
}
388400
})
389-
.catch((e) => {
390-
setUserInfo({
391-
success: false,
392-
view: <span>{e.message}</span>,
393-
});
394-
});
401+
.catch(e => setError(e.message))
402+
.finally(() => setLoading(false));
395403
}
396-
}, [visible]);
404+
}, [userId, visible]);
397405

398406
return (
399407
<>
@@ -420,7 +428,42 @@ export function UserDetailPopup(props: { userId: string; title: string }) {
420428
showOkButton={false}
421429
showCancelButton={false}
422430
>
423-
<UserDetailPopWrapper>{userInfo.view}</UserDetailPopWrapper>
431+
<UserDetailPopWrapper>
432+
{loading && <WhiteLoading />}
433+
{userInfo &&
434+
<Card
435+
style={{ width: "90%", borderRadius: 8, margin: "0 auto" }}
436+
cover={
437+
<div style={{ display: 'flex', justifyContent: 'center', padding: 20 }}>
438+
<Avatar
439+
size={100}
440+
src={userInfo.avatarUrl || ''}
441+
alt={userInfo.name || ''}
442+
/>
443+
</div>
444+
}
445+
>
446+
<Card.Meta
447+
title={userInfo.name || 'N/A'}
448+
description={userInfo.email || 'N/A'}
449+
/>
450+
<List
451+
itemLayout="horizontal"
452+
dataSource={userInfo.groups}
453+
renderItem={item => (
454+
<List.Item>
455+
<List.Item.Meta
456+
title={item.groupName}
457+
description={`Group ID: ${item.groupId}`}
458+
/>
459+
</List.Item>
460+
)}
461+
/>
462+
<p style={{ marginTop: 12 }}>Language: {userInfo.uiLanguage}</p>
463+
<p>IP Address: {userInfo.ip}</p>
464+
</Card>
465+
}
466+
</UserDetailPopWrapper>
424467
</CustomModal>
425468
</>
426469
);

deploy/docker/README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,30 @@ Image can be configured by setting environment variables.
4747
| `LOWCODER_MAX_DEVELOPERS` | Default maximum developers | `100` |
4848
| `LOWCODER_WORKSPACE_MODE` | SAAS to activate, ENTERPRISE to switch off - Workspaces | `SAAS` |
4949
| `LOWCODER_EMAIL_SIGNUP_ENABLED` | Control if users create their own Workspace automatic when Sign Up | `true` |
50-
| `LOWCODER_EMAIL_AUTH_ENABLED` | Control to show the eMail Login after Admin user is set | `true` |
5150
| `LOWCODER_CREATE_WORKSPACE_ON_SIGNUP` | IF LOWCODER_WORKSPACE_MODE = SAAS, controls if a own workspace is created for the user after sign up | `true` |
5251
| `LOWCODER_MARKETPLACE_PRIVATE_MODE` | Control if not to show Apps on the local Marketplace to anonymous users | `true` |
5352

54-
Also you should set the API-KEY secret, whcih should be a string of at least 32 random characters
53+
Also you should set the API-KEY secret, whcih should be a string of at least 32 random characters. (from Lowcoder v2.3.x on)
5554
On linux/mac, generate one eg. with: head /dev/urandom | head -c 30 | shasum -a 256
5655

5756
| Environment variable | Description | Default-Value |
5857
|-------------------------------------| ----------------------------------------------------------------------- | ----------------------------------------------------- |
5958
| `LOWCODER_API_KEY_SECRET` | String to encrypt/sign API Keys that users may create | |
6059

60+
To enable secure Password Reset flow for the users, you need to configure your own SMTP Server. You can do this with the following Variables (from Lowcoder v2.4.x on):
61+
62+
| Environment Variable | Description | Default Value |
63+
|-------------------------------------------|---------------------------------------------------------|----------------------|
64+
| `LOWCODER_ADMIN_SMTP_HOST` | SMTP Hostname of your Mail Relay Server | |
65+
| `LOWCODER_ADMIN_SMTP_PORT` | Port number for the SMTP service | `587` |
66+
| `LOWCODER_ADMIN_SMTP_USERNAME` | Username for SMTP authentication | |
67+
| `LOWCODER_ADMIN_SMTP_PASSWORD` | Password for SMTP authentication | |
68+
| `LOWCODER_ADMIN_SMTP_AUTH` | Enable SMTP authentication | `true` |
69+
| `LOWCODER_ADMIN_SMTP_SSL_ENABLED` | Enable SSL encryption | `false` |
70+
| `LOWCODER_ADMIN_SMTP_STARTTLS_ENABLED` | Enable STARTTLS encryption | `true` |
71+
| `LOWCODER_ADMIN_SMTP_STARTTLS_REQUIRED` | Require STARTTLS encryption | `true` |
72+
73+
6174

6275
## Building api-service image
6376

@@ -93,7 +106,27 @@ Image can be configured by setting environment variables.
93106
| `LOWCODER_MAX_REQUEST_SIZE` | Lowcoder max request size | `20m` |
94107
| `LOWCODER_WORKSPACE_MODE` | SAAS to activate, ENTERPRISE to switch off - Workspaces | `SAAS` |
95108
| `LOWCODER_EMAIL_SIGNUP_ENABLED` | Control is users can create their own Workspace when Sign Up | `true` |
96-
| `LOWCODER_EMAIL_AUTH_ENABLED` | Control to show the eMail Login after Admin user is set | `true` |
109+
110+
Also you should set the API-KEY secret, whcih should be a string of at least 32 random characters. (from Lowcoder v2.3.x on)
111+
On linux/mac, generate one eg. with: head /dev/urandom | head -c 30 | shasum -a 256
112+
113+
| Environment variable | Description | Default-Value |
114+
|-------------------------------------| ----------------------------------------------------------------------- | ----------------------------------------------------- |
115+
| `LOWCODER_API_KEY_SECRET` | String to encrypt/sign API Keys that users may create | |
116+
117+
118+
To enable secure Password Reset flow for the users, you need to configure your own SMTP Server. You can do this with the following Variables (from Lowcoder v2.4.x on):
119+
120+
| Environment Variable | Description | Default Value |
121+
|-------------------------------------------|---------------------------------------------------------|----------------------|
122+
| `LOWCODER_ADMIN_SMTP_HOST` | SMTP Hostname of your Mail Relay Server | |
123+
| `LOWCODER_ADMIN_SMTP_PORT` | Port number for the SMTP service | `587` |
124+
| `LOWCODER_ADMIN_SMTP_USERNAME` | Username for SMTP authentication | |
125+
| `LOWCODER_ADMIN_SMTP_PASSWORD` | Password for SMTP authentication | |
126+
| `LOWCODER_ADMIN_SMTP_AUTH` | Enable SMTP authentication | `true` |
127+
| `LOWCODER_ADMIN_SMTP_SSL_ENABLED` | Enable SSL encryption | `false` |
128+
| `LOWCODER_ADMIN_SMTP_STARTTLS_ENABLED` | Enable STARTTLS encryption | `true` |
129+
| `LOWCODER_ADMIN_SMTP_STARTTLS_REQUIRED` | Require STARTTLS encryption | `true` |
97130

98131
## Building node-service image
99132

0 commit comments

Comments
 (0)