-
Notifications
You must be signed in to change notification settings - Fork 1
/
link_stats.blade.php
118 lines (108 loc) · 4.28 KB
/
link_stats.blade.php
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
@extends('layouts.base')
@section('css')
<link rel='stylesheet' href='/css/datatables.min.css'>
<link rel='stylesheet' href='/css/stats.css'>
<link rel='stylesheet' href='/css/jquery-jvectormap.css'>
<link rel='stylesheet' href='/css/bootstrap-datetimepicker.min.css'>
@endsection
@section('content')
<div ng-controller="StatsCtrl" class="ng-root">
<div class="stats-header bottom-padding">
<h3>状态</h3>
<div class="row">
<div class="col-md-3 col-md-offset-3 link-meta">
<p>
<b>短链接: </b>
<a target="_blank" href="{{ env('APP_PROTOCOL') }}/{{ env('APP_ADDRESS') }}/{{ $link->short_url }}">
{{ env('APP_ADDRESS') }}/{{ $link->short_url }}
</a>
</p>
<p>
<b>原网址: </b>
<a target="_blank" href="{{ $link->long_url }}">{{ str_limit($link->long_url, 50) }}</a>
</p>
{{-- <p>
<em>提示: 清除正确的日期绑定(底部框)以将其设置为当前日期和时间. 新的除非将正确的日期范围设置为当前时间,否则不会显示点击次数.</em>
</p> --}}
</div>
<div class="col-md-3">
<form action="" method="GET">
<div class="form-group">
<div class='input-group date' id='left-bound-picker'>
<input type="text" class="form-control" name="left_bound">
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<div class='input-group date' id='right-bound-picker'>
<input type="text" class="form-control" name="right_bound">
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<input type="submit" value="Refresh" class="form-control">
</form>
</div>
</div>
</div>
<div class="row bottom-padding">
<div class="col-md-8">
<h4>Traffic over Time</h4> (total: {{ $link->clicks }})
<canvas id="dayChart"></canvas>
</div>
<div class="col-md-4">
<h4>Traffic sources</h4>
<canvas id="refererChart"></canvas>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h4>Map</h4>
<div id="mapChart"></div>
</div>
<div class="col-md-6">
<h4>Referers</h4>
<table class="table table-hover" id="refererTable">
<thead>
<tr>
<th>Host</th>
<th>Clicks</th>
</tr>
</thead>
<tbody>
@foreach ($referer_stats as $referer)
<tr>
<td>{{ $referer->label }}</td>
<td>{{ $referer->clicks }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@section('js')
{{-- Load data --}}
<script>
// Load data
var dayData = JSON.parse('{!! json_encode($day_stats) !!}');
var refererData = JSON.parse('{!! json_encode($referer_stats) !!}');
var countryData = JSON.parse('{!! json_encode($country_stats) !!}');
// Load datepicker dates
var datePickerLeftBound = '{{ $left_bound }}';
var datePickerRightBound = '{{ $right_bound }}';
</script>
{{-- Include extra JS --}}
<script src='/js/lodash.min.js'></script>
<script src='/js/chart.bundle.min.js'></script>
<script src='/js/datatables.min.js'></script>
<script src='/js/jquery-jvectormap.min.js'></script>
<script src='/js/jquery-jvectormap-world-mill.js'></script>
<script src='/js/moment.min.js'></script>
<script src='/js/bootstrap-datetimepicker.min.js'></script>
<script src='/js/StatsCtrl.js'></script>
@endsection