Skip to content

Commit 736b892

Browse files
committed
Added the forgotten incident menu options
1 parent 536c084 commit 736b892

File tree

7 files changed

+84
-52
lines changed

7 files changed

+84
-52
lines changed

src/Server/Coderr.Server.App/Modules/Geolocation/EventHandlers/StorePositionFromNewReport.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public async Task HandleAsync(ReportAddedToIncident e)
4343
if (string.IsNullOrEmpty(e.Report.RemoteAddress))
4444
return;
4545

46+
e.Report.RemoteAddress = "155.4.14.41";
4647
if (e.Report.RemoteAddress == "::1")
4748
return;
4849
if (e.Report.RemoteAddress == "127.0.0.1")

src/Server/Coderr.Server.SqlServer/Core/Applications/Queries/GetApplicationOverviewHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Globalization;
34
using System.Linq;
45
using System.Threading.Tasks;
56
using codeRR.Server.Api.Core.Applications.Queries;
@@ -98,7 +99,7 @@ from ErrorReports
9899

99100
result.ErrorReports = errorReports.Select(x => x.Value).ToArray();
100101
result.Incidents = incidents.Select(x => x.Value).ToArray();
101-
result.TimeAxisLabels = incidents.Select(x => x.Key.ToShortDateString()).ToArray();
102+
result.TimeAxisLabels = incidents.Select(x => x.Key.ToString("yyyy-MM-dd")).ToArray();
102103
}
103104
}
104105

src/Server/Coderr.Server.Web/ViewModels/Incident/OriginsViewModel.js

Lines changed: 23 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Server/Coderr.Server.Web/ViewModels/Incident/OriginsViewModel.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Server/Coderr.Server.Web/ViewModels/Incident/OriginsViewModel.ts

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,29 @@ module codeRR.Incident {
5555
CqsClient.query<Modules.ErrorOrigins.Queries.GetOriginsForIncidentResult>(query)
5656
.done(response => {
5757

58-
var points: any[] = [];
59-
response.Items.forEach(item => {
60-
var point = new google.maps.LatLng(item.Latitude, item.Longitude);
61-
for (let a = 0; a < item.NumberOfErrorReports; a++) {
62-
points.push(point);
63-
}
64-
});
58+
if (response.Items.length < 50) {
59+
response.Items.forEach(item => {
60+
var point = new google.maps.LatLng(item.Latitude, item.Longitude);
61+
var marker = new google.maps.Marker({
62+
position: point,
63+
map: map,
64+
title: item.NumberOfErrorReports + " error report(s)"
65+
});
66+
});
67+
} else {
68+
var points: any[] = [];
69+
response.Items.forEach(item => {
70+
var point = new google.maps.LatLng(item.Latitude, item.Longitude);
71+
points.push({ location: point, weight: item.NumberOfErrorReports });
72+
});
6573

66-
var heatmap = new google.maps.visualization.HeatmapLayer({
67-
data: points,
68-
map: map,
69-
dissipating: false,
70-
radius: 5
71-
});
74+
var heatmap = new google.maps.visualization.HeatmapLayer({
75+
data: points,
76+
map: map,
77+
dissipating: true,
78+
radius: 15
79+
});
80+
}
7281

7382
});
7483
};

