-
Notifications
You must be signed in to change notification settings - Fork 2
/
stats.html
156 lines (143 loc) · 7.3 KB
/
stats.html
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<div class="container-fluid text-left" ng-class="{'treadonly': $loading}">
<div class="row">
<div class="col-md-2" style="padding-right:40px">
<!--Sidebar content-->
<b>Sort by:</b> <button class="btn btn-default glyphicon" ng-model="sc.orderCond" btn-checkbox btn-checkbox-true="'-date'" btn-checkbox-false="'date'" ng-class="{'glyphicon-sort-by-attributes-alt':sc.orderCond=='-date', 'glyphicon-sort-by-attributes':sc.orderCond=='date'}" tooltip="Newest/Oldest"></button>
<br><hr>
<b>Filter:</b><br><br>
Task Environment:
<label class="cursor-pointer">
<button class="btn btn-primary glyphicon glyphicon-pencil btn-sm" ng-click="sc.selectTaskEnvironment()"></button>
<span ng-if="sc.task_env" class="text-blue"> {{sc.task_env.name|stringLimit:20}}</span>
<span ng-if="!sc.task_env" class="text-red"> (empty)</span>
</label>
<br><br>
Agent Program:
<label class="cursor-pointer">
<button class="btn btn-primary glyphicon glyphicon-pencil btn-sm" ng-click="sc.selectAgentProgram()"></button>
<span ng-if="sc.agent_prog" class="text-blue"> {{sc.agent_prog.name|stringLimit:20}}</span>
<span ng-if="!sc.agent_prog" class="text-red"> (empty)</span>
</label>
</div>
<div class="col-md-10">
<h2><span class="glyphicon glyphicon-stats"></span> Trials<small class="pull-right" ng-if="totalPages-1">{{sc.page+'/'+totalPages}}</small></h2>
<!--Body content-->
<div ng-hide="sc.trials.length" class="text-center margin-top-100">
<img src="./imgs/web-app/success.png" onload="$(this).addClass('animate-ok')" class="tinvisible">
<div><h1><b class="text-blue">Dear fellow!</b></h1></div>
<div>
It looks like you haven't saved any trials/stats yet
</div>
</div>
<div class="list-group mouse-cursor" style="min-height: 300px">
<a class="list-group-item step animate-filter transition-400" ng-repeat="tr in sc.trials | orderBy:sc.orderCond track by $index" ng-click="sc.setSelected(tr.date)" ng-dblclick="sc.viewStats(tr.task_env_id)" ng-class="{active:sc.isSelected(tr.date)}" ng-if="(sc.page-1)*sc.itemsPerPage <= $index&&$index < sc.page*sc.itemsPerPage">
<h4 class="list-group-item-heading">
<span class="badge active">{{tr.date | date:'dd-MMM-yyyy HH:mm:ss'}}</span>
<b>Task env.:</b> {{tr.task_env.name | stringLimit:22}}
<span ng-if="tr.agent_progs_num > 1"><b>Agent progs.:</b> {{tr.agent_progs | stringLimit:22}}</span>
<span ng-if="tr.agent_progs_num == 1"><b>Agent prog.:</b> {{tr.agent_progs | stringLimit:22}}</span>
</h4>
<span ng-show="sc.isSelected(tr.date)" class="pull-right animate-only-show">
<button class="btn btn-info glyphicon glyphicon-list" style="top:-27px; margin-right:10px" ng-click="sc.viewStats(tr.task_env_id)" tooltip="View Stats"></button>
<button class="btn btn-danger glyphicon glyphicon-remove" style="top:-27px" ng-click="sc.remove()" tooltip="Delete"></button>
</span>
</a>
</div>
<div class="text-center animate-show" ng-show="sc.trials.length > sc.itemsPerPage">
<pagination total-items="sc.trials.length" ng-model="sc.page" max-size="5" class="pagination" boundary-links="true" items-per-page="sc.itemsPerPage" num-pages="totalPages" ng-change="twc.gotoTop()"></pagination>
</div>
<div class="separator"></div>
</div>
</div>
</div>
<script type="text/ng-template" id="view-stats.html">
<div class="modal-header">
<h3 class="modal-title top-shadow">
<span class="glyphicon glyphicon-signal"></span> Trial Stats ({{trial.date | date:'dd-MMM-yyyy HH:mm:ss'}})
</h3>
</div>
<div class="modal-body">
<div class="row"><div class="col-md-6">
<b>Task Environment:</b> <span class="text-blue">{{task_env.name}}</span>
</div></div>
<br>
<tabset ng-if="showTeams()">
<tab select="setTableAgentPrograms()">
<tab-heading>
<i class="glyphicon glyphicon-stats"></i> Agent Programs
</tab-heading>
</tab>
<tab select="setTableTeams()">
<tab-heading>
<i class="glyphicon glyphicon-stats"></i> Teams
</tab-heading>
</tab>
</tabset>
<div class="table-responsive">
<table class="table stats table-striped table-bordered">
<tr>
<th rowspan="2" class="initial-color">Pos.</th>
<th rowspan="2" class="initial-color">
<span ng-if="!teamsTable">Agent Program</span>
<span ng-if="teamsTable">Team</span>
</th>
<th colspan="2" class="initial-color">Score</th>
<th colspan="2" class="initial-color">Moves</th>
<th rowspan="2" class="initial-color">Filled cells</th>
<th rowspan="2" class="initial-color">Filled Holes</th>
<th colspan="3" class="initial-color">Battery</th>
</tr>
<tr>
<th>Final</th>
<th>Total</th>
<th>Good</th>
<th>Bad</th>
<th>Use</th>
<th>Recharges</th>
<th>Restorations</th>
</tr>
<tr ng-repeat="item in orderdItems track by $index">
<td class="text-orange"><b>{{item.pos}}</b></td>
<td class="text-blue" ng-if="!teamsTable&&showTeams()&&task_env.teams[item.team].color">
<img ng-src="copperlichtdata/color-{{original_teams[item.team].color}}.png" height="20" style="margin-top:-4px" class="pull-left" tooltip="{{original_teams[item.team].name}}">
{{item.name|stringLimit:28}}
</td>
<td class="text-blue" ng-if="teamsTable&&showTeams()&&item.color">
<img ng-src="copperlichtdata/color-{{item.color}}.png" height="20" style="margin-top:-4px" class="pull-left">
{{item.name|stringLimit:28}}
</td>
<td class="text-blue" ng-if="!teamsTable&&!showTeams()">
{{item.name|stringLimit:28}}
</td>
<td class="text-green">{{item.stats.MFinalScore}}</td>
<td>{{item.stats.MTotalScore}}</td>
<td>{{item.stats.mGoodMoves}}</td>
<td>{{item.stats.mBadMoves}}</td>
<td>{{item.stats.MCells}}</td>
<td>{{item.stats.MHoles}}</td>
<td>{{item.stats.mBatteryUsed|tpercent}}</td>
<td>{{item.stats.mBatteryRecharge}}</td>
<td>{{item.stats.mBatteryRestore}}</td>
</tr>
</table>
</div>
<br>
<div class="panel panel-default">
<div class="panel-body">
<div class="col-md-2"><b>Speed</b><br>{{trial.speed | tspeed}}</div>
<div class="col-md-2"><b>Pause</b><br>{{trial.pause&&"enabled"||"disabled"}}</div>
<div class="col-md-2">
<b>Result</b><br><span ng-if="trial.result == 1"><b>neutral</b></span>
<span ng-if="trial.result == 2" class="text-green"><b>success</b></span>
<span ng-if="trial.result == 3" class="text-red"><b>failure</b></span>
</div>
<div class="col-md-2"><b>T-Time</b><br>{{trial.stats.t_time|ttime}}t-s</div>
<div class="col-md-2"><b>Time</b><br>{{(trial.stats.time/1000).toFixed(2)|ttime}}s</div>
<div class="col-md-2"><b>Total holes</b><br>{{trial.stats.total_holes}}</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default" ng-click="close()">Close</button>
</div>
</script>