Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 20, 2023
1 parent f49466d commit 61c9a67
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
8 changes: 6 additions & 2 deletions example/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="utf-8" />
<title>HaoTrader Simple Example</title>
<title>HaoTrader simple example</title>
<link crossorigin="anonymous" href="/statics/lib/layui-v2.8.17/css/layui.css" rel="stylesheet">
<script src="/statics/lib/js.cookie.min.js"></script>
<script type="text/javascript" src="/statics/lib/klinecharts.min.js"></script>
Expand Down Expand Up @@ -126,7 +126,10 @@
<div class="main ">
<div class="header layui-row" style="line-height: 40px; height: 40px;">
<div class="layui-row">
<div class="layui-col-md10 layui-col-space10">-</div>
<div class="layui-col-md10 layui-col-space10 header-all-symbols" style="padding-left: 50px;">
<!-- <a href="/usdjpy"><b>USDJPY</b></a>
<a href="/eurusd"><b>EURUSD</b></a> -->
</div>
<div class="layui-col-md2 layui-col-space10"><p style="padding-left: 20px;">Hi, <span class="user">Guest</span> <a class="logout" style="display: none;">[退出]</a></p></div>
</div>
</div>
Expand Down Expand Up @@ -281,6 +284,7 @@


<div class="footer layui-row" style="height: 30px; line-height: 30px; text-align: center; vertical-align: bottom;">
<p><a href="https://yzimhao.github.io/trading_engine/" target="_blank">API Document</a></p>
<p>Version: <i class="version"></i> Build: <i class="build"></i></p>
</div>
</div>
Expand Down
20 changes: 20 additions & 0 deletions example/statics/mod/viewdemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,31 @@ layui.define(['form',"baseinfo", 'utils', 'kchart', 'websocket','login'], functi
}
});
},
load_all_tsymbols: function(){
$.ajax({
url: API_HAOBASE_HOST+ "/api/v1/base/trading/varieties",
type: "get",
success: function (d) {
console.log("/trading/varieties: ", d);
if(d.ok){
var data = d.data;
if(data.length > 0){
var html = [];
for(var i=0; i<data.length; i++){
html.push('<a href="/'+ data[i].symbol +'"><b>'+ data[i].symbol.toUpperCase() +'</b></a>');
}
$(".header-all-symbols").html(html.join(""))
}
}
}
});
},
init: function(){
console.log(baseinfo);
login.init();
this.bind();
this.load_system_info();
this.load_all_tsymbols();
this.load_depth_data();
this.load_tradelog_data();
this.load_assets();
Expand Down

0 comments on commit 61c9a67

Please sign in to comment.