Skip to content

Commit 2252d2c

Browse files
committed
add less aggressive license messages
1 parent 49d8481 commit 2252d2c

File tree

4 files changed

+31
-39
lines changed

4 files changed

+31
-39
lines changed

client/packages/lowcoder/src/pages/setting/environments/EnvironmentDetail.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ const EnvironmentDetail: React.FC = () => {
205205
case 'licensed':
206206
return <Tag icon={<CheckCircleOutlined />} color="green" style={{ borderRadius: '4px' }}>Licensed</Tag>;
207207
case 'unlicensed':
208-
return <Tag icon={<CloseCircleOutlined />} color="red" style={{ borderRadius: '4px' }}>Not Licensed</Tag>;
208+
return <Tag icon={<CloseCircleOutlined />} color="orange" style={{ borderRadius: '4px' }}>License Needed</Tag>;
209209
case 'error':
210-
return <Tag icon={<ExclamationCircleOutlined />} color="orange" style={{ borderRadius: '4px' }}>License Error</Tag>;
210+
return <Tag icon={<ExclamationCircleOutlined />} color="orange" style={{ borderRadius: '4px' }}>Setup Required</Tag>;
211211
default:
212212
return <Tag color="default" style={{ borderRadius: '4px' }}>Unknown</Tag>;
213213
}

client/packages/lowcoder/src/pages/setting/environments/components/EnvironmentsTable.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,29 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
5555
case 'checking':
5656
return {
5757
icon: <SyncOutlined spin />,
58-
color: '#1890ff',
58+
color: '#40a9ff',
5959
text: 'Checking...',
6060
status: 'processing' as const
6161
};
6262
case 'licensed':
6363
return {
6464
icon: <CheckCircleOutlined />,
65-
color: '#52c41a',
65+
color: '#73d13d',
6666
text: 'Licensed',
6767
status: 'success' as const
6868
};
6969
case 'unlicensed':
7070
return {
7171
icon: <CloseCircleOutlined />,
72-
color: '#ff4d4f',
73-
text: 'Not Licensed',
74-
status: 'error' as const
72+
color: '#ff7875',
73+
text: 'License Required',
74+
status: 'warning' as const
7575
};
7676
case 'error':
7777
return {
7878
icon: <ExclamationCircleOutlined />,
79-
color: '#faad14',
80-
text: 'License Error',
79+
color: '#ffc53d',
80+
text: 'Setup Required',
8181
status: 'warning' as const
8282
};
8383
default:
@@ -180,8 +180,8 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
180180
<Tag
181181
icon={licenseDisplay.icon}
182182
color={licenseDisplay.status === 'success' ? 'green' :
183-
licenseDisplay.status === 'error' ? 'red' :
184-
licenseDisplay.status === 'warning' ? 'orange' : 'blue'}
183+
licenseDisplay.status === 'warning' ? 'orange' :
184+
licenseDisplay.status === 'processing' ? 'blue' : 'default'}
185185
style={{ fontSize: '11px', borderRadius: '4px' }}
186186
>
187187
{licenseDisplay.text}

client/packages/lowcoder/src/pages/setting/environments/components/UnlicensedEnvironmentView.tsx

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,37 +31,29 @@ const UnlicensedEnvironmentView: React.FC<UnlicensedEnvironmentViewProps> = ({
3131
const getLicenseIcon = () => {
3232
switch (environment.licenseStatus) {
3333
case 'unlicensed':
34-
return <CloseCircleOutlined style={{ fontSize: '48px', color: '#ff4d4f' }} />;
34+
return <CloseCircleOutlined style={{ fontSize: '48px', color: '#ff7875' }} />;
3535
case 'error':
36-
return <ExclamationCircleOutlined style={{ fontSize: '48px', color: '#faad14' }} />;
36+
return <ExclamationCircleOutlined style={{ fontSize: '48px', color: '#ffc53d' }} />;
3737
default:
38-
return <WarningOutlined style={{ fontSize: '48px', color: '#ff4d4f' }} />;
38+
return <WarningOutlined style={{ fontSize: '48px', color: '#ff7875' }} />;
3939
}
4040
};
4141

4242
const getLicenseTitle = () => {
43-
switch (environment.licenseStatus) {
44-
case 'unlicensed':
45-
return 'Environment Not Licensed';
46-
case 'error':
47-
return 'License Configuration Error';
48-
default:
49-
return 'License Issue';
50-
}
51-
};
43+
return environment.licenseError;
44+
}
45+
46+
5247

5348
const getLicenseDescription = () => {
54-
if (environment.licenseError) {
55-
return environment.licenseError;
56-
}
5749

5850
switch (environment.licenseStatus) {
5951
case 'unlicensed':
60-
return 'This environment requires a valid license to access its features and functionality.';
52+
return 'This environment needs a valid license to unlock its full capabilities and features. Please make sure your API Service URL is correctly configured and Plugin is installed.';
6153
case 'error':
62-
return 'There was an error validating the license for this environment. Please check the configuration.';
54+
return 'We encountered an issue while checking the license. Please review the configuration settings.';
6355
default:
64-
return 'This environment has license-related issues that need to be resolved.';
56+
return 'This environment requires license configuration to proceed.';
6557
}
6658
};
6759

client/packages/lowcoder/src/pages/setting/environments/services/license.service.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ export async function checkEnvironmentLicense(
6565

6666
} catch (error) {
6767
// Determine the specific error type
68-
let errorMessage = 'License not available';
68+
let errorMessage = 'License information unavailable';
6969

7070
if (axios.isAxiosError(error)) {
7171
if (error.code === 'ECONNABORTED') {
72-
errorMessage = 'License check timed out';
72+
errorMessage = 'License check took too long';
7373
} else if (error.response?.status === 404) {
74-
errorMessage = 'License endpoint not found';
74+
errorMessage = 'License service not available';
7575
} else if (error.response?.status === 401) {
76-
errorMessage = 'Unauthorized - check API key';
76+
errorMessage = 'Authentication required - please check API key';
7777
} else if (error.response && error.response.status >= 500) {
78-
errorMessage = 'License server error';
78+
errorMessage = 'License service temporarily unavailable';
7979
}
8080
}
8181

@@ -100,7 +100,7 @@ export function formatAPICalls(remaining: number, total: number): string {
100100
}
101101

102102
/**
103-
* Get API calls status color based on usage percentage
103+
* Get API calls status color based on usage percentage - using softer, less aggressive colors
104104
* @param remainingCalls - Remaining API calls
105105
* @param totalCalls - Total API calls limit
106106
* @returns Color string for UI components
@@ -110,8 +110,8 @@ export function getAPICallsStatusColor(remainingCalls: number, totalCalls: numbe
110110

111111
const usagePercentage = ((totalCalls - remainingCalls) / totalCalls) * 100;
112112

113-
if (usagePercentage >= 90) return '#ff4d4f'; // Red - Critical
114-
if (usagePercentage >= 75) return '#faad14'; // Orange - Warning
115-
if (usagePercentage >= 50) return '#1890ff'; // Blue - Moderate
116-
return '#52c41a'; // Green - Good
113+
if (usagePercentage >= 90) return '#ff7875'; // Soft red - High usage
114+
if (usagePercentage >= 75) return '#ffc53d'; // Soft orange - Moderate usage
115+
if (usagePercentage >= 50) return '#40a9ff'; // Soft blue - Normal usage
116+
return '#73d13d'; // Soft green - Low usage
117117
}

0 commit comments

Comments
 (0)