forked from vearch/python-algorithm-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
63 lines (57 loc) · 2.31 KB
/
Copy pathindex.html
File metadata and controls
63 lines (57 loc) · 2.31 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<meta HTTP-EQUIV="expires" CONTENT="0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>VectorBaseDB</title>
<link href="css/image.list.css" rel="stylesheet">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script>
function upFile () {
document.getElementById("inputFileAgent").value = document.getElementById("file").value;
var fileObj = document.getElementById("file").files[0]
var formData = new FormData()
formData.append("file", fileObj);
var xhr = new XMLHttpRequest();
$.ajax({
url: "/static/vdb/search",
data: formData,
type: "POST",
contentType: false,
processData: false,
success: function (res) {
showData(res)
$('#file').val('')
}
})
}
function showData(msg){
var jsonData=jQuery.parseJSON(msg)
var ori_url = jsonData["ori_url"]
$("#tabinfo1").html("<ul class=\"imgList clearfix\"><li><img src=images/" + ori_url + "></li>")
var data = jsonData["sim_url"]
var str = "<ul class=\"imgList clearfix\">"
for (var i = 0, l = data.length; i < l; i++){
str = str + "<li><div class='imgWrapper'><img src=" + data[i]["imageurl"] + "></div><p>score: "+data[i]["score"]+"</p></li>";
}
str = str + "</ul>"
$("#tabinfo2").html(str)
}
</script>
</head>
<body>
<h1 class="page-header">The Result Display Platform of Vearch </h1>
<input type="file" style="display:none" name="pic" id="file" accept="image/*" onchange="upFile()">
<input type="text" value="please choose one picture..." disabled id="inputFileAgent" />
<input type="button" onclick="document.getElementById('file').click()" value="Browse..." />
<table class="table table-striped" id="tabinfo1"></table>
<div class="table-responsive">
<table class="table table-striped" id="tabinfo2"></table>
</div>
</body>
</html>