src/Server/Coderr.Server.Web/Views/Incident/incident.html

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@
44
<div class="pull-right">
55
<div class="dropdown">
66
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
7-
Actions
7+
Incident menu
88
</button>
99
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
10+
<h6 class="dropdown-header">Browse information</h6>
11+
<a class="dropdown-item" href="#/application/:applicationId/incident/:incidentId/feedback" data-title="View comments from users">
12+
<span class="fa fa-comment"></span> Feedback (from users)
13+
</a>
14+
<a class="dropdown-item" href="#/application/:applicationId/incident/:incidentId/context" data-title="See what all error reports had in common">
15+
<span class="fa fa-line-chart"></span> Report similarities
16+
</a>
17+
<a class="dropdown-item" href="#/application/:applicationId/incident/:incidentId/origins" data-title="See where the reports are from (geographically)">
18+
<span class="fa fa-globe"></span> Report origins
19+
</a>
20+
<h6 class="dropdown-header">Actions</h6>
1021
<a class="dropdown-item" href="#/application/:applicationId/incident/:incidentId/close" data-title="This incident have been corrected and should not generate any more reports" data-unless="IsSolved">
11-
<span class="fa fa-check"></span> Solve
22+
<span class="fa fa-check"></span> Close
1223
</a>
1324
<a class="dropdown-item" href="#/application/:applicationId/incident/:incidentId/ignore" data-title="Do not trigger notifications or show this incident as active, no matter how many reports it receive." data-unless="IsIgnored">
1425
<span class="fa fa-pause"></span> Ignore
@@ -95,9 +106,9 @@ <h4 class="header-title m-t-0 m-b-20">Report trend</h4>
95106
</div>
96107
<div class="text-center">
97108
<form id="refresh-chart" style="display: inline">
98-
<input type="radio" name="range" value="30" checked="checked"/> month
99-
<input type="radio" name="range" value="7"/> week
100-
<input type="radio" name="range" value="1"/> day
109+
<input type="radio" name="range" value="30" checked="checked" /> month
110+
<input type="radio" name="range" value="7" /> week
111+
<input type="radio" name="range" value="1" /> day
101112
</form>
102113
</div>
103114
</div>
@@ -111,27 +122,27 @@ <h2 id="Reports">Reports</h2>
111122
<div class="card-box">
112123
<table id="reportsTable" class="table table-striped">
113124
<thead>
114-
<tr>
115-
<th>Message</th>
116-
<th>Reported at (UTC)</th>
117-
<th>Ip address</th>
118-
<th>&nbsp;</th>
119-
</tr>
125+
<tr>
126+
<th>Message</th>
127+
<th>Reported at (UTC)</th>
128+
<th>Ip address</th>
129+
<th>&nbsp;</th>
130+
</tr>
120131
</thead>
121132
<tbody data-collection="Items">
122-
<tr>
123-
<td>
124-
<a href="" data-name="Message"></a>
125-
</td>
126-
<td data-name="CreatedAtUtc"></td>
127-
<td data-name="RemoteAddress"></td>
128-
<td></td>
129-
</tr>
133+
<tr>
134+
<td>
135+
<a href="" data-name="Message"></a>
136+
</td>
137+
<td data-name="CreatedAtUtc"></td>
138+
<td data-name="RemoteAddress"></td>
139+
<td></td>
140+
</tr>
130141
</tbody>
131142
<tfoot>
132-
<tr>
133-
<td colspan="4" class="text-right" id="pager"></td>
134-
</tr>
143+
<tr>
144+
<td colspan="4" class="text-right" id="pager"></td>
145+
</tr>
135146
</tfoot>
136147
</table>
137148
</div>

src/Server/Coderr.Server.Web/codeRR.Server.Web.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
2424
<TypeScriptToolsVersion>2.3</TypeScriptToolsVersion>
2525
<UseGlobalApplicationHostFile />
26-
<UseIISExpress>false</UseIISExpress>
26+
<UseIISExpress>true</UseIISExpress>
2727
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
2828
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
2929
<Use64BitIISExpress />
@@ -630,7 +630,7 @@
630630
<AutoAssignPort>True</AutoAssignPort>
631631
<DevelopmentServerPort>50473</DevelopmentServerPort>
632632
<DevelopmentServerVPath>/</DevelopmentServerVPath>
633-
<IISUrl>http://localhost/codeRR.Server.Web</IISUrl>
633+
<IISUrl>http://localhost:50473/</IISUrl>
634634
<NTLMAuthentication>False</NTLMAuthentication>
635635
<UseCustomServer>False</UseCustomServer>
636636
<CustomServerUrl>

0 commit comments

Comments
 (0)