@using Microsoft.AspNetCore.Mvc.Localization @model OverviewViewModel @inject IViewLocalizer Localizer @{ ViewData["Title"] = @Localizer["Title"]; }
@if (Model != null) {
@foreach (ChargePointsOverviewViewModel cpvm in Model.ChargePoints) { string chargePointName = string.IsNullOrWhiteSpace(cpvm.Name) ? $"{cpvm.ChargePointId}:{cpvm.ConnectorId}" : cpvm.Name; string lastCharge = (cpvm.MeterStart >= 0 && cpvm.MeterStop != null) ? string.Format(Localizer["ChargekWh"].Value, (cpvm.MeterStop - cpvm.MeterStart)) : null; string chargeTime = null; if (cpvm.StartTime != null && cpvm.StopTime == null) { TimeSpan timeSpan = DateTime.UtcNow.Subtract(cpvm.StartTime.Value); chargeTime = string.Format(Localizer["ChargeTime"].Value, (timeSpan.Days*24 + timeSpan.Hours), timeSpan.Minutes); } string cpIcon = "fa-plug"; string cpColor = "successColor"; string cpTitle = Localizer["Available"].Value; switch (cpvm.ConnectorStatus) { case ConnectorStatusEnum.Occupied: cpIcon = "fa-bolt"; //"fa-car"; cpColor = "errorColor"; cpTitle = Localizer["Charging"].Value; break; case ConnectorStatusEnum.Faulted: cpIcon = "fa-times-circle"; cpColor = "unavailableColor"; cpTitle = Localizer["Faulted"].Value; break; case ConnectorStatusEnum.Unavailable: cpIcon = "fa-ban"; cpColor = "unavailableColor"; cpTitle = Localizer["Unavailable"].Value; break; }
@chargePointName
@cpTitle
@if (!string.IsNullOrEmpty(chargeTime)) {

@chargeTime

} else if (!string.IsNullOrEmpty(lastCharge)) {

@lastCharge

} else {

 

}
@if (Model.ServerConnection) { }
}
@if (!string.IsNullOrEmpty(ViewBag.ErrorMsg)) {
} }