model-list.html
2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>模型管理</title>
</head>
<body>
<div id="top">
</div>
<h2>模型列表</h2>
<hr>
<a href="javascript: AJAX.POST('/models/newModel')">绘制流程</a>
<table border="1" id="model-list">
<tr>
<td>模型编号</td>
<td>模型名称</td>
<td>版本</td>
<td>创建时间</td>
<td>操作</td>
</tr>
<script id="models" type="text/html">
<tr>
<td>模型编号</td>
<td>模型名称</td>
<td>版本</td>
<td>创建时间</td>
<td>操作</td>
</tr>
{{each rows.list}}
<tr>
<td>{{$value.id}}</td>
<td>{{$value.name}}</td>
<td>{{$value.version}}</td>
<td>{{$value.createTime}}</td>
<td>
<a href="/editor?modelId={{$value.id}}">编辑</a>
<a href="javascript: AJAX.DELETE('/models/{{$value.id}}')">删除</a>
<a href="javascript: AJAX.POST('/models/{{$value.id}}/deployment')">发布</a>
</td>
</tr>
{{/each}}
</script>
</table>
<hr>
<h2>部署列表</h2>
<hr>
<table border="1" id="deployment-list">
<tr>
<td>编号</td>
<td>名称</td>
<td>部署时间</td>
<td>操作</td>
</tr>
<script id="deployments" type="text/html">
<tr>
<td>编号</td>
<td>名称</td>
<td>部署时间</td>
<td>操作</td>
</tr>
{{each rows.list}}
<tr>
<td>{{$value.id}}</td>
<td>{{$value.name}}</td>
<td>{{$value.deploymentTime}}</td>
<td><a href="javascript: AJAX.DELETE('/deployments/{{$value.id}}')">删除</a></td>
</tr>
{{/each}}
</script>
</table>
<script src="/lib/js/jquery-1.10.2.min.js"></script>
<script src="/lib/js/jquery.cookie.js"></script>
<script src="/js/ajax-util.js"></script>
<script src="/lib/js/template.js"></script>
<script>
$(function() {
AJAX.GET("/models", null
, function (result) {
var html = template("models", result);
$("#model-list").html(html);
});
AJAX.GET("/deployments", null
, function (result) {
var html = template("deployments", result);
$("#deployment-list").html(html);
});
})
</script>
</body>
</html>