第一种:
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <style type="text/css"> html { height: 100%; display: flex; flex-direction: column; justify-content: center; } body { width: 1240px; text-align: center; margin: 0 auto; } th, td { padding: 2px 0; vertical-align: middle; } td { color: #333333; vertical-align: middle; height: 27px; line-height: 20px; } td p { width:100%; word-wrap: break-word; word-break: break-all; margin:5px 0; } </style> </head> <body> <table border="0" width="1240" cellpadding="0" cellspacing="0" style="font-size:11.5pt;font-family:"微软雅黑",sans-serif;color:#333333; border-color: lightgrey;margin: 10px auto;"> <tr> <td><img src="cid:image1"></td> <td width="1120" align="left"> <!-- <div style="align-items: center;"> --> <p class=MsoNormal style='margin-left:2.25pt;page-break-after:avoid;text-autospace:none'><span style='font-family:"微软雅黑",sans-serif;color:black'>{{ department }}安全工作组:<span lang="EN-US"><o:p></o:p></span></span> </p> <p class=MsoNormal style='margin-left:2.25pt;page-break-after:avoid;text-autospace:none'> <span style='font-family:"微软雅黑",sans-serif;color:black'>      你们好,{{ department }}所有产品版本<strong>{{ time_range }}</strong>的各类安全问题分布趋势如下,我们针对性的提供了相应的改进建议!请使用Chrome52、FireFox44、IE11及以上的浏览器访问<a style="color: #409EFF;" href="http://xxx.com">云服务安全智库平台</a>,并使用自己的W3账号和密码登录。<o:p></o:p></span> </p> </td> </tr> </table> <table border="1" width="1240" cellpadding="0" cellspacing="1" style="font-size:11.5pt;font-family:"微软雅黑",sans-serif;color:#333333; border-color: lightgrey;margin: 10px auto;"> <tr style="height: 40px;"> <th bgcolor="#bbccd3" colspan="14">问题数量按分类统计明细(单位:个)</th> </tr> <tr style="width: 840px;"> <th colspan="14"><img width="1150" height="560" src="cid:image3"></th> </tr> <tr style="height: 40px;"> <th bgcolor="#bbccd3" colspan="14">问题数量按月度统计明细(单位:个)</th> </tr> <tr style="height: 35px;"> <th bgcolor="#e8e8e8" width="160">问题根因分类</th> <th bgcolor="#e8e8e8" width="76">1月</th> <th bgcolor="#e8e8e8" width="76">2月</th> <th bgcolor="#e8e8e8" width="76">3月</th> <th bgcolor="#e8e8e8" width="76">4月</th> <th bgcolor="#e8e8e8" width="76">5月</th> <th bgcolor="#e8e8e8" width="76">6月</th> <th bgcolor="#e8e8e8" width="76">7月</th> <th bgcolor="#e8e8e8" width="76">8月</th> <th bgcolor="#e8e8e8" width="76">9月</th> <th bgcolor="#e8e8e8" width="76">10月</th> <th bgcolor="#e8e8e8" width="76">11月</th> <th bgcolor="#e8e8e8" width="76">12月</th> <th bgcolor="#e8e8e8" width="168">改进趋势评价</th> </tr> {% for issue in issues %} <tr> <td align="center">{{ issue.0 }}</td> <td align="center">{{ issue.1 }}</td> <td align="center">{{ issue.2 }}</td> <td align="center">{{ issue.3 }}</td> <td align="center">{{ issue.4 }}</td> <td align="center">{{ issue.5 }}</td> <td align="center">{{ issue.6 }}</td> <td align="center">{{ issue.7 }}</td> <td align="center">{{ issue.8 }}</td> <td align="center">{{ issue.9 }}</td> <td align="center">{{ issue.10 }}</td> <td align="center">{{ issue.11 }}</td> <td align="center">{{ issue.12 }}</td> {% if issue.13 == '<' %} <td align="center"><img src="cid:green"></td> {% else %} <td align="center"><img src="cid:red"></td> {% endif %} </tr> {% endfor %} {% if guides %} <tr style="height: 40px;"> <th bgcolor="#bbccd3" colspan="14">问题对应改进措施</th> </tr> <tr style="height: 35px;"> <th bgcolor="#e8e8e8" width="150">问题根因分类</th> <th bgcolor="#e8e8e8" colspan="5">安全防护参考指导</th> <th bgcolor="#e8e8e8" colspan="4">Aegis安全组件对应的API接口名称<br>(<a style="color: #409EFF;" href="http://rnd-isourcegreen.huawei.com/ConsumerCloudServiceSecurity/aegis-project/overviews">版本获取地址</a>)</th> <th bgcolor="#e8e8e8" colspan="5">Fortify对应的定制规则名称(<a style="color: #409EFF;" href="http://3ms.huawei.com/hi/group/2035111/wiki_5152489.html">规则说明</a>)</th> </tr> {% for guide in guides %} <tr> <td align="center" >{{ guide.0 }}</td> <td align="left" colspan="5"><div>{{ guide.1 | safe }}</div><o:p></o:p></td> <td align="left" colspan="4"><div>{{ guide.2 | safe }}</div><o:p></o:p></td> <td align="left" colspan="5"><div>{{ guide.3 | safe }}</div><o:p></o:p></td> </tr> {% endfor %} {% endif %} </table> <table border="0" width="1240" cellpadding="0" cellspacing="0" style="font-size:11.5pt;font-family:"微软雅黑",sans-serif;color:#333333; border-color: lightgrey;margin: 10px auto;"> <tr> <td align="left" colspan="14"><a href="http://xxxx.com"><img src="cid:image2"></a></td> </tr> </table> </body> </html>
第二种:
<!DOCTYPE html> <html lang="en"> {% load custom_modules %} <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <style type="text/css"> html { height: 100%; display: flex; flex-direction: column; justify-content: center; } body { width: 1240px; text-align: center; margin: 0 auto; } th, td { padding: 2px 0; vertical-align: middle; } td { color: #333333; vertical-align: middle; height: 27px; line-height: 20px; } td p { width: 100%; word-wrap: break-word; word-break: break-all; margin: 5px 0; } </style> </head> <body> <table border="0" width="1240" cellpadding="0" cellspacing="0" style="font-size:11.5pt;font-family:"微软雅黑",sans-serif;color:#333333; border-color: lightgrey;margin: 10px auto;"> <tr> <td><img src="cid:image1"></td> <td width="1120" align="left"> <p class="MsoNormal" style="line-height:8.0pt; margin-left: 20px;padding-top: 20px;"><span style="font-size:11.5pt;font-family:"微软雅黑",sans-serif;color:#333333">各位安全稽核组同学:<span lang="EN-US"><o:p></o:p></span></span> </p> <p class="MsoNormal" style="line-height:16.0pt; margin-left: 20px;"><span style="font-size:11.5pt;font-family:"微软雅黑",sans-serif;color:#333333">云服务安全智库平台自动统计{{ month }}月问题单数据及漏测问题情况如下:(请使用Chrome52、FireFox44、IE11及以上的浏览器访问<a href="http://wisebox.cloud.huawei.com">云服务安全智库平台</a>,并使用自己的W3账号和密码登录)。</span></p> </td> </tr> </table> <table border="1" width="1240" cellpadding="0" cellspacing="1" style="font-size:11.5pt;font-family:"微软雅黑",sans-serif;color:#333333; border-color: lightgrey;margin: 10px auto;"> <thead> <tr style="height: 40px;"> <th bgcolor="#bbccd3" colspan="3">上月发现问题最多的Top3</th> </tr> </thead> <tbody> <tr> <th bgcolor="#e8e8e8">名次</th> <th bgcolor="#e8e8e8">姓名</th> <th bgcolor="#e8e8e8">DI值</th> </tr> {% for item in top3 %} <tr> <td align="center">{{ forloop.counter }}</td> <td align="center">{{ item.0 }}</td> <td align="center">{{ item.1 }}</td> </tr> {% endfor %} <thead> <tr style="height: 40px;"> <th bgcolor="#bbccd3" colspan="3">上月发现问题最少的Top3</th> </tr> </thead> <tbody> <tr> <th bgcolor="#e8e8e8">名次</th> <th bgcolor="#e8e8e8">姓名</th> <th bgcolor="#e8e8e8">DI值</th> </tr> {% for item in last3 %} <tr> <td align="center">{{ forloop.counter }}</td> <td align="center">{{ item.0 }}</td> <td align="center">{{ item.1 }}</td> </tr> {% endfor %} <thead> <tr style="height: 40px;"> <th bgcolor="#bbccd3" colspan="3">发现问题前后两个月进步最大的Top1</th> </tr> </thead> <tbody> <tr> <th bgcolor="#e8e8e8">姓名</th> <th bgcolor="#e8e8e8">上月DI值</th> <th bgcolor="#e8e8e8">本月DI值</th> </tr> <tr> <td align="center">{{ cpr_top_info.name }}</td> <td align="center">{{ cpr_top_info.last_di }}</td> <td align="center">{{ cpr_top_info.cur_di }}</td> </tr> <thead> <tr style="height: 40px;"> <th bgcolor="#bbccd3" colspan="3">发现问题前后两个月对比落后的Top3</th> </tr> </thead> <tbody> <tr> <th bgcolor="#e8e8e8">姓名</th> <th bgcolor="#e8e8e8">上月DI值</th> <th bgcolor="#e8e8e8">本月DI值</th> </tr> {% for item in cpr_last_info %} <tr> <td align="center">{{ item.name }}</td> <td align="center">{{ item.last_di }}</td> <td align="center">{{ item.cur_di }}</td> </tr> {% endfor %} <thead> <tr style="height: 40px;"> <th bgcolor="#bbccd3" colspan="3">漏测问题最多的Top3及对应的问题原因分类</th> </tr> </thead> <tbody> <tr> <th bgcolor="#e8e8e8">姓名</th> <th bgcolor="#e8e8e8">漏测DI值</th> <th bgcolor="#e8e8e8">问题根因分类</th> </tr> {% if top3_check %} {% for item in top3_miss_di %} <tr> <td align="center" rowspan="2">{{ item.0 }}</td> <td align="center" rowspan="2">{{ item.1.di }}</td> <td align="center">{{ item.1.subclass | subclassJudge1 }}</td> </tr> <tr> <td align="center">{{ item.1.subclass | subclassJudge2 }}</td> </tr> {% endfor %} {% else %} <tr> <td align="center" colspan="3">无</td> </tr> {% endif %} </tbody> </table> <table border="0" width="1240" cellpadding="0" cellspacing="0" style="font-size:11.5pt;font-family:"微软雅黑",sans-serif;color:#333333; border-color: lightgrey;margin: 10px auto;"> <tr> <td align="left" colspan="14"><a href="http://wisebox.cloud.huawei.com"><img src="cid:image2"></a></td> </tr> </table> </body> </html>
效果如下:
|
各位安全稽核组同学: 云服务安全智库平台自动统计{{ month }}月问题单数据及漏测问题情况如下:(请使用Chrome52、FireFox44、IE11及以上的浏览器访问云服务安全智库平台,并使用自己的W3账号和密码登录)。 |
{% for item in top3 %}{% endfor %}{% for item in last3 %}{% endfor %}{% for item in cpr_last_info %}{% endfor %}{% if top3_check %} {% for item in top3_miss_di %}{% endfor %} {% else %}{% endif %}
| 上月发现问题最多的Top3 | ||
|---|---|---|
| 名次 | 姓名 | DI值 |
| {{ forloop.counter }} | {{ item.0 }} | {{ item.1 }} |
| 上月发现问题最少的Top3 | ||
| 名次 | 姓名 | DI值 |
| {{ forloop.counter }} | {{ item.0 }} | {{ item.1 }} |
| 发现问题前后两个月进步最大的Top1 | ||
| 姓名 | 上月DI值 | 本月DI值 |
| {{ cpr_top_info.name }} | {{ cpr_top_info.last_di }} | {{ cpr_top_info.cur_di }} |
| 发现问题前后两个月对比落后的Top3 | ||
| 姓名 | 上月DI值 | 本月DI值 |
| {{ item.name }} | {{ item.last_di }} | {{ item.cur_di }} |
| 漏测问题最多的Top3及对应的问题原因分类 | ||
| 姓名 | 漏测DI值 | 问题根因分类 |
| {{ item.0 }} | {{ item.1.di }} | {{ item.1.subclass | subclassJudge1 }} |
| {{ item.1.subclass | subclassJudge2 }} | ||
| 无 | ||
浙公网安备 33010602011771号