<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
        <style>
            .layui-form-item {
                margin-bottom: 0;
            }
            .layui-form-text{
                line-height: 38px;
            }
        </style>
    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <button type="button" lay-submit="" lay-filter="refresh" class="layui-btn layui-btn-primary layui-btn-sm"
                                    style="display:block;margin:0 auto">
                                <i class="layui-icon layui-icon-refresh" style="font-size: 20px"></i>
                            </button>
                            <fieldset class="layui-elem-field">
                                <legend>iot设备详情</legend>
                                <div class="layui-field-box">
                                    <div class="layui-form-item">
                                        <input type="hidden" name="id" th:value="${iotAlarm.id}" />
                                        <label class="layui-form-label"><span>告警次数：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotAlarm.alarm_times}"></span></div>
                                        <label class="layui-form-label"><span>告警等级：</span></label>
                                        <div class="layui-input-inline" th:switch="${iotAlarm.level}">
                                            <span class="layui-badge layui-bg-red" style="margin-top: 10px;" th:case="1">严重告警</span>
                                            <span class="layui-badge layui-bg-orange" style="margin-top: 10px;" th:case="2">警告告警</span>
                                            <span class="layui-badge layui-bg-blue" style="margin-top: 10px;" th:case="3">提示告警</span>
                                            <span class="layui-form-text" th:case="*"></span>
                                        </div>
                                        <label class="layui-form-label"><span>告警状态：</span></label>
                                        <div class="layui-input-inline" th:switch="${iotAlarm.status}">
                                            <span class="layui-badge" style="margin-top: 10px;" th:case="0">实时告警</span>
                                            <span class="layui-badge" style="margin-top: 10px;" th:case="1">历史告警</span>
                                            <span class="layui-form-text" th:case="*"></span>
                                        </div>
                                        <label class="layui-form-label"><span>告警类型：</span></label>
                                        <div class="layui-input-inline" th:switch="${iotAlarm.alarm_type}">
                                            <span class="layui-badge" style="margin-top: 10px;" th:case="0">业务告警</span>
                                            <span class="layui-badge" style="margin-top: 10px;" th:case="1">设备告警</span>
                                            <span class="layui-form-text" th:case="*"></span>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span>设备sn号：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotAlarm.device_id}"></span></div>
                                        <label class="layui-form-label"><span>设备名称：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotAlarm.device_name}"></span></div>
                                        <label class="layui-form-label"><span>设备类型：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotAlarm.device_type}?${iotAlarm.device_type}:''"></span></div>
                                        <label class="layui-form-label"><span>设备类型名称：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotAlarm.type_name}"></span></div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span>告警时间：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotAlarm.record_time}?${iotAlarm.record_time}:''"></span></div>
                                        <label class="layui-form-label"><span>告警描述：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotAlarm.alarm_desc}"></span></div>
                                        <label class="layui-form-label"><span>同步时间：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotAlarm.lastSyncDate}?${#dates.format(iotAlarm.lastSyncDate, 'yyyy-MM-dd HH:mm:ss')}:''"></span></div>
                                        <label class="layui-form-label"><span>告警上报时间：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotAlarm.lastNoticeDate}?${#dates.format(iotAlarm.lastNoticeDate, 'yyyy-MM-dd HH:mm:ss')}:''"></span></div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span>是否告警：</span></label>
                                        <div class="layui-input-inline" th:switch="${iotAlarm.is_alarm}">
                                            <span class="layui-badge layui-bg-green" style="margin-top: 10px;" th:case="1">告警</span>
                                            <span class="layui-badge layui-bg-red" style="margin-top: 10px;" th:case="3">解除单一告警</span>
                                            <span class="layui-badge layui-bg-black" style="margin-top: 10px;" th:case="4">解除所有告警</span>
                                            <span class="layui-form-text" th:case="*"></span>
                                        </div>
                                        <label class="layui-form-label"><span>告警原因：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotAlarm.name}"></span></div>
                                    </div>
                                </div>
                            </fieldset>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    <!-- javascript -->
    <script type="text/javascript" th:src="@{'/layui/layui.js'}" charset="utf-8"></script>
    <script type="text/javascript">
        layui.config({
            base: '/' //静态资源所在路径
        });
    </script>


</html>
