@@ -3,19 +3,19 @@ import {
3
3
Spin ,
4
4
Typography ,
5
5
Card ,
6
- Tag ,
7
6
Tabs ,
8
7
Alert ,
9
8
Descriptions ,
10
9
Menu ,
11
10
Button ,
12
- Breadcrumb ,
11
+ Tag ,
13
12
} from "antd" ;
14
13
import {
15
14
LinkOutlined ,
16
- TeamOutlined ,
15
+ HomeOutlined ,
16
+ AppstoreOutlined ,
17
+ UsergroupAddOutlined ,
17
18
EditOutlined ,
18
- HomeOutlined
19
19
} from "@ant-design/icons" ;
20
20
21
21
import { useSingleEnvironmentContext } from "./context/SingleEnvironmentContext" ;
@@ -24,6 +24,8 @@ import { Environment } from "./types/environment.types";
24
24
import history from "@lowcoder-ee/util/history" ;
25
25
import WorkspacesTab from "./components/WorkspacesTab" ;
26
26
import UserGroupsTab from "./components/UserGroupsTab" ;
27
+ import EnvironmentHeader from "./components/EnvironmentHeader" ;
28
+ import ModernBreadcrumbs from "./components/ModernBreadcrumbs" ;
27
29
const { Title, Text } = Typography ;
28
30
const { TabPane } = Tabs ;
29
31
@@ -42,6 +44,7 @@ const EnvironmentDetail: React.FC = () => {
42
44
43
45
const [ isEditModalVisible , setIsEditModalVisible ] = useState ( false ) ;
44
46
const [ isUpdating , setIsUpdating ] = useState ( false ) ;
47
+ const [ activeTab , setActiveTab ] = useState ( 'workspaces' ) ;
45
48
46
49
// Handle edit menu item click
47
50
const handleEditClick = ( ) => {
@@ -90,21 +93,27 @@ const EnvironmentDetail: React.FC = () => {
90
93
}
91
94
92
95
if ( error || ! environment ) {
96
+ const errorItems = [
97
+ {
98
+ key : 'environments' ,
99
+ title : (
100
+ < span >
101
+ < HomeOutlined /> Environments
102
+ </ span >
103
+ ) ,
104
+ onClick : ( ) => history . push ( "/setting/environments" )
105
+ } ,
106
+ {
107
+ key : 'notFound' ,
108
+ title : 'Not Found'
109
+ }
110
+ ] ;
111
+
93
112
return (
94
113
< div style = { { padding : "24px" , flex : 1 } } >
95
- < Breadcrumb style = { { marginBottom : "16px" } } >
96
- < Breadcrumb . Item >
97
- < span
98
- style = { { cursor : "pointer" } }
99
- onClick = { ( ) => history . push ( "/setting/environments" ) }
100
- >
101
- < HomeOutlined /> Environments
102
- </ span >
103
- </ Breadcrumb . Item >
104
- < Breadcrumb . Item > Not Found</ Breadcrumb . Item >
105
- </ Breadcrumb >
114
+ < ModernBreadcrumbs items = { errorItems } />
106
115
107
- < Card >
116
+ < Card style = { { borderRadius : '8px' , boxShadow : '0 2px 8px rgba(0,0,0,0.05)' } } >
108
117
< div style = { { textAlign : "center" , padding : "40px 0" } } >
109
118
< Title level = { 3 } style = { { color : "#ff4d4f" } } >
110
119
Environment Not Found
@@ -124,58 +133,53 @@ const EnvironmentDetail: React.FC = () => {
124
133
</ div >
125
134
) ;
126
135
}
136
+
137
+ const breadcrumbItems = [
138
+ {
139
+ key : 'environments' ,
140
+ title : (
141
+ < span >
142
+ < HomeOutlined /> Environments
143
+ </ span >
144
+ ) ,
145
+ onClick : ( ) => history . push ( "/setting/environments" )
146
+ } ,
147
+ {
148
+ key : 'currentEnvironment' ,
149
+ title : environment . environmentName
150
+ }
151
+ ] ;
127
152
153
+ // Get environment type tag color
154
+ const getEnvironmentTypeColor = ( ) => {
155
+ switch ( environment . environmentType ) {
156
+ case 'production' :
157
+ return 'red' ;
158
+ case 'testing' :
159
+ return 'orange' ;
160
+ default :
161
+ return 'blue' ;
162
+ }
163
+ } ;
164
+
128
165
return (
129
166
< div
130
167
className = "environment-detail-container"
131
168
style = { { padding : "24px" , flex : 1 } }
132
169
>
133
- < Breadcrumb style = { { marginBottom : "16px" } } >
134
- < Breadcrumb . Item >
135
- < span
136
- style = { { cursor : "pointer" } }
137
- onClick = { ( ) => history . push ( "/setting/environments" ) }
138
- >
139
- < HomeOutlined /> Environments
140
- </ span >
141
- </ Breadcrumb . Item >
142
- < Breadcrumb . Item > { environment . environmentName } </ Breadcrumb . Item >
143
- </ Breadcrumb >
170
+ < ModernBreadcrumbs items = { breadcrumbItems } />
144
171
145
- { /* Header with environment name and controls */ }
146
- < div
147
- className = "environment-header"
148
- style = { {
149
- marginBottom : "24px" ,
150
- display : "flex" ,
151
- justifyContent : "space-between" ,
152
- alignItems : "flex-start" ,
153
- flexWrap : "wrap" ,
154
- gap : "16px" ,
155
- } }
156
- >
157
- < div style = { { flex : "1 1 auto" , minWidth : "200px" } } >
158
- < Title level = { 3 } style = { { margin : 0 , wordBreak : "break-word" } } >
159
- { environment . environmentName || "Unnamed Environment" }
160
- </ Title >
161
- < Text type = "secondary" > ID: { environment . environmentId } </ Text >
162
- </ div >
163
- < div style = { { flexShrink : 0 } } >
164
- < Button
165
- icon = { < EditOutlined /> }
166
- onClick = { handleEditClick }
167
- type = "primary"
168
- >
169
- Edit Environment
170
- </ Button >
171
- </ div >
172
- </ div >
172
+ { /* Environment Header Component */ }
173
+ < EnvironmentHeader
174
+ environment = { environment }
175
+ onEditClick = { handleEditClick }
176
+ />
173
177
174
178
{ /* Basic Environment Information Card - improved responsiveness */ }
175
179
< Card
176
180
title = "Environment Overview"
177
- style = { { marginBottom : "24px" } }
178
- extra = { environment . isMaster && < Tag color = "green" > Master </ Tag > }
181
+ style = { { marginBottom : "24px" , borderRadius : '8px' , boxShadow : '0 2px 8px rgba(0,0,0,0.05)' } }
182
+ className = " environment-overview-card"
179
183
>
180
184
< Descriptions
181
185
bordered
@@ -198,22 +202,17 @@ const EnvironmentDetail: React.FC = () => {
198
202
</ Descriptions . Item >
199
203
< Descriptions . Item label = "Environment Type" >
200
204
< Tag
201
- color = {
202
- environment . environmentType === "production"
203
- ? "red"
204
- : environment . environmentType === "testing"
205
- ? "orange"
206
- : "blue"
207
- }
205
+ color = { getEnvironmentTypeColor ( ) }
206
+ style = { { borderRadius : '12px' } }
208
207
>
209
208
{ environment . environmentType }
210
209
</ Tag >
211
210
</ Descriptions . Item >
212
211
< Descriptions . Item label = "API Key Status" >
213
212
{ environment . environmentApikey ? (
214
- < Tag color = "green" > Configured</ Tag >
213
+ < Tag color = "green" style = { { borderRadius : '12px' } } > Configured</ Tag >
215
214
) : (
216
- < Tag color = "red" > Not Configured</ Tag >
215
+ < Tag color = "red" style = { { borderRadius : '12px' } } > Not Configured</ Tag >
217
216
) }
218
217
</ Descriptions . Item >
219
218
< Descriptions . Item label = "Master Environment" >
@@ -223,16 +222,29 @@ const EnvironmentDetail: React.FC = () => {
223
222
</ Card >
224
223
225
224
{ /* Tabs for Workspaces and User Groups */ }
226
- < Tabs defaultActiveKey = "workspaces" >
227
- < TabPane tab = "Workspaces" key = "workspaces" >
225
+ < Tabs
226
+ defaultActiveKey = "workspaces"
227
+ activeKey = { activeTab }
228
+ onChange = { setActiveTab }
229
+ className = "modern-tabs"
230
+ type = "card"
231
+ >
232
+ < TabPane
233
+ tab = {
234
+ < span >
235
+ < AppstoreOutlined /> Workspaces
236
+ </ span >
237
+ }
238
+ key = "workspaces"
239
+ >
228
240
{ /* Using our new standalone WorkspacesTab component */ }
229
241
< WorkspacesTab environment = { environment } />
230
242
</ TabPane >
231
243
232
244
< TabPane
233
245
tab = {
234
246
< span >
235
- < TeamOutlined /> User Groups
247
+ < UsergroupAddOutlined /> User Groups
236
248
</ span >
237
249
}
238
250
key = "userGroups"
0 commit comments