@@ -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,9 @@ 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" ;
29
+ import { getEnvironmentTagColor } from "./utils/environmentUtils" ;
27
30
const { Title, Text } = Typography ;
28
31
const { TabPane } = Tabs ;
29
32
@@ -42,6 +45,7 @@ const EnvironmentDetail: React.FC = () => {
42
45
43
46
const [ isEditModalVisible , setIsEditModalVisible ] = useState ( false ) ;
44
47
const [ isUpdating , setIsUpdating ] = useState ( false ) ;
48
+ const [ activeTab , setActiveTab ] = useState ( 'workspaces' ) ;
45
49
46
50
// Handle edit menu item click
47
51
const handleEditClick = ( ) => {
@@ -71,15 +75,7 @@ const EnvironmentDetail: React.FC = () => {
71
75
}
72
76
} ;
73
77
74
- // Dropdown menu for environment actions
75
- const actionsMenu = (
76
- < Menu >
77
- < Menu . Item key = "edit" icon = { < EditOutlined /> } onClick = { handleEditClick } >
78
- Edit Environment
79
- </ Menu . Item >
80
- { /* Add more menu items here if needed */ }
81
- </ Menu >
82
- ) ;
78
+
83
79
84
80
if ( isLoading ) {
85
81
return (
@@ -90,21 +86,27 @@ const EnvironmentDetail: React.FC = () => {
90
86
}
91
87
92
88
if ( error || ! environment ) {
89
+ const errorItems = [
90
+ {
91
+ key : 'environments' ,
92
+ title : (
93
+ < span >
94
+ < HomeOutlined /> Environments
95
+ </ span >
96
+ ) ,
97
+ onClick : ( ) => history . push ( "/setting/environments" )
98
+ } ,
99
+ {
100
+ key : 'notFound' ,
101
+ title : 'Not Found'
102
+ }
103
+ ] ;
104
+
93
105
return (
94
106
< 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 >
107
+ < ModernBreadcrumbs items = { errorItems } />
106
108
107
- < Card >
109
+ < Card style = { { borderRadius : '8px' , boxShadow : '0 2px 8px rgba(0,0,0,0.05)' } } >
108
110
< div style = { { textAlign : "center" , padding : "40px 0" } } >
109
111
< Title level = { 3 } style = { { color : "#ff4d4f" } } >
110
112
Environment Not Found
@@ -124,58 +126,41 @@ const EnvironmentDetail: React.FC = () => {
124
126
</ div >
125
127
) ;
126
128
}
127
-
129
+
130
+ const breadcrumbItems = [
131
+ {
132
+ key : 'environments' ,
133
+ title : (
134
+ < span >
135
+ < HomeOutlined /> Environments
136
+ </ span >
137
+ ) ,
138
+ onClick : ( ) => history . push ( "/setting/environments" )
139
+ } ,
140
+ {
141
+ key : 'currentEnvironment' ,
142
+ title : environment . environmentName
143
+ }
144
+ ] ;
145
+
128
146
return (
129
147
< div
130
148
className = "environment-detail-container"
131
149
style = { { padding : "24px" , flex : 1 } }
132
150
>
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 >
151
+ { /* Environment Header Component */ }
152
+ < EnvironmentHeader
153
+ environment = { environment }
154
+ onEditClick = { handleEditClick }
155
+ />
144
156
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 >
157
+
173
158
174
159
{ /* Basic Environment Information Card - improved responsiveness */ }
175
160
< Card
176
161
title = "Environment Overview"
177
- style = { { marginBottom : "24px" } }
178
- extra = { environment . isMaster && < Tag color = "green" > Master </ Tag > }
162
+ style = { { marginBottom : "24px" , borderRadius : '8px' , boxShadow : '0 2px 8px rgba(0,0,0,0.05)' } }
163
+ className = " environment-overview-card"
179
164
>
180
165
< Descriptions
181
166
bordered
@@ -198,22 +183,17 @@ const EnvironmentDetail: React.FC = () => {
198
183
</ Descriptions . Item >
199
184
< Descriptions . Item label = "Environment Type" >
200
185
< Tag
201
- color = {
202
- environment . environmentType === "production"
203
- ? "red"
204
- : environment . environmentType === "testing"
205
- ? "orange"
206
- : "blue"
207
- }
186
+ color = { getEnvironmentTagColor ( environment . environmentType ) }
187
+ style = { { borderRadius : '12px' } }
208
188
>
209
189
{ environment . environmentType }
210
190
</ Tag >
211
191
</ Descriptions . Item >
212
192
< Descriptions . Item label = "API Key Status" >
213
193
{ environment . environmentApikey ? (
214
- < Tag color = "green" > Configured</ Tag >
194
+ < Tag color = "green" style = { { borderRadius : '12px' } } > Configured</ Tag >
215
195
) : (
216
- < Tag color = "red" > Not Configured</ Tag >
196
+ < Tag color = "red" style = { { borderRadius : '12px' } } > Not Configured</ Tag >
217
197
) }
218
198
</ Descriptions . Item >
219
199
< Descriptions . Item label = "Master Environment" >
@@ -222,17 +202,32 @@ const EnvironmentDetail: React.FC = () => {
222
202
</ Descriptions >
223
203
</ Card >
224
204
205
+ { /* Modern Breadcrumbs navigation */ }
206
+ < ModernBreadcrumbs items = { breadcrumbItems } />
225
207
{ /* Tabs for Workspaces and User Groups */ }
226
- < Tabs defaultActiveKey = "workspaces" >
227
- < TabPane tab = "Workspaces" key = "workspaces" >
208
+ < Tabs
209
+ defaultActiveKey = "workspaces"
210
+ activeKey = { activeTab }
211
+ onChange = { setActiveTab }
212
+ className = "modern-tabs"
213
+ type = "card"
214
+ >
215
+ < TabPane
216
+ tab = {
217
+ < span >
218
+ < AppstoreOutlined /> Workspaces
219
+ </ span >
220
+ }
221
+ key = "workspaces"
222
+ >
228
223
{ /* Using our new standalone WorkspacesTab component */ }
229
224
< WorkspacesTab environment = { environment } />
230
225
</ TabPane >
231
226
232
227
< TabPane
233
228
tab = {
234
229
< span >
235
- < TeamOutlined /> User Groups
230
+ < UsergroupAddOutlined /> User Groups
236
231
</ span >
237
232
}
238
233
key = "userGroups"
0 commit comments