refactor(web): 页面随web服务发布
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
function time(field) {
|
||||
return {
|
||||
type: 'tpl',
|
||||
tpl: `\${IF(${field}, DATETOSTR(${field}, 'YYYY-MM-DD HH:mm:ss'), undefined)}`
|
||||
}
|
||||
}
|
||||
|
||||
function cloudCrud(title, path) {
|
||||
return {
|
||||
type: 'crud',
|
||||
title: title,
|
||||
api: `\${base}${path}`,
|
||||
...crudCommonOptions(),
|
||||
interval: 2000,
|
||||
headerToolbar: ['reload'],
|
||||
loadDataOnce: true,
|
||||
perPage: 100,
|
||||
columns: [
|
||||
{name: 'name', label: '名称'},
|
||||
{
|
||||
name: 'status',
|
||||
label: '状态',
|
||||
align: 'center',
|
||||
width: 60,
|
||||
},
|
||||
{
|
||||
name: 'serviceUpTime',
|
||||
label: '启动时间',
|
||||
...time('serviceUpTime'),
|
||||
align: 'center',
|
||||
width: 160,
|
||||
},
|
||||
{name: 'url', label: '地址', width: 200},
|
||||
{name: 'serviceId', label: '服务', width: 200, fixed: 'right'},
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
function cloudTab() {
|
||||
return {
|
||||
title: 'Cloud',
|
||||
tab: [
|
||||
/*{
|
||||
type: 'service',
|
||||
silentPolling: true,
|
||||
schemaApi: 'get:${base}/cloud/deploy_plan',
|
||||
},*/
|
||||
cloudCrud('服务列表', '/cloud/list'),
|
||||
cloudCrud('服务列表 (IP)', '/cloud/list_ip'),
|
||||
],
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user