forked from flipped-aurora/gin-vue-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
hequan2017 edited this page Nov 24, 2025
·
1 revision
docker gpu 开源管理系统
cd server/ go run main.go
cd web / npm run dev
- 模块:Linux SSH 管理
- 字段:
- 服务器IP地址
ip - SSH端口
port(默认22) - 登录账号
username(默认root) - 登录密码
password - 状态
status(创建/更新后自动检测:正常/异常) - 服务器标签名
label - 服务器地区
region
- 服务器IP地址
- 行为:创建或更新时,系统使用
ip/port/username/password尝试 SSH 登录,成功则记录状态为“正常”,失败记录为“异常”。 - 接口:
-
POST /ssh/createSshServer新增 -
DELETE /ssh/deleteSshServer?ID=<id>删除 -
DELETE /ssh/deleteSshServerByIds?IDs[]=<id1>&IDs[]=<id2>批量删除 -
PUT /ssh/updateSshServer更新 -
GET /ssh/findSshServer?ID=<id>查询单条 -
GET /ssh/getSshServerList?page=<n>&pageSize=<m>&ip=<like>&label=<like>®ion=<like>&status=正常列表
-
- 前端:
- 菜单:Linux SSH 管理(路由
ssh) - 列表列:IP(宽度 200)、端口、账号、服务器标签名、服务器地区、状态
- 表单默认值:
port=22、username='root' - 密码输入:编辑窗口显示且字符隐藏(
type=password) - 状态:表单只读显示后端检测结果
- 菜单:Linux SSH 管理(路由
- 示例(创建):
- 请求体:
{"ip":"192.168.1.10","port":22,"username":"root","password":"your_password","label":"生产A","region":"杭州"}
- 请求体:
- 前端:
- 页面:
Docker 管理(view/docker/dockerManage.vue) - 功能:
xterm.js终端渲染、复制选中、清屏、Shell 切换(/bin/sh//bin/bash)、尺寸预设与自适应、断线自动重连与心跳保活
- 页面:
- 后端:
- 接口:
GET /docker/execWs(WebSocket,参数:endpointId、ID、shell) - 说明:创建
exec并桥接容器 STDIN/STDOUT;支持{"type":"resize","cols":<int>,"rows":<int>}同步终端尺寸,{"type":"ping"}心跳
- 接口:
- 相关 API:
-
GET /docker/servers获取正常服务器 -
GET /docker/ps获取容器列表(支持scope=running|exited|all) -
POST /docker/createContainer创建容器 -
POST /docker/startContainer启动容器 -
POST /docker/stopContainer停止容器 -
DELETE /docker/removeContainer删除容器 -
GET /docker/findDockerEndpoint查询 Endpoint -
GET /docker/getDockerEndpointListEndpoint 列表 -
POST /docker/createDockerEndpoint创建 Endpoint -
DELETE /docker/deleteDockerEndpoint删除 Endpoint -
DELETE /docker/deleteDockerEndpointByIds批量删除 Endpoint -
PUT /docker/updateDockerEndpoint更新 Endpoint
-
- API 初始化:在
server/source/system/api.go的entities中新增上述 Docker 接口(含execWs) - 菜单初始化:在
server/source/system/menu.go的childMenus中新增Docker 管理菜单,父级为systemTools,组件路径view/docker/dockerManage.vue