Skip to content

Commit

Permalink
添加SmartEdit功能。该功能包括查看和编辑YAML文件的能力,并为每种资源类型提供相应的文档查看功能。
Browse files Browse the repository at this point in the history
  • Loading branch information
weibaohui committed Oct 15, 2024
1 parent d9898ae commit 1afca97
Show file tree
Hide file tree
Showing 37 changed files with 3,784 additions and 1,194 deletions.
132 changes: 104 additions & 28 deletions assets/pages/cluster/cluster_role.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,35 +63,111 @@
"closeOnEsc": true,
"closeOnOutside": true,
"size": "lg",
"title": "YAML 编辑器",
"body": {
"type": "service",
"api": "get:/k8s/$kind/ns/$metadata.namespace/name/$metadata.name",
"body": [
{
"type": "form",
"api": "post:/k8s/$kind/update/ns/$metadata.namespace/name/$metadata.name",
"wrapWithPanel": false,
"body": [
{
"type": "editor",
"name": "yaml",
"size": "xxl",
"allowFullscreen": true,
"placeholder": "loading",
"language": "yaml",
"value": "${yaml}",
"options": {
"wordWrap": "on",
"scrollbar": {
"vertical": "auto"
}
"title": "SmartEdit",
"body": [
{
"type": "tabs",
"tabsMode": "tiled",
"tabs": [
{
"title": "View",
"body": [
{
"type": "service",
"api": "get:/k8s/$kind/group/$group/ns/$metadata.namespace/name/$metadata.name",
"body": [
{
"type": "form",
"api": "post:/k8s/$kind/group/$group/update/ns/$metadata.namespace/name/$metadata.name",
"wrapWithPanel": false,
"body": [
{
"type": "editor",
"name": "yaml",
"size": "xxl",
"allowFullscreen": true,
"placeholder": "loading",
"language": "yaml",
"value": "${yaml}",
"options": {
"wordWrap": "on",
"scrollbar": {
"vertical": "auto"
}
}
}
]
}
]
}
}
]
}
]
}
]
},
{
"title": "Doc",
"body": [
{
"type": "page",
"asideResizor": true,
"asideMinWidth": 150,
"asideMaxWidth": 400,
"aside": [
{
"type": "input-tree",
"name": "tree",
"initiallyOpen": false,
"unfoldedLevel": 1,
"searchable": true,
"showOutline": true,
"showIcon": true,
"searchConfig": {
"sticky": true
},
"selectFirst": true,
"heightAuto": true,
"inputClassName": "no-border no-padder mt-1",
"source": "get:/k8s/doc/gvk/${apiVersion|base64Encode}/$kind",
"onEvent": {
"change": {
"actions": [
{
"componentId": "detail",
"actionType": "reload",
"data": {
"description": "${event.data.item.description}"
}
}
]
}
}
}
],
"toolbar": [
{
"type": "tpl",
"tpl": ""
}
],
"body": [
{
"type": "service",
"api": "post:/k8s/doc/detail",
"body": [
{
"type": "tpl",
"tpl": "${description}</br></br></br>${translate?translate:''}",
"wrapperComponent": "",
"inline": false
}
],
"id": "detail"
}
]
}
]
}
]
}
]
}
}
],
Expand Down
132 changes: 104 additions & 28 deletions assets/pages/cluster/cluster_role_binding.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,35 +63,111 @@
"closeOnEsc": true,
"closeOnOutside": true,
"size": "lg",
"title": "YAML 编辑器",
"body": {
"type": "service",
"api": "get:/k8s/$kind/ns/$metadata.namespace/name/$metadata.name",
"body": [
{
"type": "form",
"api": "post:/k8s/$kind/update/ns/$metadata.namespace/name/$metadata.name",
"wrapWithPanel": false,
"body": [
{
"type": "editor",
"name": "yaml",
"size": "xxl",
"allowFullscreen": true,
"placeholder": "loading",
"language": "yaml",
"value": "${yaml}",
"options": {
"wordWrap": "on",
"scrollbar": {
"vertical": "auto"
}
"title": "SmartEdit",
"body": [
{
"type": "tabs",
"tabsMode": "tiled",
"tabs": [
{
"title": "View",
"body": [
{
"type": "service",
"api": "get:/k8s/$kind/group/$group/ns/$metadata.namespace/name/$metadata.name",
"body": [
{
"type": "form",
"api": "post:/k8s/$kind/group/$group/update/ns/$metadata.namespace/name/$metadata.name",
"wrapWithPanel": false,
"body": [
{
"type": "editor",
"name": "yaml",
"size": "xxl",
"allowFullscreen": true,
"placeholder": "loading",
"language": "yaml",
"value": "${yaml}",
"options": {
"wordWrap": "on",
"scrollbar": {
"vertical": "auto"
}
}
}
]
}
]
}
}
]
}
]
}
]
},
{
"title": "Doc",
"body": [
{
"type": "page",
"asideResizor": true,
"asideMinWidth": 150,
"asideMaxWidth": 400,
"aside": [
{
"type": "input-tree",
"name": "tree",
"initiallyOpen": false,
"unfoldedLevel": 1,
"searchable": true,
"showOutline": true,
"showIcon": true,
"searchConfig": {
"sticky": true
},
"selectFirst": true,
"heightAuto": true,
"inputClassName": "no-border no-padder mt-1",
"source": "get:/k8s/doc/gvk/${apiVersion|base64Encode}/$kind",
"onEvent": {
"change": {
"actions": [
{
"componentId": "detail",
"actionType": "reload",
"data": {
"description": "${event.data.item.description}"
}
}
]
}
}
}
],
"toolbar": [
{
"type": "tpl",
"tpl": ""
}
],
"body": [
{
"type": "service",
"api": "post:/k8s/doc/detail",
"body": [
{
"type": "tpl",
"tpl": "${description}</br></br></br>${translate?translate:''}",
"wrapperComponent": "",
"inline": false
}
],
"id": "detail"
}
]
}
]
}
]
}
]
}
}
],
Expand Down
Loading

0 comments on commit 1afca97

Please sign in to comment.