You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
@model List<Device>
@{
var index = 0;
}
<div class="row">
<table class="table">
<tr>
<td>#</td>
<td>节点</td>
<td>产品</td>
<td>设备</td>
<td>显示名称</td>
<td>在线</td>
<td>操作</td>
</tr>
@foreach (var item in Model)
{
<tr>
<td>@(++index)</td>
<td>@item.Node.Number: @item.Node.Name</td>
<td>@item.Product.Number: @item.Product.Name</td>
<td>@item.Number: @item.Name</td>
<td>@item.DisplayName</td>
<td>@Html.DisplayFor(o => item.IsOnline)</td>
<td>
@if (item.Product.Number.Contains("fbee") && !item.Product.Number.Contains("gateway"))
{
var values = item.Number.Split('-');
var gateway = values[0];
var number = values[1];
<a class="api ajax" href="@Url.Action("X95","Gateway",new { gateway = gateway,number=number})" data-number="@item.Number">从网关移除</a>
}
else if (item.Product.Name == "摄像头")
{
<a class="api ajax" href="@Url.Action("StartPush","Onvif",new {number=item.Number})" data-number="@item.Number">开始推流</a>
<a class="api ajax" href="@Url.Action("StopPush","Onvif",new {number=item.Number})" data-number="@item.Number">停止推流</a>
}
else if (item.Product.Number.Contains("gateway"))
{
<a class="api ajax" href="@Url.Action("X95","Gateway",new { number=item.Number})" data-number="@item.Number">查询网关设备</a>
}
</td>
</tr>
}
</table>
</div>
@section scripts{
<script>
$('a.ajax.api').click(function () {
if (confirm('确认操作编号为:' + $(this).attr('data-number') + '的设备吗?')) {
$.get($(this).attr('href'), function () {
window.location.href = window.location.href;
});
};
return false;
});
</script>
}