帮我写一个freemarker模板,用来提示用户设备发生告警事件,使用表格形式展示,告警事件包括告警值,告警规则名称,告警时间,恢复时间,告警等级;
时间: 2023-08-28 14:03:29 浏览: 46
好的,以下是一个简单的freemarker模板,用于展示设备告警事件:
```
<!DOCTYPE html>
<html>
<head>
<title>设备告警事件</title>
<style>
table {
border-collapse: collapse;
width: 100%;
}
th, td {
text-align: left;
padding: 8px;
border-bottom: 1px solid #ddd;
}
th {
background-color: #4CAF50;
color: white;
}
tr:hover {
background-color: #f5f5f5;
}
</style>
</head>
<body>
<h1>设备告警事件</h1>
<table>
<thead>
<tr>
<th>告警值</th>
<th>告警规则名称</th>
<th>告警时间</th>
<th>恢复时间</th>
<th>告警等级</th>
</tr>
</thead>
<tbody>
<#list alarms as alarm>
<tr>
<td>${alarm.value}</td>
<td>${alarm.ruleName}</td>
<td>${alarm.startTime}</td>
<td>${alarm.endTime}</td>
<td>${alarm.level}</td>
</tr>
</#list>
</tbody>
</table>
</body>
</html>
```
在上面的模板中,我们定义了一个包含表格的HTML页面,用于展示设备的告警事件。表格中包含告警值、告警规则名称、告警时间、恢复时间和告警等级等信息。我们使用了`<#list>`指令来循环遍历告警事件列表,将每个告警事件展示为表格的一行。在表格中使用了CSS样式来设置表格的外观,包括表头和表格行的颜色、边框等。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)