Skip to content

Commit

Permalink
refactor(crd): 优化 CRD 页面布局和功能
Browse files Browse the repository at this point in the history
- 在 floating-toolbar 中添加回退按钮,提高页面导航便利性
-调整 namespaced_cr 页面布局,移除冗余的 flex容器
- 优化命名空间选择器布局,提升用户体验
  • Loading branch information
weibaohui committed Dec 25, 2024
1 parent 6d8244f commit 371548c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 68 deletions.
36 changes: 15 additions & 21 deletions assets/pages/crd/cluster_cr.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
"type": "container",
"className": "floating-toolbar",
"body": [
{
"type": "button",
"label": "回退",
"level": "link",
"className": "mr-2",
"onEvent": {
"click": {
"actions": [
{
"actionType": "goBack"
}
]
}
}
},
{
"type": "tpl",
"tpl": "${kind}",
Expand Down Expand Up @@ -48,27 +63,6 @@
}
]
},
{
"type": "flex",
"justify": "flex-start",
"items": [
{
"type": "button",
"label": "回退",
"level": "link",
"className": "ml-2",
"onEvent": {
"click": {
"actions": [
{
"actionType": "goBack"
}
]
}
}
}
]
},
{
"type": "crud",
"id": "detailCRUD",
Expand Down
84 changes: 37 additions & 47 deletions assets/pages/crd/namespaced_cr.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
"type": "container",
"className": "floating-toolbar",
"body": [
{
"type": "button",
"label": "回退",
"level": "link",
"className": "mr-2",
"onEvent": {
"click": {
"actions": [
{
"actionType": "goBack"
}
]
}
}
},
{
"type": "tpl",
"tpl": "${kind}",
Expand Down Expand Up @@ -54,55 +69,30 @@
"wrapWithPanel": false,
"body": [
{
"type": "flex",
"justify": "flex-start",
"items": [
{
"type": "button",
"label": "回退",
"level": "link",
"className": "ml-2",
"onEvent": {
"click": {
"actions": [
{
"actionType": "goBack"
}
]
}
}
},
{
"style": {
"width": 500,
"margin": 5
},
"label": "Namespace",
"type": "select",
"name": "ns",
"id": "ns",
"searchable": true,
"source": "/k8s/ns/option_list",
"value": "${ls:selectedNs||'default'}",
"onEvent": {
"change": {
"actions": [
{
"actionType": "reload",
"componentId": "detailCRUD",
"data": {
"ns": "${ns}"
}
},
{
"actionType": "custom",
"script": "localStorage.setItem('selectedNs', event.data.ns)"
}
]
"label": "命名空间",
"type": "select",
"name": "ns",
"id": "ns",
"searchable": true,
"source": "/k8s/ns/option_list",
"value": "${ls:selectedNs||'default'}",
"onEvent": {
"change": {
"actions": [
{
"actionType": "reload",
"componentId": "detailCRUD",
"data": {
"ns": "${ns}"
}
},
{
"actionType": "custom",
"script": "localStorage.setItem('selectedNs', event.data.ns)"
}
}
]
}
]
}
}
]
},
Expand Down

0 comments on commit 371548c

Please sign in to comment.