forgeplus/app/views/admins/dashboards/_baidu_tongji.html.erb

50 lines
1.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div>
数据来源百度统计,本周 [<%= @current_week_statistic.first&.date %> / <%= @current_week_statistic.last&.date %>]
</div>
<table class="table table-hover text-center subject-list-table">
<thead class="thead-light">
<tr>
<th width="20%">日期</th>
<th width="15%">访问量</th>
<th width="15%">访客数</th>
<th width="15%">IP数</th>
<th width="15%">直接访问占比</th>
<th width="15%">外部链接占比</th>
<th width="15%">搜索引擎占比</th>
<th width="20%">自定义</th>
</tr>
</thead>
<tbody>
<% @current_week_statistic.each_with_index do |week, index| %>
<tr class="">
<td><%= week.date %> </td>
<td><%= week.pv %></td>
<td><%= week.visitor %></td>
<td><%= week.ip %></td>
<td><%= week.source_through %>%</td>
<td><%= week.source_link %>%</td>
<td><%= week.source_search %>%</td>
<td><%= week.source_custom.to_f %>%</td>
</td>
</tr>
<% end %>
<!-- <tr class="">-->
<!-- <td><span style="color: #ff8200">合计</span></td>-->
<!-- <td><span style="color: #ff8200"><%#= @current_week_statistic.sum(:pv) %></span></td>-->
<!-- <td><span style="color: #ff8200"><%#= @current_week_statistic.sum(:visitor) %></span></td>-->
<!-- <td><span style="color: #ff8200"><%#= @current_week_statistic.sum(:ip) %></span></td>-->
<!-- </td>-->
<!-- </tr>-->
</tbody>
</table>
<% unless @access_token.present? && @overview_data.present? %>
<div>
<a href="/admins/baidu_tongji" target="_blank">1.百度统计需人工授权,点击去授权</a>
</div>
<div>
<a href="/admins/baidu_tongji_auth" onclick="this.href = '/admins/baidu_tongji_auth?code=' + document.getElementById('auth_code').value">2.获取百度统计授权码</a>
<input name="code" id="auth_code" style="width: 380px" placeholder="请输入1.百度统计返回的code后点击2.获取百度统计Token"/>
</div>
<% end %>