Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dmytro Bogatov
status-site
Commits
67e8e3cb
Commit
67e8e3cb
authored
Aug 08, 2017
by
Dmytro Bogatov
💕
Browse files
Add links from health reports and discrepancies.
parent
2f438b6f
Pipeline
#597
passed with stages
in 6 minutes and 13 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
client/ts/modules/metric-page/health.ts
View file @
67e8e3cb
...
...
@@ -207,7 +207,10 @@ export class HealthMetricPage extends MetricPage<Metric<HealthDataPoint>> {
<h4 class="modal-title">
Health report details | Health
${
e
.
detail
.
health
}
% |
${
timestamp
}
<small>
Inspect metric labels at the moment report was generated
Inspect metric labels at the moment report was generated.
<a href="/home/metric/
${
this
.
metric
.
metricType
}
/
${
this
.
metric
.
source
}
/
${
new
Date
(
timestamp
.
getTime
()
-
2
*
60
*
1000
).
getTime
()}
/
${
new
Date
(
timestamp
.
getTime
()
+
2
*
60
*
1000
).
getTime
()}
">
View data at that moment.
</a>
</small>
</h4>
</div>
...
...
@@ -267,10 +270,10 @@ export class HealthMetricPage extends MetricPage<Metric<HealthDataPoint>> {
$
(
`#modal-details-
${
timestamp
.
getTime
()}
`
).
modal
();
$
(
`#modal-details-
${
timestamp
.
getTime
()}
`
).
on
(
"
hidden.bs.modal
"
,
"
hidden.bs.modal
"
,
()
=>
$
(
"
.health-details-modal
"
).
remove
()
);
},
false
);
...
...
src/shared/Extensions/DateTimeExtensions.cs
View file @
67e8e3cb
...
...
@@ -22,5 +22,9 @@ namespace StatusMonitor.Shared.Extensions
?
value
.
ToString
()
:
TimeZoneInfo
.
ConvertTime
(
value
,
TimeZoneInfo
.
FindSystemTimeZoneById
(
timeZoneId
)).
ToString
();
}
public
static
long
TotalMilliseconds
(
this
DateTime
value
)
=>
Convert
.
ToInt64
((
value
-
new
DateTime
(
1970
,
1
,
1
,
0
,
0
,
0
,
DateTimeKind
.
Utc
)).
TotalMilliseconds
);
}
}
src/web/Controllers/View/AccountController.cs
View file @
67e8e3cb
...
...
@@ -75,7 +75,7 @@ namespace StatusMonitor.Web.Controllers.View
TempData
[
"MessageSeverity"
]
=
"info"
;
TempData
[
"MessageContent"
]
=
$"You have logged in."
;
if
(
string
.
IsNullOrEmpty
(
Request
.
Query
[
"returnurl"
]))
{
return
RedirectToAction
(
"Index"
,
"Home"
);
...
...
src/web/Views/Shared/Components/DiscrepancyCard/Default.cshtml
View file @
67e8e3cb
@using StatusMonitor.Shared.Extensions
<div
class=
"list-group-item media discrepancy-card discrepancy-@(Model.Resolved ? "
resolved
"
:
"
unresolved
")"
data-number=
"@ViewBag.Number"
...
...
@@ -39,11 +41,20 @@
<div
class=
"media-body"
>
<div
class=
"lgi-heading"
>
Discrepancy of type
<strong>
@Model.Type
</strong>
from
@{
var start = Convert.ToInt64((Model.DateFirstOffense.AddMinutes(-2) - new DateTime(1970, 1, 1)).TotalMilliseconds);
var end =
Model.Resolved ?
Convert.ToInt64((Model.DateResolved.AddMinutes(2) - new DateTime(1970, 1, 1)).TotalMilliseconds) :
Convert.ToInt64((Model.DateFirstOffense.AddMinutes(15) - new DateTime(1970, 1, 1)).TotalMilliseconds);
}
<a
asp-controller=
"Home"
asp-action=
"Metric"
asp-route-type=
"@Model.MetricType"
asp-route-source=
"@Model.MetricSource"
asp-route-start=
"@start"
asp-route-end=
"@end"
>
<em>
@Model.MetricType
</em>
of
<em>
@Model.MetricSource
</em>
</a>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment