-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CE-620]Add AgentList in Agent management
In Agent management,can see Agent list. Signed-off-by: fengyang_sy <[email protected]> Change-Id: I4f913a8bff040eed69b968c2abe5b568c84c3f07
- Loading branch information
1 parent
92bc663
commit a68a6f3
Showing
16 changed files
with
569 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Mock from 'mockjs'; | ||
import faker from 'faker'; | ||
import { paginator } from './_utils'; | ||
|
||
const agents = Mock.mock({ | ||
'data|11': [{ | ||
id: function () { | ||
return Mock.Random.guid() | ||
}, | ||
name: function () { | ||
return faker.company.companyName(); | ||
}, | ||
created_at: '@datetime', | ||
worker_api: function () { return Mock.Random.ip() }, | ||
capacity: function () { return Math.ceil(Math.random()*10) }, | ||
node_capacity: function () { return Math.ceil(Math.random()*10) }, | ||
status: function () { return Mock.Random.pick(['inactive', 'active']) }, | ||
log_level: function () { return Mock.Random.pick(['info', 'debug']) }, | ||
type: function () { return Mock.Random.pick(['docker', 'kubernetes']) }, | ||
schedulable: function () { return Mock.Random.pick([true, false]) }, | ||
organization_id: function () { return Mock.Random.guid() }, | ||
}], | ||
}); | ||
|
||
function getAgents(req, res) { | ||
const { page = 1, per_page = 10 } = req.query; | ||
const result = paginator(agents.data, parseInt(page), parseInt(per_page)); | ||
res.send({ | ||
total: result.total, | ||
data: result.data, | ||
}); | ||
} | ||
|
||
export default { | ||
'GET /api/agents': getAgents, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Mock from 'mockjs'; | ||
import faker from 'faker'; | ||
import { paginator } from './_utils'; | ||
|
||
const organizations = Mock.mock({ | ||
'data|11': [{ | ||
id: function () { | ||
return Mock.Random.guid() | ||
}, | ||
name: function () { | ||
return faker.company.companyName(); | ||
}, | ||
created_at: '@datetime', | ||
}], | ||
}); | ||
|
||
function getOrgs(req, res) { | ||
const { page = 1, per_page = 10 } = req.query; | ||
const result = paginator(organizations.data, parseInt(page), parseInt(per_page)); | ||
res.send({ | ||
total: result.total, | ||
data: result.data, | ||
}); | ||
} | ||
|
||
export default { | ||
'GET /api/organizations': getOrgs, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
export default { | ||
'app.operator.agent.title': 'Agent Management', | ||
'app.operator.agent.table.header.name': 'Name', | ||
'app.operator.agent.table.header.createTime': 'Create Time', | ||
'app.operator.agent.table.header.type': 'Type', | ||
'app.operator.agent.form.new.title': 'New Agent', | ||
'app.operator.agent.form.update.title': 'Update Agent', | ||
'app.operator.agent.form.name.label': 'Agent Name', | ||
'app.operator.agent.form.name.required': 'Please input organization name', | ||
'app.operator.agent.create.success': 'Create agent {name} success', | ||
'app.operator.agent.create.fail': 'Create agent {name} failed', | ||
'app.operator.agent.update.success': 'Update agent {name} success', | ||
'app.operator.agent.update.fail': 'Update agent {name} failed', | ||
'app.operator.agent.form.delete.title': 'Delete Agent', | ||
'app.operator.agent.form.delete.content': 'Confirm to delete agent {name}', | ||
'app.operator.agent.delete.fail': 'Delete Agent {name} failed', | ||
'app.operator.agent.delete.success': 'Delete Agent {name} success', | ||
'app.operator.agent.listItem.organization': 'Organization', | ||
'app.operator.agent.type': 'Type', | ||
'app.operator.newAgent.error.workerApi': 'Please input validate worker api.', | ||
'app.operator.newAgent.error.NFSServer': 'Please input validate NFS Server address.', | ||
'app.operator.newAgent.title': 'Create Agent', | ||
'app.operator.editAgent.title': 'Edit Agent', | ||
'app.operator.newAgent.label.name': 'Name', | ||
'app.operator.newAgent.required.name': 'Please input name.', | ||
'app.operator.newAgent.label.daemonUrl': 'Daemon Url', | ||
'app.operator.newAgent.required.daemonUrl': 'Please input daemon url.', | ||
'app.operator.newAgent.label.type': 'Type', | ||
'app.operator.newAgent.required.type': 'Please select a type.', | ||
'app.operator.newAgent.label.credentialType': 'Credential Type', | ||
'app.operator.newAgent.required.credentialType': 'Please select a credential type.', | ||
'app.operator.newAgent.label.certificateContent': 'Certificate Content', | ||
'app.operator.newAgent.required.certificateContent': 'Please input certificate content.', | ||
'app.operator.newAgent.label.certificateKey': 'Certificate Key', | ||
'app.operator.newAgent.required.certificateKey': 'Please input certificate key.', | ||
'app.operator.newAgent.label.configurationContent': 'Configuration Content', | ||
'app.operator.newAgent.required.configurationContent': 'Please input configuration content.', | ||
'app.operator.newAgent.label.username': 'Username', | ||
'app.operator.newAgent.required.username': 'Please input username.', | ||
'app.operator.newAgent.label.password': 'Password', | ||
'app.operator.newAgent.required.password': 'Please input password.', | ||
'app.operator.newAgent.label.extraParameters': 'Extra Parameters', | ||
'app.operator.newAgent.label.useSSL': 'Use SSL Verification', | ||
'app.operator.newAgent.label.SSLCa': 'SSL CA', | ||
'app.operator.newAgent.required.SSLCa': 'Please input ssl ca cert.', | ||
'app.operator.newAgent.label.logLevel': 'Log Level', | ||
'app.operator.newAgent.required.logLevel': 'Please select a log level.', | ||
'app.operator.newAgent.label.schedulable': 'Schedulable', | ||
'app.operator.newAgent.label.capacity': 'Capacity', | ||
'app.operator.newAgent.required.capacity': 'Please input capacity.', | ||
'app.operator.newAgent.label.NFSServer': 'NFS Server Address', | ||
'app.operator.newAgent.required.NFSServer': 'Please input NFS server address.', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
export default { | ||
'app.operator.agent.title': '代理管理', | ||
'app.operator.agent.table.header.name': '名称', | ||
'app.operator.agent.table.header.createTime': '创建时间', | ||
'app.operator.agent.table.header.type': '类型', | ||
'app.operator.agent.form.new.title': '新建代理', | ||
'app.operator.agent.form.update.title': '更新代理', | ||
'app.operator.agent.form.name.label': '代理名称', | ||
'app.operator.agent.form.name.required': '请输入代理名称', | ||
'app.operator.agent.create.success': '创建代理 {name} 成功', | ||
'app.operator.agent.create.fail': '创建代理 {name} 失败', | ||
'app.operator.agent.update.success': '更新代理 {name} 成功', | ||
'app.operator.agent.update.fail': '更新代理 {name} 失败', | ||
'app.operator.agent.form.delete.title': '删除代理', | ||
'app.operator.agent.form.delete.content': '确认删除代理 {name}', | ||
'app.operator.agent.delete.success': '删除代理 {name} 成功', | ||
'app.operator.agent.delete.fail': '删除代理 {name} 失败', | ||
'app.operator.agent.listItem.organization': '所属组织', | ||
'app.operator.agent.type': '类型', | ||
'app.operator.newAgent.error.workerApi': '请输入有效的地址。', | ||
'app.operator.newAgent.error.NFSServer': '请输入有效的NFS服务地址。', | ||
'app.operator.newAgent.title': '新建代理', | ||
'app.operator.editAgent.title': '编辑代理', | ||
'app.operator.newAgent.label.name': '名称', | ||
'app.operator.newAgent.required.name': '请输入用户名。', | ||
'app.operator.newAgent.label.daemonUrl': '服务地址', | ||
'app.operator.newAgent.required.daemonUrl': '请输入地址。', | ||
'app.operator.newAgent.label.type': '类型', | ||
'app.operator.newAgent.required.type': '请选择一个类型。', | ||
'app.operator.newAgent.label.credentialType': '凭证类型', | ||
'app.operator.newAgent.required.credentialType': '请选择一个凭证类型。', | ||
'app.operator.newAgent.label.certificateContent': '证书内容', | ||
'app.operator.newAgent.required.certificateContent': '请输入证书内容。', | ||
'app.operator.newAgent.label.certificateKey': '密钥', | ||
'app.operator.newAgent.required.certificateKey': '请输入密钥内容。', | ||
'app.operator.newAgent.label.configurationContent': '配置内容', | ||
'app.operator.newAgent.required.configurationContent': '请输入配置内容。', | ||
'app.operator.newAgent.label.username': '用户名', | ||
'app.operator.newAgent.required.username': '请输入用户名。', | ||
'app.operator.newAgent.label.password': '密码', | ||
'app.operator.newAgent.required.password': '请输入密码。', | ||
'app.operator.newAgent.label.extraParameters': '额外参数', | ||
'app.operator.newAgent.label.useSSL': '使用 SSL 验证', | ||
'app.operator.newAgent.label.SSLCa': 'SSL CA证书', | ||
'app.operator.newAgent.required.SSLCa': '请输入ssl CA证书。', | ||
'app.operator.newAgent.label.logLevel': '日志级别', | ||
'app.operator.newAgent.required.logLevel': '请选择一个日志级别。', | ||
'app.operator.newAgent.label.schedulable': '可调度', | ||
'app.operator.newAgent.label.capacity': '容量', | ||
'app.operator.newAgent.required.capacity': '请输入容量。', | ||
'app.operator.newAgent.label.NFSServer': 'NFS 服务地址', | ||
'app.operator.newAgent.required.NFSServer': '请输入NFS服务的地址。', | ||
}; |
Oops, something went wrong.