master
SeanChenTaipei 2 years ago
parent cffee03873
commit eade5dd009
  1. 5
      main.py
  2. 2
      templates/base.html
  3. 5
      templates/result_view.html

@ -276,8 +276,9 @@ def buildPort():
return redirect(url_for('index'))
# Stop frequently building strategy
if time.time() - session['lastCreateTime'] < 60:
print("UNTIL: ", time.time()-session['lastCreateTime'])
return '''<span>投資組合建立時間間隔(或與登入時間間隔)必須大於60秒!</span>'''
less = round(time.time()-session['lastCreateTime'], 1)
print("UNTIL: ", less)
return f'<span>投資組合建立時間間隔(或與登入時間間隔)必須大於60秒!差距: {less} 秒。</span>'
session['lastCreateTime'] = time.time()
for key in request.form:
print(key, request.form[key], type(request.form[key]))

@ -417,8 +417,6 @@
}
};
</script>
{% endblock %}
</body>
</html>

@ -151,7 +151,6 @@
{% block script %}
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script type="text/javascript">
const wlayout = {
'autosize': true,
@ -188,12 +187,12 @@
Plotly.newPlot("price", r.data, rlayout, {responsive: true});
Plotly.newPlot("bar", b.data, blayout, {responsive: true});
$('#copy-port').click(function(event) {
alert('投資組合即將複製。')
var stockList = [];
$('.asset').each(function(){
stockList.push($(this).text());
});
// alert(currentList.includes(texts));
if (stockList.length > 0) {
if (stockList.length > 1) {
$.ajax({
url: '/copyPort',
method: 'POST',

Loading…
Cancel
Save