-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathview.js
More file actions
38 lines (35 loc) · 816 Bytes
/
view.js
File metadata and controls
38 lines (35 loc) · 816 Bytes
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
module.exports = function(tableHtml, port) {
return `
<style>
td, th{
padding:5px;
min-width: 50px;
text-align: center;
}
</style>
<h2>使用方法</h2>
<p>
对Api “http://127.0.0.1:${port}/api/query” 发起 "post" 请求,参数如下:
</p>
<table border="1" cellspacing="0" cellpadding="0">
<tr>
<th>参数名</th>
<th>描述</th>
</tr>
<tr>
<td>sql</td>
<td>需要查询的 sql 语句</td>
</tr>
</table>
<h3>Jquery 示例</h3>
<pre>
$.post('http://127.0.0.1:${port}/api/query', {sql: 'SELECT schemaname,tablename FROM pg_tables'}, function(res){
console.log(res)
})
</pre>
<h2>数据表如下</h2>
<table border="1" cellspacing="0" cellpadding="0">
${tableHtml}
</table>
`;
};