aperio device actions
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using Aperio_Control_Centre.ACSDatabase.Models;
|
||||
|
||||
namespace Aperio_Control_Centre.ACSDatabase.UnitTest
|
||||
{
|
||||
[TestClass]
|
||||
public class DepartmentModel_Test
|
||||
{
|
||||
[DataTestMethod]
|
||||
[DataRow(null, "")]
|
||||
[DataRow("1234567890", "1234567890")]
|
||||
[DataRow("kjsdhfsdlkfjdslk jkfslkdfglkgfjdflg", "kjsdhfsdlkfjdslk jkfslkdf...")]
|
||||
public void InfoTruncate(string info, string truncated)
|
||||
{
|
||||
Department department = new()
|
||||
{
|
||||
Info = info,
|
||||
};
|
||||
Assert.AreEqual(truncated, department.InfoTruncate);
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Aperio_Control_Centre.ACSDatabase.UnitTest/UserModel_Test.cs
Normal file
40
Aperio_Control_Centre.ACSDatabase.UnitTest/UserModel_Test.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using Aperio_Control_Centre.ACSDatabase.Models;
|
||||
|
||||
namespace Aperio_Control_Centre.ACSDatabase.UnitTest
|
||||
{
|
||||
[TestClass]
|
||||
public class UserModel_Test
|
||||
{
|
||||
[DataTestMethod]
|
||||
[DataRow(null, "")]
|
||||
[DataRow("1234", "")]
|
||||
[DataRow("XXXXXXXX", "")]
|
||||
[DataRow("00000000", "00000000")]
|
||||
[DataRow("0008A5CE", "00566734")]
|
||||
[DataRow("90399DDE", "19695070")]
|
||||
[DataRow("62CEFCA0", "57732256")]
|
||||
//[DataRow("62CEFCA0", "37262968")]
|
||||
public void PaxtonCardNumber(string hex, string dec)
|
||||
{
|
||||
User user = new()
|
||||
{
|
||||
CredentialString = hex,
|
||||
};
|
||||
Assert.AreEqual(dec, user.PaxtonCardNumber);
|
||||
}
|
||||
|
||||
|
||||
[DataTestMethod]
|
||||
[DataRow(null, "")]
|
||||
[DataRow("1234567890", "1234567890")]
|
||||
[DataRow("kjsdhfsdlkfjdslk jkfslkdfglkgfjdflg", "kjsdhfsdlkfjdsl..")]
|
||||
public void SublineTruncate(string subline, string truncated)
|
||||
{
|
||||
User user = new()
|
||||
{
|
||||
SubLine = subline,
|
||||
};
|
||||
Assert.AreEqual(truncated, user.SublineTruncate);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,13 @@ namespace Aperio_Control_Centre.ACSDatabase.Models
|
||||
|
||||
[NotMapped]
|
||||
[Display(Name = "Groepen")]
|
||||
public List<Group?> Groups => DeviceGroupJoins!.Where(g => g.Group?.Active != Types.ActiveStates.Deleted).Select(g => g.Group).ToList();
|
||||
public List<Group?> Groups
|
||||
{
|
||||
get
|
||||
{
|
||||
return DeviceGroupJoins?.Where(g => g.Group?.Active != ActiveStates.Deleted).Select(g => g.Group).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
[NotMapped]
|
||||
[Display(Name = "Groepen")]
|
||||
@@ -120,11 +126,14 @@ namespace Aperio_Control_Centre.ACSDatabase.Models
|
||||
get
|
||||
{
|
||||
string groupString = "";
|
||||
foreach (var item in Groups)
|
||||
if (Groups != null)
|
||||
{
|
||||
groupString += " | " + item.Name;
|
||||
foreach (var item in Groups)
|
||||
{
|
||||
groupString += " | " + item.Name;
|
||||
}
|
||||
groupString += " |";
|
||||
}
|
||||
groupString += " |";
|
||||
return groupString;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Aperio_Control_Centre.ACSDatabase.Models
|
||||
{
|
||||
@@ -102,5 +103,27 @@ namespace Aperio_Control_Centre.ACSDatabase.Models
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[NotMapped]
|
||||
[Display(Name = "Paxton pas nummer")]
|
||||
public string? PaxtonCardNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(CredentialString))
|
||||
{
|
||||
if (CredentialString.Length == 8)
|
||||
{
|
||||
if (UInt32.TryParse(CredentialString, NumberStyles.HexNumber, CultureInfo.CurrentCulture, out UInt32 result))
|
||||
{
|
||||
string val = result.ToString("00000000");
|
||||
return val.Substring(val.Length - 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Aperio_Control_Centre.Export.Test.Paxton
|
||||
{
|
||||
//ict;JanWillem;;{'Cards':[{'Number':'19697050','Type':'0','Lost':'0'}]};;Huurder 02 Arbounie;{'AccessLevels':[{'Name':'Arbo Unie', 'Ordinal':'1'}]};;;;2023-jul-14;;;;;;;;;;;;;;;;1581
|
||||
|
||||
PaxtonCardModel card = new PaxtonCardModel
|
||||
PaxtonCardModel card = new()
|
||||
{
|
||||
Number = "19697050",
|
||||
Type = PaxtonCardTypes.Niet_gespecificeerd,
|
||||
@@ -20,7 +20,7 @@ namespace Aperio_Control_Centre.Export.Test.Paxton
|
||||
|
||||
Assert.AreEqual("{'Number':'19697050','Type':'0','Lost':'0'}", card.ToCSV());
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder sb = new();
|
||||
card.ToCSV(ref sb);
|
||||
|
||||
Assert.AreEqual("{'Number':'19697050','Type':'0','Lost':'0'}", sb.ToString());
|
||||
@@ -29,7 +29,7 @@ namespace Aperio_Control_Centre.Export.Test.Paxton
|
||||
[TestMethod]
|
||||
public void CardModel_ToCSV2()
|
||||
{
|
||||
PaxtonCardModel card = new PaxtonCardModel
|
||||
PaxtonCardModel card = new()
|
||||
{
|
||||
Number = "19697050",
|
||||
Type = PaxtonCardTypes.Handsfree_kaart,
|
||||
@@ -38,7 +38,7 @@ namespace Aperio_Control_Centre.Export.Test.Paxton
|
||||
|
||||
Assert.AreEqual("{'Number':'19697050','Type':'8','Lost':'1'}", card.ToCSV());
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder sb = new();
|
||||
card.ToCSV(ref sb);
|
||||
|
||||
Assert.AreEqual("{'Number':'19697050','Type':'8','Lost':'1'}", sb.ToString());
|
||||
|
||||
@@ -4,7 +4,6 @@ using Aperio_Control_Centre.ScreenLogging;
|
||||
using Microsoft.AspNetCore.Connections;
|
||||
using System.Net;
|
||||
using System.Timers;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
|
||||
namespace Aperio_Control_Centre.AperioServer
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@implements IDisposable
|
||||
@inject IAperioDeviceList deviceList
|
||||
@inject NavigationManager navigation
|
||||
@using Microsoft.AspNetCore.Components.QuickGrid
|
||||
@using Microsoft.AspNetCore.Connections
|
||||
@using Aperio_Control_Centre.Extensions
|
||||
@@ -18,7 +19,10 @@
|
||||
<PropertyColumn Title="Device status" Property="@(p => p.DeviceState)" />
|
||||
|
||||
<TemplateColumn Title="Battery status">
|
||||
@context.BatteryState.GetIcon(15)
|
||||
@if (context.ProductClass == Aadp.Enumerations.ProductClass.LOCK)
|
||||
{
|
||||
@context.BatteryState.GetIcon(15)
|
||||
}
|
||||
</TemplateColumn>
|
||||
|
||||
<TemplateColumn Title="Tamper status">
|
||||
@@ -29,12 +33,40 @@
|
||||
<PropertyColumn Title="Lock version" Property="@(p => p.LockVersion)" />
|
||||
<PropertyColumn Title="Firmware version" Property="@(p => p.FirmwareVersion)" />
|
||||
<PropertyColumn Title="Last data" Property="@(p => p.LastData)" />
|
||||
|
||||
|
||||
@* <PropertyColumn Title="Device id" Property="@(p => p.Id)" Sortable="true">
|
||||
<ColumnOptions> *@
|
||||
@* <input @bind="@filter" placeholder="Search..." class="form-control" autofocus
|
||||
@bind:event="oninput"
|
||||
@bind:after="UpdateFilter" /> *@
|
||||
@* </ColumnOptions>
|
||||
</PropertyColumn> *@
|
||||
|
||||
@* <TemplateColumn Title="Device id" Sortable="true" SortBy="@sortByFullName">
|
||||
<ChildContent>
|
||||
<span>
|
||||
@context.Id
|
||||
</span>
|
||||
</ChildContent>
|
||||
</TemplateColumn> *@
|
||||
|
||||
<TemplateColumn Title="Actions">
|
||||
<button class="btn btn-primary" @onclick="@(() => Actions(context))">Actions</button>
|
||||
</TemplateColumn>
|
||||
|
||||
</QuickGrid>
|
||||
|
||||
<p><strong>@message</strong></p>
|
||||
|
||||
@code {
|
||||
private QuickGrid<AperioDevice>? devicesGrid;
|
||||
private IQueryable<AperioDevice>? devices;
|
||||
|
||||
private GridSort<AperioDevice> sortByFullName = GridSort<AperioDevice>.ByAscending(e => e.Id);
|
||||
|
||||
string message = string.Empty;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
base.OnInitialized();
|
||||
@@ -49,14 +81,19 @@
|
||||
|
||||
private async Task UpdateTable()
|
||||
{
|
||||
Debug.WriteLine("Update table");
|
||||
foreach (AperioDevice dev in deviceList.GetDevices())
|
||||
{
|
||||
Debug.WriteLine(dev.Id);
|
||||
}
|
||||
// Debug.WriteLine("Update table");
|
||||
// foreach (AperioDevice dev in deviceList.GetDevices())
|
||||
// {
|
||||
// Debug.WriteLine(dev.Id);
|
||||
// }
|
||||
devices = deviceList.GetDevices().AsQueryable();
|
||||
|
||||
await devicesGrid?.RefreshDataAsync();
|
||||
await devicesGrid!.RefreshDataAsync();
|
||||
this.StateHasChanged();
|
||||
}
|
||||
|
||||
void Actions(AperioDevice p)
|
||||
{
|
||||
navigation.NavigateTo($"Aperio/DeviceActions/{p.Id}");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
body {
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1 col-xl-6 offset-xl-3">
|
||||
<div class="row mb-3">
|
||||
<div class=" col-sm-6 offset-sm-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text" id="basic-addon1"><iconify-icon icon='mdi:credit-card-search-outline' /></span>
|
||||
<input id="ReaderData" type="text" class="form-control" placeholder="Lezer data" aria-label="Lezer data" aria-describedby="basic-addon1" autofocus>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
@* @Html.ActionLink("SL040 Lezer Instellingen", "SL040Settings") *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1 col-xl-6 offset-xl-3">
|
||||
|
||||
|
||||
@* <EditForm EditContext="@editContext" OnSubmit="@Submit" FormName="Starship4">
|
||||
<DataAnnotationsValidator />
|
||||
<div>
|
||||
<label>
|
||||
Id:
|
||||
<InputText @bind-Value="Model!.Id" />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit">Submit</button>
|
||||
</div>
|
||||
</EditForm> *@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@* @if (!ViewData.ModelState.IsValid)
|
||||
{
|
||||
<div class="alert alert-warning">
|
||||
<strong>@Html.ValidationSummary(string.Empty)</strong>
|
||||
</div>
|
||||
} *@
|
||||
|
||||
@* <div class="row mb-3">
|
||||
@Html.LabelFor(model => model.CredentialString, htmlAttributes: new { @class = "col-form-label col-sm-2" })
|
||||
<div class="col-sm-10">
|
||||
@Html.EditorFor(model => model.CredentialString, new { htmlAttributes = new { @class = "form-control" } })
|
||||
@Html.ValidationMessageFor(model => model.CredentialString, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
@* <div class="row mb-3">
|
||||
@Html.LabelFor(model => model.CredentialType, htmlAttributes: new { @class = "col-form-label col-sm-2" })
|
||||
<div class="col-sm-10">
|
||||
@Html.DropDownListFor(model => model.CredentialType, new SelectList(Enum.GetValues(typeof(CredentialTypes))), "Selecteer pas type", htmlAttributes: new { @class = "form-select" })
|
||||
@Html.ValidationMessageFor(model => model.CredentialType, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
@* <div id="PassNumberBlock" class="row mb-3">
|
||||
@Html.LabelFor(model => model.PassNumber, htmlAttributes: new { @class = "col-form-label col-sm-2" })
|
||||
<div class="col-sm-10">
|
||||
@Html.EditorFor(model => model.PassNumber, new { htmlAttributes = new { @class = "form-control" } })
|
||||
@Html.ValidationMessageFor(model => model.PassNumber, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
@* <div class="row mb-3">
|
||||
@Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "col-form-label col-sm-2" })
|
||||
<div class="col-sm-10">
|
||||
@Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } })
|
||||
@Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
@* <div class="row mb-3">
|
||||
@Html.LabelFor(model => model.SubLine, htmlAttributes: new { @class = "col-form-label col-sm-2" })
|
||||
<div class="col-sm-10">
|
||||
@Html.EditorFor(model => model.SubLine, new { htmlAttributes = new { @class = "form-control" } })
|
||||
@Html.ValidationMessageFor(model => model.SubLine, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
@* <div class="row mb-3">
|
||||
@Html.LabelFor(model => model.Department, htmlAttributes: new { @class = "col-form-label col-sm-2" })
|
||||
<div class="col-sm-10">
|
||||
@Html.DropDownListFor(model => model.DepartmentId, Model.DepartmentsSelectList, "Selecteer afdeling", htmlAttributes: new { @class = "form-select" })
|
||||
@Html.ValidationMessageFor(model => model.DepartmentId, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
@* <div class="row mb-3">
|
||||
@Html.LabelFor(model => model.Group, htmlAttributes: new { @class = "col-form-label col-sm-2" })
|
||||
<div class="col-sm-10">
|
||||
@Html.DropDownListFor(model => model.GroupId, Model.GroupsSelectList, "Selecteer groep", htmlAttributes: new { @class = "form-select" })
|
||||
@Html.ValidationMessageFor(model => model.GroupId, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
|
||||
@* @if (@Configuration.GetValue<bool>("ACS:UseDordrecht"))
|
||||
{
|
||||
<div class="row mb-3">
|
||||
@Html.LabelFor(model => model.Dordrecht, htmlAttributes: new { @class = "col-form-label col-sm-2" })
|
||||
<div class="col-sm-10">
|
||||
@Html.CheckBox("Dordrecht", Model.Dordrecht ?? false, new { htmlAttributes = new { @class = "form-check-input" } })
|
||||
@Html.ValidationMessageFor(model => model.Dordrecht)
|
||||
</div>
|
||||
</div>
|
||||
} *@
|
||||
|
||||
@* <div class="row mb-3">
|
||||
@Html.LabelFor(model => model.Info, htmlAttributes: new { @class = "col-form-label col-sm-2" })
|
||||
<div class="col-sm-10">
|
||||
@Html.EditorFor(model => model.Info, new { htmlAttributes = new { @class = "form-control", @rows = 10 } })
|
||||
@Html.ValidationMessageFor(model => model.Info, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-10 offset-sm-2">
|
||||
<input type="submit" value="Aanmaken" class="btn btn-primary" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
@@ -1,10 +1,18 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Aperio_Control_Centre.ACSDatabase;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore.Internal;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Diagnostics;
|
||||
using Aperio_Control_Centre.AperioServer;
|
||||
|
||||
namespace Aperio_Control_Centre.Controllers
|
||||
{
|
||||
public class AperioController : Controller
|
||||
public class AperioController(IAperioDeviceList deviceList, IDbContextFactory<ACSDatabaseContext> dbContextFactory) : Controller
|
||||
{
|
||||
private readonly IAperioDeviceList _deviceList = deviceList;
|
||||
private readonly IDbContextFactory<ACSDatabaseContext> _contextFactory = dbContextFactory;
|
||||
|
||||
[HttpGet]
|
||||
public ActionResult Connections()
|
||||
{
|
||||
@@ -17,5 +25,94 @@ namespace Aperio_Control_Centre.Controllers
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public ActionResult DeviceActions(string? id)
|
||||
{
|
||||
//Debug.WriteLine($"Device ID = {id}");
|
||||
|
||||
if (id == null)
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
var dev = _deviceList.GetDevices().Where(d => d.Id == id).SingleOrDefault();
|
||||
|
||||
return View(dev);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public async Task<ActionResult> DoDeviceActions(string? deviceId, string? command)
|
||||
{
|
||||
//Debug.WriteLine($"Id = {deviceId}");
|
||||
//Debug.WriteLine($"Command = {command}");
|
||||
|
||||
if (deviceId == null || command == null)
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
var dev = _deviceList.GetDevices().Where(d => d.Id == deviceId).SingleOrDefault();
|
||||
if (dev != null)
|
||||
{
|
||||
switch (command)
|
||||
{
|
||||
//lock
|
||||
case "getsupporteddoormodes":
|
||||
await dev.GetSupportedDoorModes();
|
||||
break;
|
||||
case "getdoorstate":
|
||||
await dev.GetDoorState();
|
||||
break;
|
||||
case "getlockstate":
|
||||
await dev.GetLockState();
|
||||
break;
|
||||
case "getkeycylinderstate":
|
||||
await dev.GetKeyCylinderState();
|
||||
break;
|
||||
case "gethandlestate":
|
||||
await dev.GetHandleState();
|
||||
break;
|
||||
case "tamperstate":
|
||||
await dev.GetTamperState();
|
||||
break;
|
||||
case "getactivatorstate":
|
||||
await dev.GetActivatorState();
|
||||
break;
|
||||
//gateway
|
||||
case "getdevicelist":
|
||||
await dev.GetDeviceList();
|
||||
break;
|
||||
case "getdevicetime":
|
||||
await dev.GetDeviceTime();
|
||||
break;
|
||||
case "setdevicetime":
|
||||
await dev.SetDeviceTime();
|
||||
break;
|
||||
case "restarthub":
|
||||
await dev.RestartHub();
|
||||
break;
|
||||
case "getdtcs":
|
||||
await dev.GetDTCs();
|
||||
break;
|
||||
case "cleardtcs":
|
||||
await dev.ClearDTCs();
|
||||
break;
|
||||
case "getfirmwareversion":
|
||||
await dev.GetFirmwareVersion();
|
||||
break;
|
||||
case "getlockversions":
|
||||
await dev.GetLockVersions();
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return new RedirectToRouteResult(new RouteValueDictionary(new { action = "DeviceActions", controller = "Aperio", id = deviceId }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,8 +139,7 @@ namespace Aperio_Control_Centre.Controllers
|
||||
Device device = await db.Devices
|
||||
.Where(d => d.Id == id)
|
||||
.Include(l => l.Location)
|
||||
.Include(j => j.DeviceGroupJoins)
|
||||
//.Include(j => j.DeviceGroupJoins.Select(g => g.Group))
|
||||
.Include(j => j.DeviceGroupJoins)//.ThenInclude(g => g.Group)
|
||||
.SingleOrDefaultAsync();
|
||||
|
||||
if (device == null)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
@{
|
||||
ViewBag.Title = "Connections";
|
||||
ViewBag.Title = "Verbindingen";
|
||||
}
|
||||
@await Html.PartialAsync("PageTitle")
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1">
|
||||
<div class="row mb-3">
|
||||
<component type="typeof(Aperio_Control_Centre.Components.Components.AperioConnections)" render-mode="Server" />
|
||||
<component type="typeof(Aperio_Control_Centre.Components.Aperio.AperioConnections)" render-mode="Server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
81
Aperio_Control_Centre/Views/Aperio/DeviceActions.cshtml
Normal file
81
Aperio_Control_Centre/Views/Aperio/DeviceActions.cshtml
Normal file
@@ -0,0 +1,81 @@
|
||||
@model Aperio_Control_Centre.AperioServer.AperioDevice
|
||||
@{
|
||||
ViewBag.Title = $"Apparaat {Model.Id} akties ";
|
||||
}
|
||||
|
||||
<script type=text/javascript>
|
||||
function callAction(deviceid, command) {
|
||||
$.ajax({
|
||||
url: '@Url.Action("DoDeviceActions", "Aperio")' + "?deviceId=" + deviceid + "&command=" + command,
|
||||
type: "GET"
|
||||
})
|
||||
.done(function (result) {
|
||||
if (result.error) {
|
||||
alert(result.error);
|
||||
}
|
||||
})
|
||||
.fail(function (xhr, status) {
|
||||
alert(status);
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@await Html.PartialAsync("PageTitle")
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 offset-lg-3">
|
||||
|
||||
@if (Model.ProductClass == Aperio_Control_Centre.Aadp.Enumerations.ProductClass.LOCK)
|
||||
{
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','getsupporteddoormodes')">Get Supported Door Modes</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','getdoorstate')">Get Door State</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','getlockstate')">Get Lock State</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','getkeycylinderstate')">Get KeyCylinder State</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','gethandlestate')">Get Handle State</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','tamperstate')">Get Tamper State</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','getactivatorstate')">Get Activator State</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (Model.ProductClass == Aperio_Control_Centre.Aadp.Enumerations.ProductClass.GATEWAY)
|
||||
{
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','getdevicelist')">Get device list</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','getdevicetime')">Get device time</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','setdevicetime')">Set device time</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','restarthub')">Restart device</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','getdtcs')">Get DTC'S</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','cleardtcs')">Clear DTC'S</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','getfirmwareversion')">Get firmware version</button>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<button class="btn btn-primary" onclick="callAction('@Model.Id','getlockversions')">Get lock version</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,12 +1,12 @@
|
||||
@{
|
||||
ViewBag.Title = "Devices";
|
||||
ViewBag.Title = "Apparaten";
|
||||
}
|
||||
@await Html.PartialAsync("PageTitle")
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1">
|
||||
<div class="row mb-3">
|
||||
<component type="typeof(Aperio_Control_Centre.Components.Components.AperioDevices)" render-mode="Server" />
|
||||
<component type="typeof(Aperio_Control_Centre.Components.Aperio.AperioDevices)" render-mode="Server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1">
|
||||
<div class="row mb-3">
|
||||
<component type="typeof(Aperio_Control_Centre.Components.Components.ACSLog)" render-mode="Server" />
|
||||
<component type="typeof(Aperio_Control_Centre.Components.Loggings.ACSLog)" render-mode="Server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1">
|
||||
<div class="row mb-3">
|
||||
<component type="typeof(Aperio_Control_Centre.Components.Components.APILog)" render-mode="Server" />
|
||||
<component type="typeof(Aperio_Control_Centre.Components.Loggings.APILog)" render-mode="Server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1">
|
||||
<div class="row mb-3">
|
||||
<component type="typeof(Aperio_Control_Centre.Components.Components.AperioLog)" render-mode="Server" />
|
||||
<component type="typeof(Aperio_Control_Centre.Components.Loggings.AperioLog)" render-mode="Server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1">
|
||||
<div class="row mb-3">
|
||||
<component type="typeof(Aperio_Control_Centre.Components.Components.SystemLog)" render-mode="Server" />
|
||||
<component type="typeof(Aperio_Control_Centre.Components.Loggings.SystemLog)" render-mode="Server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -143,8 +143,8 @@
|
||||
Aperio
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>@Html.ActionLink("Connections", "Connections", "Aperio", null, new { @class = "dropdown-item" })</li>
|
||||
<li>@Html.ActionLink("Devices", "Devices", "Aperio", null, new { @class = "dropdown-item" })</li>
|
||||
<li>@Html.ActionLink("Verbindingen", "Connections", "Aperio", null, new { @class = "dropdown-item" })</li>
|
||||
<li>@Html.ActionLink("Apparaten", "Devices", "Aperio", null, new { @class = "dropdown-item" })</li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
@* <li>@Html.ActionLink("Tijdzones", "Index", "Timezone", null, new { @class = "dropdown-item" })</li> *@
|
||||
</ul>
|
||||
|
||||
@@ -3,18 +3,8 @@
|
||||
@{
|
||||
ViewBag.Title = "Nieuwe pas aanmaken";
|
||||
}
|
||||
|
||||
@await Html.PartialAsync("PageTitle")
|
||||
|
||||
@* <div class="row">
|
||||
<div class="col-lg-10 offset-lg-1">
|
||||
<div class="row mb-3">
|
||||
<component type="typeof(Aperio_Control_Centre.Components.User.Create)" render-mode="Server" />
|
||||
</div>
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
|
||||
@using (Html.BeginForm())
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
|
||||
@@ -45,6 +45,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (@Configuration.GetValue<bool>("ACS:useErasmus"))
|
||||
{
|
||||
<div class="row mb-3">
|
||||
@Html.LabelFor(model => model.PaxtonCardNumber, htmlAttributes: new { @class = "col-form-label col-sm-2" })
|
||||
<div class="col-sm-10">
|
||||
@Html.EditorFor(model => model.PaxtonCardNumber, new { htmlAttributes = new { @class = "form-control", @disabled = "disabled" } })
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="row mb-3">
|
||||
@Html.LabelFor(model => model.CredentialType, htmlAttributes: new { @class = "col-form-label col-sm-2" })
|
||||
<div class="col-sm-10">
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
<dt class="col-sm-3">@Html.DisplayNameFor(model => model.CredentialString)</dt>
|
||||
<dd class="col-sm-9">@Html.DisplayFor(model => model.CredentialString)</dd>
|
||||
|
||||
@if (@Configuration.GetValue<bool>("ACS:useErasmus"))
|
||||
{
|
||||
<dt class="col-sm-3">@Html.DisplayNameFor(model => model.PaxtonCardNumber)</dt>
|
||||
<dd class="col-sm-9">@Html.DisplayFor(model => model.PaxtonCardNumber)</dd>
|
||||
}
|
||||
|
||||
<dt class="col-sm-3">@Html.DisplayNameFor(model => model.CredentialType)</dt>
|
||||
<dd class="col-sm-9">@Html.DisplayFor(model => model.CredentialType)</dd>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user