Skip to content

Commit

Permalink
feat(ns): 添加 configmap 导入功能
Browse files Browse the repository at this point in the history
- 在 configmap 页面添加导入按钮和相关功能
- 实现文件上传和处理的对话框界面
- 添加后端 API 调用以完成导入操作
  • Loading branch information
weibaohui committed Dec 18, 2024
1 parent 8795e61 commit 56a561b
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions assets/pages/ns/configmap.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,57 @@
}
]
}
},
{
"type": "button",
"tooltip": "导入configmap",
"icon": "fa fa-upload",
"actionType": "dialog",
"dialog": {
"closeOnEsc": true,
"closeOnOutside": true,
"title": "上传文件 (ESC 关闭)",
"body": [
{
"type": "page",
"body": {
"type": "form",
"body": [
{
"type": "input-file",
"name": "file",
"accept": "*",
"asBlob": true
},
{
"type": "input-text",
"name": "fileName",
"label": "文件名",
"value": "${file.name ||file[0].name ||file[0].path ||file.path ||''}"
}
],
"actions": [
{
"type": "button",
"label": "上传",
"level": "primary",
"actionType": "ajax",
"close": true,
"api": {
"method": "post",
"url": "/k8s/configmap/ns/${metadata.namespace}/name/${metadata.name}/import",
"data": {
"file": "${file}",
"fileName": "${fileName}"
}
}
}
]
}
}
],
"actions": []
}
}
],
"toggled": true
Expand Down

0 comments on commit 56a561b

Please sign in to comment.