Commit b3fdd5fa authored by liuzheng712's avatar liuzheng712

update

parent 853eaffc
...@@ -173,150 +173,120 @@ server.run = function (options) { ...@@ -173,150 +173,120 @@ server.run = function (options) {
apis.route('/perms/v1/user/my/asset-groups-assets/') apis.route('/perms/v1/user/my/asset-groups-assets/')
.get(function (req, res) { .get(function (req, res) {
res.json([ res.json([
{ {
"id": 0, "id": 0,
"name": "ungrouped", "name": "ungrouped",
"assets": [] "assets": []
}, },
{ {
"id": 1, "id": 1,
"name": "Default", "name": "Default",
"comment": "Default asset group", "comment": "Default asset group",
"assets": [ "assets": [
{ {
"id": 2, "id": 2,
"hostname": "192.168.1.6", "hostname": "192.168.1.6",
"ip": "192.168.2.6", "ip": "192.168.2.6",
"port": 22, "port": 22,
"system_users": [ "system_users": [
{ {
"id": 1, "id": 1,
"name": "web", "name": "web",
"username": "web", "username": "web",
"protocol": "ssh", "protocol": "ssh",
"auth_method": "P", "auth_method": "P",
"auto_push": true "auto_push": true
} }
] ]
}, },
{ {
"id": 4, "id": 4,
"hostname": "testserver123", "hostname": "testserver123",
"ip": "123.57.183.135", "ip": "123.57.183.135",
"port": 8022, "port": 8022,
"system_users": [ "system_users": [
{ {
"id": 1, "id": 1,
"name": "web", "name": "web",
"username": "web", "username": "web",
"protocol": "ssh", "protocol": "ssh",
"auth_method": "P", "auth_method": "P",
"auto_push": true "auto_push": true
} }
] ]
} }
] ]
}, },
{ {
"id": 4, "id": 4,
"name": "java", "name": "java",
"comment": "", "comment": "",
"assets": [ "assets": [
{ {
"id": 2, "id": 2,
"hostname": "192.168.1.6", "hostname": "192.168.1.6",
"ip": "192.168.2.6", "ip": "192.168.2.6",
"port": 22, "port": 22,
"system_users": [ "system_users": [
{ {
"id": 1, "id": 1,
"name": "web", "name": "web",
"username": "web", "username": "web",
"protocol": "ssh", "protocol": "ssh",
"auth_method": "P", "auth_method": "P",
"auto_push": true "auto_push": true
} }
] ]
} }
] ]
}, },
{ {
"id": 3, "id": 3,
"name": "数据库", "name": "数据库",
"comment": "", "comment": "",
"assets": [ "assets": [
{ {
"id": 2, "id": 2,
"hostname": "192.168.1.6", "hostname": "192.168.1.6",
"ip": "192.168.2.6", "ip": "192.168.2.6",
"port": 22, "port": 22,
"system_users": [ "system_users": [
{ {
"id": 1, "id": 1,
"name": "web", "name": "web",
"username": "web", "username": "web",
"protocol": "ssh", "protocol": "ssh",
"auth_method": "P", "auth_method": "P",
"auto_push": true "auto_push": true
} }
] ]
} }
] ]
}, },
{ {
"id": 2, "id": 2,
"name": "运维组", "name": "运维组",
"comment": "", "comment": "",
"assets": [ "assets": [
{ {
"id": 2, "id": 2,
"hostname": "192.168.1.6", "hostname": "192.168.1.6",
"ip": "192.168.2.6", "ip": "192.168.2.6",
"port": 22, "port": 22,
"system_users": [ "system_users": [
{ {
"id": 1, "id": 1,
"name": "web", "name": "web",
"username": "web", "username": "web",
"protocol": "ssh", "protocol": "ssh",
"auth_method": "P", "auth_method": "P",
"auto_push": true "auto_push": true
} }
] ]
} }
] ]
} }
]); ])
res.json([{
"name": "测试服务器组1",
"id": 1,
"children": [{"name": "测试服务器1", "uuid": "", "type": "ssh", "users": ["root", "test"]}, {
"name": "测试服务器2",
"uuid": "",
"type": "ssh",
"users": ["root", "test"]
}]
}, {
"name": "樱花庄服务器组",
"id": 2,
"children": [{"name": "测试服务器1", "uuid": "", "type": "ssh", "users": ["root", "test"]}, {
"name": "测试服务器2",
"uuid": "",
"type": "ssh",
"users": ["root", "test"]
}]
}, {
"name": "阿里云服务器组",
"id": 3,
"children": [{"name": "测试服务器1", "uuid": "", "type": "ssh", "users": ["root", "test"]}, {
"name": "测试服务器2",
"uuid": "",
"type": "ssh",
"users": ["root", "test"]
}]
}])
}); });
app.use("/api", apis); app.use("/api", apis);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment