﻿@model Dashboard.Models.JobSummary

@{
    ViewBag.Title = $"{Model.Name} Summary";

    var summaryValues = string.Join(
        ";",
        Model.JobDaySummaryList.Select(x => $"{x.Date.ToLocalTime().ToString("yyyy-MM-dd")},{x.Succeeded},{x.Failed},{x.Aborted}"));

    var durationDates = string.Join(
        ";",
        Model.JobDaySummaryList.Select(x => x.Date.ToLocalTime().ToString("yyyy-MM-dd")).ToArray());

    var durationTimes = string.Join(
        ";",
        Model.JobDaySummaryList.Select(x => x.AverageDuration.TotalSeconds).ToArray());
}

<h2>@Model.Name</h2>
<div>Average Duration: @Model.AverageDuration</div>

<div id="daily_summary_chart" style="width: 900px; height: 500px" data-values="@summaryValues"></div>
<div id="daily_duration_chart" style="width: 900px; height: 500px" data-dates="@durationDates" data-times="@durationTimes"></div>

@section scripts {
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript" src="@Url.Content("/Scripts/job-build-data.js")" ></script>
}

﻿@model Dashboard.Models.JobSummary

@{
    ViewBag.Title = $"{Model.Name} Summary";

    var jobs = Model.JobDaySummaryList.OrderBy(x => x.Date);
    var summaryValues = string.Join(
        ";",
        jobs.Select(x => $"{x.Date.ToLocalTime().ToString("yyyy-MM-dd")},{x.Succeeded},{x.Failed},{x.Aborted}"));

    var durationDates = string.Join(
        ";",
        jobs.Select(x => x.Date.ToLocalTime().ToString("yyyy-MM-dd")).ToArray());

    var durationTimes = string.Join(
        ";",
        jobs.Select(x => x.AverageDuration.TotalMinutes).ToArray());
}

<h2>@Model.Name</h2>
<div>Average Duration: @Model.AverageDuration</div>

<div id="daily_summary_chart" style="width: 900px; height: 500px" data-values="@summaryValues"></div>
<div id="daily_duration_chart" style="width: 900px; height: 500px" data-dates="@durationDates" data-times="@durationTimes"></div>

@section scripts {
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript" src="@Url.Content("/Scripts/job-build-data.js")" ></script>
}

Convert to minutes in the duration display
Convert to minutes in the duration display
