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.
iot/projects/IoTNode/Views/Home/Scenes.cshtml

53 lines
1.4 KiB

@model List<Scene>
@{
HtmlTitle = "场景";
var index = 0;
}
<div class="row">
<table class="table">
<tr>
<td>#</td>
<td>场景</td>
<td>命令</td>
<td>定时器</td>
<td>触发器</td>
</tr>
@foreach (var scene in Model)
{
<tr>
<td>@(++index)</td>
<td>@scene.Name</td>
<td>
@foreach (var sceneCommand in scene.SceneCommands)
{
<div>@sceneCommand.Command.Device.Name @sceneCommand.Command.Name @sceneCommand.Command.Api.Name @sceneCommand.Command.QueryString</div>
}
</td>
<td>
@foreach (var sceneTimer in scene.SceneTimers)
{
<div>@sceneTimer.Cron</div>
}
</td>
<td>
@foreach (var sceneTigger in scene.SceneTiggers)
{
<div>@Cronos.CronExpression.Parse(sceneTigger.Condition).GetNextOccurrence(DateTime.UtcNow)</div>
}
</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>
}